NUS Hackers Wiki
NUS Hackers Wiki
  • NUS Hackers Wiki
  • Hackerschool
    • Virtual Machines and Linux
    • Beginners' Guide to the Terminal
      • Introduction to the Terminal
      • Modern Shell Tools
      • Shell Scripting
      • Real World Scripting
      • Resources
    • Self-Hosting: Three Easy Pieces
      • 1. Setting up your server
      • 2. Running Services
      • 3. Monitoring your server
    • Vim
    • Introduction to Zig
      • Language Basics
      • Error Handling
      • Memory Management
      • Working with C
      • Exploring comptime
    • CI/CD with Github Actions
      • Background
      • Basics of Github Actions
        • Target workflow
        • Running unit tests
        • Linting code
        • Deploying to Github Pages
      • Advanced use cases
        • Pollers
        • Github script
        • Executing third-party scripts
        • Reusable workflows
      • Cookbook
    • Lightning Git
      • Git Concepts
      • Getting Started with Git
      • Making your first commit
      • Branching
      • Merge Conflicts
      • Integrating remote repositories
      • Collaborative Workflows
      • Commit Manipulation and Reflog
      • Interactive rebasing
      • filter-repo
  • Orbital
    • JavaScript
      • Browser Developer Tools
      • Getting Started
      • Datatypes
      • Operators and Operations
      • Loops and Conditions
      • Functions
      • Strings
      • Arrays
      • HTML
        • Getting Started
        • Tag Attributes
        • HTML Forms
        • Browser Inspector
      • CSS
        • Selectors
        • Colors in CSS
        • Measurements in CSS
        • The Box Model
        • Adding Styles - Part 1
        • Adding Styles - Part 2
      • Working with the DOM
        • Querying the DOM - Selectors
        • Querying the DOM - Element Attributes
        • Querying the DOM - Element Styles
        • Events with JS and HTML
        • Exercise: Click Counter
        • Editing the DOM
        • Fetch Requests
        • Exercise: The NUSMods API
    • React
      • Setup
      • State
    • React Native
      • Setup
      • Intro to JSX
      • Basic Syntax
      • Handling UI
      • Props
      • State Management
    • Git
      • Setup
      • Command Glossary
      • Fundamental Concepts
        • Getting Started
        • Integrating Remote Repositories
        • Branching
        • Merge Conflicts
      • Collaborative Workflows
        • Fork and PR Workflow
        • Branch and PR Workflow
      • Advanced Concepts
        • Ignoring Files
        • Commit Message Conventions
        • Github Collaborators
        • CI/CD with Github Actions
        • Advanced Git Commands
      • FAQ
    • Telegram Bot
      • Creating a TeleBot
      • API Calls
      • Telebot Basics
      • Integrating API's
    • Relational Database
      • Database Overview
      • Database Design
      • Entity Relationship Diagram
      • SQL Basics & PostgreSQL
    • TypeScript
      • Types and Interfaces
      • Utility Types
      • Typing Component Props, Events, and Hooks
      • Why You Should Avoid Using any (and What to Do Instead)
      • TypeScript Tricks You’ll Use All the Time in React
Powered by GitBook
On this page
  • Entities
  • Properties
  • Relationships
  • Full ERD
  • Enhanced ERD
Edit on GitHub
Export as PDF
  1. Orbital
  2. Relational Database

Entity Relationship Diagram

PreviousDatabase DesignNextSQL Basics & PostgreSQL

Last updated 12 months ago

An Entity-Relationship Diagram (ERD) is a visual representation of the relationships between entities in a database. It is a powerful tool used in software development and database design to model and understand the structure of a relational database.

There are many different notations and there is no standard. We are using the crows-feet notation. You can build your own ERD in .

Let's walk through an example database design problem and visualise it with ERD!

Design a system that stores the users and their notebooks. Each notebook has a name and description. Each notebook contains several notes (but can be empty) and each note has a title and contents. A user can own multiple notebooks but each notebook belongs to exactly one user, and each note belongs to exactly one notebook. Each user has a username, email, and password that they store.

Entities

In an Entity-Relationship Diagram (ERD), an entity represents a real-world object or concept. Entities can be classified as either .

Properties

Entities have properties, also known as attributes, which describe their characteristics.

  • Primary Key(PK)

  • Foreign Key(FK)

  • Unique

  • ...

Relationships

Relationships represent associations between entities. There are three types of relationships:

  • one-to-one (1-1)

    A one-to-one relationship means that each instance of one entity is associated with exactly one instance of another entity.

  • many-to-one (M-1)

    A many-to-one relationship means that multiple instances of one entity can be associated with a single instance of another entity.

  • many-to-many (M-M)

    A many-to-many relationship means that multiple instances of one entity can be associated with multiple instances of another entity.

Crow's feet notation

Full ERD

An enhanced ERD (EERD) extends the capabilities of a traditional ERD by introducing additional concepts such as specialization/generalization, aggregation, and inheritance. These concepts allow for more complex modeling of relationships and behaviors in a database system.

Enhanced ERD
Lucidchart
strong or weak
ERD 1.0
ERD 2.0
Crow's Feet Notation
Full ERD