SELECT employee_id,last_name,salary *12 "ANNUAL SALARY"
FROM employees;
#计算12月的基本工资和奖金
SELECT employee_id,last_name,salary * 12 * (1+IFNULL(commission_pct,0))"ANNUAL SALARY"
FROM employees;
#查询employees表中去除重复的job_id以后的数据
SELECT DISTINCT job_id
FROM employees;
#查询工资大于12000的员工姓名和工资
SELECT last_name,salary
FROM employees
WHERE salary > 12000;
#查询员工号为176的员工的姓名和部门名
SELECT last_name,department_id
FROM employees
WHERE employee_id = 176;
#显示表departments的结构,并查询其中的全部数据
DESCRIBE departments;
SELECT * FROM departments;
select练习
于 2022-03-31 20:31:10 首次发布