DCL (Data Control Language)
DCL includes commands such as GRANT and REVOKE which mainly deal with the rights, permissions, and other controls of the database system.
List of DCL commands:
Two important DCL commands and their syntax are:
Command | Description | Syntax |
---|---|---|
GRANT | Assigns new privileges to a user account, allowing access to specific database objects, actions, or functions. | GRANT privilege_type [(column_list)] ON [object_type] object_name TO user [WITH GRANT OPTION]; |
REVOKE | Removes previously granted privileges from a user account, taking away their access to certain database objects or actions. | REVOKE [GRANT OPTION FOR] privilege_type [(column_list)] ON [object_type] object_name FROM user [CASCADE]; |
SQL Commands | DDL, DQL, DML, DCL and TCL Commands
SQL commands are very used to interact with the database. These commands allow users to perform various actions on a database. This article will teach us about SQL commands or SQL sublanguage commands like DDL, DQL, DML, DCL, and TCL.
All important SQL commands with their syntax and examples are covered in this article.
But before heading to the SQL command section, let’s briefly introduce SQL.
Table of Content
- Short Overview of SQL
- DDL (Data Definition Language)
- DQL (Data Query Language)
- DML(Data Manipulation Language)
- DCL (Data Control Language)
- TCL (Transaction Control Language)
- Important SQL Commands
- SQL Commands with Examples