SnowPro Associate: Platform Question 94
Single answer1.5 Describe Snowflake objects and how they fit into the Snowflake hierarchy.A data engineering team is onboarding a new application in Snowflake. They want to store raw files, load curated tables, and give analysts read access to the curated data only. During a design review, a junior engineer proposes creating a schema first and then placing a database inside that schema so the team can keep all objects together. Which statement correctly describes how Snowflake objects fit into the hierarchy and supports the team's design?
- A
A database contains schemas, and schemas contain objects such as tables, views, and stages.
- B
A schema contains databases, and databases contain tables and views.
- C
A warehouse contains databases and schemas, and access should be granted at the warehouse level for data access.
- D
Roles are created inside schemas so they can be scoped to a single database.
Show answer and explanation
Correct answer: A
Explanation
The correct Snowflake logical hierarchy for most data objects is: account -> database -> schema -> schema objects (such as tables, views, stages, file formats, and sequences). Warehouses are separate compute objects and are not part of the database/schema containment hierarchy. For this scenario, the team would typically create a database for the application, separate schemas such as RAW and CURATED, load files using stages, and store transformed data in curated tables/views. Analysts would then receive privileges on the curated schema and its objects, while being denied access to raw data. This aligns with Snowflake documentation on databases, schemas, and access control, which distinguishes storage/logical containers from compute resources and from account-level security objects like roles.
- A. Correct.
Correct. In Snowflake, the logical object hierarchy is organization/account level, then within an account: databases contain schemas, and schemas contain schema-level objects such as tables, views, stages, file formats, sequences, and tasks. This supports the team's design because raw and curated data objects can be organized into separate schemas within the same database, and access can then be granted to analysts on only the curated schema or its objects.
- B. Incorrect.
Incorrect. This reverses the Snowflake hierarchy. Schemas do not contain databases; databases are higher-level logical containers that contain schemas. This is a common misconception for people coming from informal folder-like mental models rather than Snowflake's defined object hierarchy.
- C. Incorrect.
Incorrect. Warehouses are compute resources used to execute queries and perform data processing; they do not contain databases or schemas. Although a role may need USAGE on a warehouse to run queries, data access is controlled through privileges on databases, schemas, and objects such as tables and views, not at the warehouse level alone.
- D. Incorrect.
Incorrect. Roles are account-level securable/access-control objects, not objects created inside schemas. They are used to grant privileges on Snowflake objects across the account. Someone might choose this option because roles can be used to limit access to a database or schema, but they are not stored within the schema hierarchy.