What is ER modeling, and how do you represent entities, relationships, and cardinality when designing a relational schema?
Last updated
ER (Entity-Relationship) modeling is a conceptual design technique that describes data as entities, the attributes that describe them, and the relationships between them, before it becomes physical tables. It lets you reason about structure and cardinality independent of any specific database.
Entities:
Real-world things you store data about (
Customer,Order); each becomes a table with a primary key.Attributes become columns; the identifying attribute is the key.
Relationships: Associations between entities (a Customer places an Order), implemented with foreign keys.
Cardinality:
One-to-one: rare, often merged or split for security/sparsity reasons.
One-to-many: the "many" side holds a foreign key to the "one" side.
Many-to-many: resolved with a junction (bridge) table holding both foreign keys.
Optionality: Whether participation is mandatory or optional maps to
NOT NULLvs nullable foreign keys.
- https://dev.to/arctype/er-diagrams-vs-er-models-vs-relational-schemas-4h4i
- https://dev.to/louaiboumediene/mastering-relational-database-design-a-comprehensive-guide-3jh8
- https://dev.to/be11amer/entity-relationship-er-diagrams-visualizing-your-database-structure-obb
- https://www.freecodecamp.org/news/how-to-design-structured-database-systems-using-sql-full-book/
- https://www.freecodecamp.org/news/learn-relational-database-design-1/
- https://www.geeksforgeeks.org/gate/database-design-modeling-interview-questions/
- https://dev.to/aryaglekshmi/entity-relationship-diagramerd-2k9g
- https://dev.to/pocharis/relational-database-design-to-store-university-timetables-and-record-of-students-attendance-3jg4