Advertisement
den4ik2003

Untitled

Feb 22nd, 2023
829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.84 KB | None | 0 0
  1. 28
  2. SELECT employee_nm FROM topic_2.salary
  3. ORDER BY salary DESC;
  4. --
  5. 29
  6. SELECT department_nm, AVG(salary) AS avg_salary,
  7.        MIN(salary) AS min_salary, MAX(salary.salary) AS max_salary, COUNT(*) AS number_of_people
  8. FROM topic_2.salary
  9. GROUP BY department_nm
  10. ORDER BY avg_salary DESC;
  11.  
  12. 30 - 31
  13. SELECT (MAX(salary) - AVG(salary)) AS Отклонение_Максимальной_От_Средней,
  14.        (MAX(salary) - MIN(salary)) AS Отклонение_Максимальной_От_Минимальной, department_nm
  15.         -- (AVG(salary) - MIN(salary) AS Отклонение_Средней_От_Минимальной) - эту строчку для 31 надо добавить ещё
  16. FROM topic_2.salary
  17. GROUP BY department_nm
  18.  
  19. --
  20. 32
  21. SELECT department_nm FROM topic_2.salary
  22. GROUP BY department_nm
  23. ORDER BY SUM(salary) ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement