This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
development:ohdsi_code_style_for_sql [2015/02/06 04:25] schuemie created |
development:ohdsi_code_style_for_sql [2020/04/06 13:40] (current) schuemie |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== OHDSI code style for SQL ====== | ====== OHDSI code style for SQL ====== | ||
| - | ===== Case ===== | + | This has moved here: https://ohdsi.github.io/MethodsLibrary/codeStyle.html#ohdsi_code_style_for_sql |
| - | 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'' | + | |