0% found this document useful (0 votes)
30 views8 pages

SQL 60 Queries

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views8 pages

SQL 60 Queries

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Oracle SQL queries-Practice

SQL QUERIES

1) Display the details of all employees

2) Display the depart information from department table

3) Display the name and job for all the employees

4) Display the name and salary for all the employees

5) Display the employee no and totalsalary for all the employees

6) Display the employee name and annual salary for all employees.

7) Display the names of all the employees who are working in depart number 10.

8) Display the names of all the employees who are working as clerks and

drawing a salary more than 3000.

9) Display the employee number and name who are earning comm.
10) Display the employee number and name who do not earn any comm.

11) Display the names of employees who are working as clerks,salesman or

analyst and drawing a salary more than 3000.

12) Display the names of the employees who are working in the company for

the past 5 years;

13) Display the list of employees who have joined the company before

30-JUN-90 or after 31-DEC-90.

14) Display current Date.

15) Display the list of all users in your database(use catalog table).

16) Display the names of all tables from current user;

17) Display the name of the current user.

18) Display the names of employees working in depart number 10 or 20 or 40

or employees working as CLERKS, SALESMAN or ANALYST.


19) Display the names of employees whose name starts with alphabet S.

20) Display the Employee names for employees whose name ends with alphabet S.

21) Display the names of employees whose names have second alphabet A in their
names.

22) select the names of the employee whose names is exactly five characters in
length.

23) Display the names of the employee who ar e not working as MANAGERS.

24) Display the names of the employee who are not work ing as SALESMAN OR

CLERK OR ANALYST.

25) Display all rows from EMP table. The system should wait after every

Screen full of information.

26) Display the total number of employee working in the company.

27) Display the total salary beiging paid to all employees.


28) Display the maximum salary from emp table.

29) Display the minimum salary from emp table.

30) Display the average salary from emp table.

31) Display the maximum salary being paid to CLERK.

32) Display the maximum salary being paid to depart number 20.

33) Display the minimum salary being paid to any SALESMAN.

34) Display the average salary drawn by MANAGERS.

35) Display the total salary drawn by ANALYST working in depart number 40.

36) Display the names of the employee in order of salary i.e the name of

the employee earning lowest salary should salary appear first.


37) Display the names of the employee in descending order of salary.

38) Display the names of the employee in order of employee name.

39) Display empno,ename,deptno,sal sort the output first base on name and

within name by deptno and with in deptno by sal.

40) Display the name of the employee along with their annual salary(sal*12).The
name of the employee earning highest annual salary should apper first.

41) Display name,salary,hra,pf,da,total salary for each employee. The

output should be in the order of total salary,hra 15% of salary,da 10% of salary,pf
5%

salary,total salary will be(salary+hra+da)-pf.

42) Display depart numbers and total number of employees working in each

department.

43) Display the various jobs and total number of employees within each job

group.

44) Display the depart numbers and total salary for each department.
45) Display the depart numbers and max salary for each department.

46) Display the various jobs and total salary for each job

48) Display the depart numbers with more than three employees in each dept.

49) Display the various jobs along with total salary for each of the jobs

where total salary is greater than 40000.

50) Display the various jobs along with total number of employees in each

job.The output should contain only those jobs with more than three employees.

51) Display the name of the empployee who earns highest salary.

52) Display the employee number and name for employee working as clerk and

earning highest salary among clerks.

53) Display the names of salesman who earns a salary more than the highest

salary of any clerk.


54) Display the names of clerks who earn a salary more than the lowest

salary of any salesman.

Display the names of employees who earn a salary more than that of

Jones or that of salary grether than that of scott.

55) Display the names of the employees who earn highest salary in their

respective departments.

56) Display the names of the employees who earn highest salaries in their

respective job groups.

57) Display the employee names who are working in accounting department.

58) Display the employee names who are working in Chicago.

59) Display the Job groups having total salary greater than the maximum

salary for managers.

60) Display the names of employees from department number 10 with salary

greater than that of any employee working in other department.

You might also like