Get the App
SLTechnology News&Howtos  ›  Database  › 

Oralce simple conditional query exercise

Shulou Source: shulou.com Published: 2022-06-01 06:32:49 09月20日 Update

Chapter 1 simple query and conditional query

01. Log in using the SQL PLUS tool and the user name is scott.

02. Query the name, department number and salary of all records in the emp table, and the column names should be displayed in Chinese.

03. Query the emp table for records with salaries greater than 1500, and sort them in descending order.

04. Query the records in the emp table where the comm field is null.

05. Query out the records of several departments in the emp table. (use DISTINCT to remove duplicate records)

06. Query the records with department number 10 or 20 in the emp table (use the OR and IN keywords, respectively)

In:

OR:

07. Query the emp table for the record with the second letter An of the name.

08. Query all employees hired in 1981 or May 1987 in the emp table.

09. Select all employees of department 30.

10. List the names, numbers and department numbers of all clerks (CLERK).

11. Identify all employees whose bonus is higher than their salary.

twelve。 Identify all employees whose bonus is 30% higher than their salary.

13. Find the details of all managers (MANAGER) in department 10 and all clerks (CLERK) in department 20.

14. Find the details of all the managers (MANAGER) in department 10 and all clerks (CLERK) in department 20, who are neither managers nor CLERK but whose salary is greater than or equal to 2000.

15. Find out the different jobs of the employees who receive the bonus.

16. Identify employees who do not receive bonuses or receive bonuses of less than 100.

17. Displays the name of an employee whose name does not have an R.

18. Displays the details of employees, sorted by name.

19. Displays the employee's name and date of employment, and ranks the oldest employee first according to the number of years of service.

20. Display the names, jobs and salaries of all employees, sorted by descending order of work, or by salary if the jobs are the same.

21. Displays the names of all employees who contain An anywhere in the name field.

Tags: Employee name query department bonus salary clerk job manager salary data sort field condition different same location key keyword letter Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Information Huawei Linux MariaDB