Project Questions - Answers

1. What is wrong will the below SQL statement?

SELECT * FROM customers WHERE city = (‘Brighton’,’Worthing’);


The statement WHERE city = (‘Brighton’,’Worthing’); is incorrect.

The equal sign should be replaced by IN, and the correct form would be:

SELECT * FROM customers WHERE city IN (‘Brighton’,’Worthing’);


2. Write an SQL query which will return the name, season and wholesale price of all products that are in stock where the wholesale price is greater than 25.00.


SELECT name, season, wholesale_price FROM products

WHERE in_stock = 'true' AND  wholesale_price > 25;


3. Write an SQL which will order the employees table by last name alphabetically


SELECT*FROM employees

ORDER BY last_name DESC;


Please sign in or sign up to comment.