You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
319 B
MySQL
6 lines
319 B
MySQL
5 years ago
|
/*15. Write a query in SQL to display the name of the department, average salary and number of employees working in that
|
||
|
department who got commission.*/
|
||
|
SELECT department_name, AVG(salary), COUNT(commission_pct)
|
||
|
FROM departments
|
||
|
JOIN employees USING (department_id)
|
||
|
GROUP BY department_name;
|