Employee and Payroll Management ER diagram and database schema
The Employee and Payroll Management database schema is a DB Planner template with 25 tables, 187 columns and 43 relationships, free to use. Core tables include bank_accounts, compensation_records, deduction_types, departments. It can be opened as an interactive ER diagram or exported as PostgreSQL, MySQL, or SQL Server DDL.
- Tables
- 25
- Columns
- 187
- Relationships
- 43
- Category
- SaaS
- Exports
- DBML, SQL, C#
- Price
- Free
What this schema models
A complete employee management and payroll system database design: 25 tables, 17 enums and 43 relationships covering legal entities, departments and work locations, employee records, effective-dated job assignments and compensation, tax withholding elections, benefits and deductions, time entries, leave requests and accrual, pay schedules and periods, pay runs, itemized pay stubs, and split direct deposits. THE FOUR DESIGN RULES 1. Everything that changes a paycheck is effective-dated. Job assignments, compensation, withholding elections, deductions and home addresses are rows with effective_from and effective_to, never overwritten, so "what was this employee paid on March 15?" and retro pay are exact. 2. Approved payroll is immutable. A run can be recalculated while it is a draft; once approved, a mistake is fixed with a correction or off-cycle run, and a voided paycheck points at the check that reversed it. 3. Pay stubs are itemized snapshots. Every earning, deduction, tax and employer contribution is its own line, with the hours and rate that produced it, and the totals are frozen at approval. 4. Leave balances are a ledger. Accruals, usage, carryover and payouts are entries; a balance is their sum, never a column someone can edit. DETAILS WORTH STEALING - Direct deposit splits across several accounts by priority, with fixed, percentage and remainder allocations. - Time entries record the run that paid them, so approved hours are never paid twice. - Taxes point at jurisdictions (federal, state, local), and both work location and home address matter. - Bank account numbers are stored as tokens with the last four digits, and national IDs as the last four only; full numbers belong in a vault. - Departments nest, so labor cost rolls up the org chart. - Multiple legal entities each run their own payroll. WHAT YOU GET Clean DBML that imports directly into DB Planner, and a laid-out board with zones color-coded and framed: organization, employees, employment terms, deductions, time and leave, payroll runs, and pay stubs and deposits. Every table carries a note. Postgres-flavoured types that port cleanly to MySQL or SQL Server. Useful for developers building HR, HRIS or payroll software, and for students who need a realistic employee management or payroll system ER diagram for a DBMS project. This is a schema design reference, not a tax engine: withholding calculations and compliance rules vary by jurisdiction and belong in your payroll provider or tax service.
Tables (25)
| Table | Columns |
|---|---|
| bank_accounts | 10 |
| compensation_records | 10 |
| deduction_types | 5 |
| departments | 5 |
| direct_deposits | 7 |
| emergency_contacts | 5 |
| employee_addresses | 9 |
| employee_deductions | 8 |
| employees | 12 |
| holidays | 4 |
| job_assignments | 12 |
| job_titles | 4 |
| leave_ledger | 9 |
| leave_requests | 9 |
| leave_types | 7 |
| legal_entities | 4 |
| pay_periods | 5 |
| pay_runs | 8 |
| pay_schedules | 5 |
| paycheck_lines | 10 |
| paychecks | 9 |
| tax_jurisdictions | 4 |
| tax_withholding_elections | 9 |
| time_entries | 8 |
| work_locations | 9 |
Relationships (43)
bank_accounts.employee_id references employees.idmany to onecompensation_records.approved_by references employees.idmany to onecompensation_records.employee_id references employees.idmany to onecompensation_records.pay_schedule_id references pay_schedules.idmany to onedepartments.legal_entity_id references legal_entities.idmany to onedepartments.parent_id references departments.idmany to onedirect_deposits.bank_account_id references bank_accounts.idmany to onedirect_deposits.paycheck_id references paychecks.idmany to oneemergency_contacts.employee_id references employees.idmany to oneemployee_addresses.employee_id references employees.idmany to oneemployee_deductions.deduction_type_id references deduction_types.idmany to oneemployee_deductions.employee_id references employees.idmany to oneemployees.legal_entity_id references legal_entities.idmany to oneholidays.legal_entity_id references legal_entities.idmany to onejob_assignments.department_id references departments.idmany to onejob_assignments.employee_id references employees.idmany to onejob_assignments.job_title_id references job_titles.idmany to onejob_assignments.manager_id references employees.idmany to onejob_assignments.work_location_id references work_locations.idmany to oneleave_ledger.employee_id references employees.idmany to oneleave_ledger.leave_request_id references leave_requests.idmany to oneleave_ledger.leave_type_id references leave_types.idmany to oneleave_ledger.pay_run_id references pay_runs.idmany to oneleave_requests.decided_by references employees.idmany to oneleave_requests.employee_id references employees.idmany to oneleave_requests.leave_type_id references leave_types.idmany to oneleave_types.legal_entity_id references legal_entities.idmany to onepay_periods.pay_schedule_id references pay_schedules.idmany to onepay_runs.approved_by references employees.idmany to onepay_runs.pay_period_id references pay_periods.idmany to onepay_schedules.legal_entity_id references legal_entities.idmany to onepaycheck_lines.paycheck_id references paychecks.idmany to onepaycheck_lines.tax_jurisdiction_id references tax_jurisdictions.idmany to onepaychecks.employee_id references employees.idmany to onepaychecks.pay_run_id references pay_runs.idmany to onepaychecks.voided_by_paycheck_id references paychecks.idmany to onetax_withholding_elections.employee_id references employees.idmany to onetax_withholding_elections.tax_jurisdiction_id references tax_jurisdictions.idmany to onetime_entries.approved_by references employees.idmany to onetime_entries.employee_id references employees.idmany to onetime_entries.pay_run_id references pay_runs.idmany to onework_locations.legal_entity_id references legal_entities.idmany to onework_locations.tax_jurisdiction_id references tax_jurisdictions.idmany to one
How to use this template
- Open the ER diagram to see the tables and how they relate.
- Copy it into your workspace. You get your own editable copy, in DBML.
- Export it as PostgreSQL, MySQL, or SQL Server DDL, or as C# models.
The copy opens in DB Planner’s ER diagram tool, with the schema as text in the DBML editor beside it. Have a database already? Turn its SQL into an ER diagram instead.
Frequently asked questions
- What is in the Employee and Payroll Management database schema?
- 25 tables and 43 relationships, across 187 columns. The table names and the full relationship list are shown on this page.
- Can I export it to PostgreSQL or MySQL?
- Yes. Every DB Planner template exports as DBML, as PostgreSQL, MySQL, or SQL Server DDL, and as C# models.
- Is this template free?
- Yes. You can open it in the browser without an account, and copy it into your own workspace with a free DB Planner account.
- Can I change it after copying it?
- Yes. A copy is yours: you can rename tables, add columns, and export it. Changes the author makes later do not affect your copy.