Challenge: Calculate Running Total of Sales
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 2
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Fantastico!
Completion tasso migliorato a 4.55
Challenge: Calculate Running Total of Sales
Scorri per mostrare il menu
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 2
single