By department, display average salary of employees who get a commission percentage
SELECT department_id ,  AVG ( salary )  FROM employees WHERE commission_pct ! =  "null" GROUP BY department_id
average salary by department = AVG(salary) GROUP BY department_id; employees who get a commission percentage refers to commission_pct != 'null';