Daily Metrics by Order Status in a Single SQL Pass

You have an orders table with columns: order_id, status (pending/completed/cancelled), amount, date.

Compute the following metrics by date:

  • total_revenue: sum of amount for `c...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: