Compare SQL and PL/SQL

Compare SQL and PL/SQL

SQL Stands for Structured Query Language, while PL/SQL stands for Programming Language SQL. SQL is a domain-specific language created by Oracle. It is primarily used for managing data held in a relational database management system. PL/SQL, on the other hand, is a procedural extension for SQL created by Oracle. It allows one to write a full program, including loops, variables, etc., and to accomplish multiple selects/inserts/updates/deletes, i.e. things that weren’t possible with SQL. Here are some of the primary differences between SQL and PL/SQL:

SQL

PL/SQL

SQL Stands for Structured Query Language

PL/SQL stands for Programming Language SQL.

SQL is used to execute single query.

PL/SQL is used to execute multiple statements.

SQL tells the database what to do but not how to do. So it is declarative.

PL/SQL tells the database how to do things. So it is procedural.

SQL can be used in PL/SQL programs.

PL/SQL can’t be used in SQL statement.

SQL is used with various database systems like MySQL, SQL Server, Oracle, DB2, etc.

PL/SQL is used only with Oracle database.

SQL is a data oriented language used to select and manipulate sets of data.

PL/SQL is a procedural language used to create applications

SQL is used to write queries, DDL and DML statements.

PL/SQL is used to write program blocks, functions, procedures triggers,and packages

An example of SQL query is given below.

SELECT * FROM Customers;

An example of PL/SQL program is given below.

BEGIN

dbms_output.put_line(‘Hello Workd’);

 

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.