1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
cluponka [151]
3 years ago
14

Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, y

ou can group the result set by the EmailAddress and OrderID columns. In addition, you must calculate the order total from the columns in the OrderItems table.Write a second SELECT statement that uses the first SELECT statement in its FROM clause. The main query should return two columns: the customer’s email address and the largest order for that customer. To do this, you can group the result set by the EmailAddress column.
Computers and Technology
1 answer:
Debora [2.8K]3 years ago
7 0

Answer:

Select EmailAddress,max(total) from (Select EmailAddress, OrderID, sum(total) as total from OrderItems group by EmailAddress, OrderID) group by EmailAddress

Explanation:

First step is group the rows by email and order id and sum de total of orders

Select EmailAddress, OrderID, sum(total) as total from OrderItems group by EmailAddress, OrderID

Then you use the above query as a subquery grouping by the email and selecting the max value by client

Select EmailAddress,max(total) from (Select EmailAddress, OrderID, sum(total) as total from OrderItems group by EmailAddress, OrderID) group by EmailAddress

You might be interested in
Which benefit does the Cloud provide to start-up companies without access to large funding?
tino4ka555 [31]

Answer:

You don't have to invest in hardware or a data center, you pay only for the resources that you use, so your cost grows linearly in stead of a big investment. It's capital expenditures vs operational expenditures.

7 0
1 year ago
The first widely adopted windows product, ____, featured a standardized look and feel, similar to the one made popular by apple'
slega [8]
<span>The first widely adopted windows product, Windows 3, featured a standardized look and feel, similar to the one made popular by Apple's Macintosh computer .
</span>
Microsoft’s Windows operating system was first introduced in 1985, Windows 3 which was released in 1990 was the first version to see more widespread success, because it had the ability to run MS-DOS programmes in windows which brought multitasking in programming.


8 0
3 years ago
Many people object to increased cybersecurity because _____.
yawa3891 [41]
Depending on what kind of security measures are implemented, D would definitely be a contender. However, B is also something to take into consideration. I would answer D.<span />
5 0
3 years ago
Read 2 more answers
In order to create a chart, which of the following must be selected?
valentina_108 [34]
In order to create a chart, which of the following must be selected?
O Data tools

3 0
3 years ago
Configuring a firewall to ignore all incoming packets that request access to a specific port is known as ____.
Sati [7]

Answer: Logical Point Blocking

Explanation:

4 0
1 year ago
Other questions:
  • Select three examples of cryptographs. Security tokens Shared-key Malware Firewalls Message authentication code Public-key
    7·2 answers
  • What item on a business card is generally the most prominent?
    13·2 answers
  • Why was the term personal computer created?
    5·1 answer
  • Which command is used to combine two or more cells together into one cell?
    14·2 answers
  • Tips for being confident and entertaining when presenting?
    6·1 answer
  • List the steps in setting up an online banking account
    12·2 answers
  • To create a pull quote, how should a user format the text?
    6·2 answers
  • Which of the following is an advantage of using
    6·2 answers
  • Which one is the answer for the question.
    11·1 answer
  • Add the following method to the Point class: public double distance(Point other) Returns the distance between the current Point
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!