How To Create Foreign Key

Reply

Join Date: Oct 2005
Posts: 1
Reputation: jessica81 is an unknown quantity at this point 
Solved Threads: 0
jessica81 jessica81 is offline Offline
Newbie Poster

How To Create Foreign Key

 
0
  #1
Oct 10th, 2005
hi,im really new to MySQL,can some one help me in joining table pls...i hv 2 tables,customer table and record table

customer table with CustomerID,Customer Name,CustomerAddress,
record table with RecordID,CustomerID,Date,

how to make the CustomerID in record as foreign key? how to join that two tables so that record will be deleted when i delete the customer id?

i hope u guys could give me a hand :cry: thanks!
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 3
Reputation: hemalatha.a.s is an unknown quantity at this point 
Solved Threads: 0
hemalatha.a.s hemalatha.a.s is offline Offline
Newbie Poster

Re: How To Create Foreign Key

 
0
  #2
Oct 12th, 2005
hai i am also new
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: How To Create Foreign Key

 
0
  #3
Oct 15th, 2005
Just to take note that there is no Foreign key in MySQL unless your database's type is InnoDB. I assume you are using MyISAM.

DELETE FROM Customer WHERE CustomerID = yourcustomerid;
DELETE FROM Records WHERE CusomerID = yourcustomerid;
Hope it helps.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC