On Saturday 09 February 2002 07:35, Joe Van Meer wrote:
> Hi there. You bet you can have relationships between tables! You accomplish
> this by setting primary keys and foreign keys when you create you tables.
> When you assign a unique identifier to a table not only do you assign a
> name such as "employeeid" for example, you also have to set it as the
> primary key. Here's a link to the mysql website:
> http://www.mysql.com/doc/C/R/CREATE_TABLE.html  Notice the primary option
> beside the auto_increment option, you'll no doubt need to use that as well
> to ensure you create the proper relationships between entities.
>
> Hope this helps you out,  Joe:)
>
>
>
> raf Al Shafaki <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > In databases, after creating a number of tables, one could usually set
> > relationships (or some call it relations) between these tables, by tying
> > some reference number in one table with the id (or index) in another
> > table for example, or just making any other kinds of relationships
> > between
>
> tables
>
> > for any other reason.
> >
> > I used to do relationships between tables when I used Microsoft Access.
> > My question is: Does MySQL enable you to create relationships between
> > tables after you create the tables? If so, how (what are the commands
> > from the command prompt?)

Just so that you don't get the wrong idea. Although you can create primary 
keys and such in MySQL, it is up to *you* to enforce the relations in your 
code. MySQL v3.XX (not sure about the v4.XX) does not support relations and 
foreign keys like Access does. That is there are no referential integrity 
checks in MySQL.




-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
One expresses well the love he does not feel.
                -- J.A. Karr
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to