DCL Commands of SQL

DCL stands for Data Control Language.  DCL is used to control access on data stored in data base. It is a component of SQL which has similar syntax as a general computer programming language. 
SQL has mainly two following DCL commands - 

1. Grant :- grant authorises one or more permissions to perform an operation or a set of operations on particular section of object of data base.

Syntax :- grant operations on object_name to user1, user2, ... usern with grant option; 

Example :- 
a. Grant select,update on account to Teena with grant option; 

b. Grant all account to Vaishnavi; 

2. Revoke :- revoke eliminates grant permission or authorized from one or more user, which may be the default grant.

Syntax :- revoke operations on object_name from user1, user2. ....

Example :- 
a. Revoke select, update on account from Sheetal;

b. Revoke all on account from Priya;

Grant and revoke commands are used by DBA only because they are responsible for security of data base and DBA is also decide that which operation is performed on which object by which user? So by the use of DCL command DBA provides security to data base against unauthorized access.

No comments:

Post a Comment

Nested SQL Query or SQL Sub Query in hindi in english

if a SQL query is used inside another SQL query then this type of SQL query is called sub-query.  यदि किसी SQL क्वेरी का उपयोग, किसी अन्य SQ...