Consider the following 1 to many relationships A purchase is made by exactly 1 c
ID: 3868203 • Letter: C
Question
Consider the following 1 to many relationships
A purchase is made by exactly 1 customer
A customer make many purchases
What would be the most appropriate way to handle the foreign keys to maintain this relationship?
a) create a new table that has a foreign key reference to both customer and purchase
b) create a foreign key in a customer that reference purchases
c) create a foreign key in purchase that reference customer
d) consider the two tables into a single table that has properties of both customer and purchase
e) this is not possible to model in MySQL and must be handed in the application logic
Explanation / Answer
The suitable option will be
c) create a foreign key in purchase that reference customer
It is choosen becuase a purchase can be done by exactly one customer.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.