Skip to main content
Database Design
CHAPTER 06 Beginner

Entity-Relationship (ER) Diagrams | Visual Database Planning

Updated: May 16, 2026
20 min read

# CHAPTER 6

ER Diagrams Explained

1. Introduction

If you are an architect building a house, you don't hand the construction crew a written essay describing the walls. You hand them a visual blueprint. In software engineering, the blueprint for a database is called an Entity-Relationship Diagram (ERD). An ERD is a standardized visual map that shows exactly how tables are structured and how they interact. In this chapter, we will learn how to read and draw the universal language of Database Architects.

2. Learning Objectives

By the end of this chapter, you will be able to:
  • Understand the purpose of an ER Diagram.
  • Identify the standard symbols (Chen Notation).
  • Understand modern "Crow's Foot" Notation used in software tools.
  • Map Cardinality visually.
  • Draw a complete ER Diagram from business requirements.

3. The Classic Notation (Chen Notation)

Invented by Peter Chen in 1976, this is the academic standard taught in computer science degrees. It uses strict geometric shapes:
  • Rectangle: Represents an Entity (Table).
  • Double Rectangle: Represents a Weak Entity.
  • Oval: Represents an Attribute (Column).
  • Underlined Oval: Represents a Primary Key Attribute.
  • Diamond: Represents the Relationship (Verb) between Entities.

*Visualizing a Rule:* [Customer Rectangle] ---<Places Diamond>--- [Order Rectangle].

4. Modern Software Notation (Crow's Foot Notation)

While Chen notation is great for whiteboards, modern database tools (like MySQL Workbench or Lucidchart) use "Crow's Foot" notation because it represents tables exactly as they look in SQL. Instead of diamonds and ovals, it uses connected boxes.

The Lines determine the Cardinality:

  • One (1): A straight line with a single perpendicular dash (|).
  • Many (N): A line that splits into three prongs at the end (looks like a crow's foot |<).
  • Zero or One: A line with an O and a |.

*Visualizing a 1:N Rule:* [Users Box] ----|----------|< [Orders Box] *(Read as: Exactly ONE user can have MANY orders).*

5. Why ERDs are Mandatory

An ERD serves three massive purposes in a company:
  1. 1. Developer Blueprint: The backend engineers look at the ERD to know exactly what SQL JOIN queries they need to write.
  1. 2. Stakeholder Verification: You can show an ERD to a non-technical CEO to verify that the Business Rules (Chapter 4) are correct before writing code.
  1. 3. Documentation: When a new developer joins the company, the ERD is the map they use to understand the massive 500-table database.

6. Mini Project: Draw a Social Media ER Diagram

Let's blueprint a simplified Twitter clone using Conceptual formatting.

Entities identified: User, Tweet. Attributes identified:

  • User: userid (PK), handle, email
  • Tweet: tweetid (PK), content, timestamp
Relationship: A User *Posts* a Tweet. Cardinality: 1 User can post Many Tweets (1:N).

The Whiteboard Sketch (Crow's Foot):

text
1234567
+----------------+          +----------------+
|      USER      |          |     TWEET      |
+----------------+          +----------------+
| PK: user_id    |---|----|<| PK: tweet_id   |
|     handle     |          | FK: user_id    |
|     email      |          |     content    |
+----------------+          +----------------+

*(Notice how clearly the userid Foreign Key in the Tweet table connects back to the User!)*

7. Common Mistakes

  • Overcomplicating the Conceptual ERD: A database might have 50 specific columns (like updatedat, is_deleted). Do not put all 50 columns on a high-level conceptual ER diagram; it becomes an unreadable mess. Only include the Primary Keys, Foreign Keys, and the 2 or 3 most important descriptive attributes. Save the exhaustive column list for the Data Dictionary.

8. Best Practices

  • Left-to-Right Hierarchy: When drawing an ERD, place the most important "Strong" Entities (like Users or Companies) on the left side, and let the lines flow rightwards toward the "Weak" Entities (like Orders, Logs, or Comments). This makes the diagram naturally readable.

9. Exercises

  1. 1. In modern Crow's Foot notation, what does a line ending in three diverging prongs symbolize?
  1. 2. Why is drawing an ER Diagram considered a mandatory step before writing SQL CREATE TABLE statements?

10. Database Design Challenges

Visualize a Many-to-Many (M:N) relationship between Students and Classes. Because an ERD cannot directly connect a Crow's Foot to another Crow's Foot, what physical Entity must you draw between them to resolve the relationship? *(Answer: A Pivot/Junction Table, usually named Enrollments. The diagram will show Students 1:N Enrollments, and Classes 1:N Enrollments).*

11. MCQ Quiz with Answers

Question 1

In Peter Chen's classic ER modeling notation, what geometric shape is used to explicitly represent the "Relationship" (the association/verb) connecting two distinct Entities?

Question 2

When utilizing modern "Crow's Foot" notation in database modeling software, what does the specific symbol of a straight line terminating in a three-pronged "crow's foot" indicate?

12. Interview Questions

  • Q: Explain the transition from a Conceptual ER Diagram (using Chen Notation with Diamonds) to a Logical/Physical ER Diagram (using Crow's Foot Notation). Why do software tools prefer the latter?
  • Q: You are handed an ER Diagram where the Orders table has a Crow's Foot pointing towards it from the Customers table. Explain exactly what this line means for the underlying Foreign Key SQL architecture.

13. FAQs

Q: Do I have to draw these by hand? A: No! While whiteboarding is great for brainstorming, professionals use tools like Lucidchart, Draw.io, or MySQL Workbench. In fact, MySQL Workbench can connect to a live database, scan your tables, and automatically generate a perfect Crow's Foot ERD for you!

14. Summary

You are now capable of drawing technical blueprints. By translating abstract Business Rules and Entities into standardized visual ER Diagrams using Crow's Foot notation, you can effectively communicate massive, complex database architectures to both engineers and stakeholders.

15. Next Chapter Recommendation

Our visual diagrams show lines connecting tables together. But how do we physically forge those connections in the database? In Chapter 7: Primary Keys and Foreign Keys, we will translate our visual blueprints into mathematical, structural SQL constraints.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·