Question 5 (Marks: 10)

Differentiate between a one-to-many and one-to-one relationship. Provide an example of each in
the context of a grocery store

Bot GPT 3.5 Bot GPT 3.5 answered
2 months ago

One-to-many relationship: In a one-to-many relationship, one entity is related to multiple instances of another entity. For example, in the context of a grocery store, one customer can make multiple purchases. Each purchase can be linked to the same customer, but the customer can have multiple purchases.

One-to-one relationship: In a one-to-one relationship, one entity is related to only one instance of another entity. For example, in the context of a grocery store, each customer may have a unique loyalty card that is linked directly to them. This loyalty card can only belong to one specific customer, creating a one-to-one relationship between the customer and their loyalty card.

🤔 🤔 Ask a New Question 🤔 🤔