COF-C02 · Question #417
Which SQL command can be used to verify the privileges that are granted to a role?
The correct answer is C. SHOW GRANTS TO ROLE <Role Name>. The correct syntax is SHOW GRANTS TO ROLE <role_name>, which lists all privileges that have been granted TO that role (i.e., what the role is allowed to do). Option A (SHOW GRANTS ON ROLE) shows which principals have been granted the ability to use the role itself - it is about…
Question
Which SQL command can be used to verify the privileges that are granted to a role?
Options
- ASHOW GRANTS ON ROLE <Role Name>
- BSHOW ROLES <Role Name>
- CSHOW GRANTS TO ROLE <Role Name>
- DSHOW GRANTS FOR ROLE <Role Name>
How the community answered
(54 responses)- A7% (4)
- B4% (2)
- C87% (47)
- D2% (1)
Explanation
The correct syntax is SHOW GRANTS TO ROLE <role_name>, which lists all privileges that have been granted TO that role (i.e., what the role is allowed to do). Option A (SHOW GRANTS ON ROLE) shows which principals have been granted the ability to use the role itself - it is about access to the role, not what the role can access. Option B (SHOW ROLES) lists roles that exist, not their privileges. Option D uses 'FOR', which is not valid Snowflake syntax for this purpose. The distinction between 'TO ROLE' (role's permissions) and 'ON ROLE' (who can assume the role) is a common exam trap.
Topics
Community Discussion
No community discussion yet for this question.