NC 02: Your first query

Track: No-code sandbox (sandbox.altfndata.com) Prerequisite: NC_01, so you know the table and field names.

The task

Write and run a first, simple SQL query in the sandbox editor, selecting a handful of fields from one table and reading the result grid.

Starter steps

  1. Open the SQL editor in the sandbox.
  2. Paste and run this query, which pulls a plain sample of sold watch lots:
SELECT designer, model, item_title, sale_date, usd_price_decimal, vendor
FROM all_watches_data
WHERE status = 'sold'
ORDER BY sale_date DESC
LIMIT 20;
  1. Look at the result grid below the editor. Each column header matches a field name from the schema tab you opened in NC_01.
  2. Try changing LIMIT 20 to LIMIT 50 and re-run, to see how the row count in the result grid changes.
  3. Click a column header, such as usd_price_decimal, to sort the grid client-side and get a quick feel for the value range.

Expected result

A result grid of the most recently sold watch lots, one row per lot, with populated designer names (for example well-known Swiss and international houses), a model or item_title string, a sale_date, a numeric usd_price_decimal, and a vendor (auction house or marketplace) name. Every row has status = 'sold' because of the WHERE clause. Changing the LIMIT changes the row count returned, not the underlying data.

Stretch challenge

Rewrite the query to pull the same fields from all_handbags_data instead of all_watches_data, keeping the same WHERE and ORDER BY clauses. Confirm the query runs unchanged except for the table name, since both tables share the documented field vocabulary.