Enter table definitions
Create visual ERD
Download or copy diagram
An Entity Relationship Diagram (ERD) is a visual representation of database tables and their relationships. ERDs show entities (tables), attributes (columns), and relationships (foreign keys) in a clear, structured format. They're essential for database design, documentation, and communication between developers and stakeholders.
ERDs help you plan database structure before implementation, identify potential issues, and document existing databases. They show primary keys, foreign keys, data types, and cardinality (one-to-one, one-to-many, many-to-many relationships).
User - id: INT PRIMARY KEY - name: VARCHAR(100) - email: VARCHAR(100) Post - id: INT PRIMARY KEY - user_id: INT FOREIGN KEY -> User.id - title: VARCHAR(200)
Plan database structure before implementation. Visualize tables, relationships, and constraints. Identify normalization opportunities and potential issues early in the design process.
Document existing database schemas for team members and stakeholders. ERDs provide clear visual documentation that's easier to understand than SQL DDL statements.
Plan database migrations and schema changes. Visualize how new tables and relationships fit into existing structure. Identify affected tables and relationships.
Communicate database design to non-technical stakeholders. ERDs are more accessible than raw SQL and help everyone understand data structure.
Teach database concepts and normalization. ERDs make abstract database concepts concrete and visual, helping students understand relationships and design principles.
User - id: INT PRIMARY KEY - username: VARCHAR(50) - email: VARCHAR(100) Post - id: INT PRIMARY KEY - user_id: INT FOREIGN KEY -> User.id - title: VARCHAR(200) - content: TEXT Comment - id: INT PRIMARY KEY - post_id: INT FOREIGN KEY -> Post.id - user_id: INT FOREIGN KEY -> User.id - content: TEXT
Customer - id: INT PRIMARY KEY - name: VARCHAR(100) - email: VARCHAR(100) Order - id: INT PRIMARY KEY - customer_id: INT FOREIGN KEY -> Customer.id - total: DECIMAL(10,2) - status: VARCHAR(20) OrderItem - id: INT PRIMARY KEY - order_id: INT FOREIGN KEY -> Order.id - product_id: INT FOREIGN KEY -> Product.id - quantity: INT - price: DECIMAL(10,2) Product - id: INT PRIMARY KEY - name: VARCHAR(200) - price: DECIMAL(10,2) - stock: INT
User - id: INT PRIMARY KEY - username: VARCHAR(50) - bio: TEXT Friendship - id: INT PRIMARY KEY - user_id: INT FOREIGN KEY -> User.id - friend_id: INT FOREIGN KEY -> User.id - status: VARCHAR(20) Post - id: INT PRIMARY KEY - user_id: INT FOREIGN KEY -> User.id - content: TEXT - created_at: TIMESTAMP Like - id: INT PRIMARY KEY - user_id: INT FOREIGN KEY -> User.id - post_id: INT FOREIGN KEY -> Post.id
Student - id: INT PRIMARY KEY - name: VARCHAR(100) - email: VARCHAR(100) Course - id: INT PRIMARY KEY - name: VARCHAR(100) - credits: INT Enrollment - id: INT PRIMARY KEY - student_id: INT FOREIGN KEY -> Student.id - course_id: INT FOREIGN KEY -> Course.id - grade: VARCHAR(2) Teacher - id: INT PRIMARY KEY - name: VARCHAR(100) - department: VARCHAR(50)
Book - id: INT PRIMARY KEY - title: VARCHAR(200) - isbn: VARCHAR(13) - author: VARCHAR(100) Member - id: INT PRIMARY KEY - name: VARCHAR(100) - membership_number: VARCHAR(20) Loan - id: INT PRIMARY KEY - book_id: INT FOREIGN KEY -> Book.id - member_id: INT FOREIGN KEY -> Member.id - loan_date: DATE - return_date: DATE
Explore our other database and schema tools:
Get $200 free DigitalOcean credit or sponsor us on GitHub!