🔗 One-to-One Relationship:
products
and another table product_serial_numbers
. Each product in the products
table has a unique serial number in the product_serial_numbers
table. There would be exactly one observation for a particular product_id
in both the table.🔗 One-to-Many Relationship or Many-to-One Relationship:
customer
can have multiple orders
in the orders
table, but each order
can belong to just one customer
. There is a One-to-Many relationship between the two tables.🔗 Many-to-Many Relationship:
customer
can purchase multiple products
, and a product
can be purchased by multiple customers
. The relationship between customers
and products
can be represented through an intermediary table, such as orders
, which contains records of each unique transaction..
Food for Thought:
Answers:
orders
table would have one-to-many relationship with orderdetails
table.product
can have multiple suppliers
and one supplier
can ship multiple products
.