Answered step by step
Verified Expert Solution
Link Copied!

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:

 

  1. Get all the orders placed by a specific customer. CustomerID for this customer is MAGAA

     
  2. Show customers whose ContactTitle is not Sales Associate. Display CustomerID, CompanyName, Contact Name, and ContactTitle

     
  3. Show customers who bought products where the EnglishName includes the string "chocolate". Display CustomerID, CompanyName, ProductID, ProductName, and EnglishName

     
  4. Show products which were bought by customers from Italy or USA. ". Display CustomerID, CompanyName, ShipCountry, ProductID, ProductName, and EnglishName

     
  5. 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

     
  6. 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

     
  7. Show the total number of customers in each City. Display Country, City, TotalCustomers

     
  8. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

Students also viewed these Databases questions

Question

How do our funders really view us? How do we know?

Answered: 1 week ago