display the average salary of employees for each department who gets a commission percentage.
SELECT department_id ,  AVG(salary) FROM employees WHERE commission_pct != "null" GROUP BY department_id
average salary = AVG(salary); for each department = GROUP BY department_id; who gets a commission percentage refers to WHERE commission_pct IS NOT NULL;