Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2003
    Posts
    4

    Unanswered: how to implement foreign key in mysql?

    Can anyone show an example of how to implement foreign key in mysql? if i not wrong, to implement foreign key in mysql, u need to create another type of table, if that is true, is it possible to show an example of how to create that type of table to implement foreign key using create table sql statement.(just show one simple example is enough).......? i walk around many forum looking for answers..but until now...my questions is still not answered successfully....i have been pondering over this over about a month....still dun know how to do....

    thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you've been looking for an example of creating a foreign key for an innodb table for a month? whoa!

    there's an example in the mysql manual: 7.5.5.2 Foreign Key Constraints


    rudy

  3. #3
    Join Date
    Apr 2003
    Posts
    4

    Hey ! thanks!

    I did not really read thru the mysql reference manual...cos i thought tey are damm technical and difficult to understand.....but now i understand liao.....

    So as to say, to create a table with foreign key of another table, both table must be Innob table type. And the foreign key must be indexed.btw wat is actually index mean? in my sch..i learn sql but sch never teach index, can briefly explain to me the meaning of index?thanks!!!

  4. #4
    Join Date
    Jan 2003
    Location
    Duncan BC Canada
    Posts
    80

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •