-
What kinds of relationships can we represent in a database?
The various kinds of relationships represented within a database include; One to One, One to Many and Many to One, Many to Many, and Self Referencing. -
When do we use “One to One” relationships? Give an example from the real world.
The example taken from the article is the customer_address, establishing a relationship between the CUSTOMERS table and the ADDRESSES table. -
In the article in the “One to One”-section, the author of the article has a column called customer_id in the customers table. Why? How is it used in order to connect customers to addresses?
The customer_id scales relationships between the CUSTOMERS and the ADDRESSES tables, referring to the .matching record and/ or data. -
Give an example from the real world when one would need to use a “Many to One/One to Many” relationship.
An example is an e-commerce website. In other words, customers make orders, orders contain items, and itemes have descriptions in many languages. -
Give an example from the real world when one would need to use a “Many to Many” relationship.
An example of Many to Many relationship is the items-orders. Orders contain many items. Items can be in many orders. -
What does items_orders table do?
Relationship defined as Many to Many between the items and orders.; .
Best Regards,
References
Retrieved From: https://code.tutsplus.com/articles/sql-for-beginners-part-3-database-relationships--net-8561