6 min read
2026-01-22
`SELECT`, `FROM`, `WHERE`, `JOIN` - in upper case. This visually separates the keywords from the data.
Short, meaningful aliases (`users AS u`) make JOIN queries easier to read.
Explicitly specify the required columns. This improves performance and makes the query self-documenting.
Add comments to non-obvious WHERE conditions and business logic.
Common Table Expressions (WITH) make complex queries modular and readable.
Each WHEN is indented on a new line. END - at the CASE level.
Each JOIN is on a new line. The ON condition is indented under JOIN.
Fix the SQL formatting rules in the project style guide.
See also: JSON Formatter, Diff Checker, Regex tester