programming-examples/sql/JoinHRDatabase/19. Write a query in SQL to display job title and average salary of employees.sql

5 lines
202 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*19. Write a query in SQL to display job title and average salary of employees.*/
SELECT job_title, AVG(salary)
FROM employees
NATURAL JOIN jobs
GROUP BY job_title;