MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
Oracle SQL Interview Questions for Freshers
1. Leading Oracle Training center in Bangalore
DTecH IT Education, No.1, 1st Cross, 1st Main, Ashwini layout, Off Koramangala ring road, Bangalore 560047,
Name
Marks
All questions (including sub questions) carry 10 marks each. Duration: 20 minutes
1. Write a query to display the 5th highest salary among the employees table?
2. Write a query to display the employees whose salary is greater than the average salary of their
respective departments.
3. Write a query to add a unique constraint on column "email" from EMP table after it’s created?
4. Write a query to add a DEFAULT value of SAL column in EMP table to 5500 once it’s created?
5. What would be the possible outcome of following SQL statements? If ERROR, mention the reason.
a. select length(NULL||’abc’) from dual;
b. SELECT TRUNC (TRIM (' 505 .99 ')) FROM DUAL;
c. SELECT DEPTNO, COUNT (ENAME) FROM EMP WHERE COUNT (ENAME) > 5000 GROUP BY
DEPTNO;
d. UPDATE EMP SET (DEPTNO, SAL) = (10, 2000) WHERE SAL>500 AND JOB=’CLERK’;
2. Leading Oracle Training center in Bangalore
DTecH IT Education, No.1, 1st Cross, 1st Main, Ashwini layout, Off Koramangala ring road, Bangalore 560047,
e. select * from emp where comm=null;
f. SELECT ROUND(45.343,-2) FROM DUAL;
6. What is the maximum length of any OBJECT NAME in Oracle?
a. 30 chars
b. 32 chars
c. 255 chars
d. No limit
7. What does TRUNCATE does in additional to removing data? (Choose all that apply)
a. De-allocates memory used by the table
b. De-allocates storage space used by the table
c. Changes the tablespace of the table
d. Add more storage space to the table
e. Commits the removal operation
8. You run the below statement just after creating a sequence named SQL01. What will be the result?
SELECT SEQ01.CURRVAL FROM DUAL;
a. It displays the first value of the sequence
b. It throws an error
c. It displays the previous value of the sequence
d. It won’t display anything
9. Which all constraints will be copied while creating a table copying another table?
a. All constraints
b. Only Unique constraints
c. Only Foreign key constraints
d. Only NOT NULL constraints
e. No constraints are copied
10. What is the difference between WHERE clause and HAVING clause?
11. Which are the different types of Joins available in Oracle?
3. Leading Oracle Training center in Bangalore
DTecH IT Education, No.1, 1st Cross, 1st Main, Ashwini layout, Off Koramangala ring road, Bangalore 560047,
12. Which are the five sub-languages of SQL? Provide examples from each category.
13. Which are the different classifications of functions? Provide examples
14. What is the difference between WHERE clause and HAVING clause?
15. Write a query to display all employees who are working in department 10 at location Seattle.
Use tables Employees, departments and locations.
16. Write a query to display all employees who get a salary greater than 2000 and working as managers
or all employees who work as salesmen. Use EMP table
17. Write a query to display all employees whose name contains E or second last letter of name is T.
4. Leading Oracle Training center in Bangalore
DTecH IT Education, No.1, 1st Cross, 1st Main, Ashwini layout, Off Koramangala ring road, Bangalore 560047,
18. Write a query to display all employees and their managers. Use EMP table
19. Write a query to display all departments in Oxford with an average salary of 5000 or more. Use
tables employees, departments and locations.
20. Write a query to display 01-Aug-2012 in the format FIRST AUGUST TWENTY TWELVE.