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
SVEN [57.7K]
3 years ago
11

Write a SELECT statement that returns one row for each customer that has orders with these columns: The email_address column fro

m the Customers table A count of the number of orders The total amount for each order (Hint: First, subtract the discount amount from the price. Then, multiply by the quantity.) Return only those rows where the customer has more than 1 order. Sort the result set in descending sequence by the sum of the line item amounts
Engineering
1 answer:
Dafna11 [192]3 years ago
8 0

Answer:

The statement is as follows:

Explanation:

We had better avoid such correlated subqueries by instead using aggregation with GROUP BY:

SELECT

   c.email_address,

   COUNT(DISTINCT o.order_id) AS num_orders,

   COALESCE(SUM(oi.quantity * (oi.item_price - oi.discount_amount)), 0) AS total_amount

FROM customers c

LEFT JOIN orders o

   ON c.customer_id = o.customer_id

INNER JOIN order_items oi

   ON o.order_id = oi.order_id

GROUP BY

   c.customer_id,

   c.email_address;

You might be interested in
Consider a fluid with mean inlet temperature Ti flowing through a tube of diameter D and length L, at a mass flow rate m'. The t
EleoNora [17]

Answer:

T_m(x) = T_i+\frac{\pi D}{\dot{m}c_p}(ax+\frac{bL}{\pi}-\frac{bL}{\pi}cos(\frac{x\pi}{L}))

Explanation:

Our data given are:

T_i = Mean temperature (inlet)

D = Diameter

L = Length

\dot{m}=Mass flow rate

Equation to surface flow as,

q(x) = a+bsin(x\pi/L)

We need to consider the perimeter of tube (p) to apply the steady flow energy balance to a tube , that is

q(x)pdx=\dot{m}c_p dT_m

Where p=\pi D

Re-arrange for dT_m,

dT_m = \frac{q(x)pdx}{\dot{m}c_p}

Integrating from 0 to x (the distance intelt of pipe) we have,

\int\limit^{T_m(x)}_T_i dT_m = \frac{p}{mc_p}\int_0^x q(x)dx

Replacing the value of q(x)

\int\limit^{T_m(x)}_T_i dT_m = \frac{p}{mc_p}\int_0^x (a+bsin(x\pi/L))dx

T_m(x)-T_i = \frac{\pi D}{\dot{m}c_p}\int_0^x(a+bsin(x\pi/L))dx

T_m(x)-T_i = \frac{\pi D}{\dot{m}c_p}(ax-\frac{bL}{\pi}cos(\frac{x\pi}{L}))^x_0

T_m(x) = T_i+\frac{\pi D}{\dot{m}c_p}(ax+\frac{bL}{\pi}-\frac{bL}{\pi}cos(\frac{x\pi}{L}))

8 0
3 years ago
The moisture content in air (humidity) is measured by weight and expressed in pounds or ____________________.
VikaD [51]

Moisture content is measured in terms of pounds of water per pound of air (lb water/lb air) or grains of water per pound of air (gr. of water/lb air).

Hope this helps❤

3 0
2 years ago
Answer: D because you need an explanation <br> Explanation: Please I'll mark Brainliest
mylen [45]

Answer:Could you give a picture or something so I could answer.

Explanation:

6 0
3 years ago
Definition of ceramics
dezoksy [38]

Answer:

Ceramics are generally made by taking mixtures of clay, earthen elements, powders, and water and shaping them into desired forms. Once the ceramic has been shaped, it is fired in a high temperature oven known as a kiln. Often, ceramics are covered in decorative, waterproof, paint-like substances known as glazes.

Explanation:

3 0
3 years ago
Read 2 more answers
PLEASE HELP, TEST MULTIPLE CHOICE QUESTIONS
Rina8888 [55]

Answer:

c

Explanation:

dbfjex vadamhqrmtwg

8 0
3 years ago
Read 2 more answers
Other questions:
  • When choosing building-construction materials, what kinds of materials would you choose, all other things being equal?
    6·1 answer
  • What is the thermal efficiency of a gas power cycle using thermal energy reservoirs at 627°C and 60°C? The thermal efficiency is
    12·1 answer
  • The in situ moist unit weight of a soil is 17.3 kN/m3 and the moisture content is 16%. The specific gravity of soil solids is 2.
    12·1 answer
  • Consider a new peer Alice that joins BitTorrent without possessing any chunks. Without any chunks,she cannot become a top-four u
    9·1 answer
  • In fully developed laminar flow in a circular pipe the velocity at R/2 (mid-way between the wall surface and the centerline) is
    10·2 answers
  • Which of these is shown in the photo below?
    8·1 answer
  • Calculate the magnitude of the resultant force F⃗ r=F⃗ 1+F⃗ 2+F⃗ 3 acting on the block.
    5·1 answer
  • Given an orifice meter with the dimensions in lab, a flow rate of 60 lbm/min and a differential pressure of 200 inches of water,
    14·1 answer
  • WHICH OF THIS PLS FAST!!!
    5·1 answer
  • How many gallons of 25% concentrated due will Lucy need to add to the 15% concentrated dye to make a batch with a concentration
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!