Skip to content

Instantly share code, notes, and snippets.

@cnstlungu
Created November 5, 2022 21:02
Show Gist options
  • Select an option

  • Save cnstlungu/cf3b0b822c10b461b0e5c8d596494e65 to your computer and use it in GitHub Desktop.

Select an option

Save cnstlungu/cf3b0b822c10b461b0e5c8d596494e65 to your computer and use it in GitHub Desktop.
Meaningful Column Aliases
-- 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