PL/SQL Interview Questions and Answers. Are you a developer? Need to update your software development knowledge or need to prepare for a job interview?
1. What is the basic structure of a Procedural Language/Structured Query Language (PL/SQL) block?
2. What are the different datatypes that can be defined in a PL/SQL block?
3. What is the difference between SQL and PL/SQL?
4. What are the advantages of PL/SQL?
5. What are the mandatory keywords in a PL/SQL program block?
6. Can arrays be used within a PL/SQL program block?
7. How does a PL/SQL block integrate with data dictionary?
8. Can a variable be assigned a value from database? If yes, then how?
9. Does a NOT NULL constraint of a database column apply to %TYPE variables?
10. Can SQL group functions be used within the procedural statements?
11. Explain the DECODE function? Can it be used in the procedural statements?
12. What is the maximum length of an identifier that can be used?
13. What is the equivalent of DECODE function in the procedural statements?
14. Can DDL commands be used within a procedure? If so, then how?
15. What is an anonymous block and how is it executed?
16. What is a bind variable and how is it used?
17. How can you display data from a PL/SQL block?
18. What is an identifier?
19. In the following code snippet, can the v_ex variable reference the value of the v ey variable?
20. Explain why the following code generates a compilation error.
21. How is global variable declared within a nested block?
22. What is the use of NVL function?
23. What are the different ways to determine the status of a cursor?
24. What is the difference between implicit cursor and explicit cursor?
25. Why does SQL%ISOPEN always returns the FALSE value?
26. What are OPEN, FETCH, and CLOSE cursor commands?
27. Suppose, emp_details is an explicit cursor and v_emp_dtls is a %ROWTYPE variable. Choose the correct FETCH statement from the following options.
28. What are Transaction Control statements? Can they be used within the PL/SQL block?
29. What is a SAVEPOINT command?
30. What are pseudo-columns? How can you use pseudo-columns in procedural statements?
31. What are cursor variables and how are they declared?
32. How can you check if an UPDATE statement in PL/SQL is successfully executed?
33. What is a RECORD datatype?
34. What is the function of OPEN cursor command?
35. What is the advantage of using the %ROWTYPE datatype?
36. Explain how the %NOTFOUND attribute can be used to exit from a loop.
37. How can explicit cursors be used to fetch multiple rows?
38. Can you define a record type based on an explicit cursor?
39. What is a cursor FOR loop and how does it differ from an explicit cursor?
40. Write a program to pass parameters to a cursor and print the result.
41. What is SELECT FOR UPDATE and how can it be used in a cursor?
42. How is it possible to fetch a current row from a cursor without using ROWID?
43. What is the error in the following code?
44. Which datatypes can be used with a RECORD Type?
45. What are the different forms of conditional IF construct?
47. Is it possible to label a loop? If yes, then what is its benefit?
48. Distinguish between WHILE-LOOP and FOR-LOOP.
49. In a FOR-LOOP, can the counter value be assigned a value within the loop?
50. Is it possible to assign a dynamic value to a loop counter?
51. What will be the consequence if the upper bound of the FOR-LOOP counter gets a smaller value than the lower bound?
52. How can you force FOR-LOOP to end unconditionally?
53. What is the error in the following code?
54. Give an example of the CASE construct.
55. What will be output of the following code?
56. Suppose there are two Boolean variables, v_samplel and v_sample2. What will be the value of the v_sample variable in the following conditions?
57. What is the error in the following code?
58. What is the error in the following code?
59. Choose the correct statement from the following options.
62. Can Index-By table be stored in a database? If not, then which type of collection can be used to store in a database?
63. What is the difference between nested tables and VARRAYs?
64. What is the difference in the usage of SELECT INTO and FETCH?
65. How can two PL/SQL records be compared?
66. Which datatype is not allowed in the definition of PL/SQL record?
70. What is the value of SQL%FOUND attribute after and before an INSERT statement is executed?
72. How are elements added to an Index-By table?
73. Can an IF-THEN-ELSIF block have infinite number of ELSE clauses?
74. What will be the value of %N0TF0UND attribute after a cursor is opened but before a FETCH statement is executed?
77. What is the advantage of defining implicit records?
78. How can an implicitly defined record be populated?
80. Is it possible to define a NOT NULL field in a record?
81. Is it possible to define a CONSTANT value in a record?
82. Is it possible to copy contents of one record to another?
83. Do records have methods?
84. Can a VARRAY be used in a record definition?
85. Can an uninitialized nested table be referenced?
86. What is the difference between initialization of Index-By table and nested table?
88. Can collections be compared with Boolean operators?
89. Can the EXISTS method be used for Index-By table?
96. What will the result of the NEXT(<x>) method, if x is the last element of the collection?
97. What is the difference in accessing objects of LOB and LONG datatypes?
98. What is the difference between LOB objects stored in-line and out-of-line?
99. Which package is used to manipulate LOB objects?
100. What are LOB locators?
1. What is the basic structure of a Procedural Language/Structured Query Language (PL/SQL) block?
2. What are the different datatypes that can be defined in a PL/SQL block?
3. What is the difference between SQL and PL/SQL?
4. What are the advantages of PL/SQL?
5. What are the mandatory keywords in a PL/SQL program block?
6. Can arrays be used within a PL/SQL program block?
7. How does a PL/SQL block integrate with data dictionary?
8. Can a variable be assigned a value from database? If yes, then how?
9. Does a NOT NULL constraint of a database column apply to %TYPE variables?
10. Can SQL group functions be used within the procedural statements?
11. Explain the DECODE function? Can it be used in the procedural statements?
12. What is the maximum length of an identifier that can be used?
13. What is the equivalent of DECODE function in the procedural statements?
14. Can DDL commands be used within a procedure? If so, then how?
15. What is an anonymous block and how is it executed?
16. What is a bind variable and how is it used?
17. How can you display data from a PL/SQL block?
18. What is an identifier?
19. In the following code snippet, can the v_ex variable reference the value of the v ey variable?
20. Explain why the following code generates a compilation error.
21. How is global variable declared within a nested block?
22. What is the use of NVL function?
23. What are the different ways to determine the status of a cursor?
24. What is the difference between implicit cursor and explicit cursor?
25. Why does SQL%ISOPEN always returns the FALSE value?
26. What are OPEN, FETCH, and CLOSE cursor commands?
27. Suppose, emp_details is an explicit cursor and v_emp_dtls is a %ROWTYPE variable. Choose the correct FETCH statement from the following options.
28. What are Transaction Control statements? Can they be used within the PL/SQL block?
29. What is a SAVEPOINT command?
30. What are pseudo-columns? How can you use pseudo-columns in procedural statements?
31. What are cursor variables and how are they declared?
32. How can you check if an UPDATE statement in PL/SQL is successfully executed?
33. What is a RECORD datatype?
34. What is the function of OPEN cursor command?
35. What is the advantage of using the %ROWTYPE datatype?
36. Explain how the %NOTFOUND attribute can be used to exit from a loop.
37. How can explicit cursors be used to fetch multiple rows?
38. Can you define a record type based on an explicit cursor?
39. What is a cursor FOR loop and how does it differ from an explicit cursor?
40. Write a program to pass parameters to a cursor and print the result.
41. What is SELECT FOR UPDATE and how can it be used in a cursor?
42. How is it possible to fetch a current row from a cursor without using ROWID?
43. What is the error in the following code?
44. Which datatypes can be used with a RECORD Type?
45. What are the different forms of conditional IF construct?
47. Is it possible to label a loop? If yes, then what is its benefit?
48. Distinguish between WHILE-LOOP and FOR-LOOP.
49. In a FOR-LOOP, can the counter value be assigned a value within the loop?
50. Is it possible to assign a dynamic value to a loop counter?
51. What will be the consequence if the upper bound of the FOR-LOOP counter gets a smaller value than the lower bound?
52. How can you force FOR-LOOP to end unconditionally?
53. What is the error in the following code?
54. Give an example of the CASE construct.
55. What will be output of the following code?
56. Suppose there are two Boolean variables, v_samplel and v_sample2. What will be the value of the v_sample variable in the following conditions?
57. What is the error in the following code?
58. What is the error in the following code?
59. Choose the correct statement from the following options.
62. Can Index-By table be stored in a database? If not, then which type of collection can be used to store in a database?
63. What is the difference between nested tables and VARRAYs?
64. What is the difference in the usage of SELECT INTO and FETCH?
65. How can two PL/SQL records be compared?
66. Which datatype is not allowed in the definition of PL/SQL record?
70. What is the value of SQL%FOUND attribute after and before an INSERT statement is executed?
72. How are elements added to an Index-By table?
73. Can an IF-THEN-ELSIF block have infinite number of ELSE clauses?
74. What will be the value of %N0TF0UND attribute after a cursor is opened but before a FETCH statement is executed?
77. What is the advantage of defining implicit records?
78. How can an implicitly defined record be populated?
80. Is it possible to define a NOT NULL field in a record?
81. Is it possible to define a CONSTANT value in a record?
82. Is it possible to copy contents of one record to another?
83. Do records have methods?
84. Can a VARRAY be used in a record definition?
85. Can an uninitialized nested table be referenced?
86. What is the difference between initialization of Index-By table and nested table?
88. Can collections be compared with Boolean operators?
89. Can the EXISTS method be used for Index-By table?
96. What will the result of the NEXT(<x>) method, if x is the last element of the collection?
97. What is the difference in accessing objects of LOB and LONG datatypes?
98. What is the difference between LOB objects stored in-line and out-of-line?
99. Which package is used to manipulate LOB objects?
100. What are LOB locators?
3 comments:
Useful collection of question. This question will useful for who freshers also PLSQL Training in Bangalore
Merhaba,
I’ve often thought about this MYsql in the cloud. Nice to have it laid out so clearly. Great eye opener.
I'm trying to set up a reminder. It needs to remind users of a reassessment date that occurs every 90 days based upon the first contact (enrollment_date) with a potential client. But I only need to show the closest upcoming date. So, if a client's next closest assessment date is 12-12-15 it would show that date until 12-13-15 when it would be beginning to show 3-11-16. Is that possible?
Appreciate your effort for making such useful blogs and helping the community.
Obrigado
Hi There,
Grazie! Grazie! Grazie! Your blog is indeed quite interesting around plsql-interview-questions-and.html! I agree with you on lot of points!
how to get the first non space character from a string in Oracle. Could you help me on this?
Anyways great write up, your efforts are much appreciated.
Many Thanks,
Preethi.
Post a Comment