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
Uzorak očekivanog izlaza
Ovako izgleda ispravan odgovor — broj redaka je njegov vlastiti, ne mora se podudarati s tablicama sheme.
| id | name | price | stock | category |
|---|---|---|---|---|
| 4 | Lamp | 25 | 15 | home |
Prijavi se da vidiš povijest predaja
PrijavaPrijavi se da koristiš AI mentora
Prijava