SnowPro Associate: Platform Question 96
Single answer1.5 Describe Snowflake objects and how they fit into the Snowflake hierarchy.A data engineering team is setting up a new analytics environment in Snowflake for the SALES department. They have already created a warehouse named SALES_WH for compute. Next, they need to create a database named SALES_DB and a schema named CURATED to store reporting tables. A junior engineer suggests creating the schema directly under the warehouse so the reporting tables can use the same compute resources. Which statement correctly describes how these Snowflake objects fit into the Snowflake hierarchy?
- A
The CURATED schema should be created inside the SALES_WH warehouse because schemas are child objects of warehouses.
- B
The SALES_DB database should be created inside the CURATED schema, and the warehouse should reference both objects when queries run.
- C
The CURATED schema is created inside the SALES_DB database, while the SALES_WH warehouse is a separate object used to provide compute for operations on database objects.
- D
The SALES_WH warehouse should be created inside the SALES_DB database so that all tables in CURATED inherit its compute settings.
Show answer and explanation
Correct answer: C
Explanation
This question tests understanding of Snowflake object hierarchy and the separation of storage and compute, which is fundamental for the SnowPro Associate exam. In Snowflake, databases contain schemas, and schemas contain objects such as tables, views, and stages. Virtual warehouses are separate compute objects and are not part of the database/schema hierarchy. Users run queries against database objects while specifying or using an active warehouse for compute. This separation is a core Snowflake design principle and enables multiple workloads to access the same stored data using different warehouses. See Snowflake documentation on databases, schemas, and virtual warehouses for the official object model and hierarchy.
- A. Incorrect.
Incorrect. In Snowflake, a warehouse is not a container for schemas or other database objects. Warehouses are independent compute resources. Schemas are child objects of databases, not warehouses. This option reflects a common misconception that storage objects are nested under compute resources.
- B. Incorrect.
Incorrect. The hierarchy is reversed here. A schema exists within a database, not the other way around. While queries may use a warehouse to execute against objects in a database and schema, the warehouse does not create a parent-child hierarchy with those objects.
- C. Correct.
Correct. In Snowflake, the standard object hierarchy for stored data objects is organization/account level context, then database, then schema, then objects such as tables and views. Virtual warehouses exist separately from that storage hierarchy and provide compute for SQL operations. A warehouse can be used to query objects in many databases and schemas, subject to privileges.
- D. Incorrect.
Incorrect. A warehouse is not created inside a database. It is an independent object in Snowflake used for compute. Tables in a schema do not inherit compute settings from a database because compute is selected at execution time by using a warehouse, not by nesting warehouses under databases.