
Answer-first summary for fast verification
Answer: ALTER DATABASE ROLE d1.r1 RENAME TO d1.r4;
The question asks to rename a shared database role from `r1` to `r4`. In Snowflake, database roles are scoped to a specific database, so the correct syntax is `ALTER DATABASE ROLE <database>.<role> RENAME TO <database>.<new_role_name>`. Option D (`ALTER DATABASE ROLE d1.r1 RENAME TO d1.r4;`) correctly uses the `ALTER DATABASE ROLE` command and maintains the same database scope (`d1`), which is required for renaming database roles. Option A uses `ALTER ROLE` instead of `ALTER DATABASE ROLE`, which is incorrect for database roles. Option B and Option C attempt to change the database scope (from `d1` to `d2`), which is not allowed when renaming a database role; the database must remain the same. The community discussion confirms D as the correct answer with 100% consensus, referencing Snowflake documentation that supports the syntax used in D.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.