nerdexam
Snowflake

COF-C02 · Question #61

What SQL command would be used to view all roles that were granted to USER1?

The correct answer is A. show grants to user USER1. The correct Snowflake syntax to view all roles granted to a specific user is: SHOW GRANTS TO USER <username>. The keyword TO indicates you are looking at what has been granted TO the user (i.e., which roles they have received). Option B (SHOW GRANTS OF USER) is not valid…

Account Access and Security

Question

What SQL command would be used to view all roles that were granted to USER1?

Options

  • Ashow grants to user USER1;
  • Bshow grants of user USER1;
  • Cdescribe user USER1;
  • Dshow grants on user USER1;

How the community answered

(22 responses)
  • A
    91% (20)
  • B
    5% (1)
  • C
    5% (1)

Explanation

The correct Snowflake syntax to view all roles granted to a specific user is: SHOW GRANTS TO USER <username>. The keyword TO indicates you are looking at what has been granted TO the user (i.e., which roles they have received). Option B (SHOW GRANTS OF USER) is not valid Snowflake syntax. Option C (DESCRIBE USER) shows user account properties and attributes but not role assignments. Option D (SHOW GRANTS ON USER) uses the ON keyword, which is used to show what privileges have been granted ON an object (e.g., ON a table or database), not TO a user.

Topics

#SQL Commands#User Management#Role Management#Grants

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice