This is an old revision of the document!
The OHDSI code style for SQL is heavily inspired by the Poor Man's T-SQL Formatter, which is available as a NotePad++ plug-in. The only difference with the default settings is that in OHDSI, comma's are trailing. You can automatically format your SQL correctly by using the Poor Man's T-SQL Formatter Online Tool (but don't forget to set Trailing Commas).
Because several database platforms are case-insensitive and tend to convert table and field names to either uppercase (e.g. Oracle) or lowercase (e.g. PostgreSQL), we use snake_case. All names should be in lowercase.
Good
SELECT COUNT(*) AS person_count FROM person
Bad
SELECT COUNT(*) AS personCount FROM person
SELECT COUNT(*) AS Person_Count FROM person
SELECT COUNT(*) AS PERSON_COUNT FROM person