Friday, July 3, 2009

Advantages of SQL

SQL (Structured Query Language) is the language used by relational database management system (RDBMS) for database interaction. It enables users to manipulate, access, and manage the data stored in relational database. The RDBMS is one area of the IT industry where technological developments are taking place at very rapid pace.

SQL came into light in 1974, when a group in IBM developed the first prototype of a relational database called SEQUEL (Structured English Query Language). Software companies other than IBM also started coming up with products that used SQL. This revolution led to the development of ORACLE, which is a product of Relational Software Corporation (now Oracle Corporation). The American National Standard Institute (ANSI) approved the SQL database language project in 1978, which led to the development of SQL Standard language. There are extensions to standard SQL which adds procedural programming language features. These are: PSQL (Procedural SQL), SQLPL (SQL procedural language), TSQL (Transact SQL) etc.

The SQL standards are divided into several parts as follows :
  • The SQL/CLI (Call Level Interface): It defines common interfacing structures that user can use to execute SQL statements from the applications written in other programming languages.


  • The SQL/PSM (Persistent Stored Module): It standardizes procedural extension for SQL.


  • The SQL/MED (Management of External Data): It provides extension to SQL that defines foreign data wrappers and data link types to allow SQL to manage external data.


  • The SQL/OLB (Object Language Binding ): It defines the syntax and semantics of SQLJ, which is SQL embedded in JAVA.
Different Parts of SQL

SQL is divided into several parts as follows:

  • Data Definition Language (DDL): The database objects can be created , altered, or deleted using DDL. The commands used are CREATE, ALTER, and DROP.


  • Data Manipulation Language (DML): DML commands allow users to insert, modify, and delete the data in the database. SQL provides three data manipulation statements: INSERT, UPDATE, and DELETE.


  • Data Query Language: It is one of the most commonly used SQL statement which enable the users to query one or more tables to get the desired result. The statement used is SELECT.


  • Data Control Language (DCL): DCL is mainly related with security purposes, that is, it determines who can access and what operations could be performed on the database.


  • Transaction Control: This includes commands for specifying beginning and ending of the transactions from the database. Statements like COMMIT, START TRANSACTION, and ROLLBACK are used to do this task. Several implementations also allow explicit locking of data for concurrency control.


Advantages of SQL

  1. Applications written in SQL can be easily ported across different systems.


  2. SQL, as a language, provides a greater degree of abstraction and is independent of the ways it is implemented internally.


  3. SQL is not only simple language but also capable of handling complex situations.


  4. SQL can also be used to define data structure, control access to the data, delete, insert, and modify data in the database.


  5. With the help of views, an important feature of SQL, different users of same database can see different views of its structure and content. This feature allows users to deal with only those part of the database with which they are concerned.


  6. The expected results are well defined and thus it becomes easy for users to fire a query and get the result.


  7. SQL allows the users to only think "what to do" and not "how to do". This makes the user to concentrate on the retrieval of the appropriate data and not on the back-end process of retrieval.


  8. SQL uses a free style of syntax that gives the user the flexibility to structure SQL statements.


  9. SQL has high level, English like structure which enables the beginners to follow and understand it very easily.



Thus, it can be concluded that SQL is mainly developed to query data contained in a relational database. SQL is set-based declarative query language, not an imperative language such as C or BASIC. There are several standards for SQL, but the SQL that can be used on various RDBMS today is in different ways. This is mainly because of two reasons:
  • The SQL standard is very complex.
  • Each database vendor needs various ways to differentiate its products from others.
SQL has been used in Oracle's PL/SQL language including the newest Oracle Database 11g features. SQL is also used in Transact-SQL language which is used to administer several instances of the SQL Server Database Engine, to create and manage database. Transact-SQL is an extension of the language defined in the SQL standards published by the International Standard Organization (ISO) and American National Standard Institute (ANSI).

No comments:

Post a Comment