Monday 5 October 2020

Oracle SQL - Interview Questions

 In this post, we provide the list of Basic SQL Interview questions.


1.       What is the difference between Delete and Truncate command in SQL


2.       What does UNION do? What is the difference between UNION and UNION ALL


3.       Define a synonym, how many types there are, and explain the difference between them.


4.       What is an index? What are diff type of indices?


5.       What’s the advantage of using an index?


6.       Difference between Primary Key and Unique key?


7.       What are different Joins? Explain outer join? how would you write outer join


8.       How to find duplicate rows in a table and then write SQL query to delete them


9.       Write a SQL Query to find second highest salary of Employee


10.   What is difference between Cartesian Join and Cross Join?


11.   What are the default packages provided by oracle


12.   What is group by function and where it is used


13.   What is the diff between Where and Having


14.   What is the use of Aggregate functions in Oracle?


15.   What are user defined data types?


16.   Difference between DECODE and CASE


17.   What is %Rowtype and %Type


18.   Explain the different cursor attributes


19.   Explain different types of cursors


20.   What are the different types of Exceptions?


21.   What is the basic difference between a Procedure and a Function?


22.   What are the modes of parameters in a PL/SQL Procedure?


23.   Explain different types of triggers


24.   Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger? Why?


25.   Describe the disadvantage of Database Trigger over Stored Procedures? 


26.   What is an Exception? What are types of Exception?


27.   When an exception is triggered in a loop, how do you continue to next iteration?


28.   What is Pragma EXECPTION_INIT? Explain the usage?


29.   How do you define public and private procedure in oracle?


30.   Enlist various types of PL/SQL Exceptions?


31.   Which is the Default Cursor in Oracle PL/SQL?


32.   Why is closing the Cursor required during explicit cursor development?


33.   Explain about SQLERRM and SQLCODE and their importance.


34.   What rules are to be taken care of when doing comparisons using NULL?


35.   What is the Difference between Runtime Errors and Syntax Errors?


36.   What are the different Loop Control Structures used in PL/SQL?


37.   How do you go about tuning your PL/SQL code?


38.   How can we create a table in PL/SQL block and insert records into it


39.   Explain the usage of WHERE CURRENT OF clause in cursors?


40.   What is difference between a Cursor declared in a procedure and Cursor declared in a package specification?


41.   What is Overloading of procedures?


42.   What is the difference between a view and a materialized view?


43.   Name some Oracle's built-in packages?


44.   Explain autonomous transaction


45.   Can COMMIT statement be executed as part of trigger


46.   Explain how to debug PL/SQL program.


47.   How can we read and write files from PL/SQL program?


No comments:

Post a Comment