Prepare and execute each of the queries listed using the”Adventureworks2012″ database in SQL Server.
23. Select Product ID, name, and size of all products with asize of S, M, or L sort the results by name.(Production.Product)(31 rows)
24. Select Sales Order ID, order date, subtotal, and total for allorders with a total amount due between 5000 dollars
and 9,999.99 sort the results by order date.(Sales.SalesOrderHeader)(393 rows)
Answer
23). SELECT Product_Id, name, size FROM product WHERE size in(‘S’, ‘M’, ‘L’) ORDER BY name
24). SELECT order_id, order_date, subtotal, total FROMsalesorderheader WHERE total BETWEEN 5000 AND 9999.99 ORDER BYorder_Date;
Please comment if you need any help.