Relational Model Notation
Diagrammatic Representation: Visualizing Database Structure
Read aloud is unavailable in this browser.
The Power of Visual Schema Representation
Humans are visual beings—we process images far more rapidly than text. While formal textual notation provides precision, diagrammatic representations provide insight. A well-constructed schema diagram reveals structural patterns, relationship networks, and potential design issues at a glance.
Visual schema notation serves multiple audiences:
- Architects see overall system structure and integration points
- Developers understand entity relationships and query paths
- Business analysts validate that the model captures requirements
- Operations teams identify backup and dependency relationships
- New team members orient themselves quickly in unfamiliar systems
This page explores the major diagrammatic conventions for relational schemas, from simple relationship diagrams to sophisticated visual modeling tools.
After studying this page, you will be able to:
• Read and create schema diagrams with table boxes and relationship lines • Apply crow's foot notation to express cardinality constraints • Use UML class diagram notation for data modeling • Interpret IDEF1X database diagrams • Choose appropriate diagram styles for different audiences and purposes
Basic Schema Diagrams
The simplest and most common diagrammatic representation uses boxes for tables and lines for relationships.
Table Box Notation
Each relation is represented as a rectangle divided into sections:
┌─────────────────────┐
│ TABLE_NAME │ ← Header with table name
├─────────────────────┤
│ • pk_column (PK) │ ← Primary key indicated
│ column2 │
│ column3 (FK) │ ← Foreign keys marked
│ column4 │
└─────────────────────┘
Relationship Lines
Lines connect tables to show foreign key relationships:
- Solid line: Identifying relationship (FK is part of child's PK)
- Dashed line: Non-identifying relationship (FK is not part of child's PK)
- Line endpoints: Indicate cardinality (one or many)
Visualization Components
Inside the box:
- Primary key attributes (marked with PK, key icon, or underlined)
- Foreign key attributes (marked with FK or referencing arrow)
- Other attributes (sometimes omitted for clarity)
- Data types (optional, depending on target audience)
Between boxes:
- Lines showing referential relationships
- Cardinality indicators at line endpoints
- Relationship labels (optional, describing the association)
- •Primary tables at top/center — Core entities should be visually prominent
- •Minimize line crossings — Rearrange boxes to reduce intersection
- •Consistent positioning — Child tables below or to the right of parents
- •Appropriate detail level — Omit non-essential attributes for overview diagrams
- •Clear labeling — Use relationship names that convey business meaning
Crow's Foot Notation
Crow's foot notation (also called IE notation, after Information Engineering) is the most widely used cardinality notation in database design tools.
Symbol Components
Cardinality is expressed using three symbols at line endpoints:
| Symbol | Meaning | Visual |
|---|---|---|
Line │ | One (exactly) | Single vertical line |
Circle ○ | Zero (optional) | Small circle |
Crow's foot < | Many | Three-pronged fork |
Combined Symbols
Combinations express minimum and maximum cardinality:
| Notation | Min | Max | Meaning |
|---|---|---|---|
│─ | 1 | 1 | Exactly one (mandatory single) |
││─ | 1 | 1 | One and only one |
○│─ | 0 | 1 | Zero or one (optional single) |
│<─ | 1 | N | One or more (mandatory many) |
○<─ | 0 | N | Zero or more (optional many) |
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
// CROW'S FOOT NOTATION EXAMPLES// ================================ // One-to-Many: Department has many Employees// ------------------------------------------DEPARTMENT ─────────────┤ │──○<──── EMPLOYEE │ │ │ One Department │ Zero or more Employees (mandatory) │ (can be empty dept) Read as: "One DEPARTMENT has zero or more EMPLOYEE" "Each EMPLOYEE belongs to exactly one DEPARTMENT" // One-to-One: Employee has one Parking Space (optional)// -----------------------------------------------------EMPLOYEE ───────────────○│─────────○│──── PARKING_SPACE One Employee Zero or One parking space (may not have one) (may not be assigned) Read as: "One EMPLOYEE has zero or one PARKING_SPACE" "One PARKING_SPACE is assigned to zero or one EMPLOYEE" // Many-to-Many (via junction): Student enrolls in Courses// -------------------------------------------------------STUDENT ─────┤│──○<─── ENROLLMENT ───○<──│├───── COURSE │ │ │ │ One Student Many enrollments One Course (junction table) Read as: "One STUDENT has many ENROLLMENT" "One COURSE has many ENROLLMENT" "Each ENROLLMENT links one STUDENT to one COURSE" // Self-Referencing: Employee reports to Manager// ---------------------------------------------- ┌───────────────────┐ │ │ ○< │ │ │ EMPLOYEE ───────────────────┘ │ │ │ └─ emp_id (PK) └─── manager_id (FK → emp_id) Read as: "One EMPLOYEE manages zero or more EMPLOYEE" "Each EMPLOYEE reports to zero or one EMPLOYEE"| Parent Side | Child Side | Relationship | Example |
|---|---|---|---|
| ││ | ○< | One-to-Many (optional) | Department → Employees |
| ││ | │< | One-to-Many (mandatory) | Order → OrderLines |
| ○│ | ○│ | One-to-One (both optional) | Employee ↔ Parking |
| ││ | ││ | One-to-One (both mandatory) | Country ↔ Capital |
| ○< | ○< | Many-to-Many (via junction) | Student ↔ Course |
Read relationships from each end toward the middle. At DEPARTMENT end: 'One department'. At EMPLOYEE end: 'Many employees'. Combined: 'One department has many employees'. The symbols closest to each entity describe how many of that entity participate.
UML Class Diagram Notation for Data Modeling
UML (Unified Modeling Language) class diagrams, originally designed for object-oriented systems, are frequently adapted for data modeling, especially in environments where developers are already familiar with UML.
Class Box Structure
┌─────────────────────────┐
│ <<table>> │ ← Stereotype indicates table
│ EMPLOYEE │
├─────────────────────────┤
│ +emp_id : INTEGER {PK} │ ← Attributes with types
│ +name : VARCHAR(100) │
│ +salary : DECIMAL(10,2) │
│ +dept_id : INTEGER {FK} │
├─────────────────────────┤
│ │ ← Operations section (empty)
└─────────────────────────┘
Visibility and Stereotypes
- + Public (all attributes typically public in data models)
- <<table>> Table stereotype
- <<PK>> or {PK} Primary key
- <<FK>> or {FK} Foreign key
- <<unique>> Unique constraint
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
// UML CLASS DIAGRAM NOTATION FOR DATA MODELING// ============================================= // Association with Multiplicity// ───────────────────────────── DEPARTMENT ────────────── 1..* EMPLOYEE 1 "employs" // Reads as: One DEPARTMENT employs 1 or more EMPLOYEE// Each EMPLOYEE works for exactly one DEPARTMENT // UML Multiplicities:// 1 = exactly one// 0..1 = zero or one// * = zero or more // 1..* = one or more// m..n = from m to n (e.g., 2..5) // Complete Association Example:┌──────────────┐ employs ┌──────────────┐│ <<table>> │ 1 1..* │ <<table>> ││ DEPARTMENT │─────────────────────────▶│ EMPLOYEE │├──────────────┤ │ ├──────────────┤│ +dept_id {PK}│ │ │ +emp_id {PK} ││ +name │ │ │ +name ││ +budget │ │ │ +dept_id {FK}│└──────────────┘ │ │ +salary │ │ └──────────────┘ │ Association name with direction // Aggregation (hollow diamond): "has-a" weak relationshipDEPARTMENT ◇──────────── EMPLOYEE// Department has employees, but employees can exist without department // Composition (filled diamond): "owns" strong relationship ORDER ◆──────────── ORDER_LINE// Order owns order lines; lines cannot exist without order // Generalization (inheritance): ┌──────────────┐ │ PERSON │ └──────┬───────┘ /│ / │ ┌──────────┐ │ ┌──────────┐ │ EMPLOYEE │ │ │ CUSTOMER │ └──────────┘ │ └──────────┘ │ EMPLOYEE and CUSTOMER inherit from PERSON- •UML strengths: Familiar to OO developers, rich stereotype system, standardized by OMG
- •UML weaknesses: Less intuitive cardinality symbols, busy diagrams with many details
- •Crow's foot strengths: Purpose-built for databases, intuitive cardinality, widely adopted
- •Crow's foot weaknesses: Limited stereotype support, less standardized variations
- •Choice depends on: Team background, tooling, organizational standards
IDEF1X Notation
IDEF1X (Integration Definition for Information Modeling) is a formal notation standardized by NIST, commonly used in government and defense projects.
Entity Representation
Independent entity: Square-cornered box
┌───────────────┐
│ EMPLOYEE │ ← Independent (has own PK)
├───────────────┤
│ emp_id (key) │
├───────────────┤
│ name │
│ salary │
└───────────────┘
Dependent entity: Round-cornered box
╭───────────────╮
│ ORDER_LINE │ ← Dependent (PK includes FK)
├───────────────┤
│ order_id (FK) │
│ line_num (key)│
├───────────────┤
│ product_id │
│ quantity │
╰───────────────╯
Key Notation
Attributes above the line are keys; below are non-keys.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
// IDEF1X NOTATION ELEMENTS// ========================= // Entity Box Structure:// ┌─────────────────┐// │ ENTITY_NAME │ ← Entity name// ├─────────────────┤ ← Separator line// │ key_attr1 │ ← Key area (above separator)// │ key_attr2 │ Attributes forming PK// ├─────────────────┤ ← Another separator // │ non_key_attr1 │ ← Non-key area (below separator)// │ non_key_attr2 │ Regular attributes// └─────────────────┘ // Independent Entity (own primary key):┌─────────────────┐│ DEPARTMENT │├─────────────────┤│ dept_id │├─────────────────┤│ name ││ budget ││ location │└─────────────────┘ // Dependent Entity (PK includes foreign key):╭─────────────────╮│ DEPENDENT │ ← Rounded corners indicate dependence├─────────────────┤│ emp_id (FK) │ ← Part of primary key│ dependent_num │ ← Rest of primary key├─────────────────┤│ name ││ relationship ││ birth_date │╰─────────────────╯ // Relationship Types:// ─────────────────────// Identifying (solid line): Child PK includes parent PKEMPLOYEE ─────────────● DEPENDENT// The dot (●) indicates cardinality (filled = one, diamond = zero) // Non-Identifying (dashed line): Child PK is independent DEPARTMENT - - - - - -◇ EMPLOYEE// Diamond (◇) indicates optional (nullable FK) // Cardinality Notation:// P = One or more (positive)// Z = Zero or more// 1 = Exactly one// n = Specific number DEPARTMENT ─────────(P)─────── EMPLOYEE// One department has one or more employeesIDEF1X emerged from U.S. Air Force ICAM program in the 1980s and remains mandated for many government contractors. While less common in commercial development, understanding IDEF1X is essential when working with legacy federal systems or organizations requiring FIPS 184 compliance.
Modern Visualization Tools and Formats
Contemporary database development leverages sophisticated visualization tools that generate diagrams automatically from schemas and support collaborative editing.
Tool Categories
Reverse Engineering Tools:
- Connect to live databases and generate diagrams
- Examples: DBeaver, DataGrip, MySQL Workbench, pgAdmin
Modeling Tools:
- Design schemas visually before implementation
- Examples: ERwin, PowerDesigner, Lucidchart, dbdiagram.io
Code-First Diagramming:
- Generate diagrams from DDL or ORM definitions
- Examples: Prisma, DBML, PlantUML, Mermaid
Text-Based Diagram Languages
Modern tools support text-based diagram definitions that integrate with version control:
12345678910111213141516171819202122232425262728293031323334353637
// DBML (Database Markup Language)// Used by dbdiagram.io and dbdocs.io Table users { id integer [pk, increment] username varchar(50) [unique, not null] email varchar(255) [unique, not null] created_at timestamp [default: 'now()']} Table posts { id integer [pk, increment] title varchar(200) [not null] body text user_id integer [ref: > users.id] status post_status [default: 'draft'] published_at timestamp} Table comments { id integer [pk, increment] body text [not null] post_id integer [ref: > posts.id] user_id integer [ref: > users.id] created_at timestamp} Enum post_status { draft published archived} // Relationships are inferred from ref: declarations// > means many-to-one (many comments to one post)// < means one-to-many// - means one-to-one- •Version control friendly — Diff and merge like code
- •Documentation integration — Embed in Markdown, wikis, READMEs
- •Automation — Generate from and to SQL DDL statements
- •Collaboration — Review changes in pull requests
- •Consistency — Auto-layout ensures uniform appearance
Choosing the Right Diagrammatic Notation
Different audiences and purposes call for different diagram styles. The key is matching notation to context.
| Context | Recommended Notation | Rationale |
|---|---|---|
| Executive overview | Simple box-and-line, minimal attributes | Focus on entities and relationships, not details |
| Developer documentation | Crow's foot with types | Full structural detail developers need |
| OO development team | UML class diagrams | Leverages existing UML familiarity |
| Government/defense projects | IDEF1X | Compliance with federal standards |
| Agile/DevOps teams | DBML, Mermaid in docs | Integrates with code review workflows |
| Database administration | Tool-generated (DBeaver, etc.) | Auto-sync with actual schema |
Create multiple diagram views from the same source model. High-level overviews for stakeholders, detailed schemas for developers, and focused subsystem views for specific features. Modern tools generate multiple views automatically.
Summary: Visual Schema Representation
- •Basic schema diagrams use boxes for tables and lines for relationships
- •Crow's foot notation expresses cardinality with intuitive fork/circle/line symbols
- •UML class diagrams apply OO modeling conventions to data structures
- •IDEF1X notation provides rigorous standardized format for formal projects
- •Modern tools support text-based diagram languages (DBML, Mermaid) for version control
- •Choose notation based on audience, organizational standards, and tooling
You can now read and create schema diagrams using multiple notational conventions. Next, we explore standard conventions and best practices that ensure your notations are consistent, professional, and universally understood.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.