SQL
AuraScore 79/100

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.

Template

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

  1. Inspect the date dimension joins against {{reporting_timeframe}} to verify effective dating and prevent future-dated record contamination.
  2. Cross-reference employee status filters against {{employee_status_table}} and ensure alignment with {{active_headcount_definition}}.
  3. Verify window functions used for calculating tenure and movement to guarantee correct partitioning by employee ID.
  4. Check join cardinality between core employee records and position/compensation tables to detect duplicate row generation.
  5. Evaluate aggregations across departments to ensure soft-deleted or rehired worker records are handled accurately.
  6. Audit SQL projection clauses against {{data_privacy_level}} requirements to detect unmasked PII or sensitive compensation fields.
  7. 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?
AuraScore breakdown
79/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

data-analytics
data-sql
research-productivity-operations
sql
hr-analytics
data-governance