Jump to content

Sql Foreign Keys


Guest rgrigga
 Share

Recommended Posts

Guest rgrigga

First of all, I want to thank you for all of the resources provided by w3schools. My colleagues and I use the site every day. Please keep it up, and THANK YOU!!!I have a suggestion for content that may be helpful for others:SQL:FOREIGN KEYSMySQL's default engine, MyISAM, does not support foreign keys. A query with the proper syntax will succeed with no error message generated, but MySQL will not enforce referential integrity. (For example, it mysteriously allows the addition of a record to table1 with a FK value that does not exist as a PK in table2).Of course there are other considerations to engine selection, but this issue may be useful for others to discover on this page of the SQL tutorial: http://www.w3schools.com/sql/sql_foreignkey.asp.The solution I chose to use was to convert my tables to InnoDB. Perhaps you can phrase this more eloquently, but I hope it is helpful!Thanks again!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...