SQL patterns for analysts
42 reusable query patterns, each with a PostgreSQL example, a step-by-step explanation, notes on how MySQL, BigQuery, SQL Server and SQLite differ, and the mistakes that make the result wrong. You can also type the question in plain English and let SchemaChat write the query.
Window functions
Dates and time
Aggregation and pivots
Data cleaning
Joins and reconciliation
Business analytics patterns
Looking for the formula behind a specific business number? The metrics library covers sales, marketing, SaaS, finance, retail, operations, support, HR and product metrics. Coming from spreadsheets? See the Excel to SQL equivalents, or the glossary for unfamiliar terms.