Learn with Yasir

Share Your Feedback

Administrations


Administrations

Roles and Privileges

🟢 Basic Questions

  1. What is a role in PostgreSQL?
  2. What is the benefit of using group roles?
  3. Differentiate between
    • LOGIN role
    • NOLOGIN role
  4. What is the purpose of the GRANT command in PostgreSQL?
  5. What is the purpose of the REVOKE command in PostgreSQL?
  6. What is the difference between GRANT and REVOKE?
  7. What does GRANT SELECT ON table TO role do?

🟡 Conceptual Questions

  1. What does WITH GRANT OPTION mean?
  2. Write a SQL command to give SELECT permission on table students to role teacher.

🔵 SQL Practice Questions

  1. Write a command to give all privileges on a table to a role admin_role.
  2. How do you grant CONNECT privilege on a database to a role?

🔴 Scenario-Based Questions

  1. In a university system, how will you give teachers permission to view and update student records?
  2. Why is it dangerous to use GRANT ALL PRIVILEGES in production systems?