Pages

Friday 11 October 2013

SQL Introduction

    The SQL stands for Structured Query Language. It is a special purpose language used to manage data held in RDBMS (Relational Database Management System). The capacity of SQL includes data inserting, updating, deleting, query, schema creation and modification, and controlling data access.

    The SQL is an ANSI (American National Standard Institute) standard. The SQL is used as a standard database language by all the relational database systems like Oracle, MySQL, Microsoft SQL Server, MS Access, Sybase, Informix and PostgreSQL.  

History of SQL

     Dr. E.F Codd proposed the relational model for database system in 1970 and SQL was the first commercial language for this relational model. This relational model also formed the basis for today’s relational database management system (RDBMS).

    The SQL was initially developed by IBM in early 1970s. This version of SQL was called as SEQUEL (Structured English Query Language). Later in 1970, the Relational Software, Inc (which is now Oracle Corporation) developed their own SQL based RDBMS. The Oracle V2 for VAX computers was the first commercially available implementation of SQL introduced then by Relational Software, Inc. 

Communication of SQL Statements with RDBMS

   The below diagram shows communication of SQL commands with the RDBMS like oracle, MySQL, etc.   
 


SQL Statement

     The SQL statements are classified as shown below.

Data Retrieval Language

Command
Description
select
used to retrieve records from tables present in database

Data Manipulation Language (DML)

Command
Description
insert
used to insert record into database
update
used to update record present in database
delete
used to delete records from database
merge
used to merge two or more data present in database

Data Definition Language (DDL)

Command
Description
create
used to create objects in database
alter
used to modify existing database object
drop
delete  entire objects from the database
rename
used to rename objects in database
truncate
used to remove a part of data or round off the data present in database

Transaction Control

Command
Description
commit
used to save the changes made to data in database
rollback
used to undo the transaction performed
savepoint
used to set a savepoint within the transaction

Data Control Language

Command
Description
grant
used to give any privilege to user
revoke
used to take by the privilege given to the user