Question: Already created primary keys, Need help with the foreign keys. See details below. 4 CREATE TABLE SELECT gives you the data definitions and data, but
Already created primary keys, Need help with the foreign keys. See details below.


4 CREATE TABLE SELECT gives you the data definitions and data, but no keys. So now you will need to ALTER TABLE statements to create keys as shown in the table below. The primary keys are the ones shown with the key icon on the original schema. VERY IMPORTANT- MySQL requires that a foreign key reference a primary key OR indexed attribute. My advice: create all of the PRIMARY KEYS first, then the foreign keys (or be very careful of the order in which your ALTER the tables. Foreign Key deletion should be handled [as specified] in the table. DO NOT specify any ON UPDATE handling
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
