SQL Querying
SQL is how you actually ask a database questions. Every clause below updates a real query and a real, live-filtered result, over the same Customers and Orders tables from the design lesson.
Build a query, watch it run live
Change any setting below and watch both the SQL text and the highlighted matching rows update immediately.
SELECT
FROM
WHERE
ORDER BY
JOIN: combining two tables into one result
This is usually the hardest SQL concept at this level, because it needs both tables at once. A JOIN matches rows using the foreign key link, exactly like the relationship from the design lesson, and produces one combined table you can then filter and sort as normal.
Add a WHERE filter to the join
Aggregate functions: summarising instead of listing
Sometimes you don't want every row, you want a total, an average, or a count. GROUP BY splits the rows into buckets first, then the aggregate function summarises each bucket separately.
Function
INSERT, UPDATE and DELETE
SELECT only ever reads data. These three statements are how a database actually changes.