SQL: given (Cust_Id, Prod, Sales), output per-customer cumulative sales (window cumulative sum). Asked in the Round 1 stage. Write a PostgreSQL query using the customer_sales table.
cust_id, prod, sales, and cumulative_sales.cumulative_sales must accumulate sales separately for each customer, ordered by prod ascending. Include rows with NULL sales.cust_id ascending, then prod ascending with NULL products last.| Column | Type | Description |
|---|---|---|
| cust_id | INT | Customer identifier |
| prod | VARCHAR(100) | Product name used for ordering |
| sales | NUMERIC(12,2) | Sales amount for the customer and product |