Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a SELECT statement that returns three columns: email_address, order_id, and the order total for each customer. To do this, you can group the result

Write a SELECT statement that returns three columns: email_address, order_id, and the order total for each customer. To do this, you can group the result set by the email_address and order_id columns. In addition, you must calculate the order total from the columns in the Order_Items table. Write a second SELECT statement that uses the first SELECT statement in its FROM clause. The main query should return three columns: the customers email address and the largest order (aliased as max_order_total) and the smallest order_id (aliased as min_order_id). To do this, you can group the result set by the email_address. Sort the result set by the largest order in descending sequence.

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

Step: 3

blur-text-image

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

4. Show how the profit motive can encourage resource conservation.

Answered: 1 week ago