Open In App

Difference between T-SQL and PL-SQL

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

1. Transact SQL (T-SQL) : T-SQL is an abbreviation for Transact Structure Query Language. It is a product by Microsoft and is an extension of SQL Language which is used to interact with relational databases. It is considered to perform best with Microsoft SQL servers. T-SQL statements are used to perform the transactions to the databases. T-SQL has huge importance since all the communications with an instance of SQL server are done by sending Transact-SQL statements to the server. Users can also define functions using T-SQL. Types of T-SQL functions are :

  • Aggregate functions.
  • Ranking functions. There are different types of ranking functions.
  • Rowset function.
  • Scalar functions.

These additions bring T-SQL within the criteria of the Turing completeness test. Thus Transact-SQL is a programming language. 2. Procedural Language for SQL (PL/SQL) : PL/SQL stands for Procedural Language for SQL. It is a procedural extension for SQL by Oracle Corporation also for the Oracle relational database. It’s major advantage is that it allows use of procedures, procedures are similar to functions. The main highlights of PL/SQL are that it gives us the functionality of iteration, decision making and many more features. The smallest functional unit in PL/SQL is called a block. It can handle exceptions (run-time errors). PL/SQL is an application language, which is usually used to build, format and display the user screens, web pages and reports, while SQL provides data for these applications. Difference between T-SQL and PL-SQL :

S.No T-SQL PL/SQL
1. The full Form of TL-SQL is Transact Structure Query language. The full Form of PL/SQL is Procedural Language Structural Query Language.
2. T-SQL was developed by Microsoft. PL-SQL is developed by Oracle.
3. T-SQL provides a higher degree of control to the programmers. It is a natural programming language that is much compatible with the SQL and provides higher functionality.
4. T-SQL performs best with Microsoft SQL server. PL-SQL performs best with Oracle database server.
5. With help of BULK INSERT statement in T-SQL users can input multiple rows. OOPS concepts like function overloading, information hiding and data encapsulation are supported by using PL/SQL.
6. It is much easier to understand and simple to use. It is considered more complex than T-SQL and more powerful.
7. In T-SQL SELECT INTO statement must be used. In PL/SQL INSERT INTO statement is to be used.
8. In T-SQL, both the DELETE and UPDATE statements are improved to enable data from another table to be used in the operations, without using a subquery. In PL/SQL, subquery is needed to use data from another table in the operation.
9. In T-SQL there is no AUTOCOMMIT command and transactions are saved by using COMMIT command manually after every transaction. In PL/SQL AUTOCOMMIT can be used to automatically commit/save a transaction.

Last Updated : 19 Dec, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads