Database relations
Databases are not intended for storing data but for storing relationships. Relationships are what make Entities worthy. Your main goal in designing databases is to identify Entities and Relationships between them. I show here the types of Relationships and how to store them. There are 3 types of relationships in Relational Databases: 1- One to one 2- One to many 3- Many to many The type of relationships between two entities will define how we store them. One to one example: Imagine a school offering personal laptops to their students. If a laptop is assigned to only one student, and the student can only have one laptop assigned by the school, this is a one-to-one relationship. One to many example: Another school with different rules. In this school, a laptop is assigned to only one student, but the student can get assigned more than one laptop (one PC and one Mac, for example). This relationship becomes one-to-many because one student can have many laptops, but each laptop is assigned ...