nerdexam
Snowflake

SOL-C01 · Question #5

A data engineer needs to create a new database named `SALES DATA in Snowflake. They want to ensure that only users with the 'ACCOUNTADMIN' role can initially modify the database. After creation, they

The correct answer is A. CREATE DATABASE SALES DATA;. Option A is correct because in Snowflake, when a database is created using CREATE DATABASE, ownership is automatically granted to the role that executed the statement. If ACCOUNTADMIN runs the command, it becomes the default owner with full control - no additional syntax is requi

Snowflake Account and Security

Question

A data engineer needs to create a new database named `SALES DATA in Snowflake. They want to ensure that only users with the 'ACCOUNTADMIN' role can initially modify the database. After creation, they will grant specific privileges to other roles. Which of the following SQL statements is the most appropriate way to create the database with these requirements?

Options

  • ACREATE DATABASE SALES DATA;
  • BCREATE OR REPLACE DATABASE SALES DATA;
  • CCREATE DATABASE SALES DATA WITH DATA RETENTION TIME IN DAYS-I;
  • DCREATE DATABASE SALES DATA WITH OWNER = 'ACCOUNTADMIN';
  • ECREATE DATABASE SALES DATA COMMENT = 'Sales Data Database';

How the community answered

(36 responses)
  • A
    81% (29)
  • B
    6% (2)
  • C
    11% (4)
  • D
    3% (1)

Explanation

Option A is correct because in Snowflake, when a database is created using CREATE DATABASE, ownership is automatically granted to the role that executed the statement. If ACCOUNTADMIN runs the command, it becomes the default owner with full control - no additional syntax is required to enforce this.

Why the distractors fail:

  • B (CREATE OR REPLACE) is unnecessary and potentially destructive - it drops and recreates the database if it already exists, which is inappropriate for a brand-new database.
  • C introduces invalid syntax (DATA RETENTION TIME IN DAYS-I); the correct Snowflake clause is DATA_RETENTION_TIME_IN_DAYS = <integer>, and it's irrelevant to the ownership requirement anyway.
  • D (WITH OWNER = 'ACCOUNTADMIN') is not valid Snowflake DDL - Snowflake does not support an OWNER clause in CREATE DATABASE; ownership is determined implicitly by the executing role.
  • E (COMMENT = 'Sales Data Database') simply attaches metadata and has no effect on access control or ownership.

Memory tip: Think "creator = owner" in Snowflake. Run CREATE DATABASE as ACCOUNTADMIN and it owns it automatically - no extra clauses needed. Any option adding extra syntax is either invalid, irrelevant, or introduces unintended behavior.

Topics

#Database Creation#ACCOUNTADMIN Role#Ownership#Access Control

Community Discussion

No community discussion yet for this question.

Full SOL-C01 Practice