SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Types of SQL Server Commands

SQL commands are used as an instruction to communicate with the database to perform specific tasks like create database, delete, update records, alter etc. These commands perform different types of task to execute within the database. With the help of these commands user can create different objects. There are four types of commands that are categorized given below according to their importance or role in database.

DDL (Data Definition Language): These statements are used to define the structure or schema of the database. For example:
  • Create: used to create objects in the database
  • Alter: used to alter or change the database structure
  • Drop: used to delete objects in the database
  • Rename: used to rename the object in the database
  • And truncate, comment etc.
DML (Data Manipulation Language): These statements are used to manipulate or manage data within schema objects. For example:
  • Select: It is used to get back or retrieve data from the database
  • Insert: It is used to insert data into table.
  • Update: It is used to update existing data in the table.
  • Delete: It is used to delete records from the table.
  • Merge: Used to merge insert or update operation.
DCL (Data Control Language): These statements are used to control access to the data within the database. For example:
  • Grant: It is used to give user access to the database.
  • Revoke: It used to release or drop user access to the database by grant command.
TCL (Transaction Control Language): These statements are used to manage changes made by DML statements and helps to group statements in logical transactions. For example:
  • Commit: Used to save process.
  • Rollback: Used to rollback or restore the transaction to the previous state of commit.
  • Savepoint: Used to save a point in transaction which can be further executed.
  • Set Transaction: Used to set transaction level.

Zora's SQL Tips

Hi! I am Zora Stalin, an IT geek and a passionate learner of technology. Besides my job as an Information Technology Analyst, I love searching and sharing new things that excite me help for others.


Leave a comment on the original post [sqlserveroverview.blogspot.com, opens in a new window]

Loading comments...