Data Control Language in SQL ( DCL Commands )

Data Control Language in SQL

 

What are DCL Commands ??

Data Control Language or shortly called DCL commands are a set of SQL Commands that  provides database security by granting or removing various permissions or privileges for the database given to the users. Thus they control the access level of the data .

Who can provide or remove these privileges to/from the users ??

Only Database Administrators ( DBAs) or Database Owner have the rights to grant or remove privileges from the users.

Types of DCL Commands :

There are two types of DCL Commands :

  • GRANT
  • REVOKE

Before studying these commands in details , It is important to understand what is meant by Privileges and Roles.

Privileges :

Privileges are the permissions given to the users for accessing the database objects.

DCL_1

 

Roles :

Roles may be defined as a bundle or packet of privileges. When a Role is granted to the user automatically all the privileges that comes under it are also assigned to the user. Similar is the case with the revoke.

The main advantage of creating roles is to ease the process of granting and revoking in case of multi user environment where multiple privileges can be granted or revoked at one shot which otherwise would take lot of time if done separately.

The Roles may be of two types :

1. User defined .

2. System defined.

DCL_2

 

Avatar photo

Shikha Katariya

Shikha

You may also like...