SnowPro Associate: Platform Question 95
Single answer1.5 Describe Snowflake objects and how they fit into the Snowflake hierarchy.A data engineering team is setting up a new Snowflake environment for an analytics project. They want to create a table named SALES in a new schema called MART inside an existing database named ANALYTICS. A junior engineer says that once connected to Snowflake, they can create the table directly because databases, schemas, and tables all exist at the same level in the object hierarchy. Which statement correctly describes how these Snowflake objects fit into the hierarchy and what must exist before the SALES table can be created?
- A
The SALES table can be created directly under the Snowflake account, and the MART schema will be created automatically when the table is created.
- B
The ANALYTICS database must exist first, then the MART schema must exist within that database, and then the SALES table can be created within the schema.
- C
A virtual warehouse must contain the ANALYTICS database, and the SALES table can then be created inside the warehouse.
- D
The MART schema is a child of the virtual warehouse, so creating the warehouse first is the required step before creating the SALES table.
Show answer and explanation
Correct answer: B
Explanation
In Snowflake, object hierarchy is a core concept for organizing data platform resources. At a high level, an account contains databases and other account-level objects, but for data storage the key hierarchy is database > schema > table/view/stage/file format and other schema-level objects. To create a table such as ANALYTICS.MART.SALES, the ANALYTICS database must already exist, and the MART schema must exist within that database. Only then can the SALES table be created. Virtual warehouses are separate compute objects used to process queries and DDL/DML operations, but they do not contain databases or schemas. This distinction is emphasized in Snowflake documentation on object hierarchy and database, schema, and warehouse roles within the platform.
- A. Incorrect.
Incorrect. In Snowflake, tables are not created directly under the account. The relevant containment hierarchy for database objects is database > schema > table (and other schema-level objects). A schema does not get auto-created simply by creating a table unless the schema already exists or is explicitly created first. This option reflects a common misunderstanding about object levels in Snowflake.
- B. Correct.
Correct. Snowflake database objects follow a clear hierarchy: databases contain schemas, and schemas contain tables, views, and similar objects. Therefore, to create ANALYTICS.MART.SALES, the database ANALYTICS must exist, the schema MART must exist within that database, and only then can the SALES table be created in that schema.
- C. Incorrect.
Incorrect. A virtual warehouse is a compute resource used to execute SQL statements; it does not contain databases, schemas, or tables. Databases and schemas are storage/organizational objects in the metadata hierarchy, separate from warehouses. This option confuses compute resources with logical data organization.
- D. Incorrect.
Incorrect. Schemas are not children of virtual warehouses. Warehouses are independent compute objects in Snowflake and are not part of the database/schema/table containment path. While a warehouse is often needed to run DDL statements in practice, it does not define where schema objects reside in the Snowflake hierarchy.