- Write keywords in uppercase (`SELECT`, `FROM`, `WHERE`, `JOIN`) and object names in `snake_case` lowercase — consistency makes queries scannable.
- Qualify all column references with the table alias in multi-table queries: `u.user_id` instead of `user_id` to prevent ambiguity and future breakage.
- Avoid `SELECT *` in production queries — enumerate every column explicitly so schema changes do not silently alter result sets or break downstream consumers.
- Place each clause on its own line and indent continuation lines by 4 spaces — complex `WHERE` conditions get one condition per line joined by `AND`/`OR`.
- Use table aliases that are meaningful abbreviations (`u` for `users`, `oi` for `order_items`) rather than arbitrary letters like `a`, `b`, `c`.
- Name tables in singular form (`user`, `order`, `product`) and use `snake_case` — avoid abbreviations that obscure meaning (`usr`, `ord`).
- Use `-- comment` for inline clarifications and `/* block comment */` only for multi-line header blocks at the top of complex queries or stored procedures.
- Terminate every statement with `;` even in single-statement scripts to make statements composable and safe to paste into interactive clients.