Using the Orders database introduced in Watt (2014) - Appendix C; write the SQL Statements for below
Fantastic news! We've Found the answer you've been seeking!
Question:
Using the Orders database introduced in Watt (2014) - Appendix C; write the SQL Statements for below cases:
- Get all the orders placed by a specific customer. CustomerID for this customer is MAGAA
- Show customers whose ContactTitle is not Sales Associate. Display CustomerID, CompanyName, Contact Name, and ContactTitle
- Show customers who bought products where the EnglishName includes the string "chocolate". Display CustomerID, CompanyName, ProductID, ProductName, and EnglishName
- Show products which were bought by customers from Italy or USA. ". Display CustomerID, CompanyName, ShipCountry, ProductID, ProductName, and EnglishName
- Show total price of each product in each order. Note that there is not a column named as total price. You should calculate it and create a column named as TotalPrice. Display OrderID, ProductID, ProductName, UnitPrice, Quantity, Discount, and TotalPrice
- Show how many products there are in each category and show the results in ascending order by the total number of products. Display CategoryName, and TotalProducts
- Show the total number of customers in each City. Display Country, City, TotalCustomers
- Show the orders which were shipped late than the actual required date. Display OrderID, OrderDate, RequiredDate, and ShippedDate.
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date: