CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/HR & Workforce

👥 HR & Workforce · Database ERD

Payroll Database Schema

A schema for monthly payroll: employees, salary structures and components, pay runs, payslips and statutory deductions.

More HR & Workforce templates

Drawing diagram…

What this diagram shows

  • Salary structure is made of earning and deduction components
  • Each monthly pay run creates one payslip per employee
  • Payslip lines keep the calculated amount for each component

Prompt used

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.

Mermaid code
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
  }

Related templates

FlowchartHR & Workforce

Recruitment Pipeline Workflow

A hiring process from job requisition to the new joiner's first day: sourcing, screening, interviews, offer and background checks.

State MachineHR & Workforce

Leave Request Approval Lifecycle

The states of an employee leave request in an HRMS: submission, manager approval, HR escalation for long leave, and cancellation.

C4 ArchitectureProHR & Workforce

HRMS Architecture

A human resource management system: employee records, attendance, leave, payroll, performance and the employee self-service app.

SequenceHR & Workforce

Employee Onboarding Sequence

What happens between an accepted offer and a new joiner's productive first week: documents, background check, accounts, laptop and induction.

SankeyHR & Workforce

Hiring Funnel Sankey

How candidates move through a hiring funnel for a quarter, by source, and where they drop out.

State MachineHR & Workforce

Employee Lifecycle

Every stage of an employee's time with a company: offer, onboarding, probation, active, leave, notice and exit.