Domain: Snowflake Features & Architecture
· 477 words · 10 min read

Snowflake Object Hierarchy

Overview

Understanding how objects are organized and nested within Snowflake is fundamental for management, security, and querying. The COF-C03 exam will test your knowledge of this hierarchy and how objects relate to one another.

Key Concepts

Snowflake employs a strict, logical hierarchy. The top level is the Organization, followed by Accounts, Databases, Schemas, and finally, specific data objects.

1. Organization

An Organization is a first-class Snowflake object that links all the Snowflake accounts owned by your company.

2. Account

A Snowflake Account is a distinct environment tied to a specific cloud provider and region (e.g., AWS US East).

3. Database

A database is the highest-level logical container for data within an account.

4. Schema

A schema is a logical grouping of database objects (tables, views, etc.).

5. Objects (Tables, Views, etc.)

These are the actual data structures that reside within a schema.

The Hierarchy Visualized


Organization
└── Account 1
    ├── User / Roles
    ├── Virtual Warehouses
    ├── Database A
    │   ├── Schema 1 (e.g., PUBLIC)
    │   │   ├── Table X
    │   │   ├── View Y
    │   └── Schema 2 (e.g., STAGING)
    │       └── Table Z
    └── Database B
└── Account 2

Fully Qualified Names

To refer to an object in SQL, especially if it resides in a different database or schema than your current active context, you use a Fully Qualified Name.

The format is: <database>.<schema>.<object>

SQL Examples


-- Creating the hierarchy
CREATE DATABASE sales_db;

-- Explicitly use the database
USE DATABASE sales_db;

CREATE SCHEMA apac_region;

-- Using a fully qualified name to query a table
SELECT * FROM sales_db.apac_region.daily_sales;

-- View current context
SELECT CURRENT_DATABASE(), CURRENT_SCHEMA();

Exam Tips

⚠️ Crucial for COF-C03:

Key Takeaways