SnowPro Associate: Platform Question 143
Single answer2.2 Create a database, explore data, configure parameters, and transfer ownership.A Snowflake administrator created a database named SALES_RAW and now needs to hand over full control of that database to the DATA_ENGINEERING role. The administrator wants DATA_ENGINEERING to become the owner of the database so that role can manage future privileges on it. Which command should the administrator run to correctly transfer ownership of the database?
- A
GRANT OWNERSHIP ON DATABASE SALES_RAW TO ROLE DATA_ENGINEERING COPY CURRENT GRANTS
- B
GRANT ALL PRIVILEGES ON DATABASE SALES_RAW TO ROLE DATA_ENGINEERING
- C
ALTER DATABASE SALES_RAW SET OWNER = DATA_ENGINEERING
- D
TRANSFER OWNERSHIP OF DATABASE SALES_RAW TO ROLE DATA_ENGINEERING
Show answer and explanation
Correct answer: A
Explanation
This question tests practical knowledge of transferring ownership in Snowflake. To make another role the owner of a database, the correct command is GRANT OWNERSHIP ON DATABASE ... TO ROLE .... OWNERSHIP is a special privilege and must be transferred explicitly; it is not included in ALL PRIVILEGES. In Snowflake, transferring ownership is significant because the owner controls the object and can manage grants on it. The COPY CURRENT GRANTS clause is commonly used to preserve existing granted privileges during transfer, which aligns with administrative best practices when changing control of production objects. This behavior is documented in Snowflake SQL command reference for GRANT OWNERSHIP and privilege management.
- A. Correct.
Correct. In Snowflake, ownership is transferred using the GRANT OWNERSHIP command. For an object such as a database, the valid pattern is GRANT OWNERSHIP ON DATABASE
TO ROLE <role_name>. Using COPY CURRENT GRANTS preserves existing outbound privileges where supported during the ownership transfer, which is often important in production environments. - B. Incorrect.
Incorrect. Granting ALL PRIVILEGES does not make the role the owner. OWNERSHIP is a special privilege in Snowflake and is not included in ALL PRIVILEGES. A common misconception is that full operational privileges are equivalent to object ownership, but only the OWNERSHIP privilege allows transfer of control and future grant management as the object owner.
- C. Incorrect.
Incorrect. Snowflake does not use ALTER DATABASE ... SET OWNER syntax to transfer object ownership. Someone familiar with other database platforms might expect ownership to be changed through an ALTER statement, but Snowflake requires GRANT OWNERSHIP for this task.
- D. Incorrect.
Incorrect. TRANSFER OWNERSHIP is not valid Snowflake SQL syntax. This distractor is plausible because it describes the intent clearly, but the platform-specific command is GRANT OWNERSHIP.