Bird
0
0

What does the GRANT SELECT ON table_name TO user_name; command do in PostgreSQL?

easy📝 Conceptual Q11 of 15
PostgreSQL - Roles and Security
What does the GRANT SELECT ON table_name TO user_name; command do in PostgreSQL?
ARemoves all permissions from the user on the specified table.
BAllows the user to delete data from the specified table.
CCreates a new table with the given name.
DAllows the user to read data from the specified table.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the GRANT command

    The GRANT command is used to give specific permissions to users on database objects like tables.
  2. Step 2: Identify the permission type SELECT

    SELECT permission allows reading data from the table but not modifying it.
  3. Final Answer:

    Allows the user to read data from the specified table. -> Option D
  4. Quick Check:

    GRANT SELECT = read permission [OK]
Quick Trick: GRANT SELECT means read access only [OK]
Common Mistakes:
  • Confusing SELECT with DELETE permission
  • Thinking GRANT creates tables
  • Mixing GRANT with REVOKE commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes