Payroll / HR Database Schema
Design a payroll / HR database schema — employees, salary history, timesheets, payroll, and leave requests.
Use this templateWhat you get
- Effective-dated Salary history preserves past pay for re-runs
- Timesheet captures hours and overtime feeding payroll
- Payroll row stores gross / tax / net so statements match forever
What this template is for
This payroll and HR database schema gives you a ready-to-edit ER diagram for an HRIS or payroll system. It models the entities every HR system needs: departments and positions, employees, salary history (effective-dated rows so a raise doesn't erase the old amount), timesheets, payroll runs that combine salary plus timesheet for a pay period, and leave requests. The key design decision is treating Salary as an effective-dated history table rather than a column on Employee — that's what makes audit, historical payroll re-runs, and back-pay corrections possible. Use it to design an HRIS, document an existing payroll database, or explain why salary changes belong in a history table.
When to use this template
- Design the database for an HRIS or payroll system.
- Model salary as an effective-dated history so raises don't lose the old amount.
- Plan payroll runs that combine base salary plus timesheet hours for a period.
- Decide how leave requests interact with timesheets and payroll.
- Document an existing HR database for a new engineer.
- Explain to stakeholders why historical payroll re-runs need salary history.
How to use it
- 1Start with Department and Position — the org structure.
- 2Add Employee referencing both, plus identity fields and hire date.
- 3Add Salary as a history table with effective_from / effective_to per employee.
- 4Add Timesheet capturing hours and overtime per work date.
- 5Add Payroll combining salary + timesheet for a pay period, with gross/tax/net.
- 6Add LeaveRequest with type, dates, and approval status.
Quick example
HRIS payroll schema
Start editing online
Open the template in CodePic, replace the sample nodes, and turn it into your own study board in a few minutes.
See examples: /templates/payroll-hr-database-schema/examples


