Answers to SQL Tutorial - Introduction to Querying Databases

  1. What is wrong will the below SQL statement?

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

 IN instead of =

 

 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 wholesale_price > 25;

 

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

SELECT * FROM employees

ORDER BY last_name ASC;

Comments

Please sign in or sign up to comment.