Oracle SQL Interview Question
Oracle SQL Interview Question
QUESTION
1. What is the difference between “Delete” & “Truncate”?
2. What us the difference between “Procedure” & Function”?
3. What is the difference between NVL, NVL2, NULLIF, COALESCE?
4. What is the difference between RANK & DENSE RANK?
5. What are the different types of SQL Statement?
6. How to get unique records without using “DISTINCT” in Oracle?
7. What is DUAL table in oracle, Explain with examples?
8. What is trigger?
9. What are the types of triggers?
10.What is the purpose of triggers in database?
11.What is the difference between DML & DDL?
12.Similarities & Difference DECODE & CASE?
13.Difference between REPLACE & TRANSLATE?
14. What is view?
15.What is Simple view?
16.What is Complex View?
17.Are DML’s allowed on view?
18. Difference between “Simple” & “Complex” view?
19.Can we use “DML” & “DDL” Statements inside function?
20.Can we use “OUT” and “INOUT” parameter in function?
21.Can function return more than one value?
22.Difference between VIEW AND MATERIALIZED VIEW?
23. What is set operator? Difference between “UNION” &
“UNIONALL”, “INSERT” & “MINUS”?
24. What is %ROWTYPE and % TYPE? What is the advantage of using
“%rowtype” & “%type”?
25. What is index? How to create index?
26.What are the types of index?
27.How to find the list of indexes for a given table?
28.Explain B-tree index?
a. What is B-tree index? How index data is stored?
b. Where to find the metadata information?
c. How to find whether index is used by the query?
d. When to create B-tree index?
e. What types of scan operations B-tree index will do?
f. Can we create index for all columns?
g. What are advantages/dis adv. Of B-tree index?
29.Explain Bitmap index
30.Explain “Function based” index?
31.Explain “Reverse Key” index?
32.When to choose what type of index?
33.How to know index is being used?
34.How to monitor index usage?
35.What are the Benefits/drawbacks of index?
36.What are the types of DML triggers?
37.What is the order of execution if there is more than one trigger
exits?
38.What is SQL Loader?
39.What is the difference between VARRAY, NESTED TABLE,
ASSOCIATIVE ARRAY.
40.What is “INSTEAD OF ” Trigger?
41.What is Error/Exception in PLSQL? How to handle Exception on
PLSQL?
42.What are the types of Exception?
43.What is “PRAGMA exception_init”?
44.What is “Raise_application_error”?
45.What is “SQLERRM” & “SQLCODE”?
46.What is “SUBQUERY”? What are the types of “SUBQUERY”?
47.EXPLAIN “Simple Subquery” and its types with an example?
48.Explain “Correlated Subquery” with an example?
49.“Inline View” Vs “SUBQUERY”?
50.“NULL” related practical question?
51.NULL & Order by?
52.Difference between “IN” & “ANY”?
53.SQL Loader & External Table?
54.RANK & DENSE_RANK AS “Aggregate” & “Analytical” Function
55.Query was running fine till yesterday, but suddenly its very slow
form today, how would you start your analysis?
56.What is Cursor? What are the types of cursors?
57.What is explicit cursor? How to access the value using explicit
Cursor?
58.What are the cursor attributes?
59.What is parameterized cursor? For cursor?
60.What is ref cursor? Strongly typed ref cursor vs weakly typed?
61.What is “for update” & “where current of” clause in cursor?
62. Cursor vs collection? When to use cursor & when to use
collection?
63.Named Cursor vs ref cursor?
Compound Trigger
64.What is “Compound trigger”?
65.Advantages of “Compound trigger”?
66.What is mutating trigger?
67.How to avoid mutating trigger error?
68.How to avoid “mutating trigger error” using compound trigger?
69.How to write SQL to delete duplicate records?
70.What’s maximum number of trigger (of different type) that can be
defined on same table?
71.What’s the “Order of Execution “ if there is more than one trigger
of different type on same table?
72.Can we define more than one trigger of “same type” on same
table?
73.“IF YES”, then what’s the order of execution ? and how to control
the order of execution?
74.What is PRAGMA autonomous_transaction?
75.Real time use case for “autonomous_transacton”?
76.What are the Advantage of packages in oracle?
77.I have a table with duplicates entries in production, I cannot
delete existing rows, However I want to prevent further duplicates
rows to get inserted. How can I do?
78.Does “creating a primary key constraint” always an index
automatically?
79.Will “Droping constraint”, will drop underlying index?
80.Will Dropping “TABLE”, will drop underlying index?
81.Can a “primary key” creates NONUNIQUE index?
82. We use “UNIQUE INDEX” or “UNIQUE CONSTRAINT” to enforce
uniqueness of a column. What’s the difference? And when to use
what?
83.Can I use? IGNORE_ROW_ON_DUPKEY_INDEX?
84.Can I use “Oracle error log table?”
85.While executing the insert statement INSERT INTO emp_target
SELECT * FROM emp_source;
I want only the “non-duplicate” record to get inserted, duplicate
records should get excluded during insertion How can I do?
86.Can I use MERGE Statement?
87.if is no primary key in TARGET table, then how to do this?
88.while executing the insert statement