Question
Queries Filename: queries.sql Write SELECT statements to complete the following queries. Query 1 Driver List Write a query that returns the order number and customer
Queries Filename: queries.sql
Write SELECT statements to complete the following queries.
Query 1 Driver List Write a query that returns the order number and customer email for each order. If an order does not have a customer name, display Anonymous instead:
Query 2 Order Aggregate Write a query that shows the order date, customer email, delivery address and combined total cost for each order. Order the results by the order date. Orders without a registered customer should list Anonymous as their email. Using the Order View in this query is recommended.
Query 3 Top products A products popularity is based on how many times it appears as a customers favourite product. Write a query that selects the top 3 most favorited products. List the products name, type and number of times favorited.
Query 4 Best Customers The company wants to send discounts to their most loyal customers. Write a query that selects the email addresses of any customers who have spent more money than the average customer. That is, the total cost of all of their orders is greater than the average amount spent by other customers
Query 5 Stolen Order Investigation A customer has reported that a staff member has stolen their order. The customer does not remember what email address they used to sign up but they have only made three orders and one of them was two days ago. They dont remember exactly what was stolen but one of the items started with the letter F. The stolen order is their most recent order. Write a single query that uses the above information to find the name of the staff member who delivered the missing order.
Qhang 1 - Derww tils Queng L - beter AewriateStep 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