Can be obtained in a single select ???
An example company, department, and production carried out
Obtain the percentage of production: the production of the person between the production of his department of his department (production person * 100 / production department
-
Department production:
select departamento, sum(produción) from empresa group by departamento
-
Worker production
select dni, departamento,sum(produción) from empresa group by dni,departamento