4.4 Data Control Language
DCL – GRANT and REVOKE statements.
DCL statements are those which are used to control access permissions on the tables, indexes, views and other elements of the DBMS.
Granting & Revoking Privileges
Query:
GRANT ALL <------------------ ON customers TO ashraf; | Grants all permissions on the table customers to the user who logs in as 'ashraf'.
|
Query:
GRANT SELECT <-------------- ON customers TO sunil; | Grants SELECT permission on the table customers to the user 'sunil'. User 'sunil' does not have permission to insert, update, delete or perform any other operation on customers table.
|
GRANT SELECT ON customers TO sunil WITH GRANT OPTION; <--------- |
Enables user 'sunil' to give SELECT permission on customers table to other users. |
REVOKE DELETE <------------- ON customers FROM ashraf; | Takes away DELETE permission on customers table from user 'ashraf'. |
Leave a Comment