Skip to main content
dbSyntax
Home CoursePracticeReferenceModelingInterview Prep
Start Here
  • What is a database?
  • What is SQL?
  • SQL syntax
  • SQL datatypes
  • How to run queries (tooling)
  • How to read tables/ERDs
SQL Foundations
  • SELECT / FROM
  • ORDER BY
  • LIMIT / OFFSET
  • DISTINCT
  • Aliases
Filtering
  • WHERE
  • AND / OR / NOT
  • IN / BETWEEN
  • LIKE
  • NULL (IS NULL, COALESCE)
Aggregation
  • COUNT / SUM / AVG / MIN / MAX
  • GROUP BY
  • HAVING
  • CASE & Conditional Aggregation
Joins
  • Joins Intro
  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • FULL OUTER JOIN
  • CROSS JOIN
  • Self Join
  • Join Debugging: Duplicates & Missing Rows
  • UNION vs UNION ALL
Subqueries & CTEs
  • Subqueries (IN / EXISTS)
  • Correlated Subqueries
  • WITH (CTEs)
Window Functions
  • OVER / PARTITION BY / ORDER BY
  • ROW_NUMBER / RANK / DENSE_RANK
  • LAG / LEAD
  • Moving Averages & Running Totals
  • QUALIFY
Data Cleaning
  • String Cleanup
  • Date Parsing
  • Deduping
Analytics Patterns
  • Top-N Per Group
  • Cohorts & Retention
  • Funnels
  • Rolling Metrics & Period-over-Period
Performance Modeling
  • Index Intuition
  • Normal Forms
  • Reading Explain Plans
Capstone
  • Capstone Part 1: KPI Baseline
  • Capstone Part 2: Cohorts & Retention
  • Capstone Part 3: Segments & Recommendation
Home / Course / SQL Foundations

SQL Foundations

Learn SQL sql foundations with practical examples and guided drills on dbSyntax.

Start with SELECT / FROM

SELECT / FROM

Beginner

Every SQL query answers two questions before anything else: what columns do I want, and what table do they come from? SELECT answers the fir...

ORDER BY

Beginner

ORDER BY is how you sort a result set. Without it, the database is free to return rows in whatever order is cheapest, and that order is not ...

LIMIT / OFFSET

Beginner

LIMIT caps how many rows your query returns. OFFSET tells SQL how many rows to skip before starting to return them. Together they let you pr...

DISTINCT

Beginner

DISTINCT removes duplicate rows from a result. It sounds simple, and on one column it is. But the word "duplicate" hides a couple of subtlet...

Aliases

Beginner

An alias is a second name. You use aliases to rename columns in the result, shorten table names inside a query, or name values you compute o...

dbSyntax Write and Run SQL in Your Browser
CoursePracticeReferenceModelingInterview PrepPrivacyTerms
© 2026 dbSyntax.