SQL 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.