Welcome to our free Oracle PL/SQL tutorial. This tutorial is based on Webucator's Oracle PL/SQL Training course.
Oracle PL/SQL is designed to extend and integrate with Oracle SQL. While SQL itself is powerful and can accomplish many tasks, it is a set-oriented language designed to obtain and manipulate data in a relational database system (RDBMS). Even though Oracle SQL includes additional functionality unavailable in ANSI standard SQL, it lacks the features available in procedural languages. A procedural language provides the ability to assign values to variables, execute statements in sequence, iterate, and conditionally process commands. Hence, PL/SQL (or Procedural Language extensions to the Structured Query Language) was designed by Oracle to provide such features within the database.
A SQL user typically constructs a query to perform an operation on data in the database. Although several queries can be executed in sequence, the fundamental programming unit in SQL is a single statement. A PL/SQL user typically creates a program that includes variable declaration and assignment, conditional statements (e.g. IF/ELSE statements), and loops (e.g. FOR or WHILE statements). The program can contain many SQL statements, including statements that are dynamically generated. In addition, PL/SQL provides mechanisms to seamlessly integrate SQL and so effectively extends the capabilities present in SQL alone.
Many languages can be used with SQL embedded in them, but PL/SQL executes within the database itself. Although there are other languages that can execute within the Oracle database (Java for instance), they are simply general purposes languages that are available in this environment. PL/SQL was specifically designed for to interact closely with SQL within the Oracle database.