Katkat

Calculate Monthly Revenue from Orders in 2023

AmazonData Scientist · Technical Screen

Last updated

This question evaluates proficiency in SQL-based data manipulation, including aggregation, date extraction, and combining transactional tables to produce business metrics, and falls under the Data Manipulation (SQL/Python) domain.

orders

idorder_datecustomer
12023-01-03101
22023-02-14102
32023-02-20101

​

order_items

idorder_iditemprice
11A25.00
21B15.00
32C35.00
Scenario

Online assessment: SQL section with order and order_item data.

Question

Given tables orders and order_items, write a SQL query that returns each calendar month of 2023 and the corresponding total revenue (sum of price).

Hints

JOIN the two tables, filter by year, GROUP BY month extracted from order_date, ORDER BY month.