Challenge: Calculate Running Total of Sales
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 2
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Großartig!
Completion Rate verbessert auf 4.55
Challenge: Calculate Running Total of Sales
Swipe um das Menü anzuzeigen
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 2
single