SQL Questions Only
SQL Questions Only
__________________________________________________________________________________
PRACTICE QUESTIONS
DEPT TABLE :
EMP TABLE :
SUB QUIRES:
53. List the details of the emps whose salaries more than the employee BLAKE
54. List the emps whose Jobs are as ALLLEN.
55. List the emps who are senior to King.
UPDATE:
DELETE:
JOINS :
113. List the total information of EMP table along with Dname and Loc of all the emps
working under ‘ACCOUNTING’ or ‘RESEARCH’ in the asc Deptno.
114. List the Empno, Ename, Sal, Dname of al the ‘MANAGER’ and ‘ANALYST’
working in New York or Dallas with an exp more than 7 years without receiving the
Comma sc order of Loc.
115. Display the Empno, Ename, Sal, Dname, Log, Deptno, Job of all emps working at
CHICAGO or working for ACCOUNTING dept with Ann sal >28000, but the Sal
should not be = 3000 or 2800, Who doesn’t belongs to the Manager and Whose No.
having a digit ‘7’ or ‘8’ in 3rd position in the asc order of Deptno and desc order of
Job.
116. Display the total information of the emps along with Grades I the asc order of grade.
117. List all the grade 2 and Grade 3 emps.
118. Display all grade 4.5 Analyst and Manager.
119. List the Empno, Sal, Dname, grade, Experience and Annual sal of emps working for
Dept 10 or 20.
120. List the details of the Depts along with Empno, Ename or without the emps.
121. List the emps whose are senior to their own Manager.
122. List the emps of Deptno 20 whose Jobs are same as Deptno 10.
123. List the emps whose Salary is same as FORD or SMITH in desc order of Salary.
124. List the emps whose Jobs are sale as MILLER or Sal is more than ALLEN.
125. List the emps whose Sal is more than the total remuderation of the SALESMAN.
126. List the emps who are senior to BLAKE working at CHICAGO & BOSTON.
127. List the emps of Grade 3,4 belongs to the dept ACCOUNTING and RESEARCH
whose Sal is more than ALLEN and exp more than SMITH in the asc order of Exp.
128. List the emps whose jobs same as SMITH or ALLEN.
129. List the most recently hired employee of Grade 3 belongs to the Loc CHICAGO.
130. List the emps with their Dept names.
131. List the emps who are not working in ‘Sales’ dept.
132. List the emps Name, Dept, Sal & Comm for those whose Salary is between 2000
and 5000 and Loc is Chicago.
133. List the emps whose Salary is greater than his Manager’s salary.
134. List the Grade, Ename for the Deptno 10 or 30 but grade is not 4 while they joined
in the company before ’31-Dec-82’.
135. List the ename, Job, Dname, Loc for those who are working as a MANAGERS.
136. List the emps whose Manager name is ‘Jones’ & also List their Manager names.
137. List the Name and Salary of Ford if his Salary is equal to Hisal of his Grade.
138. List the Name, Job, Dname, Mgrno, Salary, grade Dept wise.
139. List the emps Name, Job and MGR without Manager.
140. List the Name, Salary, Comm for those emps whose Net pay is greater than or equal
to any other employee Salary of the company.
141. List the emps whose Sal is less than his Manager but more than other Managers.
142. List the Mgrs who are not working under ‘President’ but working under other
Manager.
143. List the emps who joined in the company on the same date.
144. List the employee Name, Job, Annual salary, Deptno, dept name, and grade who
earn 36000 a year and who are not CLERKS.
145. List the Name, Job and Salary of the emps who are not belonging to the department
10 but who have the same Job or Salary as the emps of dept 10
146. List the details of emps working at Chicago.
147. List the Empno, Ename, deptno, loc of all emps.
148. List the Empno, Ename, loc of dname of the depts.10 or 20.
149. List the empno, Sal, loc of emps working at Chicago sal as with an exp>6y.
150. List the emps along with of those who belongs to Dallas New York with Sal ranging
from 2000 to 5000 joined in 1981.
151. List the Empno, Ename, Sal, grade of all emps.
152. List the grade 2 & 3 emps of Chicago.
153. List the emps with loc & grade of Accounting dept or the location Dallas or Chicago
with the grades 3 to 5 & exp >6y.
154. List the grades 3 emps of Research or Operations depts. Joined after 1987 and
whose names should not be either Miller or Allen.
155. List the emps whose Job is same as Smith.
156. List the emps who are senior to Miller.
157. List the emps whose Job is same as either Allen or Sal is more than Allen sal.
158. List the emps whose Sal is greater than Blake salary.
159. List the dept 10 emps whose Sal is more than Allen Salary.
160. List the Managers who are senior to king & who are junior to Smith.
161. List the Empno, Ename, loc, Sal, Dname of all emps belongs to king dept.
162. List the emps whose grade is greater than the grade of Miller.
163. List the emps who are belongs Dallas or Chicago with the grade same as Adams or
exp more than Smith.
164. List the emps whose Sal is same as Ford or Blake.
165. List the emps details of the emp of Chicago.
166. List the Empno, Ename, Sal, Experience, TA, HRA, DA and Gross and Dname of
all emps joined in the year 1981 in the Loc NEWYORK and DALLAS with Sal
<4500.
167. List Empno, Ename, Sal, Dname, Loc of all emps working at DALLAS, with the
Sal should not more than 3500 in the desc order of sal.
168. List the information of EMP along with Loc, employee working at Loc which does
not have a char ‘a’ with the annual Salary ranging from 22000 to 40000 without
Comm.
169. List the Empno, Ename, Deptno and Dname of all emps belongs to RESEARCH
Dept.
170. List all the emps along with Location who belongs to Depts 10 or 20.
171. List the emps whose Sal is more than Blake Sal.
172. List the emps of Deptno 10 whose Jobs are same as any emp job of deptno 20.
173. List the emps who are senior to Ward.
174. List the empno, ename, Sal, Grade of all emps who belongs to the grade 3 or 4
175. List the Empno, Ename, Sal, Grade of all emps working for the mgrs 7788, 7369,
7566.
176. List all the Grade 3 ‘Analysis and ‘managers’ in the asc order of Job.
177. List all Grade 4 emps working for Research Dept along with Grade and Dname.
178. List the emps working at Chicago with the job same as the emp of DALLAS.
179. List the emps of NEWYORK whose Job is same as any emp belongs to grade 3.
180. List the details of the emps whose Jobs are same as FORD and BLAKE.
181. List the empno, ename, sal, deptno, all emps working in Accounting or sales dept.
182. List the unique job categories of emps working at Dallas in the dest order.
183. List the emps along with the dname, those are working in location which is not
having a char ‘Y’ or blank space in the ename & exp>15 Y & does not belongs the
jobs president Salesman in the asc order of exp.
184. List the empno, ename, annsal, job, loc of all emps working at Chicago, Dallas with
an annsal between 16000 to 52000 & whose job != Analyst working with some Mgr
joined in jan to June & Nov-Dec but not belongs to year 83 or 84 in the asc order of
loc.
185. List the empno, ename, sal, total details of the dept where the emps sal>3/4th of
comm. And working in dept which is not located in Boston, Dallas & whose names
are not having a chr ‘Z’ or ‘TH’ or ‘LL’ together & sal is 4 digit & it should not
ending with 0 in the asc order of loc.
186. List all Managers & Analyst of grade 3-5 with exp 8-14 Years in the asc order of
grade.
187. List the details of emps with dname, grade those who are working in Accounting
belongs to grade 3.
188. List the emps with exp & annsal of those belongs to grade 1,2,3 & desig as Clerk
OR Salesman at Chicago or NEW YORK working for the Mgr is not ending with
‘9’.
189. List the emps whose sal is more than Jones sal.
190. List the details of dept where President is working.
191. List the emps along with dname whose dname is same as Allen.
192. List the emps whose grade is same as Miller grade
193. List the empno, ename, sal, job, deptno, loc, grade of emps whose grade is same as
the emps who are working under Blake.
194. List the emps whose jobs are same as emps job of dept 20.
195. List the emps whose jobs are not same as any employee of sales dept.
196. List the emps whose Sal is more than any emp of dept 10.
197. List the emps who are senior to all emps & who are Mgrs to others.
198. List the emps whose jobs are same as Ford or Blake.
199. List the common jobs of grade 1 & emps working at Chicago.
200. List the jobs of emps available in Chicago & not available in Dallas.
201. List those Managers who are getting the sal less than his own emps Salary.
202. Find out the emps who joined in the company before their Managers.
203. List the Deptno where there are no emps.
204. List the emps of dept 20 & 30 whose experience is more than any employee of
Dept. 10.
205. Display the emps whose Grade is 3.
206. Display the Grade of ‘Jones’.
207. Display the emps who are in ‘Sales’ Dept not in Grade 3.
208. Display the emps who do not have any persons working under them.
209. Display the emps whose job is not ‘Manager’ but they are managers to some other
employees.
210. Display the Dept’s whose name start with‘s’ while the Loc name ends with ‘k’.
211. Print the details of all the emps who are sub-ordinates to Blake.
212. List the emps who are working as Managers using co-related sub-query.
213. List the emps whose Managers name is ‘Jones’ and also with their managers name.