Bird
0
0

Which PostgreSQL command is used to allow a user to add new rows to a specific table?

easy📝 Conceptual Q1 of 15
PostgreSQL - Roles and Security
Which PostgreSQL command is used to allow a user to add new rows to a specific table?
AGRANT SELECT ON table_name TO user_name;
BGRANT UPDATE ON table_name TO user_name;
CREVOKE DELETE ON table_name FROM user_name;
DGRANT INSERT ON table_name TO user_name;
Step-by-Step Solution
Solution:
  1. Step 1: Understand the permission types

    INSERT permission allows adding new rows to a table, SELECT allows reading data, DELETE allows removing rows, and UPDATE allows modifying existing rows.
  2. Step 2: Identify the correct command for adding rows

    The command to allow adding rows is GRANT INSERT ON table_name TO user_name; which grants INSERT permission on the table.
  3. Final Answer:

    GRANT INSERT ON table_name TO user_name; -> Option D
  4. Quick Check:

    INSERT permission = GRANT INSERT ON table_name TO user_name; [OK]
Quick Trick: INSERT permission lets users add rows to tables [OK]
Common Mistakes:
  • Confusing SELECT with INSERT permission
  • Using REVOKE instead of GRANT to give permission
  • Granting UPDATE instead of INSERT

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes