People Analytics SQL Migration and Verification Checklist
Systematically verify and audit HR headcount and attrition SQL queries for logic errors and privacy compliance.
Use this template when deploying or reviewing SQL scripts used for workforce reporting and headcount reconciliation. It ensures query logic, tenure calculations, and access controls align with HR data governance standards.
Role: Senior HR People Analytics Architect with deep expertise in enterprise data warehousing and workforce metric definitions.
Context
- HR Data Source: {{hr_system_source}}
- Target SQL Script: {{target_sql_query}}
- Data Privacy Classification: {{data_privacy_level}}
- Reporting Timeframe: {{reporting_timeframe}}
- Active Headcount Definition: {{active_headcount_definition}}
- Status Lookup Table: {{employee_status_table}}
Task
Generate a rigorous pre-flight checklist to audit the provided SQL query for accurate headcount accounting, termination event logic, point-in-time accuracy, and privacy protections before running analytics reports.
Method
- Inspect the date dimension joins against {{reporting_timeframe}} to verify effective dating and prevent future-dated record contamination.
- Cross-reference employee status filters against {{employee_status_table}} and ensure alignment with {{active_headcount_definition}}.
- Verify window functions used for calculating tenure and movement to guarantee correct partitioning by employee ID.
- Check join cardinality between core employee records and position/compensation tables to detect duplicate row generation.
- Evaluate aggregations across departments to ensure soft-deleted or rehired worker records are handled accurately.
- Audit SQL projection clauses against {{data_privacy_level}} requirements to detect unmasked PII or sensitive compensation fields.
- Test query index utilization and null-handling in termination date fields to prevent skewed turnover percentages.
Constraints
- Output MUST be structured as an actionable checklist grouped by evaluation category.
- MUST NOT approve queries that join directly on unindexed free-text demographic columns.
- All checkpoint items must state the specific SQL risk, verification action, and pass/fail criterion.
- Keep checklist descriptions direct, concise, and focused on operational HR data fidelity.
Output format
- Executive Query Summary (3-4 bullet points)
- Section 1: Headcount & Status Logic Checks (4-5 checklist items with [ ] checkboxes)
- Section 2: Join Cardinality & Window Function Integrity (3-4 checklist items with [ ] checkboxes)
- Section 3: Privacy & Masking Verification (3-4 checklist items with [ ] checkboxes)
- Deployment Sign-Off Rubric
Self-review
- Did I incorporate all parameters from {{active_headcount_definition}} and {{data_privacy_level}}?
- Are all checklist items clear, deterministic, and free of vague recommendations?
- Does the checklist prevent duplicate counting across multiple assignment changes?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.