Advertisement
den4ik2003

Untitled

Feb 22nd, 2023
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.65 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. FROM topic_2.salary
  16. GROUP BY department_nm
  17.  
  18. 32
  19. SELECT department_nm FROM topic_2.salary
  20. GROUP BY department_nm
  21. ORDER BY SUM(salary) ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement