RienSQL
TASK #207 · Hard

Two departments split the whole company revenue

Your brief
Management compares how much the Sales and Product departments contribute to company revenue: they need each department's revenue and its share of the whole company's revenue, in percent.

The two shares add up to exactly 100%, although employees of other departments close orders too.

Output name (department name), revenue (department revenue) and revenue_share (share of the whole company's revenue in percent, rounded to 1 decimal place).
Expected columnsname revenue revenue_shareCompany
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
departmentsid, name
employeesid, name, department_id, manager_id, salary, hired_at
customersid, name, registered_at
ordersid, customer_id, employee_id, amount, created_at
loginsuser_id, logged_at