nerdexam
Snowflake

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…

Account Access and Security

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)
  • A
    7% (4)
  • B
    4% (2)
  • C
    87% (47)
  • D
    2% (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

#SQL Commands#Roles and Privileges#Access Control#Security

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice