
#Zadanie 1
SELECT departments.dept_name, COUNT(*) as nmb FROM
  dept_manager INNER JOIN departments ON dept_manager.dept_no = departments.dept_no
GROUP BY departments.dept_name
ORDER BY nmb DESC, dept_name;


#Zadanie 2
SELECT COUNT(*) as nmb FROM
  employees 
  WHERE employees.birth_date<STR_TO_DATE('20, 07, 1969', '%d,%m,%Y') AND
employees.gender='M';

#Zadanie 3
SELECT AVG(salary) FROM salaries
WHERE from_date<=STR_TO_DATE('13, 12, 1991', '%d,%m,%Y') AND
  to_date>=STR_TO_DATE('13, 12, 1991', '%d,%m,%Y');
