# mattm/sql-style-guide

An opinionated guide for writing clean, maintainable SQL.

Repository: https://github.com/mattm/sql-style-guide
Canonical: https://ross.abutalabs.com/products/sql-style-guide
License Family: other
Last push: 2025-01-14T18:02:57+00:00

## Health v2 (maintenance only)
Score: 33/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 1, release rhythm 35, longevity 100
- inputs: {"age_days": 2716, "days_push": 596, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1099, forks 114 (observed 2026-08-28T04:03:34.991164+00:00)

## What it is
An opinionated style guide for writing clean, readable, and maintainable SQL, authored by a data analyst. It documents formatting conventions such as lowercase keywords, CTE usage, and column alignment with annotated examples.

## Use cases
- adopt a sql formatting standard for my analytics team
- learn how to write clean readable sql queries
- find best practices for formatting ctes and joins
- set up a sql style guide for my company
- review sql code style conventions
- improve maintainability of sql in dbt or looker projects

## When to choose
- you or your team lack a SQL style guide and want a well-explained starting point
- you want opinionated, example-driven formatting conventions you can adapt
- you are a data analyst or analytics engineer standardizing query style

## When to avoid
- your team already follows a different established SQL style (e.g., dbt Labs or GitLab guides)
- you need an automated formatter or linter rather than a written guide
- you need dialect-specific SQL standards beyond general formatting

## Facets
- artifact type: learning-resource
- maturity: stable
- function: documentation
- domain: developer-tools, databases, data-science, tutorials
- platform: cross-platform
- tags: sql, style-guide, code-formatting, best-practices, data-analytics

## Member repositories
- mattm/sql-style-guide (main) score 33

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:34.991164+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:46:04.242904+00:00, confidence not recorded.
  - readme: https://github.com/mattm/sql-style-guide (fetched 2026-08-28T04:03:34.991164+00:00, sha 8d1e4fa57ae4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
