
👥 HR & Workforce · Database ERD
A schema for monthly payroll: employees, salary structures and components, pay runs, payslips and statutory deductions.
Drawing diagram…
ERD for payroll: Employee has a SalaryStructure effective from a date; SalaryStructure has StructureComponents referencing Components (basic, HRA, special allowance, PF, professional tax, TDS) with amounts or formulas; PayRun is a month's processing; Payslip per Employee per PayRun has PayslipLines per Component; Attendance summary feeds loss-of-pay days.
erDiagram
EMPLOYEE ||--o{ SALARY_STRUCTURE : "paid under"
SALARY_STRUCTURE ||--|{ STRUCTURE_COMPONENT : includes
COMPONENT ||--o{ STRUCTURE_COMPONENT : "used in"
PAY_RUN ||--|{ PAYSLIP : produces
EMPLOYEE ||--o{ PAYSLIP : receives
PAYSLIP ||--|{ PAYSLIP_LINE : itemises
COMPONENT ||--o{ PAYSLIP_LINE : "computed as"
COMPONENT {
int id PK
string name
string type
bool taxable
}
SALARY_STRUCTURE {
int id PK
int employee_id FK
decimal annual_ctc
date effective_from
}
PAY_RUN {
int id PK
string month
string status
}
PAYSLIP {
int id PK
int pay_run_id FK
int employee_id FK
int lop_days
decimal net_pay
}A hiring process from job requisition to the new joiner's first day: sourcing, screening, interviews, offer and background checks.
The states of an employee leave request in an HRMS: submission, manager approval, HR escalation for long leave, and cancellation.
A human resource management system: employee records, attendance, leave, payroll, performance and the employee self-service app.
What happens between an accepted offer and a new joiner's productive first week: documents, background check, accounts, laptop and induction.
How candidates move through a hiring funnel for a quarter, by source, and where they drop out.
Every stage of an employee's time with a company: offer, onboarding, probation, active, leave, notice and exit.