-2
USE sql_store;

SELECT *
FROM order_items
WHERE order = 6  AND (unit_price * quantity) > 30

Look at the below image.

enter image description here

I tried finding what might have went wrong but I couldn't.

NOTE: I am a beginner and I started learning SQL recently.

EDIT: enter image description here

Kaushik
  • 187
  • 3
  • 13

1 Answers1

1

order is a reserved word (as part of the order by clause). If you want to use it for a column name, you'll have to escape it by using backticks:

SELECT *
FROM   order_items
WHERE  `order` = 6  AND (unit_price * quantity) > 30
-- Here^-----^
Mureinik
  • 297,002
  • 52
  • 306
  • 350