Oracle simple query statement 1. select * from emp where deptno = 30; 2. select all employees in department 30. list the names, numbers, and department numbers of all clerks. select ename, empno, deptno from emp WHERE job = 'cler'; 3. select * from emp where comm> sal; 4. select * from emp where comm> (60%) * sal; 5. find out the details of all managers in department 10 and all clerks in department 20 select * from emp where (deptno = 10and job = 'manager ') or (deptno = 20and job = 'cler'); 6. find all managers in department 10 and all clerks in department 20, neither a manager nor a clerk, but with high salaries Details of all employees equal to or equal to 2000 www.2cto.com select * from emp where (deptno = 10and job = 'manager') or (deptno = 20and job = 'cler ') or job notin ('manager', 'cler') and sal> = 2000; 7. find out the different job selectdistinct job from emp where comm isnotnull; 8. select * from emp where comm isnullor comm <100; 9. find all employees employed on the last three days of each month. Select * from emp where last_day (hiredate)-hiredate = 2; 10. select * from emp where months_between (sysdate, hiredate)/12> = 12; 11. display the names of all employees in uppercase: select INITCAP (ENAME) from emp; 12. select ENAME from emp where length (ename) = 5; 13. show employee names without R: www.2cto.com select ENAME from emp where ename notlike '% R %'; 14. display the first three characters of all employees: select substr (ename, 1, 3) from emp; 15. show the names of all employees, replace all Ase with Lectreplace (ename, 'A', 'A') from emp; 16. displays the names and employment dates of employees who have served for 10 years: select ename, hiredate from emp where months_between (sysdate, hiredate)/12> = 10; 17. displays detailed information about employees. select * from emp orderby ename; 18. display the name and date of employment of the employee. Sort the oldest employee in front of select ename, hiredate from emp orderby hiredate asc; 19 Based on the service life. displays the names, jobs, and salaries of all employees. Jobs are sorted in descending order. If jobs are the same, select ename, job, sal from emp orderby job desc, sal; 20. display the names of all employees, the year and month of joining the company, by employment day The month where the period is located. If the month is the same, the employees of the earliest year are ranked first. Select ename, to_char (hiredate, 'yyyy/mm') from emp orderby to_char (hiredate, 'mm'), to_char (hiredate, 'yyyy') asc; 21. displays the daily salary of all employees in the case of 30 days in a month, ignoring the remainder select round (sal/30) from emp; www.2cto.com 22. select * from emp where to_char (hiredate, 'mm') = 2; 23. for each employee, select ename, round (sysdate-hiredate) emp_date from emp; 24. select ename, to_char (hiredate, 'yyyy') | 'Year' | to_char (hiredate, 'mm ') | 'month' | to_char (hiredate, 'dd') | 'day' from emp; the author listens to the storm at midnight.