Brightlane's buying team is reviewing the premium product range ahead of a catalog presentation.
Write a query to return the name and price of every product priced above $100.
Assumptions:
- The
productstable contains every item in Brightlane's catalog. - The
pricecolumn records each product's selling price in dollars.
Output:
- One row per qualifying product, with columns
nameandprice.
Schema · ecommerce 5 tables
Run previews · Check grades
Write a query, then run it to see results here.
Worked solution Try it yourself first
SELECT
name,
price
FROM
products
WHERE
price > 100 The shape
A single numeric comparison on price does the filtering — the catalog walks past row by row, and only rows whose price clears the $100 threshold come through.
Clause by clause
SELECT name, pricereturns the two columns the buying team is reviewing: what the product is called and what it costs. Order matches the prompt's required output.FROM productsis the catalog source — every item Brightlane sells, premium or not.WHERE price > 100keeps only rows whosepriceis strictly greater than100. The literal100has no quotes because it's a number; PostgreSQL compares it numerically against thepricecolumn. A product priced at exactly100would not survive —>is strict.
Why this and not >=
The prompt says "priced above $100," which excludes the boundary itself. Strict > matches that wording. If the prompt had said "priced at or above $100" or "$100 and up," >= would be the right operator and a $100 item would qualify. The two operators differ by exactly one value: the boundary. Picking the wrong one shifts the row count by however many rows sit exactly at the threshold.
You practiced filtering rows with a numeric comparison (price > 100). Threshold filters on numeric columns recur in every report that segments by amount.