Question: The Customer _ Order table, which stores data about customer orders, contains the folowing data: Customer _ Order Prompt 2 Questions ( There are 8

The Customer_Order table, which stores data about customer orders, contains the folowing data:
Customer_Order
Prompt 2 Questions
(There are 8 questions for Prompt 2).
Write a query to retrieve each unique customer ID (cust_id) from the Customer_Order table.
There are
multiple ways to construct the query, but do not use a subquery.
Write a query to retrieve each unique customer ID (cust_id) 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 Customer_Order 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 (cust_idi) whose lowest order number (order_num) 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 2 or more orders on the same day. Retrieve the
cust_id and order_date values, along with the tatal number of orders on that date. Do not use a subquery.
Along with the Customer_Order table, there is another Customer table below. Write a query that returns the
name of each customer who has placed exactly 3 orders. Do not return the same customer rame more than
once, and use a correlated subquery (no JOINS please) against Customer_Order to determine the total
number of orders for each customer:
Customer
cust_id cust_name
121 Acme Wholesalers
234 Griffin Electric
336 East Coast Marine Supplies
544 Sanford Automative
Construct a different query to return the same data as the previous question [name of each customer who
has placed exactly 3 orders) but use a non-correlated subquery (no JOINS please) against the
Customer_Order table. It is important to code a non-correlated 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.
The Customer _ Order table, which stores data

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!