Bird
0
0

Which of the following is the correct syntax to grant SELECT permission on column email of table users to user alice?

easy📝 Syntax Q12 of 15
PostgreSQL - Roles and Security
Which of the following is the correct syntax to grant SELECT permission on column email of table users to user alice?
AGRANT SELECT(email) ON users TO alice;
BGRANT SELECT ON users TO alice(email);
CGRANT SELECT ON users(email) TO alice;
DGRANT SELECT TO alice ON users(email);
Step-by-Step Solution
Solution:
  1. Step 1: Recall PostgreSQL syntax for column-level GRANT

    The correct syntax is GRANT SELECT (email) ON users TO alice; (parentheses after privilege).
  2. Step 2: Match options with syntax

    GRANT SELECT(email) ON users TO alice; matches the correct syntax exactly, others misplace keywords or parentheses.
  3. Final Answer:

    GRANT SELECT(email) ON users TO alice; -> Option A
  4. Quick Check:

    GRANT SELECT(column) ON table TO user [OK]
Quick Trick: GRANT SELECT(column) ON table TO user is correct syntax [OK]
Common Mistakes:
  • Placing column name after TO user
  • Putting column inside ON table()
  • Misordering keywords in the statement

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes