Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between SQL, PL-SQL and T-SQL?

Tags:

sql

tsql

plsql

What is the difference between SQL, PL-SQL and T-SQL?

Can anyone explain what the differences between these three are, and provide scenarios where each would be relevantly used?

like image 810
Goober Avatar asked Jun 25 '09 10:06

Goober


People also ask

What is the difference between SQL and T-SQL?

The obvious difference is in what they are designed for: SQL is a​ query language used for manipulating data stored in a database. T-SQL is also a query language, but it's an extension of SQL that is primarily used in Microsoft SQL Server databases and software.

Can I use T-SQL in Oracle?

T-SQL was originally developed by Sybase and now owned by Microsoft. Hence, it works with Microsoft SQL Server only. P/L SQL was developed by Oracle and works with Oracle only. All database objects like Tables/Views/Procedures are internally organized by database names.

Which is better PL SQL or SQL?

Q: Which is better: SQL or PL/SQL? PL/SQL is an extension of SQL and further includes many procedural features like function, data variables, exception handling, and triggers. Moreover, PL/SQL allows us to transfer an entire block of statements to the database at once whereas SQL executes a single query at a time.

Why we use PL SQL instead of SQL?

Advantages of PL/SQL Because of this tight integration of the two programs, PL/SQL enables users to utilize all SQL data manipulation, cursor control, transaction statements and all other SQL functions, operators and pseudo-columns. Users aren't required to convert between PL/SQL and SQL data types.


1 Answers

  • SQL is a query language to operate on sets.

    It is more or less standardized, and used by almost all relational database management systems: SQL Server, Oracle, MySQL, PostgreSQL, DB2, Informix, etc.

  • PL/SQL is a proprietary procedural language used by Oracle

  • PL/pgSQL is a procedural language used by PostgreSQL

  • TSQL is a proprietary procedural language used by Microsoft in SQL Server.

Procedural languages are designed to extend SQL's abilities while being able to integrate well with SQL. Several features such as local variables and string/data processing are added. These features make the language Turing-complete.

They are also used to write stored procedures: pieces of code residing on the server to manage complex business rules that are hard or impossible to manage with pure set-based operations.

like image 161
Quassnoi Avatar answered Oct 19 '22 16:10

Quassnoi