Challenge: Monthly VIP Customer Report
Uppgift
Swipe to start coding
Write a query to generate a monthly report of VIP customers based on their transaction history. A customer is considered "VIP" for a given month if they have a total transaction amount of at least 500 and have made at least 2 transactions in that month.
- Group transactions by month and customer.
- Calculate the total transaction amount for each customer per month.
- Count the number of transactions for each customer per month.
- Use
CASE WHENto label customers as'VIP'if they meet both criteria: total amount >= 500 and transaction count >= 2. - Only include customers who qualify as VIP in the results.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 4. Kapitel 6
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 4.17
Challenge: Monthly VIP Customer Report
Svep för att visa menyn
Uppgift
Swipe to start coding
Write a query to generate a monthly report of VIP customers based on their transaction history. A customer is considered "VIP" for a given month if they have a total transaction amount of at least 500 and have made at least 2 transactions in that month.
- Group transactions by month and customer.
- Calculate the total transaction amount for each customer per month.
- Count the number of transactions for each customer per month.
- Use
CASE WHENto label customers as'VIP'if they meet both criteria: total amount >= 500 and transaction count >= 2. - Only include customers who qualify as VIP in the results.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 4. Kapitel 6
single