SQL, TSQL and PL/SQL

The distinction between SQL, TSQL, and PL/SQL is a question that regularly arises while teaching data platform courses because these terminologies are used frequently in the database industry.

SQL:
SQL is a programming language used to store and process data in relational databases. A relational database is a tabular database that stores information in tabular form, with rows and columns reflecting different data qualities and the various relationships between the data values.

SQL statements are used to conduct operations such as storing data, updating, removing data, searching for data, and retrieving data from a database. SQL can also be used to maintain and improve database performance.

MySQL, PostgreSQL, Oracle, Sybase, Microsoft SQL Server, and other popular relational database management systems/products.

PL/SQL:
Oracle created PL/SQL (Procedure Language to SQL) to extend the capabilities of SQL by combining SQL with procedural elements of programming languages. Conditional statements, loops, arrays, strings, exceptions, collections, records, triggers, functions, procedures, cursors, and other features are supported by the PL/SQL language.

It was created since SQL does not enable the techniques of condition checking, looping, and branching. Moreover, passing SQL statements to the Oracle engine one at a time increases traffic and degrades speed.

TSQL:
Transact-SQL is a procedural language (originally developed by Sybase and now owned by Microsoft) and is a programming extension that adds various features to the Structured Query Language, which is used to connect with relational databases.

It supports local variables, transaction control, bulk processing, error or exception handling, and a variety of string and row processing support functions. T-SQL syntax differs from PL-SQL syntax. Nonetheless, it has the same capabilities as other languages and produces identical outputs.

Hope this helps.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s