SQL Foundations
Learn SQL sql foundations with practical examples and guided drills on dbSyntax.
Start with SELECT / FROMSELECT / FROM
BeginnerEvery 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
BeginnerORDER 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
BeginnerLIMIT 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
BeginnerDISTINCT 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
BeginnerAn 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...