RienSQL
TASK #205 · Medium

Department shares add up to 94%

Your brief
A presentation needs each department's share of the company headcount, as a percentage with one decimal place.

In the report every share came out as a whole number, and together they add up to only 94%, although each department's headcount is correct.

Output name (department name) and headcount_share (the department's share of all company employees, in percent, rounded to 1 decimal place).
Expected columnsname headcount_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