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
How to analyze time complexity of a code?
VladimirAG [237]

Answer:

we can multiply or divide by a constant factor to get to the simplest expression. The most common metric for calculating time complexity is Big O notation. This removes all constant factors so that the running time can be estimated in relation to N as N approaches infinity.

Explanation:

7 0
4 years ago
What two choices do you have when you open the Remote tab of the System Settings?
andre [41]

Answer:

remote assistance and remote desktop

Explanation:

^

4 0
3 years ago
Explain the distinction between a real address and a virtual address.
kap26 [50]

Answer:

<em />

<em>A real address is the physical address in main memory. Though a virtual address is the address of a storage location in virtual memory.</em>

<em></em>

<em></em>

<em>hopes this help (:`</em>

6 0
2 years ago
Read 2 more answers
Taran is concerned with the security of his macros in a database. Which security option could he use to provide protection?
Lynna [10]

Answer:security VBA code

Explanation:

6 0
3 years ago
Creating calendar events prevents individuals from being able to schedule a time to collaborate.
Yuliya22 [10]

Answer:

False because calender events help a person remeber when s/he has a event happening that day!

6 0
4 years ago
Other questions:
  • Suppose that we are developing a new version of the AMD Barcelona processor with a 4 GHz clock rate. We have added some addition
    11·1 answer
  • I am in desperate need to graduate. Overloaded with tons of online homework to be completed before the school year ends. I don't
    5·1 answer
  • instructor is describing a component that is always located on the CPU and accelerates the processing of instructions. Which com
    12·1 answer
  • Open Comments.java and write a class that uses the command window to display the following statement about comments:
    8·1 answer
  • An ____ is a collection of tools, features, and interfaces that enables users to add, update, manage, access, and analyze the co
    10·1 answer
  • A potentiometer a three wire variable resistor is used in which type of sensor ?
    13·1 answer
  • This graphics program should draw a caterpillar. A caterpillar has NUM_CIRCLES circles. Use a for loop to draw the caterpillar,
    6·1 answer
  • USB 3.1 offers an improvement over its predecessors by enabling a maximum data transfer rate of up to:
    8·1 answer
  • You have been asked to replace a cracked screen on a laptop. The replacement screen was delivered today, but it did not include
    7·1 answer
  • Using an open connection to a small company's network, an attacker submitted arbitrary queries on port 389 to the domain control
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!