Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the Orders database introduced in Watt (2014) - Appendix C; write the SQL Statements for below cases: Get all the orders placed by
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started