0% found this document useful (0 votes)
10 views

PL SQL Interview Q1

PL/SQL is a procedural language that is an extension of SQL and allows for conditional control statements, exception handling and variable declaration. It supports reusability to improve database performance. The basic structure of a PL/SQL block includes a declaration block, execution block and exception block. A trigger is a special type of program that is used to restrict data when performing DML or DDL commands. Data types in PL/SQL include VARCHAR, NUMBER, DATE and BOOLEAN.

Uploaded by

prabhas
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

PL SQL Interview Q1

PL/SQL is a procedural language that is an extension of SQL and allows for conditional control statements, exception handling and variable declaration. It supports reusability to improve database performance. The basic structure of a PL/SQL block includes a declaration block, execution block and exception block. A trigger is a special type of program that is used to restrict data when performing DML or DDL commands. Data types in PL/SQL include VARCHAR, NUMBER, DATE and BOOLEAN.

Uploaded by

prabhas
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

1. What is PL/SQL?

PL?SQL IS A PROCEDURAL LANGUAGE WHICH IS THE EXTENSION OF SQL. IN PL/SQL IT


SUPPORTS MULTIPLE LINE EXICUTION .
WE CAN USE CONDITIONAL AND CONTROL STATEMENT.IN PL SQL WE CAN DECLARE
VARIABLESAND ALSO IT SUPPORTS EXCEPTION HANDLING.
PLSQL CAN SUPPORT REUSABLITY MECHANISM TO IMPROVE THE PERFORMANCE OF DB

2. Compare SQL and PL/SQL.

3. Do you know the basic structure of PL/SQL?


THE STRUCTURE OF PLSQL IS HAVING 3 BLOCKS:
1.DECLARATION BLOCK---- HERE WE CAN DECLARE VARIABLES , CURSORS, USER DEFINED
EXCEPTIONS
2. EXECUTION BLOCK ---- HERE WE CAN WRITE THE LOGICAL CODE OF THE PROGRAM
3.EXCEPTION BLOCK --- HERE WE CAN GIVE EXCEPTIONS PRE DEFINED EXCEPTIONS

4. What is a trigger? How do you use it


A TRIGGER IS A SPECIAL TYPE PROGRAM WHIHCH IS USED TO RESTRICT THE DATA WHEN IT
PERFORMING DML OR DDL COMMANDS
WE CAN USE TRIGGERS AS ROW LEVEL TRIGGERS AND STATEMENT LEVEL TRIGGERS.

5. What data types does PL/SQL have?

THERE ARE SOME DATA TYPES OF PLSQL


VARCHAR,NUMBER, DATE,BOOLEAN

6. Explain the PL/SQL compilation process.

7. Tell me what a package consists of.


A PACKAGE IS A DB OBJECT WHICH IS THE COMBINATION MULTIPE PROCEDURES ,CURSORS AND
MULTIPLE FUNCTIONS.
WITH THE USE OF PACKAGE WE CAN GET THE DATA VERY FASTLY

8. What are the benefits of using PL/SQL packages?


THE BENIFITS OF THE PLSQL PACKAGES ARE FAST PERFORMANCE OF THE DB AND TIME
REDUNDANCY

9. Do you understand the meaning of exception handling?


RUN TIME ERRORS ARE CALLED EXCEPTION . WHENEVER THE CODE IS COMPILING IF ANY
ERRORS OCCURS THE PLSQL BLOCK WILL STOPPED THE EXECUTION .
SO TO CONTINUE THE EXECUTION EXCEPTIONS ARE USED.

10. Give me some examples of predefined exceptions.


DATA NOT FOUND,
TOO_MANY_ROWS
ZERO_DIVIDE
INVALID_CURSOR
CURSOR_NOT_FOUND

11. What do you understand by PL/SQL cursors?


CURSOR IS TEMPORARY STORAGE AREA,AT THE TIME OF EXECUTION OF BLOCK WE CAN USE
THE RESULTS OF CURSOR.
IT CAN HOLD MORETHAN ONE ROW

12. When do we use triggers?


13. What is a PL/SQL block?
A BLOCK IS SET OF STATEMENTS WHICH ARE COMPILED AND EXECUTED BY DB AND STORED IN
A SINGLE UNIT
THERE ARE 3 TYPES BLOCK AVAILALE IN PL/SQL
DECLARATION BLOCK
EXCEPTION BLOCK
EXECUTION BLOCK

14. Name the differences between syntax and runtime errors.

15. What are COMMIT, ROLLBACK, and SAVEPOINT?

16. What are the two types of exceptions?

SYSTEM DEFINED
USER DEFINED

17. Do you know what a mutating table error is?

18. When is a declaration statement required?

DECLARATION OF VARIABLES,CURSORS,EXCEPTIONS

19. Explain three basic parts of a trigger in PL/SQL.

20. What are character functions?


UPPER,LOWER,SUBSTRING,INSTRING,INTCAP,PADDING,L PAD,R PAD,TRIM,L TRIM,R TRIM.

21. What is the difference between type and rowtype?

22. Name some schema objects that are created in PL/SQL.

23. What is the purpose of sysdate and user keywords?

24. Are there any downsides to using PL/SQL?

25. How can we use comments in PL/SQL code?

Single-line comments ( - - ) anywhere on a line and extend to the end of the


line.
Multi-line comments /* --------DATA----------- */

====================================

1. How do you access the fields of a record in PL/SQL?

2. Can you label a PL/SQL loop?

3. What are the different methods for tracing PL/SQL code?

4. Why should you use an index in a table?

5. How do developers use database links?

6. Tell me what expressions mean in PL/SQL.


7. What is the overloading of a procedure?

8. Define a subprogram in PL/SQL.

9. How would you implement a standalone procedure?

10. Tell me how to declare a constant in PL/SQL.

11. Explain what the open cursor command function does.

12. How do you delete triggers?

13. What is the difference between temporary and permanent tablespaces?

14. Which command do developers use to delete a procedure?

15. What are the cursor attributes used in PL/SQL?

16. How do you declare a user-defined exception?

17. The case statement has no selector in PL/SQL. Is this true?

18. What is the difference between implicit and explicit cursors?

19. What are the benefits of triggers?

20. What are the found and not found cursor attributes in PL/SQL?

21. Can you explain the PL/SQL execution architecture?

22. What are the functions available for manipulating character data?

23. What virtual tables are available in PL/SQL?

24. What are PL/SQL records?

25. What are the three parameter modes in PL/SQL?

==========================================================

1. What are pseudocolumns, and how do they work?

2. What is the difference between SQLCODE and SQLERRM?

3. Explain the daily activities of a PL/SQL developer.

4. How can you locate a PL/SQL block?

5. What is a join?

6. How do you display the highest salary from an employee table?

7. Tell me how you would create a nested table.

8. What is the difference between a mutating table and a constraining table?

9. How do you create a function in PL/SQL?

10. What programming constructs does PL/SQL support?


11. Explain what a timestamp data type is in PL/SQL.

12. How do you include single quotes in a string literal in PL/SQL?

13. What does the error ORA-03113 mean?

14. What is an autonomous transaction?

15. How can you debug your PL/SQL code?

16. How will you restrict the string length in PL/SQL?

17. Tell me about the role of a hierarchical profiler.

18. What are the roles of PLVrb and PLVcmt in PL/SQL?

19. How do you get returns on more than one row?

20. Describe a problem developers might face while writing log information in a
database table in PL/SQL.

21. How can you verify whether a CPU has executed an update statement?

22. What do you know about PRAGMA EXCEPTION_INIT in PL/SQL?

23. Which command deletes a package in PL/SQL?

24. What is the purpose of the DBMS_OUTPUT package?

25. What is a subquery? Name some types of subqueries in PL/SQL.


A. SUB QUERY IS QUERY INSIDE THE QUERY .IN A SUB QUERY THERE ARE MANY TYPES LIKE
CORELATED SUBQUERY AND NON CORELATED SUB QUERY
IN A CO-RELATED SUB QUERY THE SUBQUERY FIRST OUTER QUERY IS EXICUTED THEN
INSIDE QUERY IS EXICUTED .
IN NON RELATED SUBQUERY FIRST SUBQUERY IS EXICUTED THEN OUTER QUERY IS
EXICUTED.

You might also like