Skip to main content

ERD — Entity Relationship Diagram

An entity relationship diagram (ERD) — also called an ER diagram — is a structural diagram that represents the tables, columns, and relationships in a relational database. ERDs are the standard visual language for database schema design, used by software engineers, data architects, and data engineers to communicate database structure.

ERDs were formalized by Peter Chen in his 1976 paper "The Entity-Relationship Model — Toward a Unified View of Data", one of the most cited papers in computer science.


Components of an ERD

Entities (Tables)

An entity represents a real-world object or concept that has data stored about it. In a relational database, entities map to tables.

Examples: Customer, Order, Product, Employee, Invoice

Attributes (Columns)

Attributes describe properties of an entity. They map to columns in a table.

  • Key attributes uniquely identify an entity instance (primary key)
  • Composite attributes are built from multiple sub-attributes (e.g., full_name = first_name + last_name)
  • Derived attributes are calculated from other attributes (e.g., age from birth_date)
  • Multi-valued attributes require a separate table (1NF normalization)

Relationships

Relationships describe how entities are connected. In relational databases, relationships are implemented using foreign keys.

Relationship TypeDescriptionSQL Implementation
One-to-one (1:1)One entity A instance relates to exactly one entity BFK in either table with UNIQUE constraint
One-to-many (1:N)One entity A instance relates to many entity B instancesFK in the "many" table
Many-to-many (M:N)Many A instances relate to many B instancesJunction table with two FKs
Self-referencingEntity relates to itself (hierarchy, tree)FK in same table (e.g., employee.manager_id → employee.id)

ERD Notations

Crow's Foot Notation (Information Engineering / IE)

The most widely used notation in modern tools. Uses visual "crow's foot" symbols at relationship ends to indicate cardinality.

| Symbol | Meaning | | ------ | ---------------------------- | ---------------------------- | ----------------------- | | | | | Exactly one (mandatory) | | | o | Zero or one (optional) | | } | | One or many (mandatory many) | | }o | Zero or many (optional many) |

TalkingSchema uses Crow's Foot (IE) notation by default.

Chen Notation

The original notation from Peter Chen's 1976 paper. Uses diamonds for relationships and ellipses for attributes. More commonly seen in academic settings and older enterprise tools (erwin, ER/Studio).

IDEF1X

A formal notation standard used in US government and defense contexts. Similar to IE notation but with slightly different cardinality symbols. Used by some enterprise modeling tools.


ERD Example: E-Commerce Schema

customers               orders               order_items          products
───────────────── ────────────────── ───────────────── ─────────────────
id (PK) }|──|{ id (PK) id (PK) }|──|{ id (PK)
email customer_id (FK) ─┘ order_id (FK) ─┘ name
name total_amount product_id (FK) ──┐ price
created_at status quantity category_id (FK)
created_at unit_price

How TalkingSchema Generates ERDs

TalkingSchema generates entity relationship diagrams from plain language descriptions using its AI copilot. You describe your data model requirements — tables, relationships, constraints — and TalkingSchema:

  1. Generates a structured schema with all tables, columns, data types, and FK relationships
  2. Renders an interactive ERD canvas with Crow's Foot (IE) notation
  3. Highlights every added, modified, or removed element with a color-coded diff overlay
  4. Lets you approve or undo individual changes via Plan Mode

Example prompts:

"Design an e-commerce database with customers, orders, order items, and products. Include inventory tracking and product categories."

"Add a many-to-many relationship between products and tags."

"Create a self-referencing hierarchy for employee → manager relationships."


ERD Tools Comparison

ToolAI GenerationSQL ImportORM ExportFree Tier
TalkingSchema✅ Plain language → ERD✅ PostgreSQL, MySQL, SQLite, MSSQL✅ Prisma, Drizzle, OpenAPI, GraphQL
dbdiagram.io❌ Write DBML code
Lucidchart❌ Manual drawingLimited
draw.io❌ Manual drawing
pgAdmin❌ Reverse-engineer only✅ PostgreSQL only✅ (open source)

Frequently Asked Questions

What is the difference between an ERD and a schema diagram?

The terms are often used interchangeably. Strictly, an ERD includes the conceptual model (entities and relationships without implementation details), while a schema diagram is the physical model (actual tables, column types, FK constraints, indexes). TalkingSchema generates physical-level diagrams that double as ERDs.

What notation does TalkingSchema use for ERDs?

TalkingSchema uses Crow's Foot (IE) notation, which is the most widely adopted notation in modern tools (also used by Mermaid, Prisma diagrams, and most web-based ERD tools).

Can TalkingSchema generate an ERD from an existing SQL database?

Yes. Connect your Supabase or Neon PostgreSQL database, or upload a SQL DDL file or DBML file, and TalkingSchema reverse-engineers a visual ERD automatically. You can then extend or modify it using the AI copilot.