Home » Database Basics » 04 - Databases - Architecture, Management, and Programming
4

Variants of SQL

Tailoring the SQL to suit best the OS and DBMS

Every vendor has come up with a version of SQL that is tailored to their particular DBMS and the Operating System on which their DBMS runs best. Each vendor's version of SQL may contain special features, enhancements or extensions. For example, most vendors offer a field type that automatically increments every time a new record is inserted - this is not described in the SQL standards. One vendor's additions will not work on a competitor's RDBMS. It is always safest to stick to pure SQL whenever possible; otherwise, your code may not run on another DBMS. Take a look at the following table to get an idea about the differences between the SQL Server DBMS's Transact SQL and Oracle's PL/SQL.

Feature

PL/SQL

T-SQL

Indexes

B-Tree indexes,
Bitmap indexes,
Partitioned indexes,
Function-based indexes,
Domain indexes

B-Tree indexes

Tables

Relational tables,
Object tables,
Temporary tables,
Partitioned tables,
External tables,
Index organized tables

Relational tables,
Temporary tables

Triggers

BEFORE triggers,
AFTER triggers,
INSTEAD OF triggers,
Database Event triggers

AFTER triggers,
INSTEAD OF triggers

Procedures

PL/SQL statements,
Java methods,
third-generation language
(3GL) routines

T-SQL statements

Arrays

Supported

Not Supported

Table 4c: Features - T-SQL vs PL/SQL