Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Database Design: Please list all the foreign keys in relations that have them in

ID: 3869393 • Letter: D

Question

Database Design:

Please list all the foreign keys in relations that have them in this schema. For each one, please state the foreign key name, the relation in which it is the primary key, and the relation in which it is a foreign key. A sample statement can be: “Attribute X which is a foreign key in relation K, references the primary key of relation J.”

SALESPERSON (Salesperson-ID, Salesperson-name, Salesperson-phone) CAR (Car-VIN, Model, Manufacturer, Sticker-price) OPTIONALEQUIPMENT (Car-VIN, Option-name, Price) DEAL (Salesperson-ID, Car-VIN, Date-of-transaction, Final-price)

Explanation / Answer

A foreign key is an attribute that acts as key to link two or more relations.

It can be a single attribute (column) or a combination of attributes and it's values match a Primary key in another table.

In the above schema there are multiple Foreign keys among the relations:

1) Attribute Car-VIN which is a foreign key in relation OPTIONAL_EQUIPMENT, references the primary key of relation CAR.

2) Attribute Salesperson-ID which is a foreign key in relation DEAL, references the primary key of relation SALESPERSON.

3) Attribute Car-VIN which is a foreign key in relation DEAL, references the primary key of relation CAR.