Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

SQL practice › Window functions

Running Revenue

Hard · Window functions

For every date with at least one delivered order, return the date, that day's revenue (quantity × price of delivered orders) and the running total of revenue up to that date, ordered by date.

Hint

First total each day in a subquery, then SUM() OVER (ORDER BY date).

Write your query on this page — it runs against the sample company database in your browser and is checked instantly.

Next problem: Third Highest Distinct Salary