use-uppercase-sql-keywords
Installation
SKILL.md
Summary
Write SQL reserved words (keywords) in UPPERCASE and table/column names in snake_case.
Rationale
- Readability: Quickly distinguishes structure (
SELECT) from data/identifiers (user_id). - Convention: Standard practice in the SQL community and documentation.
- Scanning: Makes it easier to parse complex queries visually.
Guidance
- Keywords:
SELECT,FROM,WHERE,JOIN,AND,OR,NULLshould be uppercase. - Identifiers: Tables (
users), columns (first_name), and aliases (u) should be lowercase/snake_case. - Functions: Built-in functions (
COUNT,MAX) should typically be uppercase.
Examples
Bad
select id, username from users where is_active = true and role = 'admin';