
Styling conventions
Introduction
Many programming languages use styling conventions: rules for writing code.
This serves the following purposes:
-
Increasing the readability of the code.
-
Easier to make modifications by others.
For SQL, there is no single set of styling conventions.
-
There are different standards.
-
It is highly recommended to follow one standard with your colleagues.
1. Considerations for styling conventions
We consider a number of different choices in standards:
1.1. Indentation
2 spaces
Tab
1.2. Capitalization
Uppercase
Lowercase
1.3. Naming
Snake case
Camel case
2. Example standards
If you want to delve deeper into standards, take a look at the following pages:
- Kickstarter SQL Style Guide
- GitLab SQL Style Guide
- Brooklyn Data Co. SQL style guide
- Mazur's SQL Style Guide
- dbt Style Guide
Summary
- Styling conventions help with:
- Increasing the readability of your code.
- Making it easier for others to make modifications.
- There are different choices in standards for SQL.
- Choose one standard with your colleagues.