#第三章练习题
#1、查询员工12个月的工资总和，并起别名为ANNUAL SALARY
#理解1：计算12个月的基本工资
SELECT employee_id,last_name,salary * 12 AS 'ANNUAL SALARY'
FROM employees;

#理解2：计算12个月的基本工资和奖金
SELECT employee_id,last_name,salary * (1 + IFNULL(commission_pct,0))*12 AS 'ANNUAL SALARY'
FROM employees;

#2、查询employees表中去除重复的job_id以后的数据
SELECT DISTINCT job_id
FROM employees;

#3、查询工资大于12000的员工姓名和工资
SELECT first_name,last_name,salary
FROM employees
WHERE salary > 12000;

#4、查询员工工号为176的员工姓名和部门号
SELECT employee_id,first_name,last_name,department_id
FROM employees
WHERE employee_id = 176;

#5、显示表departments的结构，并查询其中的全部数据
#查询结构
DESCRIBE departments;
#查询全部数据
SELECT *
FROM departments;