SELECT customer, category, quantity * unit_price AS line_total
FROM data
ORDER BY line_total DESC
LIMIT 5;
Run this query on the demo dataset →
Combining ORDER BY with LIMIT gives you a top-N query: sort every row by the value you care about (here, each line's total), highest first, then cut the result off after the first 5 rows. This is the SQL way to answer 'what are my 5 biggest orders' without eyeballing a sorted spreadsheet column.
A table named data with columns: order_id (integer), customer (text), country (text), category (text), quantity (integer), unit_price (real), order_date (text, YYYY-MM-DD).
Want to run it on your own file? Open it with Query CSV with SQL: your file becomes the table data, and you can paste this query with your own column names.