eawedat — 2011-08-24T04:58:36-04:00 — #1
what is the best statement? /faster/preferred?
key xyz(sid), constraint xyz foreign key(sid) references Singers(id) on delete cascade;
foreign key(sid) references Singers(id) on delete cascade;
index idx_dr(sid),foreign key(sid) references Singers(id) on delete cascade;
what is the difference between "key" & "index"
r937 — 2011-08-24T08:21:19-04:00 — #2
KEY and INDEX are synonymous
FOREIGN KEY, however, is completely different (and doesn't actually do anything in myisam tables)
note that declaring a FOREIGN KEY will automatically create the underlying INDEX
eawedat — 2011-08-24T09:56:23-04:00 — #3
sorry not to mention that, but I am talking about InnoDB.
so how is foreign key related in innodb?
guelphdad — 2011-08-24T11:01:57-04:00 — #4
Did you bother to look in the manual?
eawedat — 2011-08-24T11:07:24-04:00 — #5
if you have something to assist with ..so assist, if not i assume you could /exit
guelphdad — 2011-08-24T11:25:28-04:00 — #6
If you can't be bothered to look something up in the manual, don't post in a public forum.
eawedat — 2011-08-24T11:31:58-04:00 — #7
really? ,,, I am not going to argue with you kid!
but if you put your glasses on you could see that I already posted 3 sql's statements, that indicates that I BOTHERED to look at the manual.
2)These forums are to help guys who are beginner like me! if guys like you monitor every post !! like a bodyguard and giving commands what to post and what not!! that would not be called forums!!
Forums came to help people who are in need of help like me!
3)I just do not get the idea of you guys who have free time just to "BLAME".
I already stated if you have something to help , just help if not keep quit with all respect!
r937 — 2011-08-24T13:12:31-04:00 — #8
it is done with the REFERENCES syntax
eawedat — 2011-08-24T13:32:26-04:00 — #9
yeah as it's written above..
thank you very much:)