Sales by Day of Week

ASKED IN INTERVIEW
10pts
Amazon

Problem Statement

Find the total revenue generated for each day of the week for orders placed in 2025.

Rules:

  • Output columns: day_of_week, total_revenue.
  • Sort: Monday to Sunday.
  • Use full day names.
Tests your understanding of
Date Extraction, Aggregation, Sorting and TO_CHAR

Input Tables

orders
order_id(INTEGER)order_date(TIMESTAMP)revenue(DECIMAL)
12025-01-06 10:00:00150
22025-01-07 14:00:00200
32025-01-13 09:00:0050
42025-01-08 11:00:00300
products
product_id(INTEGER)price(DECIMAL)
10110
warehouse_logs
log_id(INTEGER)order_id(INTEGER)
11

Expected Output

day_of_week(VARCHAR)total_revenue(DECIMAL)
Monday200
Tuesday200
Wednesday300

Tags

HardASKED IN INTERVIEWDate ExtractionAggregationSortingTO_CHAR
20-30 min
41%

Hints