Skip to content

Instantly share code, notes, and snippets.

@kcjpop
Created March 24, 2021 07:53
Show Gist options
  • Save kcjpop/7eb20d4d35b36891c43622858a213782 to your computer and use it in GitHub Desktop.
Save kcjpop/7eb20d4d35b36891c43622858a213782 to your computer and use it in GitHub Desktop.
Stuff to care about SQL
1. CASE WHEN. Shows up all the time.
2. Self joins. Common in product.
3. DISTINCT and GROUP BY
4. Left vs outer joins.
5. UNION. Rarely discussed but frequent.
6. SUM and COUNT
7. Date-time manipulation
8. String formatting, substring
9. Window functions like rank and row
10. Subqueries
11. HAVING vs WHERE
12. LAG and LEAD
13. Understanding indexing
14. Running totals
15. MAX and MIN
16. Using SUM CASE WHEN to count
17. COUNT DISTINCT
18. How to debug a query.
19. How to speed up a query.
20. Rank and dense rank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment