Skip to content
IRC-Coding IRC-Coding
ER model Entity-Relationship Relationships Cardinality One-to-many Many-to-many Mapping Chen notation Crow's Foot

ER Models Entity-Relationship Explained

ER models visualize data structures with entities, relationships, and cardinality. Learn Chen notation and Crow's Foot diagram techniques.

S

schutzgeist

2 min read

ER Models Entity-Relationship – Relationships, Cardinality, 1:n, n:m, Mapping

This article is a term explanation for ER models – including exam questions and tags.

In a Nutshell

ER models are graphical representations for visualizing data structures with entities, their attributes, and the relationships between them. They form the foundation for database design.

Compact Technical Description

Entity-Relationship models (ER models) were developed by Peter Chen to model data structures conceptually. They consist of three main components: entities (objects from the real world), attributes (properties of entities), and relationships (links between entities). Relationships have cardinalities that describe the number of possible links (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 and help avoid redundancies and ensure data integrity.

Exam-Relevant Key Points

  • Entities: Real or abstract objects with unique identification
  • Attributes: Properties of entities, primary and foreign keys
  • Relationships: Links 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 with lines and symbols for cardinalities
  • Mapping: Transformation of ER models into relational schemas
  • IHK relevant: Being able to interpret and create ER models

Core Components

  1. Entity types and entity instances
  2. Attributes (simple, composite, derived, multi-valued)
  3. Primary keys and foreign keys
  4. Relationship types and relationship instances
  5. Cardinalities and participations
  6. Weak entities and identifying relationships
  7. Generalization and specialization (inheritance)
  8. Aggregation and composition
  9. Chen notation vs. Crow’s Foot
  10. Mapping to relational tables

Practical Example

// ER Model Library (simplified)
ENTITY: Book
- ISBN (Primary key)
- Title
- Author
- Year

ENTITY: Customer
- CustomerNo (Primary key)
- Name
- Address

RELATIONSHIP: borrows (1:n)
- One customer can borrow many books
- One book can be borrowed by one customer

Mapping:
- Table Book(ISBN, Title, Author, Year, CustomerNo_FK)
- Table Customer(CustomerNo, Name, Address)
- Foreign key CustomerNo_FK in Book table

Advantages and Disadvantages

Advantages

  • Visual representation facilitates understanding
  • Early detection of design problems
  • Standardized notations for communication
  • Good foundation for database implementation

Disadvantages

  • Complex models can become confusing
  • Different notations can cause confusion
  • Abstraction can hide important details
  • Requires experience for good modeling

Typical Exam Questions (with Brief Answers)

  1. Three main components of ER models? Entities, attributes, relationships.

  2. Difference between 1:n and n:m relationships? 1:n: One record on one side can have many on the other side, but vice versa only one. n:m: Both sides can have many.

  3. Chen notation symbols? Rectangles for entities, diamonds for relationships, ovals for attributes.

  4. Crow’s Foot for 1:n relationship? Line with “foot” on the n-side, straight line on the 1-side.

  5. Primary key vs. foreign key? Primary key uniquely identifies a record, foreign key refers to the primary key of another table.

  6. Weak entity? Entity that cannot exist without another entity, identified by a foreign key.

  7. Mapping of n:m relationship? Creates separate junction table with foreign keys to both involved entities.

  8. Generalization in ER models? Special entities inherit from a general entity (IS-A relationship).

Most Important Sources

  1. https://de.wikipedia.org/wiki/Entity-Relationship-Modell
  2. https://www.guru99.com/er-diagram-tutorial.html
  3. https://www.lucidchart.com/pages/de/er-diagramme

Keine Bücher für Kategorie "datenbanken" gefunden.

Back to Blog
Share:

Related Posts