Entity Relationships and Cardinalities
Learn how to define relationships and cardinalities in the database model.
Why do we need database relationships?
Think about an online bookstore. Customers browse products, add them to their carts, place orders, and make payments. Each of these actions involves different types of data—customer details, product information, order history, and payment records. Now, what if there was no link between these pieces of information? You wouldn’t know which customer placed which order or which payment belonged to which purchase.
Databases are not just about storing information; they are about structuring it in a meaningful way. Without relationships, a database would be nothing more than disconnected islands of data. Relationships allow us to connect relevant data points, avoid redundancy, maintain consistency, and retrieve meaningful insights
Before moving forward, ...