Bird
0
0

Given the commands:

medium📝 query result Q13 of 15
PostgreSQL - Roles and Security
Given the commands:
GRANT SELECT ON orders TO alice;
GRANT INSERT ON orders TO bob;
REVOKE SELECT ON orders FROM alice;

Which of the following is true about user permissions on the orders table?
AAlice cannot read data; Bob can insert data.
BAlice can read and insert data; Bob can only insert data.
CAlice can read data; Bob cannot insert data.
DBoth Alice and Bob have no permissions on the table.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze granted permissions

    Alice was granted SELECT (read) permission, Bob was granted INSERT permission.
  2. Step 2: Analyze revoked permissions

    Alice's SELECT permission was revoked, so she no longer can read data.
  3. Final Answer:

    Alice cannot read data; Bob can insert data. -> Option A
  4. Quick Check:

    Revoked SELECT removes read access [OK]
Quick Trick: Revoking removes permission even if previously granted [OK]
Common Mistakes:
  • Assuming revoked permission still applies
  • Confusing INSERT with SELECT
  • Thinking REVOKE affects other users

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes