Exercise 1: Query the employee information of department 90
#练习:查询90号部门的员工信息
SELECT * FROM employees
WHERE department_id = 90; #过滤条件
Exercise 2: Query the employee information of department 90
#练习:查询last_name为'King'的员工信息
SELECT * FROM employees
WHERE last_name = 'King'
Exercise 3: Query the total salary of employees for 12 months, and alias it as ANNUAL SALARY
SELECT employee_id,last_name,first_name,salary * 12 "ANNUAL SALARY"
FROM employees
Exercise 4: Query the data after removing duplicate job_id in the employees table
SELECT DISTINCT job_id FROM employees
Exercise 5: Query the data after removing the duplicate job_id in the employees table
SELECT last_name,first_name,salary
FROM employees
WHERE salary>12000
Exercise 6: Query the name and department number of the employee whose employee number is 176
SELECT last_name, department_id
FROM employees
WHERE employee_id = 176;
Exercise 7: Display the structure of the table departments and query all the data in it
DESC departments; #查询表结构(DESCRIBE或DESC)
SELECT * FROM departments; #查询全部数据