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
Illusion [34]
3 years ago
6

Writea SELECT statement that uses the ranking functions to rank products by the total quantity sold. Returnthese columns:The pro

duct_name column from the Products tableA column named total_quantity that shows the sum of the quantity for each product in theOrder_Items tableA column named rank that uses the RANK function to rank the total quantity in descending sequenceA column named dense_rank that uses the DENSE_RANK function to rank the total quantity in descending sequence
Computers and Technology
1 answer:
Nataliya [291]3 years ago
5 0

Answer:

SELECT  product_name, SUM(DISTINCT quantity) AS total_quantity

RANK() OVER (PARTITION BY total_quantity ORDER BY product_name) AS rank,

DENSE_RANK () OVER (ORDER BY quantity DESC) AS dense_rank

FROM Order_items

JOIN products ON Order_items.product_id = products.product_id

GROUP BY product_id

Explanation:

The SQL query returns four columns namely, product name, total quantity, rank and dense rank. The query uses the rank and the dense rank function to return the rows according to numeric ranks.

You might be interested in
You have an application that you would like to run on your Windows workstation every Monday at 3:00 p.m. Which tool would you us
NikAS [45]

Answer:

Task Scheduler

Explanation:

Task Scheduler allows you to automate tasks in Windows 10

7 0
3 years ago
One of the First-Generation Computer built in 1942 during the Second World War and fully utilized to compute Military Artillery
Temka [501]
ENIAC, in full Electronic Numerical Integrator and Computer, the first programmable general-purpose electronic digital computer, built during World War II by the United States. American physicist John Mauchly, American engineer J. Presper Eckert, Jr., and their colleagues at the Moore School of Electrical Engineering at the University of Pennsylvania led a government-funded project to build an all-electronic computer.

From Brittanica.com
7 0
3 years ago
How many features are there in the team​
sdas [7]

Answer:

<h3><u>Component Team</u></h3>
  • Leads to 'invented' work and a Forever-Growing Organization
  • Dependencies between teams leads to additional planning
<h3><u>Feature Team</u></h3>
  • Leads to customer focus,visibility and smaller organization
  • Minimizes dependencies between teams and increase flexibility

4 0
2 years ago
What do you need to do before you can sort and filter data in a database?
tatuchka [14]

You need to A) format the table first.

7 0
3 years ago
Write an algorithm in pseudo code to find the product of two numbers​
Vadim26 [7]

Answer:

Read num1 , num2

Set multi to num1*num2

Write multi

Explanation:

7 0
4 years ago
Other questions:
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • after installing a secondary hard drive what needs to be done to the hard drive and what do these two task do?
    9·1 answer
  • "The fact that we could create and manipulate an Account object without knowing its implementation details is called"
    9·1 answer
  • Which of the following is NOT essential for individuals to have to build their own web page?
    9·1 answer
  • [Java] Using the comparable interface
    13·1 answer
  • What do character formats do for your document's message? A. Set how text aligns within a document B. Provide organization C. Pr
    6·2 answers
  • How can you represent a graphic element in a wireframe?
    5·1 answer
  • The best way to help prevent a system from a worm attack is to use anti-virus software anti-malware software a firewall a router
    12·1 answer
  • What is the output of the following code snippet if the variable named cost contains 100? if cost &lt; 70 or cost &gt; 150 : dis
    8·1 answer
  • Refund please, this has not helped at all.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!