Write a SELECT statement that answers this question: Which invoices have a PaymentTotal that's greater than the median PaymentTotal for all paid invoices? (The median marks the midpoint in a set of values; an equal number of values lie above and below it.) Return the InvoiceNumber and InvoiceTotal for each invoice. Hint: Begin with the solution to exercise 2, then use the ALL keyword in the WHERE clause and code "TOP 50 PERCENT PaymentTotal" in the subquery.

Answers

Answer 1

Answer:

Here is the SELECT statement:

SELECT InvoiceNumber, InvoiceTotal  

FROM INVOICES

WHERE PaymentTotal > ALL

(SELECT TOP 50 PERCENT PaymentTotal  

FROM INVOICES

ORDER BY PaymentTotal)

 

Explanation:

This can also be written as:

SELECT InvoiceNumber, InvoiceTotal  

FROM INVOICES

WHERE PaymentTotal >

(SELECT AVG(PaymentTotal )

FROM invoices

WHERE PaymentTotal > ALL

(SELECT TOP 50 PERCENT PaymentTotal  

FROM INVOICES

ORDER BY PaymentTotal)


Related Questions

Who created the word robot?

Answers

Answer:

Karel Čapek

Explanation:

Robot is drawn from an old Church Slavonic word, robota, for “servitude,” “forced labor” or “drudgery.” The word, which also has cognates in German, Russian, Polish and Czech, was a product of the central European system of serfdom by which a tenant's rent was paid for in forced labor or service

plz mark brainliest

Other Questions
Find the value of each variable What is the domain of the following set of points? *{(3,4), (7,-2), (11, -8)} 2 ways to show 2,059 written in expanded form? What is Chantal wearing?a skirt and a tee shirta coat and orange pantsa swiming suit and a shirta cap and boots The production planner for Fine Coffees, Inc. produces two coffee blends: American (A) and British (B). Two of his resources are constrained: Columbia beans, of which he can get at most 300 pounds (4,800 ounces) per week; and Dominican beans, of which he can get at most 200 pounds (3,200 ounces) per week. Each pound of American blend coffee requires 12 ounces of Colombian beans and 4 ounces of Dominican beans, while a pound of British blend coffee uses 8 ounces of each type of bean. Profits for the American blend are $2.00 per pound, and profits for the British blend are $1.00 per pound. What is the objective function? A. $1 A + $2 B = Z B. $12 A + $8 B = Z C. $2 A + $1 B = Z D. $8 A + $12 B = Z E. $4 A + $8 B = Z What is 4% of 50% of 5 ? Pointed teeth help tear apart food, and large, flat teeth are used to grind food. Based on this information, what types of teeth are characteristic of animals that eat plants and animals that eat other animals? Plz Help ASAP European diseases such as smallpox, measles and typhoid took the lives of How do convection, global winds and jet streams influence weather and climate? Why is religious freedom important for good government? pls help me someone im so stressed out rn I just had 4 math tests. I do virtual and a lot of the teachers at my school do both bc of the shortage this year, and my math teacher hasn't taught math in 20 years and told us we were on our own. I haven't had ONE meet with him this whole year :(((((((( Use the table below to answer questions 1-4. MINUTES 0 3 6 a 12 WORDS TYPED 120 2 360 480 1 point 1. Kenny is practicing for a typing test to obtain a job as a paralegal. The number of words he can type is proportional to the number of minutes. If the test is 18 minutes long, how many words will Kenny be able to type? Your cousin plays point guard for her community basketball team. When she plays in a game, four out of every seven baskets she scores for her team are lay-ups.If your cousin scores fourteen baskets for her team at Saturday night's game, how many were lay-ups?If, during the course of the season, your cousin scores one hundred nineteen baskets for her team, how many were lay-ups?If, during a month of playing in basketball games, your cousin makes twenty four lay-ups, how many total baskets did she score for her team? 00:00 A 2-liter bottle of juice costs $2.80. A box containing six 12-liter bottles sells for $3.90. Which option has a higher cost per liter? What is that cost? A. 00:00 2-liter bottle; $1.40 B. 00:00 Box of six 12-liter bottles; $1.30 C. 00:00 2-liter bottle; $2.80 D. 00:00 Box of six 12-liter bottles; $3.90 p+m+85/7-a+d=?Explain and answer Write the recursive formula then determine the next term of 3,10,24,52 Jenna read this information in her research on medicine in the Middle Ages:Because the moon appeared to change, doctors believed that it could affect peoples health.What is the dependent clause in this sentence?A Because the moon appeared to changeB appeared to changeC doctors believedD doctors believed that it could affect peoples health when a writer uses descriptive language , how does.it affect the reader ? Which of the following pairs of angles arecomplementary?A. 24 and 66B. 56 and 124C. 24 and 66; 34 and 56D. 56 and 124; 66 and 114 1.Who introduced the first Muluki Ain and when?