Question: The Customer _ Order table, which stores data about customer orders, contains the folowing data: Customer _ Order Prompt 2 Questions ( There are 8
The CustomerOrder table, which stores data about customer orders, contains the folowing data:
CustomerOrder
Prompt Questions
There are questions for Prompt
Write a query to retrieve each unique customer ID custid from the CustomerOrder table.
There are
multiple ways to construct the query, but do not use a subquery.
Write a query to retrieve each unique customer ID custid along with the latest order date for each
customer. Do not use a subquery.
Write a query to retrieve all rows and columns from the CustomerOrder table, with the results sorted by
order date descending latest date first and then by customer ID ascending.
Write a query to retrieve each unique customer custidi whose lowest order number ordernum is at least
Please note that this is referring to the value of the lowest order number and NOT the order count. Do
not use a subquery.
Write a query to retrieve only those customers who had or more orders on the same day. Retrieve the
custid and orderdate values, along with the tatal number of orders on that date. Do not use a subquery.
Along with the CustomerOrder table, there is another Customer table below. Write a query that returns the
name of each customer who has placed exactly orders. Do not return the same customer rame more than
once, and use a correlated subquery no JOINS please against CustomerOrder to determine the total
number of orders for each customer:
Customer
custid custname
Acme Wholesalers
Griffin Electric
East Coast Marine Supplies
Sanford Automative
Construct a different query to return the same data as the previous question name of each customer who
has placed exactly orders but use a noncorrelated subquery no JOINS please against the
CustomerOrder table. It is important to code a noncorrelated subquery for this question.
Write a query to retum the name of each customer, along with the total number of orders for each customer.
Include all customers, regardless if they have orders or not. Use a scalar, correlated subquery no JOINS
please to generate the number of orders.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
