Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Above-Average Customers | Advanced SQL for Data Analysis
SQL for Data Analysis

bookChallenge: Above-Average Customers

Task

Swipe to start coding

Write a query using a subquery to find customers with total quantity purchased greater than the average quantity purchased.

  • Calculate the total quantity purchased by each customer.
  • Calculate the average total quantity purchased across all customers.
  • Select only those customers whose total quantity purchased is greater than this average.
  • Return the customer ID, first name, last name, and total quantity purchased for each qualifying customer.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Above-Average Customers

Swipe to show menu

Task

Swipe to start coding

Write a query using a subquery to find customers with total quantity purchased greater than the average quantity purchased.

  • Calculate the total quantity purchased by each customer.
  • Calculate the average total quantity purchased across all customers.
  • Select only those customers whose total quantity purchased is greater than this average.
  • Return the customer ID, first name, last name, and total quantity purchased for each qualifying customer.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 2
single

single

some-alt