Use an entity-relationship (E-R) diagram to document a database design

8.1 Database Concepts 📚

What is an Entity-Relationship (E‑R) Diagram?

An E‑R diagram is a visual map that shows how data is organized in a database. Think of it as a road map for the information: entities are like cities, relationships are the roads that connect them, and attributes are the landmarks within each city.

Key Components

  • Entity – a real‑world object or concept (e.g., Student, Course).
  • Attribute – a property of an entity (e.g., studentID, courseName).
  • Primary Key – a unique attribute that identifies each entity instance (e.g., studentID).
  • Relationship – a connection between two entities (e.g., enrolls between Student and Course).
  • Cardinality – the number of instances that can participate in a relationship (e.g., one‑to‑many, many‑to‑many).

Step‑by‑Step: Building an E‑R Diagram

  1. Identify the entities in the system.
  2. Determine the attributes for each entity.
  3. Select a primary key for each entity.
  4. Define the relationships between entities.
  5. Specify the cardinality for each relationship.
  6. Draw the diagram using rectangles for entities, diamonds for relationships, and ovals for attributes.

Example: University Database

Entity Attributes Primary Key
Student studentID, name, email studentID
Course courseID, title, credits courseID
Enrollment enrollID, grade enrollID

Relationships:

  • Student enrolls in Course (many‑to‑many via Enrollment).
  • Enrollment belongs to one Student and one Course.

Exam Tips for 9618

  • Always label entities, attributes, and relationships clearly.
  • Use underlining for primary keys in diagrams.
  • Show cardinality with symbols (1, N, M).
  • When asked to justify a design, explain why each relationship is necessary.
  • Practice drawing diagrams quickly – use a template of rectangles, diamonds, and ovals.

Remember: clarity beats complexity. A tidy, well‑labelled diagram is worth more than a messy one.

Revision

Log in to practice.

2 views 0 suggestions