What is Difference between SQL and PL SQL | SQL Vs PL SQL

Difference between SQL and PL SQL :

In my previous articles i have given different concepts of SQL and PL SQL with its differences, In this article i would like to explain most basic question in everyone’s mind which is ‘What is Difference between SQL and PL SQL?’. I will try to give you difference between SQL and PL SQL with examples. This article is different from other articles because first i will try to explain you the difference between SQL and PL SQL in bullet points then i will give you the difference between SQL and PL SQL in tabular format.

What you will find in this article :

1.What is SQL?

2.What is PL SQL?

3.Difference between SQL and PL SQL

What is SQL and PL SQL Bullet-points :

We all know that Oracle is combination of two database languages which is SQL and PL SQL. SQL stands for Structured Query language in which user may or may not use the programming techniques. The PL SQL is Procedural Language Structured Query Language in which user will be able to use the programming concepts to do the database transactions or to add the business logic. Following bullet points give you the actual Difference between SQL and PL SQL :

1.SQL and PL SQL as Language :

The SQL stands for Structured Query language which is mainly used to issue or execute a single query with insert/update/delete/select. User can not be able to execute multiple statements at a same time.

PL SQL stands for Procedural Language Structured Query Language in which user will be able to execute multiple queries at a same time. PL SQL is proper programming language where user can use the programming concepts like looping,if..else statements to execute multiple statements at a same time. The bunch of SQL statements are used in one PL SQL program.

2.SQL and PL SQL Usages :

The SQL statements are mostly used to create analytical reports, web pages and screens. The SQL statements are used in supporting applications also. If user wants to update something in application then simple sql statement needs to be fired from support team. The best use of SQL statement are in to reporting techniques.

PL SQL is mainly used to add the Business logic for specific module or for specific application.User can add total business logic in to PL SQL using multiple programming techniques just like java and php. So the main use of PL SQL language is to add the complex business logic at back-end level.

3.SQL and PL SQL as Data and Program Oriented :

SQL is data oriented language which is mainly used to process and analyse the data using simple queries like insert,update and delete.

PL SQL is procedural language which is mainly used to create the applications as well as will use to add business logic in to application from back-end systems.

4.SQL and PL SQL Objects :

SQL is simple used to write the DDL statements as well as DML statements.

PL SQL is used to write procedures,views,functions,packages,triggers. These are called as PL SQL objects.

5. SQL and PL SQL Execution :

The sql statements are simply executed one statement at a time.

The PL SQL statements are set of different sql statements. These are executed using blocks. So the PL SQL statements are executed as a block of code.

6. SQL and PL SQL instruction to databases :

SQL statements are also called as declarative statements. The SQL statements tells the database what to do but not able to tell the database how to do the things?

PL SQL is procedural language which tells the database about how to do the things.

7. Embedding SQL into PL SQL :

You can embed SQL in to PL SQL block but can not embed PL SQL code in to SQL.

These are above some important bullet points of Difference between SQL and PL SQL. In next section i will explain the difference between SQL and PL SQL in to tabular format.

Difference between SQL and PL SQL in tabular format :

                         SQL                        PL SQL
SQL Stands for Structured Query language in which single SQL statement is executed at a time. PL SQL stands for Procedural Language Structured Query Language which is used as programming language in databases.
SQL simply used to perform DDLs (Data Definition Language) and DMLs with using single query at a time. PL SQL is nothing but the block of code embed with SQL statements which is used to add business logic with using programming concepts.
SQL is called as declarative language which is used to define what needs to be done. PL SQL is called as procedural language which is used to define how the things should be done.
SQL executes as a single statement. PL SQL executes as a block. The code of PL SQL is always written in to the block.
The main use of SQL statement is to process and manipulate the data. The SQL statements are mainly used for reporting purpose. PL SQL statements are used to perform the transactions to the databases. PL SQL is mainly used to build the application logic.
SQL directly interacts with database server There is no interaction between database server.
User can add SQL in to PL SQL statements User can not add PL SQL in to SQL statements

The above table gives you difference between SQL and PL SQL. Hope you get the idea about difference between SQL and PL SQL. If you like this article or if you have any questions regarding this article kindly comment in to comment section.

2 Replies to “What is Difference between SQL and PL SQL | SQL Vs PL SQL”

Comments are closed.