0% found this document useful (0 votes)
2 views2 pages

Program 11

PL/SQL is an extension of SQL that incorporates procedural programming features, enabling complex database applications with capabilities like loops and exception handling. Key differences between SQL and PL/SQL include the presence of variables and control structures in PL/SQL, while SQL is primarily data-oriented and declarative. PL/SQL allows for modular code and high processing speed for large data operations, making it essential for database developers.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Program 11

PL/SQL is an extension of SQL that incorporates procedural programming features, enabling complex database applications with capabilities like loops and exception handling. Key differences between SQL and PL/SQL include the presence of variables and control structures in PL/SQL, while SQL is primarily data-oriented and declarative. PL/SQL allows for modular code and high processing speed for large data operations, making it essential for database developers.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PROGRAM 11

P11: I n t r o d u c t i o n o f P L / S Q L . D i f f e r e n t i a t e b e t w e e n S Q L v s
PL/SQL. Implement by example
PL/SQL:
PL/SQL (Procedural Language/Structured Query Language) is an extension of SQL (Structured
Query Language) that integrates procedural constructs, allowing for the creation of powerful and
complex database applications. Developed by Oracle Corporation, PL/SQL enables users to
manipulate data, define business logic, and automate tasks within the Oracle database environment.
With its procedural capabilities such as loops, conditions, and exception handling, PL/SQL
facilitates the creation of modular, maintainable, and efficient code for tasks ranging from simple
data retrieval to intricate data processing and manipulation, making it a fundamental tool for
database developers and administrators alike.
DIFFERENCE BETWEEN PL/SQL AND SQL:

Sr. Basis of SQL PL/SQL


No. Comparison

1. Definition It is a database Structured Query It is a database programming


Language. language using SQL.

2. Variables Variables, constraints, and data


Variables are not available in SQL. types features are available in
PL/SQL.

3. Control structures Control Structures are available


No Supported Control Structures like for
like, for loop, while loop, if, and
loop, if, and other.
other.

4. Nature of It is an application-oriented
It is a Data-oriented language.
Orientation language.

5. Operations PL/SQL block performs Group of


Query performs the single operation in
Operation as a single block resulting
SQL.
in reduced network traffic.

6. Declarative/
Procedural SQL is a declarative language. PL/SQL is a procedural language.
Language

7. Embed SQL can be embedded in PL/SQL. PL/SQL can’t be embedded in SQL.

8. Interaction with It directly interacts with the database It does not interact directly with the
Server server. database server.

9. Exception SQL does not provide error and PL/SQL provides error and
Handling exception handling. exception handling.
Sr. Basis of SQL PL/SQL
No. Comparison

10. Writes It is used to write queries using DDL


The code blocks, functions,
(Data Definition Language) and DML
procedures triggers, and packages
(Data Manipulation Language)
can be written using PL/SQL.
statements.

11. Processing Speed SQL does not offer a high processing PL/SQL offers a high processing
speed for voluminous data. speed for voluminous data.

12. Application You can use PL/SQL to develop


You can fetch, alter, add, delete, or
applications that show information
manipulate data in a database using SQL.
from SQL in a logical manner.

SYNTAX:
CREATE VIEW <view_name> AS SELECT <set of fields>
FROM relation_name WHERE (Condition)
QUERY:
CREATE VIEW view_employee AS SELECT * FROM employee WHERE (salary >
200000)
SELECT * FROM view_employee
RESULT:

You might also like