Tables in this data model
- departments — 3 columns
- positions — 4 columns
- employees — 6 columns
- compensation — 5 columns
- time_off_requests — 7 columns
- performance_reviews — 5 columns
- benefits_enrollments — 4 columns
How to use this ER diagram template
- Click Open in the editor. The ER diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
- Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
- Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
- Prefer text? Edit the SQL DDL below and paste it in through ☰ → Import / export SQL; the finished model exports back to DDL.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
SQL DDL source
The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.
CREATE TABLE departments (
department_id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(80) NOT NULL,
cost_center VARCHAR(20)
);
CREATE TABLE positions (
position_id INTEGER NOT NULL PRIMARY KEY,
department_id INTEGER NOT NULL REFERENCES departments(department_id),
title VARCHAR(120) NOT NULL,
grade VARCHAR(10)
);
CREATE TABLE employees (
employee_id INTEGER NOT NULL PRIMARY KEY,
position_id INTEGER NOT NULL REFERENCES positions(position_id),
manager_id INTEGER REFERENCES employees(employee_id),
full_name VARCHAR(150) NOT NULL,
hire_date DATE NOT NULL,
status VARCHAR(20) NOT NULL
);
CREATE TABLE compensation (
comp_id INTEGER NOT NULL PRIMARY KEY,
employee_id INTEGER NOT NULL REFERENCES employees(employee_id),
base_salary DECIMAL(12,2) NOT NULL,
currency CHAR(3) NOT NULL,
effective_on DATE NOT NULL
);
CREATE TABLE time_off_requests (
request_id INTEGER NOT NULL PRIMARY KEY,
employee_id INTEGER NOT NULL REFERENCES employees(employee_id),
approver_id INTEGER REFERENCES employees(employee_id),
leave_type VARCHAR(20) NOT NULL,
starts_on DATE NOT NULL,
ends_on DATE NOT NULL,
status VARCHAR(20) NOT NULL
);
CREATE TABLE performance_reviews (
review_id INTEGER NOT NULL PRIMARY KEY,
employee_id INTEGER NOT NULL REFERENCES employees(employee_id),
reviewer_id INTEGER NOT NULL REFERENCES employees(employee_id),
cycle VARCHAR(20) NOT NULL,
rating INTEGER
);
CREATE TABLE benefits_enrollments (
enrollment_id INTEGER NOT NULL PRIMARY KEY,
employee_id INTEGER NOT NULL REFERENCES employees(employee_id),
plan_name VARCHAR(80) NOT NULL,
coverage VARCHAR(20)
);
Related: Database schema diagram tool · ER diagram from SQL · All database & er models templates · All 521 templates