How the SQL is laid out
- Each major clause (
SELECT,FROM,JOIN,WHERE,GROUP BY…) starts a new line. - Column lists and conditions are indented one per line.
- Keywords can be UPPER, lower or left as typed.
- Multiple statements are separated by a blank line.
Why pick a dialect
Databases disagree on details — PostgreSQL’s :: casts and $1 parameters, MySQL’s backtick identifiers, SQL Server’s [brackets] and TOP, BigQuery’s backtick table paths. The right dialect keeps these intact.
Formatting never changes what the query does; only whitespace and keyword case change.