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

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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote