Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle SQL vs Oracle PL/SQL [closed]

Tags:

sql

oracle

plsql

I have to learn Oracle SQL for work and am very tempted by the O'Reilly book 'Oracle PL/SQL Programming' as it has been so highly reviewed. However, I am unclear as to whether or not PL/SQL is a different language to SQL or if it is just a superset or if it something else. Can someone please help me here? Thanks.

like image 723
ConorW Avatar asked Nov 06 '12 13:11

ConorW


People also ask

Is Oracle SQL same as PL SQL?

PL/SQL is Oracle's procedural language extension to SQL. PL/SQL allows you to mix SQL statements with procedural constructs. PL/SQL provides the capability to define and execute PL/SQL program units such as procedures, functions, and packages.

Is PL SQL still used?

The answer is that PL/SQL is not growing, but not going away either. Because it is used in the Oracle database, and the Oracle database is a fixture of enterprise systems world-wide, it will outlive you. High-performance batch processing has to happen close to the data, so PL/SQL will continue to rule in this area.


2 Answers

SQL is a data query and manipulation langauge. PL/SQL is a procedural programming language.

PL/SQL is Turing complete language, with syntax for building complicated programmes. It also has a large number of libraries which give it a great range of capabilties. However, undoubtedly its main use is building stored procedures which embed SQL statements for retrieving and working with data. So to that extent PL/SQL is a superset of SQL.

Although in earlier versions of the database the PL/SQL SQL engine lagged behind the database engine so some SQL functionality was not available in PL/SQL. Since 9i Oracle has mad a concerted effort to keep the two in step, and its pretty hard to find anything we can do in pure SQL which we cannot also do in PL/SQL.

like image 88
APC Avatar answered Nov 08 '22 20:11

APC


it is a superset.

all of SQL plus some PROCEDURAL extensions - so you can have variables, loops, conditional logic etc.

like image 29
Randy Avatar answered Nov 08 '22 21:11

Randy