×

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

Top 30 Zend Framework Interview Questions for 2024

1) What is Zend Framework? Zend is an open source, object-oriented web application framework. It is implemented in PHP 5. It was developed in 3 March 2006. 2) What is the use...

6 minutes read.

Top 28 Angular 2 Interview Questions for 2024

1) What is Angular 2? It is an open source JavaScript framework which is used to build web applications in JavaScript and HTML. It is also used to overcome obstacles encountered while...

4 minutes read.

Top 15 Haskell Interview Questions for 2024

1) What is Haskell? Haskell is a functional programming language. It is based on mathematical functions. This programming language is more intelligent than other popular programming languages. 2) Who is the developer of...

2 minutes read.

Polymer.js Interview Questions

1) What is Polymer.js? Polymer.js is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML. 2) Describe...

3 minutes read.

Top 31 Flask Interview Questions for 2024

1) What is Flask? Flask is a micro web framework written in Python. It is based on Werkzeug toolkit and Jinja 2 template engine. 2) Who is the developer of Flask? Armin Ronacher...

6 minutes read.

Top 31 PHP Interview Questions for 2024

1) What is PHP? PHP is a object-oriented scripting language, open source, interpreted and executed at server side. It is also used to develop web applications. 2) What are the features of PHP? Features...

4 minutes read.

Top 43 React Native Interview Questions for 2024

1. What is React Native? React native is an open-source JavaScript framework designed by Facebook for native mobile applications development. It is based on a JavaScript library-React. React Native saves your development...

11 minutes read.

Top 15 Cordova Interview Questions for 2024

Top 20 Cordova Interview Questions and Answers for Freshers 1) What is Cordova? Cordova is a mobile application development framework. Cordova allows building mobile application using HTML5, CSS3, and JavaScript. Cordova is...

3 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.

Top 15 RESTful Web Services Interview Question for 2024

1) What is REST? REST is web standards based architecture and stands for REpresentational State Transfer. It uses HTTP Protocol for data communication. Here, everything is a resource. 2) What are the HTTP methods used...

2 minutes read.

Top 22 DOJO Interview Questions for 2024

1) What is DOJO? DOJO is an open source JavaScript framework designed for very fast development of JavaScript/AJAX based application and websites having cross platform interdependencies. 2) Enlist all features of DOJO. ...

4 minutes read.

Top 15 NodeJS Interview Questions for 2024

1) What is NodeJs? NodeJs is open source JavaScript based feamework used to develop I/O intensive web application. It is collections of JavaScript library and runtime environment. It is used to...

3 minutes read.

Top 15 Pure CSS Interview Questions for 2024

1) What is Pure CSS? Pure is a CSS (Cascading Style Sheet) framework. It is a collection of small set of responsive CSS modules. We can integrate it to any web...

5 minutes read.

Top 30 CodeIgniter interview Questions for 2024

1) What is CodeIgniter? CodeIgniter is an open source PHP framework. It is used to develop web applications and websites. It is loosely based on MVC pattern and easy to use...

4 minutes read.

Top 15 XML Interview Questions for 2024

1) What is XML? XML (eXtensible Markup Language) is designed to transport and store data. It has user executive tags i.e. no pre-defined tags used as in HTML. This language is...

2 minutes read.

Top 15 Foundation Interview Questions for 2024

1) What is Foundation? Foundation is a front-end framework that is for designing beautiful responsive websites. This framework is compatible with all types of devices and provides you with HTML, CSS...

2 minutes read.

Top 15 PostgreSQL Interview Questions for 2024

1) What is PostgreSQL? PostgreSQL is a most advance open source database system. PostgreSQL is an object Oriented Relational Database Management System (ORDBMS). PostgreSQL source code is available free of charge...

3 minutes read.

Top 30 AJAX Interview Questions for 2024

1) What is AJAX? AJAX (Asynchronous JavaScript and XML) create better, faster and interactive web-apps. It provides data transfer between web-server and browser. 2) List some advantages of AJAX Advantages are: More Interactive: Very...

3 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.

Top 16 WebGL Interview Questions for 2024

1) What is WebGL? WebGL stands for Web Graphics Library. It is a JavaScript API that is used for rendering 3D graphic in any compatible web browser. It is written in...

3 minutes read.