0% found this document useful (0 votes)
21 views12 pages

Oracle 12c Practice Questions Guide

The document contains a comprehensive list of SQL queries and commands related to Oracle 12c, focusing on employee and department management. It includes tasks such as creating tables, modifying data types, displaying employee details, and performing various data retrieval operations. The queries cover a wide range of functionalities, including filtering, sorting, and aggregating data based on specific criteria.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views12 pages

Oracle 12c Practice Questions Guide

The document contains a comprehensive list of SQL queries and commands related to Oracle 12c, focusing on employee and department management. It includes tasks such as creating tables, modifying data types, displaying employee details, and performing various data retrieval operations. The queries cover a wide range of functionalities, including filtering, sorting, and aggregating data based on specific criteria.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

1) DEPT table is required with the following structure:


DEPTNO NUMBER(10)
DNAME CHAR(30)
LOC VARCHAR2(33)
2)EMP table is required with the following structure:
EMPNO NUMBER(2)
ENAME VARCHAR2(15)
JOB VARCHAR2(15)
MGR char(4)
HIREDATE DATE
SAL NUMBER(6)
COMM NUMBER(6)
DEPTNO NUMBER(2)
3) Display the DEPT details from department table.
4) Display the DEPT details from employees.
5) Display empno, ename and job for all employees.
6)Reduce the size of DEPTNO column of DEPT table to 2
7)change the data type of DNAME to VARCHAR2 and width to 15.
8)Reduce the with of LOC to 15.
9)Increase the size of EMPNO to 4.
10)Reduce the size of JOB to 10.
11)Change the data type of MGR to NUMBER(4)
12)SAL should accept 5 integers and 2 decimals.
13)COMM should accept 5 integers and 2 decimals.
14) Display all the details of all SALESMAN
15) List the emps who joined before 1982.
16) List the empno, ename, deptno, hiredate, an Exp of all Managers.
17) Display all the details of the emps whose Comm is more than their Sal
18) List the emps along with their EXP and whose Dally Sal is more than Rs200
19)JOB can be duplicate
20)COMM can be NULL
21)HIREDATE should not be SUNDAY
22)SAL should be less than or equals to 10,000
23)EMPNO should be primary key
24)DEPTNO of DEPT table should be PRMIARY KEY
25)DEPTNO of EMP table should be a foreign key to DEPTNO of DEPT table.
26) Display the names of all the employees and their experience in years.
27)Deptno of EMP table should be a foreign key to DEPTNO of DEPT table.
28) List all employees number, name, job and hiredate of employees in department 10.
29)Select the name and salary of all employees are CLERKS
30) Display the unique Dept’s of emps.
31) Display emps whose Salary is more than 2000 after giving 20% increment.
32) List the Empno,Ename and Sal is increase by 20% and expressed as No .of Rs.
33) Display the unique Dept with jobs.

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

34) List all MANGER, CLERKS


35) Display all employee names and the salaries whose salary is not the range on 1500 and
2850 and
The Column Heading to be displayed as
EMP Monthly
Name Salary
36) Display the name of the employee who don’t have any manager.
37) Display the name , salary and commission for all employees whose commission amount is
greater than their salary increased by 10%
38) Display the Ename, salary and salary increased by 15% expressed as a whole number. Label
the column New Salary. In addition to this display the increase of salary over the previous one.
For Example.
ENAMESAL NEWSAL INCREASE
--------------- -------- -------- ----------
KING 5000 5500 500
39) Display the Employee name, hiredate, salary review date which is the first Monday after 6
months of the service.
Ename Hiredate Review

KING 17-NOV-81 Monday , the Twenty-Forth of May , 1982

40) Display employee number and total salary for each employees.
41) Display employee number and annual salary for each employees.
42) Display the name of all employees who are working in department number 10
43) Display the name of all employees working as MANAGER and drawing a salary more than
2000.
44) Display employee’s number and names for employees who earn commission.
45) Display names of employees who do not earn any commission.
46) Display the names of employees who are working as CLERK, SALESMAN or ANALYST and
drawing a salary more than 2000.
47) Display the names of employees who are working in the company for the past 5years.
48) Display the list of employees who have joined the company before 31st JAN 81or30 NOV 81.
49) Display current user
50) Display current date
51) List the first 10 records of the EMP table.
52) List the emps empno, ename, sal and the column heading as Emp_Num, Emp_Name,
Salary.
53) List all the unique deptno of emps.
54) Display the job and the no. of persons working in each job type.
55) Display the name and salary of all employees who are CLERKS.
56) List the name, job and salary of everyone hired on December 17, 1980.
57) List the Department number and department number for department with numbers
greater than or equals to 20.

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

58) Select the name , salary, and commission of employees whose commission is greater than
their salary.
59) Display the names of employees working in department number 10 or 20 or and employees
woring as CLERK,MANAGER or SALESMAN.
60) Display the name, monthly salary, daily salary and hourly salary for all employees. Assume
that SAL column in the table is monthly salary; that there are 22 Working days in a month; and
that there are 8 working hours in a day. Rename the columns as MONTHLY , DAILY and hourly.
61) Display details of FORD.
62) Display the names of the employees whose name starts with alphabet M.
63) Display the names, job of employees whose job ends with alphabet R.
64) List the names of employees whose name is exactly four characters in length.
65) List the names, job of employees whose names have second alphabet.
66) Display the names of employees who are not working as managers
67) Display all employees joined on 1 MAY 1981.
68) Display empno, ename, hiredate of all employees joined before 1 JAN 1983.
69) Display employee number and total salary for each employee.
70) Display employee name and annual salary for all employees.
71) Display the name of all the employees who are working in department number 10.
72) Display the name of all the employees who work as clerks and drawing a salary more than
2000.
73) Display the employees whose names start with ‘T’ and end with ‘R’.
74) Display the employees whose exp is more than 10 years.
75) Display who are working as clerks and exp is more than 15 years.
76) How to create LST file
77) Display who are working as clerks, salesman or analyst and drawing a salary more than
3000.
78) Display the total number employees working in the company.
79) Display the total salary and total commission to all employees.
80) Display all rows from emp table. The system should wait after every screen full of
information.
81) List the names and employee number of managers who earn more than 2600, in the order
of names.
82) Select the information about managers and the president from the column job in the EMP
table, order the result by department number.
83) List the names and employees number of manages who earn more than 2600 , in the order
of names.
85) Display the minimum salary from EMP table.
86) Display the average salary from EMP table.
87) Display the maximum salary being paid to CLERK.
88) Display the maximum salary being paid in dept no 20
89) Display the minimum salary being paid to any SALESMAN
90) List the name , job and department of everyone whose name falls in the alphabetical range
from ‘C’ to ‘F’.

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

91) List the empno, ename, sal, job of emps with the annual <3400 but receiving some comm.
Which should not be greater than Sal and the desg should be Salesman working for dept 20.
92) List all the unique jobs along with deptno.
93) Display the average salary drawn by managers.
94) Display the total salary drawn by analyst working in dept no 40.
95) Display the names of employees in order of salary i.e, the name of the employee earning
lowest salary should appear first.
96) Display the names of employees in descending order of salary.
97) Display the details from emp table in order of emp name.
98) Display empno, ename,depthno and sal. Sort ithe output first based on name and within
name by deptno and within deptno by sal.
99) Display the name of employees along with their annual salary (sal*12).The name of the
employees earning highest annual salary should appear first?
100) Display all employees name start with ‘TH’ or ‘LL’.
101) Display all employees who are hired during 1983.
102) Display the data as Who..When..Ex SMITH HAS HELD THE POSITION OF CLERK IN DEPT 20
SINCE 13-JUN-83.
103) List the details of the employees in department 10 and 20 in alphabetical order of names
104) List all rows from EMP table by converting the NULL values in COMM Column to 0.
105) List all SALESMAN
106) List all managers and salesman with salaries over 1500.
107) Write a query that will accept a given job and displays all records according to the job.
108) List the names and hire dates of employees in department [Link] hire dates
as‘DD/MM/YY’.
109) How many months has the president worked for the company? Round to the nearest
whole number.
110) List all the employee names, jobs and a job classification, which you will supply. Translate
the value stored in each job filed (CLERK, MANAGER etc.,) to a job classification number
(1,2,etc).Translate CLERK to 1,MANAGER to 3,PRESIDENT to 5 and all other jobs to [Link] the
job classification column JOB-CLASS.
111) List all the emps who are working since 1st April 1982.
112) List all the emps who joined before 1985 and salary is more than 3000.
113) Give SQL commands to find the average annual salary per jobs in each department. The
SAL figures in the EMP table are for each month.
114)In one query ,count the number of people in department 30 who can receive a salary and
the number of people who receive the commission.
115) Display name, salary, Hra;pf,da,Total salary for each employees. The Output should be in
the order of total salary,hra 15% of salary, DA 10% of [Link] 5% salary Total Salary will be
salary + hra+da)-pf?
116) Display Department number and total number of employees working in each Department.
117) Display the various jobs and total number of employees working in each job group?
118) Display department number and Total Salary for each Department?
119) Display department numbers and Maximum Salary from each Department?
120) Display various jobs and Total salary for each job?

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

121) Display each job along with min of salary being paid in each job group?
122) Display the department number with more than three employees in each department?
123) Display the department number with more than three employees in each department?
124) Display various jobs along with total salary for each of the job where total salary is greater
than 4000?
125) Display the various jobs along which total number of employees in each job. The output
should contain only those jobs with more than three employees?
126) Display the emps whose job same as FORD.
127) Display the emps who are senior to KING.
128) Display the name of employees who earn Highest Salary?
129) Display the employee Number and name for employee working as clerk and earning
highest salary among the clerks?
130) Display the names of salesman who earns a salary more than the Highest Salary of the
clerk?
131) Display the names of clerks who earn a salary more than the lowest Salary of any
salesman.
132) Computer Average, Minimum and Maximum salaries of those group of employees having
the job of CLERK or MANAGER.
133) Display the department number where more than two clerks are working.
134) calculate the total compensation expense for each department for one year. The sal and
comm figures in the EMP tables are for each month. Assume that employees who don’t earn a
commission receive non-monetary benefits that are worth Rs 100-/-.
135)Do a case sensitive search for a list of employees with a job that a user enters.
136) Display the names of employees who earn a salary more than that of jones or that of
salary greater than that of scott?
137) Display the names of employees who earn salary in their respective departments?
138) Produce the names and jobs of employees as EX: SMITH (CLERK).
139 ) Which employees earn less than 30% of the president’s salary?
140 ) Display the names of employees who earn Highest salary in their respective departments?
141 ) Display the names of employees who earn Highest salaries in their respective job groups?
142 ) Create a view consisting of employees and their total sum of salary grouped by
department number wise.
143) Display employee names who are working in Accounting Department?
144 ) Display the employee names who are working in Chicago?
145) Transfer SMITH to deptno 10?
146) Transfer the emps of dept 20 to 30.
147) Transfer the emps CHICAGO TO DALLAS.
148) create a view consisting of all the columns from EMP table and their corresponding
records from dept table consisting of department name and location.
149) how many employees are working in NEW YORK.
150) Update the salary of ‘ALLEN’ with the highest paid emp of Grade 2 and transfer him to
BLAKEs dept and change the MGR to BLAKE.
151) Create a query at will display the employee name , dept number and all the employees
name that work in the same dept as a given employees.

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

152) Display dept name, location, number of employees and the average salary for all
employees in that dept.
153) Display the employee name and his manager’s name.
154) Display the employee’s name, department’s name, grade and manager’s naeme.
155) Print the following: salary itself it is.’HIGH’ if it is more than.’LOW’ if it is less than 1500.
156) Display the job groups having Total salary greater than the maximum salary for Managers?
157) Display the names of employees from department’s number 10 with salary than that of
ANY employee working in other department?
158) Display the names of employees in Upper Case?
159) Display the names,jobs of employees in Lower Case?
160) Display the names of employees in proper case?
161)Find the length of your name using Appropriate Function?
162) Display the length of all the employee names?
163) List department number, department name, location, commission paid and total salary of
each department.
164) Display the average monthly salary bill for each job type with in a department.
165) Display those jobs where the minimum salary is greater than or equal to 3000.
166) Display the name of employees concatenate with Employee number?
167) Use appropriate function and extract 3 characters starting from 2 characters from the
following string ‘Oracle’ i.e., the output should be ac?
168) Find the first occurrence of character 0 from the following string xyzTechnologies.
169) Increment the Salaries by 5% and a comm. Of 300 to the existing comm. and changing the
clerk to jobs of all ‘salesman’ whose salaries is more than or equal to 1500.
170) Increment the sales of the emps by 5%.
171) Increment the sal of all the by Rs 500 and change their MGR to 7902.
172) Change the MGR of all BOSTON related emps FORD.
173) Transfer the emps to analyst dept and give the sal of smith plus 500 to those belongs to
grade 3 working at NEW YORK or DALLAS with an exp >7 y whose name should not be chars.
174) Find out the difference between highest and lowest salaries.
175) Find all department, which have more than 3 employees.
176) List lowest paid employee working for each manager, exclude any group where the
minimum salary is less than 1000, in the reverse order of salaries.
177) Display all employee names and their department names in the order of department
names.
178) Display all employee name, department numbers, and department names.
179) Replace every occurrence of alphabets A with B in the string. Aliens(Use Translate
function)?
180) Display the information from the employee table. Where ever job Manager is found it
should be displayed as Boss?
181) Display emypno, ename, deptno from emp table. Instead of display department numbers
display the related department name (Use decode function)?
182) Display your Age in Days?
183) Display your Age in Months?
184) Display current date as 15th August Friday Nineteen Ninety Seven?

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

185) Display the following output for each row from emp table?Scott has joined the company
on 13th August nineteen ninety?
186) Update the dept no of sales dept for those emps working at dept no 10.
187) update the salary of FORD with the highest paid salary emp of SALESMAN more than 8
year exp.
188) Change the mgr to 7788 for those working for the mgr 7369.
189) Display the departments that have no employees.
190) Find all employees who joined the company before their managers.
191) Find the employees who earn more than the lowest salary in each department.
192) Add 300 to the comm. Of all SALESMAN who are receiving some comm.
193) Change the dept no of FORD to 30 and also change the job as SALESMAN with an
increment in the Salary 8%.
194) Display employees who earn more than the lowest salary in each department 30.
195) Find the job with highest average salary.
196) Display the name,job, and heiredate for employees whose salary is more than the highest
salary in SALES dept.
197) Transfer the emps of dept 20 to SALES dept.
198) Given an increment of 300 to all emps of grade 2.
199) replace the sal of SMITH with the highest paid CLERK of NEW YORK or DALLS.
200) Display all the employees whose grade is the same as that of JONES.
201) Display the empnames, salary of all who report to KING.
202) Display the empname,gross,job,loc who are having more than JONES Gross.
203) Display current date and 78 days after.
204) Find the nearest Saturday after Current date?
205) Display the current time?
206) Delete all the information of CLERKS.
207) Delete all Grade 2 emps.
208) Delete all employees who joined in the month of DEC 1981.
209) Delete all the emps working in NEW YORK.
210) Delete all the emps who are senior than their manager.
211) Display the date three months before the Current date?
212) Display the common jobs department number 10 and 20?
213) Display current date and 78 days after.
214) Display the current date in the following fashion.
215) Display Employee name and Job information from employee in the following fashion.
216) Display all the information from depart table where second character of LOC name is ‘A’.
217) Display the last date in Feb-97.
218) Display logged on user name in the following fashion. Current User Name is : SCOTT
219) Display ‘NARESH TECHNOLOGY IS VERY GOOD FOR ORACLE; text as ‘Naresh Technology is
Very Good FOR ORACLE’ in a Select statement.
220) Select employee name ,Hiredate in the format of ‘’2nd of July 1997’’ for deptno 10 and 20.
221) Display employee names in lower case whose salary is greater than 2000 and less than
2800.
222) Display the jobs found in department 10 and 20 Eliminate duplicate jobs?

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

223) Display the details of those employees who do not have any person working under him?
224) Display the details of those employees who are in sales department and grade is 3?
225) Display those employees whose manager name is Jones?
227) Display those employees whose salary is more than 3000 after giving 20% increment?
226) Display those employees with their department names?
228) Display all employees with their department names?
229) Display all the emps working under FORD with exp>5year.
230) Delete the information FORD,SCOTT.
231) delete the emps who joined most recently under FORD.
232) create a unique index for employee names of emp table.
233) Assuming the salary of emp table as for a month, produce annual salary with heading as
ANNUAL SALARY’.
234) Select employee number and name combined to together with a heading ‘EMPLOYEE’.
235) Display in how many department employees are working.
236) List the employees who are having experience of more than 10 years.
237) List the employees who have ‘I’ or ‘LL’ as the exact middle characters(s) of their names.
238) List the employees whose name bigger than their manager’s name.
239) List the employees who are managers of clerk with salary more than 2000.
240) find all the managers in any department and all clerks in department 10 only.
241) List the employee names by adding ‘_’ on left side, to the double of the actual size of the
name.
242) Display ename who are working in sales department?
243) List the total information of EMP table along with dname and loc of all the emps employee
and department tables.
244) Display employee number, employee name, department name, location from employee
and department tables.
245) Display employee number,employee name, salary +comm as TOTAL,location from
employee and department tables.
246) Display the empno,ename,sal,dname,loc of all CLERK or MANAGER working in NEW YORK
or CHICAGO with an exp more than 8 years without receiving the COMM.
247) Display employee name, department name, job from employee and department tables
who job is CLERK.
248) Display employee name, deptno,dname from employee and department table where
location is DALLAS.
249) Display empno, ename, deptno,dname from emp and dept who empno is 7788 or 7902.
250) Display first 3 characters of employee name, job, sal, comm,location from employee and
department tables who works in department 20 or 30, salary should be more than 1000 comm
as not
251) Delete the emps who joined most recently under KING.
252) Delete grade 3 and 4 emps.
253) List the employee names where the second occurrence from second position is ‘A’.
254) Display employee name,job,hirdate and salary combined together without using that ‘II’
operator.

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

255) Display employee name,dept name,salary, and commission for those sal in between 2000
to 5000 while location is Chicago?
256) Display those employees whose salary is greater than his managers salary?
257) Display those employees who are working in the same dept where his manager is work?
259) Display the grade and employees name for the deptno 10 or 30 but grade is not 4 while
joined the company before 31-DEC-82?
260) update the salary of each employee by 10% increment who are not eligible for
commission?
261) Delete those employees who joined the company before 31-DEC-82 while their
department Location is New York or Chicago?
262) delete the emps who belongs to Grade 2 or 3 working at Chicago joined in any month of
the first half of 82.
263) Delete duplicate records in the emp table.
264) Delete those dept’s where no employee is working.
265) Delete the emps who are senior to their own managers.
266) List all managers from all department and all clerks from department 10 only.
267) List all employee names from EMP table if the name contains second and last-but-one
character as W.
268) List all columns from both the DEPT and EMP table.
269) Display different jobs and the number of employees working from EMP table.
270) Display the different between total salary of department 10 and department 20.
271) Display first 3 characters of employee name, job, sal, comm, location from employee and
department tables who works in department 20 or 30, salary should be more than 1000 comm
as not null.
272) Display location, department name,dname,average salary for each department name for
employee number 7788,7902,7346..
273) Display and location and sum of the salary spending for employees on that location
respectively.
274) Select department number, dname,average salary for each department.
275) Select department number,name where atleast 3 employees works.
276) Select department name,location where the average salary in each department more than
1600.
277) Count how many employees have ‘S’ in their names.
278) Product this format.
EMPLOYEE……………………………………………..JOB
SMITH……………………………………………..CLERK
ALLEN…………………………………..SALESMAN
279) Display employee name,job deptno,loc for all who are working as manager?
280) Display name and salary of ford if his salary is equal to hisal of his grade?
281) Display those employees whose manager name is Jones and also display their manager.
282) Display those employee name, job, department, his manager name, his grae and make an
under department wise?
283) List out all the employee names,job,salary,grade and depart name for everyone in a
company except ‘CLERK’.Sort on salary display the highest salary?

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

284) Display employee name, job and his manager. Display also employees who are without
managers?
285) Display Top 5 employee of a Company?
286) Display those employees whose salary is equal to average of maximum and minimum?
287) Select count of employees in each department where count >3.
288) Display dname where atleast three working and display only deptname?
289) Display name of those managers name whose salary is more than average salary of
Company?
290) List employee names and hirdates by adding one year to the date.
291) List the employee names who have minimum and maximum experience.
292) Display those managers name whose salary is more than average salary of his employees?
293) Display employee name,sal,comm and netpay for those employees whose netpay is
greater than or equal to any other employee salary of the company?
294) Display those employee whose salary is less than his manager but more than salary of
other managers?
295) Find the last 5(least) employees of company?
296) Find out the number of employees whose salary is greater than their managers salary?
297) Display the manager who are not working under president but they are working under any
other manager?
298) Delete those records from emp table whose deptno not available in dept table?
299) Display those enames whose salary is out of grade available in salgrade table?
300) Display name of those employees whose salary is odd value?
301) Display name of those employees who are going to retire 31-DEC-99 If maximum job
period is 30 years?
302) Display those empoyees whose salary is odd value?
303) Display those employees whose salary contains atleast 3 digits?
304) Display those employees who joined in the company in the month of Dec?
305) Display the Cartesian product of EMP and DEPT tables.
306) Display those employees whose name contains A?
307) Display those employees whose deptno is available in salary?
308) Display those employees whose first 2 characters from hiredate –last 2 characters sal?
309) Count how many duplicate records are there in the EMP table.
310) List ROWIDS from EMP table.
311) create a view with different job and sum of salary from EMP table. Is manipulation
possible in the view?
312) Create a view with EMPNO, ENAME,JOB, and [Link] manipulation possible in the view
directly?
313) Display those employees whose 10% of salary is equal to the year joining?
314) Display those employees who are working in sales or research?
315) Display those employees who joined the company before 15th of the month?
316) Create a view with DNAME,ENAME,[Link] it possible to manipulate the view directly?
317) Get all department numbers, which are present in DEPT table but not in EMP table.
318) List all the employees who are hired in last week of a month.
319) Delete those employee who joined the company 10 years back from today?

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

320)who are the top three earners of the company?


321)In the employee table if the job is ‘CLERK’ change It to ‘WORKER’ if job is ‘MANAGER’
change it to ‘BOSS’, otherwise change it to ‘EMPLOYEE’.
322) Find all employees who have the job equal to that of SMITH.
323) Create a sequence and change the employees’ number of EMP table into serial numbers.
324) Display the experience of employees in years,month,weeks and days.
325) Write a query to display a character in Pyramid format.
326) Count the number of employees who are working as manager(Using set operatory)
327) Display the name of employees who joined the company on the same date.
328) Display the name of the dept those employees who joined the company on the same date.
329) Display those employees whose grade is equal to any number of sal but not equal to first
number of sal?
330) Count the no of employees working as manager using set operation?
331) Display the name of employees who joined the company on the same date?
332) Display the manager who is having maximum number of employees working under him?
333) What is name of Default Index(in case of Primary key, Unique).
334) List out the employee name and salary increased by 15% and express as whole number of
Dollars?
335) Produce the output of the emp table ‘’Employee_and job’’ for ename and job?
336) List of employees with hiredate in the format of ‘June 4 1988’?
337) Print list of employees displaying ‘Just salary’ if more than 1500 if exactly 1500 diplay ‘on
taget’ if less than 1500 display below 1500?
338) Which query to calculate the length of time any employee has been with the company.
339)Given a string of the format’nn/nn’.Verify that the first and last 2 characters are
[Link] that the middle character is ‘/’ Print the expression ‘Yes’ IF valid NO’ of not
[Link] the following values to test your solution ‘12/54’,01/1a,’99/98’?
340) Employees hire on OR Before 15th of any month are paid on last Friday of that month
those hired after 15th are paid the last Friday of the following month. print a list of employee
their hire date and first pay date sort those whose salary contains first digit of their deptno?
341) print the details of employees who are subordinates to BLAEKS?
342) Display those who working as manager using co related sub query.
343) write an SQL statement to refresh the salaries, according to experience of the employees.
For one year of experience, the salary will be 1000.
344) Write an SQL statement to accept date of birth and display the ager in years, months,
weeks,days, hours, minutes and second separately.
345) Write an SQL statement to insert a record into DEPT [Link] the user provides a value for
LOC it should be inserted; Otherwise ‘HYDERABAD’ should be inserted as default.
346) Find out how many managers are there without listing them.
347) Use the variable in a statement which finds all employees who can earn 30000 a year or
more(i.c using &)
348) In which year did most people join the [Link] the year and number of
employees.’’
349? create a copy of emp table.
350) Display those employee whose joining of month and grade is equal.

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795


Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

Oracle 12c Practice Material By-Krishna Naresh +91 9538912795

Common questions

Powered by AI

To handle and remove duplicate records in an employee table, an SQL query employing the DISTINCT keyword can be used to select unique records. Alternatively, a DELETE operation on duplicate entries can be paired with a subquery that identifies rows where some identifying characteristics are repeated but rowids or other distinct identifiers differ .

Use SQL pattern matching functions such as LIKE and wildcards to find employees with specific patterns in their names. For example, to find names with 'S' as a part of them anywhere, use '%S%'. This approach utilizes the ability of SQL to match character combinations in text fields flexibly .

The salary review date for an employee is determined as the first Monday after six months from the hire date. For example, if an employee was hired on November 17, 1981, their review date would be Monday, May 24, 1982 .

To list employees hired on a specific date, use an SQL query to filter records based on the hire date column, matching the specified date. Additionally, join with the department table on department number to fetch and list the department details corresponding to each hired employee .

Views in databases can be used to create a unified presentation of employee and department information by joining tables, such as displaying employee names along with department names and locations. However, whether a view can be modified directly depends on the SQL implementation and the specific view definitions. Direct manipulation is often restricted due to the underlying complexities .

To change an employee's managerial hierarchy, update the employee's department number to that of the new manager's and set their manager ID to the new manager's ID. This process often involves multiple updates in the database to ensure referential integrity and might require cascading changes to linked records .

To identify employees earning more than the highest-paid clerk, calculate the maximum salary among clerks and compare it against other employees' salaries. Employees whose salaries exceed this maximum amount are identified as earning more than all clerks .

To list employees who work in department 10 and hold specific job titles such as Clerk, Manager, or Salesman, you would use a query that checks for an employee's department number being 10 or 20 and their job title being either Clerk, Manager, or Salesman .

To convert a monthly salary figure to daily and hourly rates, assume the SAL column represents monthly salary, with 22 working days in a month and 8 hours per day. The daily salary can be calculated by dividing the monthly salary by 22, and the hourly salary by dividing the daily salary by 8 .

To calculate and display employee experience, determine the duration from the hire date to the current date to calculate experience in years, months, weeks, and days. This involves date arithmetic where years can be calculated as the total days divided by 365, months as remaining days divided by 30, and weeks and days from further breakdown of remaining days .

You might also like