COF-C03 Question 20
Single answer1.3 Differentiate Snowflake object hierarchy and typesA data engineering team is onboarding a new analytics application in Snowflake. The security architect wants to ensure the team understands the Snowflake object hierarchy before granting privileges. The team plans to create a new table named SALES in the ANALYTICS schema within the PROD database. Which statement correctly describes the hierarchy and object types involved in this scenario?
- A
The SALES table is a child object of the ANALYTICS schema, and the ANALYTICS schema is a child object of the PROD database.
- B
The PROD database is a child object of the ANALYTICS schema, and the SALES table is a child object of the PROD database.
- C
The ANALYTICS schema is a child object of the SALES table, because tables logically contain schemas in Snowflake.
- D
The warehouse used to query SALES is a child object of the ANALYTICS schema, because compute objects belong inside schemas.
Show answer and explanation
Correct answer: A
Explanation
Snowflake separates objects into different categories and levels of hierarchy. Databases are top-level logical containers for data organization, schemas are namespaces within databases, and tables are schema-level objects stored within schemas. By contrast, virtual warehouses are independent compute objects and are not part of the database/schema hierarchy. Understanding this distinction is important for both object organization and privilege management, because privileges can be granted at different levels such as database, schema, and table. This aligns with Snowflake documentation on object hierarchy and object types, which distinguishes account-level objects like warehouses from database objects and schema objects.
- A. Correct.
Correct. In Snowflake, a database contains schemas, and schemas contain schema-level objects such as tables, views, and stages. In this scenario, PROD is the database, ANALYTICS is the schema inside that database, and SALES is a table inside the schema.
- B. Incorrect.
Incorrect. This reverses the hierarchy. In Snowflake, schemas do not contain databases. Databases are higher-level logical containers, and schemas exist within databases. A table is not directly a child of a database; it is a child of a schema within a database.
- C. Incorrect.
Incorrect. This reflects a common misconception about object relationships. Tables do not contain schemas. Instead, schemas are namespaces that organize objects like tables and views. The hierarchy is database > schema > table, not table > schema.
- D. Incorrect.
Incorrect. Warehouses are compute objects and are not contained within databases or schemas. They exist independently of the database/schema hierarchy and are used to execute queries against data objects. This option confuses storage object hierarchy with compute resources.