SQL - Security BasicsWhich SQL statement correctly grants SELECT permission on the table 'customers' to user 'alice'?AGRANT SELECT ON customers TO alice;BALLOW SELECT FROM customers TO alice;CPERMIT SELECT ON customers FOR alice;DGIVE SELECT ON customers TO alice;Check Answer
Step-by-Step SolutionSolution:Step 1: Recall the correct SQL syntax for granting permissionsThe standard syntax uses GRANT, followed by the permission, ON the object, TO the user.Step 2: Match the syntax to the optionsOnly GRANT SELECT ON customers TO alice; uses the correct keywords and order.Final Answer:GRANT SELECT ON customers TO alice; -> Option AQuick Check:Grant syntax = GRANT ... ON ... TO ... [OK]Quick Trick: Use GRANT ... ON ... TO ... to assign permissions [OK]Common Mistakes:Using incorrect keywords like ALLOW or PERMITMixing up TO and FOR keywordsOmitting the ON keyword
Master "Security Basics" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Query Patterns - Top-N per group query - Quiz 7medium CASE Expressions - COALESCE and NULLIF as CASE shortcuts - Quiz 3easy Common Table Expressions (CTEs) - Recursive CTE for hierarchical data - Quiz 8hard Database Design and Normalization - Star schema concept - Quiz 5medium SQL Security Basics - Why prepared statements exist - Quiz 1easy Stored Procedures and Functions - Parameters (IN, OUT, INOUT) - Quiz 4medium Triggers - Trigger performance considerations - Quiz 6medium Triggers - Why triggers are needed - Quiz 14medium Triggers - INSERT trigger - Quiz 12easy Window Functions Fundamentals - Window function vs GROUP BY mental model - Quiz 9hard