SQL · Databricks · Hard
You are given a transaction-level table named transactions with these columns: transaction_id (INT, primary key), txn_date (DATE), customer_id (INT), and dollars (DECIMAL(10,2), a non-negative amount in US dollars). Treat a week as running Monday through Sunday, and label each week by week_start_date, the Monday that opens it. Emit a row for every week from the one containing the earliest txn_date up through the one containing the latest txn_date, including weeks that hold…
Checking your access…