In this blog, we are listing the different types of SQL Server Languages termed as commands or statements.
These statements or commands are categorized as per their functionality.
Topics Covered
SQL Server Languages or Commands
There are mainly four types of language statements or commands in SQL Server – DML, DDL, DCL, and TCL.
Let’s find out more about each one of them in detail.
DML
DML is the abbreviation of Data Manipulation Language. It is used to retrieve, modify, add, and delete data in the database.
Examples: SELECT, UPDATE, INSERT, DELETE statements
- SELECT – used for retrieving data from the database.
- UPDATE – used for modifying the data in the database.
- INSERT – used for adding or inserting new data into the database.
- DELETE – used for deleting the already existing data from the database.
⭐ SELECT is a DQL (Data Query Language) statement. Since its the only DQL statement, we have covered in under DML.
DDL
DDL is an abbreviation of Data Definition Language. It is used to create, modify, and destroy the structure of database objects in the database.
Examples: CREATE, ALTER, DROP, TRUNCATE statements
- CREATE – used for creating database objects like tables, stored procedures, functions, etc.
- ALTER – used for modifying the existing database objects like tables, stored procedures, functions, etc.
- DROP – used to drop or delete the existing database objects.
- TRUNCATE – used to delete all the records from the table and to reset the identity of the column to initial value.
DCL
DCL is the abbreviation of Data Control Language. It is used to create roles, permissions, and referential integrity as well it is used to control access to the database by securing it.
Examples: GRANT, REVOKE statements
- GRANT – used for creating access permissions for users to the database.
- REVOKE – used for revoking the already assigned permissions.
TCL
TCL is the abbreviation of Transactional Control Language. It is used to manage different transactions occurring within a database.
Examples: COMMIT, ROLLBACK, SAVE TRANSACTION statements
- COMMIT – used for saving the work done in a particular transaction.
For example: “Ctrl + S” in word file. - ROLLBACK – used for reverting the transaction to the original state before commit.
For example: “Ctrl + Z” in word file. - SAVE TRANSACTION – used for setting save point in transactions.
To know more about TCL or Transact-SQL or any of these SQL Server Languages, you may refer to Microsoft Docs.
I hope you like the information given for SQL Server Languages or Commands in this blog. Please share it with your friends and colleagues using the below buttons.
[mashshare]
Happy Querying!