PostgreSQL - Roles and SecurityWhich 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;Check Answer
Step-by-Step SolutionSolution:Step 1: Recall PostgreSQL syntax for permissionsPostgreSQL uses the GRANT command to give permissions to users.Step 2: Match the correct syntaxThe correct syntax is "GRANT SELECT ON table_name TO user_name;", which is the only valid command among the options.Final Answer:GRANT SELECT ON table_name TO user_name; -> Option BQuick Check:GRANT = give permission [OK]Quick Trick: GRANT is the keyword to give permissions in PostgreSQL [OK]Common Mistakes:Using ALLOW instead of GRANTUsing PERMIT or ACCESS which are invalidIncorrect command order
Master "Roles and Security" in PostgreSQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PostgreSQL Quizzes Advanced Features - ENUM types - Quiz 2easy Advanced Features - Extensions (pg_trgm, uuid-ossp, hstore) - Quiz 1easy Advanced Features - Foreign data wrappers concept - Quiz 12easy Advanced Features - Range types (int4range, daterange) - Quiz 14medium Advanced PL/pgSQL - Dynamic SQL with EXECUTE - Quiz 3easy Advanced PL/pgSQL - Dynamic SQL with EXECUTE - Quiz 11easy PL/pgSQL Fundamentals - IF-ELSIF-ELSE control flow - Quiz 6medium Table Partitioning - Why partitioning is needed - Quiz 11easy Table Partitioning - Partitioning best practices - Quiz 6medium Triggers in PostgreSQL - Trigger for data validation - Quiz 14medium