SQL Playground Mission: Map a Dataset Before Querying
Start freeform SQL work by building a quick map of table sizes.
Before writing a report on an unfamiliar dataset, map the tables. A row-count inventory tells you which tables are small lookup tables, which tables hold transactional detail, and where a join might multiply rows.
This mission uses UNION ALL to stack one small count query per table. It is the same habit you can use in the playground before exploring your own CSV or Parquet upload.
select 'first_table' as table_name, count(*) as rows from first_table
union all
select 'second_table', count(*) from second_table
order by rows desc, table_nameSchema · Garden ShopView dataset schema6 tables
One row per customer. Some customers have no phone on file.
One row per product, with price, cost, and inventory levels.
Lookup table of product categories.
One row per order. Unshipped orders have a null shipped_date.
One row per line item within an order.
One row per supplier. Some suppliers have no contact email.
Return a table inventory for Garden Shop. The result should havetable_name and rows, covering customers, products, categories, orders, order_items, and suppliers. Sort by row count descending, then table name.
- Columns: table_name, rows.
- Rows: one per Garden Shop table (6 rows).
- order_items is largest with 48 rows; suppliers is smallest with 6 rows.
Related
Understand tables, rows, columns, and queries.
Learn the basic shape of relational data.
Run queries and read results in the browser.
Write a first SELECT and read the returned rows.