SQL Fundamentals
Build a rock-solid foundation — learn to read and write SQL from scratch using a real e-commerce database.
0/12 done
SELECT & FROM
SELECTYour first query — ask the database for data and tell it which table to look in.
WHERE Clause
WHEREFilter rows so you only get back data that matches your conditions.
Complete SELECT & FROM to unlock
Comparison & Logical Operators
AND / OR / NOTCombine conditions with AND, OR, NOT — and use BETWEEN and IN as shortcuts.
Complete WHERE Clause to unlock
NULL Values
NULLUnderstand what NULL means and how to handle missing data gracefully.
Complete Comparison & Logical Operators to unlock
ORDER BY
ORDER BYSort results by any column, ascending or descending — and by multiple columns at once.
Complete NULL Values to unlock
LIMIT & OFFSET
LIMIT / OFFSETControl how many rows come back and skip rows for pagination.
Complete ORDER BY to unlock
DISTINCT
DISTINCTRemove duplicate values and get a clean list of unique results.
Complete LIMIT & OFFSET to unlock
Column Aliases
ASRename columns and calculate new values right inside your SELECT.
Complete DISTINCT to unlock
Creating Tables & Data Types
CREATE TABLEDesign a table from scratch and pick the right data type for each column.
Complete Column Aliases to unlock
INSERT — Adding Data
INSERT INTOWrite new rows into a table — one at a time, or many at once.
Complete Creating Tables & Data Types to unlock
UPDATE — Modifying Data
UPDATE ... SET ... WHEREChange existing rows safely — always with a WHERE clause.
Complete INSERT — Adding Data to unlock
DELETE — Removing Data
DELETE FROM ... WHERERemove rows permanently — and understand why most production systems prefer soft deletes.
Complete UPDATE — Modifying Data to unlock