medium · ~10 min
Finance needs a breakdown of total revenue by department along with each department's percentage share of overall company sales.
sales
department
total_sales
amount
pct_of_total
Input contract: sale_id is the non-null primary key of sales; department is non-null; amount is a non-null, strictly positive (> 0) number; sales contains at least one row.
sale_id
> 0