Microsoft SQL Server is a relational database management system (RDBMS) developed by Microsoft.
There are mainly 4 types of language statements or commands in SQL Server.
DML
DML is abbreviation of Data Manipulation Language. It is used to retrieve, modify, add, and delete data in database.
SQL Server Languages – DML, DDL, DCL & TCL
Examples: SELECT, UPDATE, INSERT and 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 database.
- DELETE: used for deleting the already existing data from database.
DDL
DDL is abbreviation of Data Definition Language. It is used to create, modify and destroy the structure of database objects in 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 table and to reset identity of column to initial value.
DCL
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: used for creating access permissions for users to database.
- REVOKE: used for revoking the already assigned permissions.
TCL
TCL is 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.
SQL Server Languages – DML, DDL, DCL & TCL
SQL Server Languages DML, DDL, DCL and TCL
A heartily welcome to the blog! This is my first post in SQL Server category. Hope you will enjoy reading.
Here we conclude our topic. Hope it helped you in knowing different type of language commands in SQL Server.