Tuesday, 24 March 2015

SQL Server Commands

SQL Server Commands- DDL, DML, TCL, DCL :


DML Commands : DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database.

Examples : SELECT, UPDATE, INSERT statements

Select : It is used to extract the data from one or combination of tables
Update : It is used to update the data in a database table.
Delete : It is used to delete data from the database table.
Insert Into : It is used to insert data into a database(table)

DDL Commands : DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database.

Examples: CREATE, ALTER, DROP statements

Create Table: It is used to create a Table
Alter Table: It is used to Alter the table definition like adding any columns or deleting any table column.
Drop table: It is used to Drop the table.
Create Index: It is used to Create a Index on a table
Drop Index: It is used to drop a table from the table

DCL Commands : DCL is abbreviation of Data Control Language. It is used to create roles, permissions, and referential integrity as well it is used to control access to database by securing it.

Examples: GRANT, REVOKE statements
Grant : It is used to give access rights to the user for the database
Revoke: It is used to revoke or delete the access rights of some of the users for a given database.

TCL Commands : TCL is abbreviation of Transactional Control Language. It is used to manage different transactions occurring within a database.

Examples: COMMIT, ROLLBACK statements

Commit: This command is used to save the work done by the user.
Rollback:  This command is used to delete the data till the last committed state of the database.

No comments:

Post a Comment