0
4.4kviews
Short notes on Data Control Commands in SQL
1 Answer
written 8.4 years ago by |
DCL is the simplest of the SQL subsets, as it consists of only three commands:
i. GRANTCommand- Give user access privileges to a database
Example:
GRANT SELECT ON employee TO cr7; GRANT SELECT, UPDATE, DELETE ON employee TO cr7;
ii. REVOKE Command- withdraws access privileges given with the GRANT or taken with the DENY command
Example:
REVOKE SELECT ON employee FROM cr7;
REVOKE SELECT, UPDATE, DELETE FROM cr7;
iii. Deny Command- deny user access
The SQL Command for this:
DENY [permission]
ON [object]
TO [user]
Example:
DENY DELETE
ON HR.employees
Access is a four-part relationship -