PostgreSQL - Roles and SecurityWhich 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;Check Answer
Step-by-Step SolutionSolution:Step 1: Understand the permission typesINSERT permission allows adding new rows to a table, SELECT allows reading data, DELETE allows removing rows, and UPDATE allows modifying existing rows.Step 2: Identify the correct command for adding rowsThe command to allow adding rows is GRANT INSERT ON table_name TO user_name; which grants INSERT permission on the table.Final Answer:GRANT INSERT ON table_name TO user_name; -> Option DQuick 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 permissionUsing REVOKE instead of GRANT to give permissionGranting UPDATE instead of INSERT
Master "Roles and Security" in PostgreSQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PostgreSQL Quizzes Advanced Features - Range types (int4range, daterange) - Quiz 7medium Advanced PL/pgSQL - Functions returning TABLE - Quiz 11easy Advanced PL/pgSQL - Dynamic SQL with EXECUTE - Quiz 3easy Indexing Strategies - Analyzing index usage with pg_stat - Quiz 11easy PL/pgSQL Fundamentals - RETURN and RETURN NEXT - Quiz 13medium Performance Tuning - Work_mem and effective_cache_size tuning - Quiz 1easy Roles and Security - GRANT and REVOKE permissions - Quiz 11easy Table Partitioning - Partition pruning behavior - Quiz 14medium Transactions and Concurrency - Transaction isolation levels - Quiz 13medium Transactions and Concurrency - Row-level locking (FOR UPDATE, FOR SHARE) - Quiz 3easy