SQL · Amazon · Medium
Problem You have two tables: orders and customers. Table: orders order_id is the primary key. Table: customers customer_id is the primary key. The region column can contain NULL values. Join the two tables on customer_id. Keep only orders placed within the 365 days leading up to 2026-07-01. For each region, calculate the sum of the order amounts. Treat any NULL region as a distinct group labeled 'Unknown'. Return two columns: region and total_amount. Sort the result by…
Checking your access…