ER Models Entity-Relationship – Relationships, Cardinality, 1:n, n:m, Mapping
This post is a conceptual guide to ER models, complete with exam questions and key terms.
In a Nutshell
ER models are graphical representations that visualize data structures, showing entities, their attributes, and the relationships between them. They form the foundation for database design.
Compact Technical Definition
Entity-Relationship models (ER models) were developed by Peter Chen to represent data structures conceptually. They consist of three core components: entities (real-world objects), attributes (properties of those entities), and relationships (connections between entities). Relationships have cardinalities that describe how many associations are possible (1:1, 1:n, n:m). The most common notations are Chen notation and Crow’s Foot notation. ER models serve as a blueprint for creating relational databases, helping eliminate redundancy and maintain data integrity.
Key Exam Topics
- Entities: Real or abstract objects with unique identification
- Attributes: Properties of entities, including primary and foreign keys
- Relationships: Connections between entities with cardinalities
- Cardinalities: 1:1 (one-to-one), 1:n (one-to-many), n:m (many-to-many)
- Chen notation: Rectangles for entities, diamonds for relationships, ovals for attributes
- Crow’s Foot: Practical notation using lines and symbols to represent cardinalities
- Mapping: Transformation from ER models into relational schemas
- IHK relevance: Ability to interpret and create ER models
Core Components
- Entity types and entity instances
- Attributes (simple, composite, derived, multivalued)
- Primary keys and foreign keys
- Relationship types and relationship instances
- Cardinalities and participations
- Weak entities and identifying relationships
- Generalization and specialization (inheritance)
- Aggregation and composition
- Chen notation vs. Crow’s Foot
- Mapping to relational tables
Practical Example
// ER model for a library (simplified)
ENTITY: Book
- ISBN (Primary Key)
- Title
- Author
- Year
ENTITY: Customer
- CustomerID (Primary Key)
- Name
- Address
RELATIONSHIP: borrows (1:n)
- A customer can borrow many books
- A book can be borrowed by one customer
Mapping:
- Table Book(ISBN, Title, Author, Year, CustomerID_FK)
- Table Customer(CustomerID, Name, Address)
- Foreign Key CustomerID_FK in Book table
Advantages and Disadvantages
Advantages
- Visual representation enhances understanding
- Early detection of design problems
- Standardized notations for communication
- Strong foundation for database implementation
Disadvantages
- Complex models can become difficult to read
- Different notations may create confusion
- Abstraction can hide important details
- Requires experience to model effectively
Typical Exam Questions (with Brief Answers)
-
What are the three main components of ER models? Entities, attributes, and relationships.
-
What’s the difference between 1:n and n:m relationships? 1:n: One record on the first side can relate to many on the second side, but not vice versa. n:m: Both sides can relate to many on the other side.
-
What symbols are used in Chen notation? Rectangles for entities, diamonds for relationships, ovals for attributes.
-
How does Crow’s Foot represent a 1:n relationship? A line with a “foot” on the n-side, and a straight line on the 1-side.
-
Primary key vs. foreign key? A primary key uniquely identifies a record, while a foreign key references the primary key of another table.
-
What is a weak entity? An entity that cannot exist without another entity and is identified through a foreign key.
-
How is an n:m relationship mapped? A separate junction table is created with foreign keys pointing to both related entities.
-
What is generalization in ER models? Specialized entities inherit from a general entity (IS-A relationship).
Primary Sources
- https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model
- https://www.guru99.com/er-diagram-tutorial.html
- https://www.lucidchart.com/pages/er-diagrams
Recommended Reading: Databases
Keine Bücher für Kategorie "datenbanken" gefunden.
More ER Model Articles
Entity-Relationship models are fundamental to database modeling. The following articles help you master all aspects of ER models.
Fundamentals and Relationships
- ER Models: Entity Relationship Relationships - Detailed explanation of relationship types and cardinalities



