InterviewSolution
| 1. |
Explain The Working Of Sql Privileges? |
|
Answer» SQL GRANT and REVOKE commands are used to implement privileges in SQL multiple user environments. The administrator of the DATABASE can grant or revoke privileges to or from USERS of database OBJECT like SELECT, INSERT, UPDATE, DELETE, ALL etc. GRANT Command: This command is used provide database access to user apart from an administrator. Syntax: GRANT privilege_name ON object_name TO {user_name|PUBLIC|role_name} [WITH GRANT OPTION]; In above syntax WITH GRANT OPTIONS indicates that the user can grant the access to another user too. REVOKE Command: This command is used provide database deny or remove access to database objects. Syntax: REVOKE privilege_name ON object_name FROM {user_name|PUBLIC|role_name}; SQL GRANT and REVOKE commands are used to implement privileges in SQL multiple user environments. The administrator of the database can grant or revoke privileges to or from users of database object like SELECT, INSERT, UPDATE, DELETE, ALL etc. GRANT Command: This command is used provide database access to user apart from an administrator. Syntax: GRANT privilege_name ON object_name TO {user_name|PUBLIC|role_name} [WITH GRANT OPTION]; In above syntax WITH GRANT OPTIONS indicates that the user can grant the access to another user too. REVOKE Command: This command is used provide database deny or remove access to database objects. Syntax: REVOKE privilege_name ON object_name FROM {user_name|PUBLIC|role_name}; |
|