SQL Server : Structured Query Language

Structured Query Languages :

SQL is a standard that every database should follow. That means all the SQL commands should work in all databases. Based on the type of operations we are performing on the database, SQL is divided into the following types:

  • Data Definition Language (DDL)
  • Data Manipulation Language (DML)
  • Transaction Control Language (TCL)
  • Data Control Language (DCL)

Data Definition Language :

It is used to create an object (e.g table), alter the structure of an object and also to delete the object from the server. All these commands will effect only the structure of the database object. The commands contained by this language are :

  • CREATE - Used to create an object
  • ALTER - Used to modify an existing object
  • DROP - Used to delete the object
  • TRUNCATE - Used to delete only the data of an object
Note : DDL commands are AUTO COMMIT. i.e with the execution of these commands, the results will be stored directly into the database.

Data Manipulation Language :

The DML commands are most frequently used SQL Commands. They are used to query and manipulate existing objects like tables. They should affect only the data of an existing structure. The commands existing in this language are:

  • SELECT - Used to query the object data
  • INSERT - Used to enter the data into the object
  • UPDATE - Used to modify existing objects data
  • DELETE - Used to delete the data of an object.

Transaction Control Language :

A transaction is a logical unit of work. All changes made to the database can be referred to as a transaction.
Whenever, we perform a DML operation, results will be stored in the buffer not in the database. The user can control Transaction changes with the use of this language commands. They are :

  1. COMMIT - Used to make the changes permanent
  2. ROLLBACK - Used to undo the changes

Transaction Control Languages in sql server

Data Control Language :

In general to access ab object which was created by another user, at first, we must get the permission from the owner of the object. To provide the permission or remove the permission, we use this language commands. They are

  • GRANT - Used to provide Permission
  • REVOKE - Used to remove the Permission


Post a Comment