Bird
0
0

Which SQL command is used to remove column-level SELECT permission from a user in PostgreSQL?

easy📝 Conceptual Q2 of 15
PostgreSQL - Roles and Security
Which SQL command is used to remove column-level SELECT permission from a user in PostgreSQL?
AREMOVE SELECT ON column_name FROM user_name;
BREVOKE SELECT (column_name) ON table_name FROM user_name;
CDENY SELECT ON table_name TO user_name;
DDROP PERMISSION SELECT ON table_name FOR user_name;
Step-by-Step Solution
Solution:
  1. Step 1: Recall the syntax for revoking permissions in PostgreSQL

    PostgreSQL uses REVOKE to remove permissions.
  2. Step 2: Identify correct syntax for column-level revoke

    REVOKE SELECT (column_name) ON table_name FROM user_name; is the correct form.
  3. Final Answer:

    REVOKE SELECT (column_name) ON table_name FROM user_name; -> Option B
  4. Quick Check:

    Revoke column permission = REVOKE SELECT (col) ON table [OK]
Quick Trick: Use REVOKE with column list in parentheses for column permissions [OK]
Common Mistakes:
  • Using DENY which is not valid in PostgreSQL
  • Trying REMOVE or DROP PERMISSION commands which don't exist
  • Omitting parentheses around column name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes