No, you don't. In fact, unless you are using InnoDB-type tables in MySQL version 3.23.44 and higher, they aren't supported.
Foreign keys, on database servers which support them, have nothing whatsoever to do with relating tables. What they do is constrain input with the intent of increasing data consistency.
Assume, for example, that column "foo" in table "a" has a foreign key constraint which points to column "bar" in table "b". What the constraint does it insure that the only value that can be inserted in "foo" is a value that already exists in "bar".
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.