You are on page 1of 5

TABLE NAME :- EMP

EMP_ID FNAME LNAME SALARY HIERDATE DEPT_ID


1 Rahul Salunke 45000 1-JAN-2010 10
2 Sagar Shinde 39000 19-APR-1990 10
3 Amol Amte 67000 15-DEC-1998 40
4 Sachin Sharma 22000 27-AUG-2005 20
5 Amar Jagtap 35000 31-DEC-2000 30
6 Mangesh Patil 29000 16-FEB-1996 60

TABLE NAME:- DEPT

DEPT_ID DEPT_NAME LOC_ID


10 Hr 11
20 It 22
30 Devlopment 33
40 Testing 44
50 Designing 55
60 Managment 66

TABLE NAME:- LOC

LOC_ID LOC_NAME
11 Pune
22 Mumbai
33 Satara
44 Banglore
55 Goa
66 Delhi
GRADE

GRADE MIN_SAL MAX_SAL


10 20001 30000
20 30001 40000
30 40001 50000
40 50001 60000
50 60001 70000
60 70001 100000000

CREATE TABLES .

ADD CONSTRAINTS ON TABLE.

ADD PRIMARY KEY.

ADD FOREIGN KEY.

ADD NOT NULL ON SALARY.

INSERT VALUES INTO THE TABLE.

1. Display all the information of the EMP table?


2. Display unique fnames from EMP table?
3. List the emps in the asc order of their Salaries?
4. List the details of the emps in asc order of the Deptid and desc of salary?
5. Display all the unique salary group by deptid in the descending order?
6. Display all the details of all emps who work in ‘Hr’ department?
7. List the emps who joined before 2000?.
8. List the EmpID, fname, Salary, Daily sal of all emps in the asc order of Annual salary
9. Display the Empid, fname, Hiredate of those emp who have experience more than Rahul.
10. List the Empid, fname, Salary, Experience of all emps who work for it department.
11. Display all the details of the emps whose daily Salary greather than 200.
12. . List the emps in the asc order in fname of those joined after the second half of 2005.
13. List the emps whose experience grteater than 15 years and daily salary greater than 1000.
14. List the emps who are work in either ‘Hr’ or ‘It’ department in the Desc order.
15. List the emps by their seniority.
16. List the emp who are working for the Deptid 10 or20.
17. List the emps who are joined in the year 2000 to 2005.
18. List the emps who are joined in the month of Aug 2005.
19. List the emps Who Annual sal from 100000 and 150000.
20. List the fnames those are having five characters in their Names.
21. List the fnames those are starting with ‘S’ and with five characters.
22. List the emps those are having four chars and second character must be ‘m’.
23. List the Five character names starting with ‘S’ and ending with ‘n’.
24. List the emps who joined in January.
25. Display the last character of the fname.
26. Display the emp detail whose second last character of lname is ‘i’;
27. List the emps who joined in the month of which second character is ‘e’.
28. . List the emps whose annual Sal is five digit number ending with three 0.
29. List the emps whose names having a character set ‘Sa’ together.
30. List the emps those who joined in 90’s.
31. List the emps who does not belong to Deptno 20 in four ways.
32. List all the emps except ‘10 & ‘30” in asc order of Salaries.
33. List all the emps who joined before or after 2000.
34. List the emps who are working in 30 detpid.
35. List the emps who joined in any year but not belongs to the month of March.
36. List the emps of Deptid 30 or 10 joined in the year 2000.
37. Display the details of Sachin.
38. . Display the location of RAHUL.
39. List the total information of EMP table along with Deptname and locname of all the emps Working
at pune loc.
40. List the Empid, fname, Salary, Deptid of all the ‘devlopments’ and ‘it’ department who working in
Mumbai , with an exp more than 7 years .
41. Display the Empid, fname, Salary, Deptname, Locid,locname, Deptid of all emps working at Mumbai
and work in It departments
42. Display the total information of the emps along with loc name in asce order.
43. List all the detail of emp who work in 20 ,30 department.
44. . List the empid, fname, Salary, Deptname, experience, and Annual Sal of emps working for Dept10
or20.
45. List all the information of emp with Loc and the deptname of all the emps belong to the salary range
from 30000 to 50000 and those fname are ending with ‘l’ & ’r’ and those are join in 2000 to 2005.
46. List the details of the departments along with Empno, Ename or without the emps.
47. List the details of the emps whose Salaries more than the employee sagar’s salary.
48. List the emps whose department are same as Rahul.
49. List the emps who are senior to Amar.
50. Display the emp who have all seniors.
51. List the Emps of Deptno 20 .
52. List the Emps whose Salary is more thn mangesh salary in desc order of Sal.
53. List the emps Whose department are same as Amol or Sal is more than Sagar.
54. List the Emps whose annual Salary is > the total salary where group by deptid.
55. List the emps who are senior to Amar working in Hr department.
56. List the Emps work in Hr and Management whose daily Salary is more than 700 and experience
more than shindes experience in the asc order by EXP.
57. List the emps whose department same as rahul or mangesh.
58. List the deptname who have 0 employee.
59. Find the highest sal of EMP table.
60. Find the lowest sal of EMP table.
61. Find the average sal of EMP table.
62. Find the total sal of EMP table.
63. Find details of highest paid employee.
64. . Find the highest paid employee in each department.
65. List the most recently hired 2 emps.
66. List the employees who are senior to most recently hired employee.
67. Find years between most old employee and recently hier employee.
68. Display fname, salary,locname of the highest paid employee who’s location is pune or Mumbai or
delhi.
69. List the employees who’s salary Is greater than most senior employee .
70. Display the deptname of the most senior employee.
71. Display the average salary by department.
72. List the employee in dept 10 whose sal is >the average sal of dept 20 emps.
73. Display the number of employee in each dept.
74. List the department,details where at least two emps are working.
75. Display the Number of emps, and max sal of each location.
76. Display the location name where at least one emp can work.
77. Display the details of the deptid , deptname where maximum number of emps are working.
78. Display the emps whose work at locid 33.
79. List the employees whose salary is more than 30000 after giving 20% increment.
80. Display the all details of emp table and department table.
81. List the emps who are not working in testing or designing dept.
82. . List the emps name ,deptname, salary. For those whose salary is between 30000 and 50000 while
loc is pune.
83. List the emps whose annual salary is greater than 250000.
84. Display all the details of EMP for the deptno 10 or deptno 30 while they joined the company before
’31-dec-2000’.
85. List the fname ,lname, dname, location for those who are working in It department.
86. List the emp full name , salary and dname whose lname third last character is ’n’ and sort on the
basis of highest sal.
87. List the names of the emps who are getting the lowest sal dept wise.
88. List the emps whose sal is equal to the average .
89. List the no. of emps in each department where the no. is more than 2.
90. Display the name of department where atleast 3 employee are working.
91. List the employee names and his average salary department wise.
92. LiSt the Fname,Lname, dname ,sal, grade dept wise.
93. List the empid, fname,, sal, grade and dname except IT and sort on the basis of highest salary.
94. List the all details of emp who are work at satara location.
95. List the names of the emps who are getting the highest sal dept wise.
96. List the emps whose salary is equal to the average of max and minimum from emp table.
97. List the emp whose sal< hr department salary.
98. Find out least 3 earners of the company.
99. Display the deptname who have 0 emp’s working.
100. List those Emps whose Salary is odd value.
101. List those Emps whose Salary is even value.
102. List the emps who joined in the month of DEC.
103. List the emps whose Deptid is available in his Salary.
104. List first 50% of chars of Fname in Lower Case and remaining are upper Case.

You might also like