tags:

views:

3894

answers:

5

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

Can anyone explain what the difference between these three are and a scenario where each would be relevantly used?

+7  A: 
  • SQL is a query language to operate on sets.

    It is more or less standartized, 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

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

Procedural languages are designed to extend the SQL's abilities while being able to integrate well with SQL.

They are 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.

Quassnoi
TSQL is also used by Sybase; at least in Oracle, PL/SQL procedures can do a lot more than just manage "business rules"; PL/SQL procedures can access web sites, send email etc.
ammoQ
PL/SQL doesn't solely exist in the database, e.g. Oracle Forms contains a client-side implementation of PL/SQL.
ammoQ
Note each database has it's own implementation of SQL (T-SQL and PL/SQL being two of the more common), ANSII standard SQL is often used when multiple backends are used, but not all databases use all ANSII SQL features either. And the database specific implementation of SQl tends to be the one that performs best for that database - after all they have to give you a reason to use their database, right?
HLGEM
+3  A: 
  • SQL: a language for talking to the database. It lets you select data, mutable and create database objects (like tables, views, etc.), change database settings.
  • PL-SQL: a procedural programming language (with embedded SQL)
  • T-SQL: (procedural) extensions for SQL used by SQL Server
Diederik Hoogenboom
A: 

Pl-sql is used in oracle data bass t-sql is used in Mssql data bass

Asif Ali
@Asif: hello. Did you read the other answers? They said the same thing you just said. That's why I'm going to downvote you.
John Saunders
A: 

The query language that Microsoft SQL Server uses is a variant of the ANSI-standard Structured Query Language, SQL. The SQL Server variant is called Transact-SQL.

madhu
A: 

please can u write cursor , procedures,package program microsoft sql server
plese in form me

raja