#count
#作用:
SELECT COUNT(employee_id),COUNT(salary),COUNT(salary*12)
FROM employees;
SELECT COUNT(1)
FROM employees;
SELECT COUNT(4)
FROM employees;
SELECT COUNT(*)
FROM employees;
SELECT COUNT(commission_pct)
from employees;
SELECT commission_pct
from employees
where commission_pct is not NULL;
SELECT 72+35
SELECT AVG(salary),SUM(salary)/COUNT(salary),
AVG(commission_pct),SUM(commission_pct)/COUNT(commission_pct),
SUM(commission_pct)/107
from employees;
SELECT AVG(commission_pct)
from employees;
SELECT AVG(commission_pct)/COUNT(1)
from employees;
SELECT AVG(salary),MAX(salary)
from employees;
SELECT department_id,AVG(salary),MAX(salary)
from employees
GROUP BY department_id;
SELECT job_id,AVG(salary)
from employees
GROUP BY job_id;
SELECT department_id,job_id,AVG(salary)
from employees
GROUP BY department_id
,job_id;
SELECT department_id,job_id,AVG(salary)
from employees
GROUP BY job_id ,department_id;
-- ----------------
SELECT departmen_id,job_id,AVG(salary)
from employees
GROUP BY department_id;