Data Control Language DCL Revoke and Grant Command in SQL

Data Control Language (DCL) Command

An information control dialect (DCL) is a sentence structure like a PC programming dialect used to control access to information put away in a database (Authorization). Specifically, it is a segment of Structured Query Language (SQL). Samples of DCL summons include: GRANT to permit indicated clients to perform determined assignments.

Data Control Language (DCL) is used to control privileges within the Database. These privileges are usually required to perform any operation within the database, such as for creating tables, sequences, or views. Privileges are of two types,

  • System:  session creation, table etc. are all types of system privilege.
  • Object : any query or command, to work on tables, comes under object privilege.

DCL perform two commands,

  • Grant: Grants user access privileges to database.
  • Revoke: Revoke the permissions from a user. 

To Allow a User to create a Session                         :                                          grant create session to username;

To Allow a User to create a Table                             :                                               grant create table to username;

To Grant all privilege to a User                                   :                                                         grant sysdba to username;

To Grant permission to create any Table               :                                       grant create any table to username;

To Grant permission to Drop any Table                  :                                          grant drop any table to username;

To take back Permissions                                             :                                      revoke create table from username;

More Related Articles For You

    DBMS Tutorial

    SQL and DBMS Interview Questions with Answers

    DBMS and SQL Practice Tests , Questions and Quizzes