Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Customer Purchase Aggregation | Advanced CTE Applications and Performance
Mastering Common Table Expressions (CTEs) in SQL
Sezione 3. Capitolo 2
single

single

bookChallenge: Customer Purchase Aggregation

Scorri per mostrare il menu

Compito

Swipe to start coding

Write a query using a Common Table Expression (CTE) and aggregate functions to list customers whose total purchase amount exceeds $5,000.

  • Use a CTE to calculate the total purchase amount for each customer.
  • In the CTE, join the customers and sales_transactions tables on customer_id.
  • Group the data by customer to aggregate their total purchase amount.
  • In the main query, select the customer ID, first name, last name, and total purchase amount from the CTE.
  • Only include customers whose total purchase amount is greater than 5000.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 2
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt