SQL Core Cheat Sheet
SELECT, WHERE, JOIN, GROUP BY, HAVING, CASE, ORDER BY and LIMIT patterns for daily analysis.
Filter
WHERE Status = 'Open'Pattern
WHERE Code LIKE 'AK%'Group
GROUP BY MaterialPost-filter
HAVING COUNT(*) > 1Missing match
LEFT JOIN ... WHERE right.Key IS NULLLatest row
ROW_NUMBER() OVER(PARTITION BY Key ORDER BY Time DESC)Use the pattern, then verify the result
Cheat sheets are reminders, not substitutes for checking keys, data types, duplicates and edge cases. Follow the linked learning material when a pattern is new to you.