×

Top 25 PL/SQL Interview question for 2024

1) What is PL/SQL?

It is defined as SQL having Procedural features of Programming Language i.e. Procedural Language extension of SQL.

2) Enlist the section of PL/SQL block.

It consist of three block
  • Declaration Section
  • Execution Section
  • Exception Handling or Error Section

3) Give the advantage of PL/SQL.

  • Structured Block
  • Better Performance
  • Error Handling
  • Procedural Language Capability

4) Enlist the types of Data types in PL/SQL.

  • Scalar Data types: e.g. number, date, char, long, Boolean etc.
  • Composite Data types: e.g. Record, Table etc.

5) Write syntax to declare the variable?

Syntax:
DECLARE  
Var_name datatype [NOT NULL  := value]  
e.g. tut_example varchar2(10) NOT NULL  :="Best tutorial"
Syntax: to directly assign values to variable from database.
SELECT column_name  
INTO variable_name   
FROM table_name   
[WHERE condition];

6) Write some programming constructs supported by PL/SQL.

  • Variable and Constant
  • Flow Control
  • Cursor Management
  • Exception Handling
  • Triggers

7) Write single statement to concatenate Tutorials and Examples.

Website: = 'Tutorials' || 'Examples';

8) Give the precedence order among (AND, OR, NOT, NULL).

Highest order: NOT Lowest order: OR

9) What is Trigger in PL/SQL?

Trigger is initiated when query is fetched for any INSERT, UPDATE, DELETE etc where there is change in the structure of Database. It maintains the "Referral Integrity" of the PL/SQL.

10) Enlist the command that is use to create PL/SQL Packages.

  • CREATE PACKAGE command is used for creating the specification part.
  • BODY command is used for creating the body part.

11) What are the uses of Trigger?

  • Creating validation mechanisms
  • Creating logs to register the use of a table
  • Update other tables

12) Differentiate between Execution of Trigger and Stored Procedures ?

Trigger is executed automatically whereas Stored Procedures has to be invoked.

13) Which command is used to delete the package?

DELETE PACKAGE is used to delete the package.

14) Define CURSOR in PL/SQL.

It is a temporary area which is generated at the time of SQL statement execution in the system memory. It contains information about select statement and row data affected in database.

15) Enlist the types of cursor.

  • Implicit Cursor: It is created when DML statement is executed e.g. INSERT, UPDATE AND DELETE.
  • Explicit Cursor: It is created when we execute SELECT Statement which returns more then one rows.

16) Explain Raise_application_error.

It is a procedure of package DBMS_STANDARD that allows issuing of user_defined error messages from database trigger or stored sub-program.

17) When is a declare statement required?

DECLARE statement is used by PL SQL anonymous blocks such as with stand alone, non-stored procedures. If it is used, it must come first in a stand alone file.

18) What is the importance of SQLCODE and SQLERRM?

SQLCODE returns the value of the number of error for the last encountered error whereas SQLERRM returns the message for the last error.

19) What packages are available to PL SQL developers?

DBMS_ series of packages, such as, DBMS_PIPE, DBMS_DDL, DBMS_LOCK, DBMS_ALERT, DBMS_OUTPUT, DBMS_JOB, DBMS_UTILITY, DBMS_SQL, DBMS_TRANSACTION, UTL_FILE.

20) What is SQL*Loader?

SQL*Loader is a product for moving data in external files into tables in an Oracle database. To load data from external files into an Oracle database, two types of input must be provided to SQL*Loader : the data itself and the control file.

21) Explain the concept of exception.

An exception occurs when unwanted situation arises. The situation can be exceptional to normal functioning of the program. It can occur due to system error, user error and application error.

22) Define user defined exceptions.

We use user defined exception only when oracle doesn't raise its own exception. In this procedure we raise an exception by using RAISE command.

23) Define Row level trigger.

Row level trigger is fired each time a row is affected by DML statements like Insert, Update and Delete. When no rows affected, the trigger is not executed at all.

24) Define Statement level triggers.

It is fired when statement affects rows in a table but the processing required is completely independent of the number of rows affected.

25) Explain how can you save or place your messages in a table?

To save msg in a table, you can do it in two ways:
  • Load individual messages with calls to the add_text procedure.
  • Load sets of messages from a database table with the load_from_dbms procedure.

Related Topics

Artificial Neural Network Interview Questions

1. Explain Neural Network?  Neural Network is a sequence of an algorithm that gives its best to recognize the underlying relationship in a data-set through a process. The artificial neural network...

8 minutes read.

Top 12 Docker Interview Questions for 2024

Most frequently asked Docker Interview Questions and Answers for Fresher 1. What is Docker? Docker is a new form of Software Containerization in the field of IT. It is an open-source container...

4 minutes read.

Top 30 D Programming Language Interview Questions for 2024

1) What is D programming language? D programming language is an object oriented programming language. It is created by Walter Bright of Digital Mars. It was released in 2001. 2) Who is the...

4 minutes read.

Flutter Interview Questions

Here’s a list of top Flutter questions that are frequently asked. Q1.  Is Flutter an open-source? A1.  Yes, Flutter is a 100% open-source software development kit. Q2.  What are flutter widgets? A2.  Widgets are...

7 minutes read.

Top 15 T-SQL(Transact-SQL) Interview Questions for 2024

1) What is T-SQL? T-SQL stands for Transact Structured Query Language. T-SQL is the extension of SQL functionality supported by Microsoft SQL Server and Sybase ASE. 2) What are the features of...

3 minutes read.

Top 15 Apache Tapestry Interview Questions for 2024

1) What is Apache Tapestry? It is an open source web framework written in Java and can work under any application server. It is easily integrate with back ends like Hibernate...

2 minutes read.

Top 30 SQLite Interview Question for 2024

1) What is SQLite? It is an in-process library which implements self-contained, serverless, zero-configuration, transactional SQL database. 2) What datatype does SQLite supports? It uses dynamic typing and data can be stored in...

5 minutes read.

Top 30 Flex Interview Questions for 2024

1) What is Flex? Flex is an open source framework which is used to build applications for mobile, browser and desktop. It provides FLEX SDK consisting of the Flex class library, Flex...

4 minutes read.

Top 26 SEO Interview Questions for 2024

Most Frequently asked SEO Interview Questions and Answers for Fresher and Experienced 1) What is SEO? SEO stands for Search Engine Optimization. It is a set of processes followed by website owners...

4 minutes read.

Top 32 Laravel Interview Questions for 2024

1) What is Laravel? Laravel is an open source PHP framework. It is used to design and develop web applications. It is based on MVC (Model-View-Controller) design pattern. It is created by Taylor...

6 minutes read.

Top 30 Python Interview Questions for 2024

1) What is Python? Python is a high level, interpreted and object-oriented programming language. It is easy to learn and supports multiple programming patterns. It is also known as powerful and versatile...

6 minutes read.

Top 28 Prototype Interview Questions for 2024

1) What is Prototype? Prototype is a JavaScript framework which is used in dynamic web applications. It is a namespace and a module that is used to manage HTML forms. It is also...

4 minutes read.

Top 30 Core Java Interview Questions for 2024

1. What is the difference between HashMap and Hashtable in Java? Ans. S.No. HashMap Hashtable 1. ...

6 minutes read.

Top 18 UiPath Interview Questions for 2024

RPA UiPath Interview Questions and Answers for Fresher  1. What is RPA? RPA is an acronym for Robotic Process Automation. Robotic In RPA, Robotic is termed as an entity or machine which tries to...

7 minutes read.

Top 30 Ruby on Rails Interview Questions for 2024

1) What is Ruby on Rails? It is a server-side web application framework. It is an open source ruby framework which is used for developing database-backed web applications. Here, no compilation phase is...

4 minutes read.

Django Interview Questions for 2024

Django is an open-source python web framework. It is very popular due to the functionalities it offers. It uses the Model-View-Template architecture. Many giant organizations are using Django as their...

10 minutes read.

Top 15 SQL Server Interview Question for 2024

1) Describe SQL Server? SQL server is a DataBase Management System developed by Microsoft. It was first introduced in year 2008 since, then many version has been introduced such as :...

2 minutes read.

Top 14 Elixir Interview Questions for 2024

1) What is Elixir? Elixir is a dynamic, functional language. It is designed to build scalable and maintainable applications. 2) Who developed Elixir? Ericsson developed elixir in 1986. 3) What is the stable version of...

2 minutes read.

Top 40 IoT Interview Questions and Answers in 2024

Q.1 What is IoT? IoT stands for the Internet of things refers to the interconnection of the network of various devices that can recognize, collect and transfer data over the internet...

13 minutes read.

Top 14 Web icon Interview Questions for 2024

1) What is Web Icon? Web Icon is a symbol that is used to represent a specific action or a capability on a webpage. It is used in documents as well...

5 minutes read.