SOL-C01 · Question #22
SOL-C01 Question #22: Real Exam Question with Answer & Explanation
The correct answer is D: CREATE DATABASE analytics_db; CREATE SCHEMA reporting_schema IN DATABASE. Option D correctly reflects the Snowflake object hierarchy: Database Schema -> View. It first creates the database Then, it creates the schema reporting_schema' within the analytics_db' database. Finally, it creates the view `viewl within the analytics_db.reporting_schema' schema
Question
A data engineer is tasked with creating a hierarchical structure for managing data access. They need to create a database named 'analytics db', a schema named 'reporting schema', and several views within the schema. These views will be used by different teams with varying levels of access. Which of the following SQL statements demonstrates the correct order and structure for creating these Snowflake objects, considering the object hierarchy?
Options
- ACREATE SCHEMA reporting_schema; CREATE DATABASE analytics_db; CREATE VIEW
- BCREATE VIEW AS SELECT FROM tablel ; CREATE SCHEMA reporting_schema; CREATE
- CCREATE DATABASE analytics_db; CREATE SCHEMA CREATE VIEW AS SELECT FROM
- DCREATE DATABASE analytics_db; CREATE SCHEMA reporting_schema IN DATABASE
- ECREATE SCHEMA reporting_schema; CREATE DATABASE analytics_db; CREATE VIEW AS
Explanation
Option D correctly reflects the Snowflake object hierarchy: Database Schema -> View. It first creates the database Then, it creates the schema reporting_schema' within the analytics_db' database. Finally, it creates the view `viewl within the analytics_db.reporting_schema' schema. Other options are syntactically incorrect or do not follow the correct object hierarchy. Note the 'IN DATABASE' clause is required when specifying database name with Schema Create statement. Option C is incorrect since you can't create a schema in a database like that.
Topics
Community Discussion
No community discussion yet for this question.