ITP

BE - Database Management Systems

What is role? How can we authorize a user using grant and revoke command? Give example.

In : BE Subject : Database Management Systems

a role is a named collection of privileges that can be assigned to users to simplify authorization management. Instead of granting individual permissions to each user, the database administrator can group related privileges into a role and then assign that role to users. This makes it easier to manage access control, especially when dealing with a large number of users.

Authorization in SQL is mainly managed using the GRANT and REVOKE commands:

  1. GRANT Command:
    The GRANT command is used to provide specific privileges to a user or a role. Privileges can include operations such as SELECT, INSERT, UPDATE, or DELETE on database objects.
    Syntax:

     GRANT privilege_name ON object_name TO user_name;
    GRANT SELECT, INSERT ON Students TO User1;
  2. REVOKE Command:
    The REVOKE command is used to remove previously granted privileges from a user or a role.
    Syntax:

           REVOKE privilege_name ON object_name FROM user_name;

           REVOKE INSERT ON Students FROM User1;

 

 

  • A role groups privileges for easier management.

  • GRANT gives privileges to users or roles.

  • REVOKE removes privileges from users or roles.

 

 

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap