SnowPro Advanced: Data Engineer — Question 84
A Data Engineer runs the following sequence:
use role ACCOUNTADMIN;
create role ROLE1;
grant role ROLE1 to role ACCOUNTADMIN;
grant create database on account to role ROLE1;
use role ROLE1;
create database DB1;
use role ACCOUNTADMIN;
drop role ROLE1;
Who is the owner of database DB1?
Answer options
- A. The deleted ROLE1 remains the owner of the DB1 database.
- B. The ACCOUNTADMIN becomes the owner of the DB1 database.
- C. ROLE1, because the role cannot be dropped as long as it owns the DB1 database.
- D. Database DB1 has no owner.
Correct answer: B
Explanation
The correct answer is B because when ROLE1 is dropped after creating DB1, ownership defaults to ACCOUNTADMIN. Option A is incorrect as ROLE1 is deleted and cannot own DB1 anymore. Option C is wrong because a role can be dropped regardless of ownership, and option D is not valid since the database must have an owner.