sql-analytics-workflow
Design, review, debug, or explain analytical SQL with correct grain, joins, filters, time logic, performance awareness, and validation. Use for SQL analysis, writing or debugging a query, metric SQL,
SKILL.mdskills/common/sql-analytics-workflow/SKILL.md
GitHubSQL Analytics Workflow
Make the question and row grain explicit before writing SQL.
- Confirm dialect, tables, field meaning, row grain, time zone, and access boundaries.
- Write a plain-language query contract: population, filters, joins, grouping, metric, and expected row count.
- Build incrementally: inspect a small sample, validate joins, check duplicated entities, then aggregate.
- Parameterize dates and document assumptions. Prefer safe read-only queries unless writes are explicitly authorized.
- Validate totals against an independent small check and report limitations.
Do not execute destructive SQL, expose secrets, or assume dialect-specific functions. Flag PII and large-scan cost risks before execution.