Created
November 5, 2022 21:02
-
-
Save cnstlungu/cf3b0b822c10b461b0e5c8d596494e65 to your computer and use it in GitHub Desktop.
Meaningful Column Aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- avoid naming your CTEs this way | |
| WITH cte AS ( | |
| SELECT 1 AS a ) | |
| ) ... | |
| -- avoid inconsistent naming conventions | |
| SELECT 'stationery' AS product_group, 'pen' AS ProductName | |
| -- avoid non-meaningful aliases | |
| SELECT | |
| a, | |
| b | |
| FROM | |
| products t1 ON .... | |
| JOIN | |
| prices t2 ON .... | |
| JOIN | |
| orders t3 ON .... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment