Bird
0
0

Which of the following is the correct syntax to enable row-level security on a table named employees?

easy📝 Syntax Q12 of 15
PostgreSQL - Roles and Security
Which of the following is the correct syntax to enable row-level security on a table named employees?
AALTER TABLE employees SET ROW LEVEL SECURITY ON;
BALTER TABLE employees ENABLE ROW LEVEL SECURITY;
CENABLE ROW LEVEL SECURITY ON employees;
DALTER TABLE employees ACTIVATE RLS;
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct command to enable RLS

    The correct syntax is ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;.
  2. Step 2: Match options with syntax

    Only ALTER TABLE employees ENABLE ROW LEVEL SECURITY; matches the exact syntax for enabling RLS on a table.
  3. Final Answer:

    ALTER TABLE employees ENABLE ROW LEVEL SECURITY; -> Option B
  4. Quick Check:

    Enable RLS uses ALTER TABLE ... ENABLE ROW LEVEL SECURITY [OK]
Quick Trick: Use ALTER TABLE ... ENABLE ROW LEVEL SECURITY to activate RLS [OK]
Common Mistakes:
  • Using SET instead of ENABLE
  • Trying to enable RLS without ALTER TABLE
  • Using incorrect keywords like ACTIVATE

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes