SOL-C01 · Question #75
A data engineer wants to transfer ownership of a database named 'SALES DATA' to a role named 'DATA ADMIN'. The data engineer executes the following command: '"sql GRANT OWNERSHIP ON DATABASE SALES DAT
The correct answer is A. The data engineer does not have the 'OWNERSHIP' privilege on the 'SALES_DATA database.. Transferring ownership in Snowflake requires that the executing role currently holds the OWNERSHIP privilege on the object. Without it, Snowflake will deny the command regardless of other privileges - you cannot give away what you don't own. Why the distractors are wrong: B & C -
Question
A data engineer wants to transfer ownership of a database named 'SALES DATA' to a role named 'DATA ADMIN'. The data engineer executes the following command: '"sql GRANT OWNERSHIP ON DATABASE SALES DATA TO ROLE DATA ADMIN; However, the command fails. Which of the following is the MOST likely reason for the failure?
Options
- AThe data engineer does not have the 'OWNERSHIP' privilege on the 'SALES_DATA database.
- BThe 'DATA ADMIN' role does not exist.
- CThe 'SALES DATA' database does not exist.
- DThe command is syntactically incorrect. GRANT OWNERSHIP requires a 'REVOKE CURRENT
- EThe data engineer must first relinquish ownership before granting ownership to another role.
How the community answered
(54 responses)- A63% (34)
- B2% (1)
- C19% (10)
- D6% (3)
- E11% (6)
Explanation
Transferring ownership in Snowflake requires that the executing role currently holds the OWNERSHIP privilege on the object. Without it, Snowflake will deny the command regardless of other privileges - you cannot give away what you don't own.
Why the distractors are wrong:
- B & C - A non-existent role or database would cause an error, but the question asks for the most likely reason; privilege gaps are far more common in practice.
- D - The
COPY CURRENT GRANTS/REVOKE CURRENT GRANTSclause is optional in Snowflake'sGRANT OWNERSHIPsyntax, so its absence doesn't cause failure. - E - Snowflake transfers ownership atomically in a single command; there is no requirement to manually relinquish it first.
Memory tip: Think of ownership like a property deed - only the current deed holder can sign it over to someone else. If you don't hold the deed (OWNERSHIP privilege), the transfer is rejected at the door.
Topics
Community Discussion
No community discussion yet for this question.