View with aggregation
SQL
Medium
0 views
Problem Description
Create view v_daily_sales that returns day and total_sales from Orders.
Output Format
View created
Sample Test Case
Input:
Orders(order_date, total_amount)
Constraints
Group by date
Official Solution
CREATE VIEW v_daily_sales AS SELECT order_date AS day, SUM(total_amount) AS total_sales FROM Orders GROUP BY order_date;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!