Question: Insert the following data into your database separating it appropriately into the make and model tables and setting the make_id foreign key to link each
Insert the following data into your database separating it appropriately into the make and model tables and setting the make_id foreign key to link each model to its corresponding make.
| make | model |
|---|---|
| Mercury | Milan AWD FFV |
| Mercury | Milan FFV |
| Mercury | Milan FWD |
| Volkswagen | Jetta III |
| Volkswagen | Jetta III GLX |
Here is the structure of the tables you will need for this assignment:
CREATE TABLE make ( id SERIAL, name VARCHAR(128) UNIQUE, PRIMARY KEY(id) ); CREATE TABLE model ( id SERIAL, name VARCHAR(128), make_id INTEGER REFERENCES make(id) ON DELETE CASCADE, PRIMARY KEY(id) );
Step by Step Solution
3.36 Rating (159 Votes )
There are 3 Steps involved in it
To insert the given data into your database properly follow these steps Step 1 Insert Data into the Make Table First we need to populate the make tabl... View full answer
Get step-by-step solutions from verified subject matter experts
