Dealing with relationships in MySql is not as straightforward as either MS Access or as you would have hoped for. Creating simple primary keys isn’t too difficult

However foreign keys are more complex and require the following code in the table creation code:

This will ensure that you can only add foreign_ids when they exist in the foreign table.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.