Price Without Extra Math
The catalog currently checks doubled price against the threshold 24, making the lookup heavier than needed. Rewrite it as a direct comparison of price to the equivalent threshold 12, keeping the result sorted by id.
Original query
SELECT * FROM products WHERE price * 2 > 24 ORDER BY id
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| id | name | price | stock | category |
|---|---|---|---|---|
| 4 | Lamp | 25 | 15 | home |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in