SQL Statements In MS SQL

main Image
SQL Statements

SQL is divided in four statements.These statements are used for getting definition of database,for manipulation of database tables data,for giving control over database and for controlling transaction performed in database.these types of statements in database are referred as SQL Statements.
SQL Statements are of four types
1. Data Definition Language(DDL)
2. Data Manipulation Language(DML)
3. Data Control Language(DCL)
4. Transaction Control Language(TCL)

Data Definition Language(DDL)

This statement in database are used for creating,altering or modifying the tables in database.
These are as below:
1. CREATE - For creating tables,index,procedure in database.
2. ALTER - For alter or modify tables and their structure.
3. DROP - For removing tables,database or any object in database.

Data Manipulation Language(DML)

This statement in database are used for manipulation of data in tables.They affect the data in database.They are used for selecting,updating,inserting and deleting records in tables.
These are as below:
1. SELECT - For retrieving data from tables.
2. INSERT - For inserting data in tables.
3. UPDATE - For updating data in tables.
4. DELETE - For deleting data in tables.

Data Control Language(DCL)

This statement in database are used for control over database.User can give and revert the permission to other user for accessing that database.
These are as below:
1. GRANT - For granting permission to other user over database.
2. REVOKE - For reverting permission from other user over database.

Transaction Control Language(TCL)

This statement in database for controlling the transaction over database tables.It is used to manage different transactions occurring within a database.
These are as below:
1. COMMIT - For saving all the transaction that are being done before writing this command.
2. ROLLBACK - For reverting any particular transaction and put database in previous mode for executing that transaction.In simple word,it is undo process.
3. BEGIN - For starting any transaction.

I hope this article will help you.