Sequence NODE_298
Medium

Calculate Daily Revenue from Orders

SQL
Technical Specification

Group orders by date and calculate total revenue per day, sorted by date ascending.

Input/Output Samples
Input:orders table
Output:{ day:'2025-01-01', revenue:12345.67 }
Optimal Logic Path
SELECT 
  DATE(created_at) AS day,
  SUM(total_amount) AS total_revenue
FROM orders
GROUP BY day
ORDER BY day ASC;
Architectural Deep-Dive
Aggregating by date powers simple charts for revenue trends.