Bird
0
0

Which PostgreSQL command is used to give a user permission to SELECT data from a table?

easy📝 Syntax Q12 of 15
PostgreSQL - Roles and Security
Which PostgreSQL command is used to give a user permission to SELECT data from a table?
AALLOW SELECT ON table_name TO user_name;
BGRANT SELECT ON table_name TO user_name;
CPERMIT SELECT FROM table_name TO user_name;
DACCESS SELECT ON table_name TO user_name;
Step-by-Step Solution
Solution:
  1. Step 1: Recall PostgreSQL syntax for permissions

    PostgreSQL uses the GRANT command to give permissions to users.
  2. Step 2: Match the correct syntax

    The correct syntax is "GRANT SELECT ON table_name TO user_name;", which is the only valid command among the options.
  3. Final Answer:

    GRANT SELECT ON table_name TO user_name; -> Option B
  4. Quick Check:

    GRANT = give permission [OK]
Quick Trick: GRANT is the keyword to give permissions in PostgreSQL [OK]
Common Mistakes:
  • Using ALLOW instead of GRANT
  • Using PERMIT or ACCESS which are invalid
  • Incorrect command order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes