Filter and sort rows
Combine WHERE conditions and ORDER BY to list affordable products that are in stock.
Learn the queries that answer everyday questions about data. Each exercise gives you a small table to query, so there is nothing to install: filter rows, join two tables, total values and count groups.
Know what a table and a SELECT statement represent. Every starter includes CREATE TABLE and INSERT statements, so you do not need an external database.
Combine WHERE conditions and ORDER BY to list affordable products that are in stock.
Match customers to their orders with JOIN and understand why rows without a match disappear.
Use GROUP BY and SUM to calculate one total per customer.
Count rows per group and use HAVING to keep only the groups that meet a condition.
Write a query that groups rows by customer and returns SUM(amount), ordered by customer.
Open lesson and hintsSelect the name and price of products that are in stock and cost less than 100. Order the rows from the cheapest to the most expensive.
Open lesson and hintsList each customer name together with the amount of each of their orders. Include only customers who have orders, and order the rows by name and then amount.
Open lesson and hintsCount the visits for each page, keep only pages visited more than once and order the result with the highest count first.
Open lesson and hintsWork out the expected rows by hand, then run the query against the starter data. Inspect column names and values. Once it works, add another row and predict how the output changes.
The playground uses SQLite, not a PostgreSQL or MySQL server. Database-specific syntax may differ.
Completion is self-reported. There is no automated grading, and progress is saved only on this device.