How do I filter rows where quantity is at least 5 in SQL?
SELECT * FROM data
WHERE quantity >= 5
ORDER BY quantity DESC;
Run this query in QueryLocal →
`WHERE quantity >= 5` keeps only the rows whose quantity meets or exceeds 5, discarding the rest before any sorting happens. Changing the number on the right of `>=` is all it takes to tighten or loosen the filter.
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).