Challenge: Customer Spending Analysis
Tarefa
Swipe to start coding
Write a query that shows, for each customer, the total 'purchase' and 'refund' amounts as separate columns.
- Select
customer_idfrom thetransactionstable. - Calculate the sum of
amountfor transactions wheretransaction_typeis 'purchase' and display it astotal_purchase. - Calculate the sum of
amountfor transactions wheretransaction_typeis 'refund' and display it astotal_refund. - Group the results by
customer_id. - Display one row per customer.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 2
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 4.17
Challenge: Customer Spending Analysis
Deslize para mostrar o menu
Tarefa
Swipe to start coding
Write a query that shows, for each customer, the total 'purchase' and 'refund' amounts as separate columns.
- Select
customer_idfrom thetransactionstable. - Calculate the sum of
amountfor transactions wheretransaction_typeis 'purchase' and display it astotal_purchase. - Calculate the sum of
amountfor transactions wheretransaction_typeis 'refund' and display it astotal_refund. - Group the results by
customer_id. - Display one row per customer.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 2
single