Challenge: Calculate Running Total of Sales
Tarea
Swipe to start coding
Write a query to calculate the running total of sales amount for each employee, ordered by sale_date.
- For each row in the
salestable, calculate a running total of theamountfor the sameemployee_id. - The running total should be ordered by
sale_date. If two sales have the same date for the same employee, usesale_idto break ties. - The output should include columns:
sale_id,sale_date,employee_id,amount, and the calculated running total asrunning_total. - The results should be ordered by
employee_id, then bysale_date, then bysale_id.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 2
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Genial!
Completion tasa mejorada a 4.55
Challenge: Calculate Running Total of Sales
Desliza para mostrar el menú
Tarea
Swipe to start coding
Write a query to calculate the running total of sales amount for each employee, ordered by sale_date.
- For each row in the
salestable, calculate a running total of theamountfor the sameemployee_id. - The running total should be ordered by
sale_date. If two sales have the same date for the same employee, usesale_idto break ties. - The output should include columns:
sale_id,sale_date,employee_id,amount, and the calculated running total asrunning_total. - The results should be ordered by
employee_id, then bysale_date, then bysale_id.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 2
single