SQL – Structured Query Language
SQL (structured query language) is programming language used to control and manipulate data from the relational database.
The preliminary version of SQL developed by IBM in 1979 using Edgar F. Codd’s white paper about Relational Model Large Data Banks, later the first SQL product ORACLE released by Relational Software, nowadays knows as ORACLE Corporation.
Previously SQL also called as SEQUEL (Structured English Query Language)
Type of SQL Command
SQL basically its divided into four main categories
1. DDL – Data Definition Language
2. DML – Data Manipulation Language
3. DCL – Data Control Language
4. TCL – Transaction Control Language
1. Data Definition Language
The Data Definition Language(DDL) is used to create and modify the Database object such Database, Table, index, procedure, function .the DDL command are auto commit which mean once changes are made to Database object you cannot rollback it. In this command mostly used by the authorized persons such as DBA, Manger and privileged users. Following SQL statement are come under DDL Command
CREATE – Used for create database object
DROP – Delete the data base object
ALTER – Used for modify the database object
RENAME – Change the Object name
2. Data Manipulation Language
Data Manipulation Language (DML) this commands are used to manipulate data stored in Relational database object. The changes are made by DDL command you can rollback the in certain period in following article we will see more depth about this. This command is commonly used by Business users and developer.
INSERT – Used to add new record or Rows to table
UPDATE – Modify the existing data in table
DELETE – Delete particular or all records from table
SELECT – Used to retrieve data from table or view.
3. Data Control Language
Data Control Language (DCL) this command is used to restrict the access of data in the database by providing and restrict the privilege to the user. This command is fired by DBA and Privileged user. The following statement are comes in this category.
GRANT – Used to provide database object access privilege to user’s
REVOKE – Remove the database object access privilege from user’s
4. Transaction Control Language
Transaction Control Language(TCL) this commands are used for user to manage the changes made by following DML commands Insert, Update, Delete. Commands are come in this category
COMMIT – Used to save changes made by DML statement
ROLLBACK – Used to Restore changes made by DML statement till last commit
SAVEPOINT – used to create point in database transaction to rollback
SET TRANSACTION – Used to modify the transaction option used by rollback segment.
We will see more about above explained commands in future articles.