SQL-FUNDAMENTALS5 MIN READ
Sort clauses by job
Classify SELECT clauses by their role in the query pipeline.
Source rows Raw-row filter Group definition Group filter Output and presentation FROM subscriptions s LEFT JOIN cancellations c ON c.subscription_id = s.id WHERE s.started_at >= DATE '2026-01-01' GROUP BY s.plan_id HAVING COUNT(c.id) > 10 ORDER BY churn_rate DESC LIMIT 20 SELECT s.plan_id, COUNT(*) AS subscriptions
Read the full lesson
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in