Prepstellar

COF-C03 · Getting started

20 cards

Snowflake Structure and Core Vocabulary

Swipe, scroll or use ← →
  1. Containers, from broadest to narrowest

    A Snowflake environment becomes easy to navigate the moment you separate containers from the objects inside them. Every securable object lives somewhere, and that "somewhere" is a chain with a fixed order.

    The customer organization is the top-most logical container. An organization contains account objects, an account contains databases, a database contains schemas, and a schema contains securable objects such as tables, views, functions, and stages.

    Level Contains
    Organization Accounts
    Account Databases
    Database Schemas
    Schema Tables, views, functions, stages

    Read the path from broadest to narrowest: organization, account, database, schema, object. A table is not a peer of a database, and a schema is not above an account. Exam options often scramble exactly two of these levels, so read the whole sequence before choosing.

    1 / 20
  2. Quick check

    Which sequence orders Snowflake containers from broadest to narrowest?

    1. AAccount, organization, schema, database, and its securable objects

      The organization sits above the account, and a database contains schemas rather than the reverse, so two levels are swapped here.

    2. BOrganization, account, database, schema, securable object

      Right. The organization contains accounts, each account contains databases, each database contains schemas, and each schema contains securable objects.

    3. CDatabase, account, organization, schema, table

      A database is placed above the account and the organization here, inverting the top of the hierarchy.

    2 / 20

  3. What lives inside a schema

    The schema is where the vocabulary stops being abstract. It is the named container, inside a database, that holds the objects you actually query and load into.

    Tables, views, functions, and stages are all securable objects held in a schema. That is what makes the schema the right answer whenever a design has to keep a stage next to its tables and views in a single named container within one database.

    The frequent confusions are worth naming:

    Candidate Why it is not a schema-level object
    A customer organization It is the top-most container, far above the schema
    A Snowflake account It contains databases; it does not sit inside one
    A user identity It is an identity, not an object stored in a schema
    A privilege It is a level of access, not something a schema holds
    3 / 20
  4. Quick check

    A designer must keep a stage beside tables and views, all three inside one named container within a database. Which container fits?

    1. AA schema

      Right. Schemas are the containers inside a database that hold securable objects such as stages, tables, and views.

    2. BA customer organization

      The organization is the top-most container above accounts; it cannot sit inside a database.

    3. CAn access privilege

      A privilege is a defined level of access to an object, not a container that can hold objects.

    4 / 20

  5. The four words of access control

    Four terms do most of the work in Snowflake security, and most beginner errors are simply two of them swapped.

    A user is an identity recognized by Snowflake and can represent a person or a service. A securable object is an entity to which access can be granted, and access is denied unless a grant allows it. A role is an entity to which privileges can be granted, while a privilege defines a level of access to an object.

    Term One-line definition Concrete example
    User An identity, for a person or a service The analyst who signs in; a service account
    Securable object Something access can be granted on A table, a view, a stage
    Role Something privileges can be granted to ANALYST_RO
    Privilege A level of access to an object SELECT on a table

    Note the default in that definition of a securable object: access is denied unless a grant allows it. Nothing is open by accident.

    5 / 20
  6. Quick check

    What does a privilege represent?

    1. AAn identity associated with a person or a service

      That describes a user, which is an identity rather than a level of access.

    2. BA defined level of access to a securable object

      Right. A privilege is a defined level of access to an object, and privileges are what roles receive.

    3. CA group of schemas stored inside an account

      That describes a database, a container in the object hierarchy, not an access right.

    6 / 20

  7. Keep your progress in the app

    That’s 3 of 9 quick checks. In the app they stay answered, and every lesson remembers where you left off.

    Opens in your browser. Nothing to install.

    Start studying

    On your phone, with the same account

    Get it on Google Play Download on the App Store
    Keep reading here
  8. Roles: privileges on one side, users on the other

    A role is the hinge of the usual RBAC model: privileges are granted to it, and it in turn is granted to users. It is not the only possible grantee, however. Snowflake also supports direct grants to users through user-based access control (UBAC). These privileges count only when ALL secondary roles are active in the session.

    For example, Alice may receive a direct SELECT grant on the Sales table. That grant counts if ALL secondary roles are already active in her session. If they are not active, she can activate them with USE SECONDARY ROLES ALL.

    That is why a role is neither a container nor a permission. It does not store databases or schemas, which live in the object hierarchy. And it is not itself a level of access such as SELECT, which is a privilege. It is the named bundle that collects privileges so they can be handed to people and services consistently.

    A user can hold multiple roles and switch the active role in a session to perform different actions with different privilege sets. Switching the primary role is not by itself an isolation guarantee. A session acts with the aggregate privileges granted to its primary role and to any active secondary roles, so an analyst who wants only production rights in play must also control which secondary roles are active. Authorization for CREATE statements comes from the primary role alone.

    7 / 20
  9. Quick check

    What is a role in Snowflake access control?

    1. AA container that directly stores databases and schemas

      Containers belong to the object hierarchy (organization, account, database, schema), and a role holds none of them.

    2. BA level of access such as SELECT on a table

      That describes a privilege; a role is what privileges are granted to, not the access level itself.

    3. CAn entity to which privileges can be granted

      Right. A role receives privileges and is then assigned to users, which is what separates rights from identities.

    8 / 20

  10. The RBAC chain

    Snowflake usually uses role-based access control, in which privileges are assigned to roles and roles are assigned to users. Say the chain out loud until it is automatic: grant privileges on securable objects to roles, then grant roles to users.

    In role-based access control, privileges on objects are granted to roles, and roles are granted to users.privilege ongrant togrant toSalesobjectSELECTprivilegeAnalystroleAliceuser
    The role is the hinge of the chain. In RBAC, you grant privileges to the role, not to the person.

    The value of that indirection is practical. When someone joins, changes team, or leaves, you change which roles they hold, not dozens of individual grants on individual tables. And when a new table appears, you grant on it once, to a role, and everyone who holds that role is covered.

    The chain describes RBAC, not every authorization path. Users are identities rather than containers, but they can receive privileges directly through UBAC. Databases are securable containers, and privileges describe allowed actions on them.

    9 / 20
  11. Quick check

    Which assignment pattern describes Snowflake role-based access control?

    1. AGrant privileges on securable objects to roles, and then grant those roles to users

      Right. RBAC separates access rights from identities: privileges go to roles, and roles go to users.

    2. BPlace users inside schemas, then schemas inside roles

      Users are identities, not objects stored in a schema, and roles are not containers for schemas.

    3. CGrant databases to privileges, then privileges to accounts

      Databases are containers rather than things that can be granted, and accounts are not the grantees of privileges.

    10 / 20

  12. Ownership belongs to a role

    Ownership answers a different question from either hierarchy: not where this object lives, and not who may read it, but which role controls it.

    Each securable object is owned by one role, which by default is the role used to create that object. Ownership is therefore a privilege relationship, not a statement that a user personally contains the object.

    Two consequences follow, and both show up in questions:

    • Ownership is singular. It is one role, not every user who can see the schema, and not the containing database or organization.
    • Ownership follows the creating role, not the person who typed the statement. If you create a table while a different role is active, that role owns the result. Switching your active role before a CREATE is therefore a real design decision, not a formality.
    11 / 20
  13. Quick check

    Who owns a newly created securable object by default?

    1. AEvery user who can see the schema that holds it

      Ownership is held by a single role, so a group of users who can merely see the container do not own the object.

    2. BThe role that was used to create the object

      Right. Each securable object is owned by one role, and by default that is the role used to create it.

    3. CThe database object that contains the schema

      Containers hold objects in the hierarchy; a database does not own the objects inside its schemas.

    12 / 20

  14. Role hierarchy and privilege inheritance

    Roles can be granted to other roles, creating a hierarchy in which roles higher in the hierarchy inherit privileges from roles below them.

    Direction is everything here. Inheritance flows upward: the grantee role picks up what the granted role already had. Work an example through slowly.

    Role C is granted to Role B. Role B is granted to Role A. Role A is assigned to a user.

    Role What it holds
    Role C Its own privileges
    Role B Its own privileges, plus C's
    Role A Its own privileges, plus B's and C's
    The user Everything Role A holds, when Role A is active

    So the user reaches C's privileges through A, not because A was granted to C, but because C was granted to B and B to A.

    13 / 20
  15. Role hierarchy and privilege inheritance

    Keep the two maps apart. The object hierarchy answers where an object lives. The role hierarchy answers how privileges flow. They look similar on a diagram and behave nothing alike: a role never becomes a schema, and a schema never inherits anything.

    Snowflake also ships a small set of system-defined roles that already sit in such a hierarchy (among them ACCOUNTADMIN, SECURITYADMIN, USERADMIN and SYSADMIN), plus PUBLIC, a pseudo-role automatically granted to every user and every role in the account. Custom roles are normally built into a hierarchy underneath them.

    14 / 20
  16. Quick check

    Role C is granted to Role B, Role B is granted to Role A, and Role A is assigned to a user. How do privileges flow?

    1. ARole C inherits from Roles B and A, because inheritance flows downward

      Inheritance runs upward toward the grantee role, so C, the role granted away, gains nothing from B or A.

    2. BEach role becomes a schema that contains the role immediately below it

      Roles and schemas belong to two different maps: the role hierarchy carries privileges, the object hierarchy holds objects.

    3. CRole A inherits privileges from Roles B and C, so the user receives them through Role A

      Right. Roles higher in the grant hierarchy inherit the privileges of the roles below them, and the user gets them by activating Role A.

    15 / 20

  17. The session's active role

    Signing in is not the same as being authorized. Every session carries an authority, and it is chosen by a documented rule.

    Every active user session has exactly one current primary role and can also activate secondary roles. If a connection specifies a role already granted to the user, that role becomes the primary role. If no role is specified, Snowflake uses the user's default role, and PUBLIC when no default role has been set.

    Situation at connection time Current primary role
    The connection names a role already granted to the user That role
    No role is named, but the user has a default role The default role
    No role is named and no default role is set PUBLIC

    PUBLIC is the fallback precisely because it is granted to everyone; it is not a privileged administrator role, so a session that lands on it is usually a session that cannot do much.

    16 / 20
  18. The session's active role

    The active role and its granted privileges determine which SQL actions the user can perform on objects. That single sentence explains a puzzle every beginner meets: an object is right there, in the right database and schema, and the query still fails.

    Selecting an account, database, or schema identifies context. Selecting a role identifies authority. A correctly named object can still be unavailable when the active role lacks the necessary privileges, and when a user holds several roles, the first thing to check is which one is active and what it has been granted, on the object and on the containers around it.

    17 / 20
  19. Quick check

    A connection names no role, and the user has no default role. Which primary role does the session use?

    1. APUBLIC

      Right. With neither a connection role nor a user default, Snowflake falls back to PUBLIC.

    2. BACCOUNTADMIN

      ACCOUNTADMIN is a top-level system-defined role; it is never the automatic fallback for a session.

    3. CSECURITYADMIN

      SECURITYADMIN is a system-defined role for managing grants, users, and roles, not the documented default.

    18 / 20

  20. Key takeaways

    • Navigate containers as organization, account, database, schema, then securable object, and remember that the schema is what holds tables, views, functions, and stages.
    • Users receive authority through roles and privileges; roles do not contain the data objects themselves. Grant privileges to roles, then roles to users.
    • The current primary role is the session's central authorization context, and object ownership belongs to one role, by default the role that created the object.
    • Two maps, never one: the object hierarchy says where an object lives, the role hierarchy says how privileges flow, upward from granted role to grantee.
    19 / 20
  21. Quick check

    A user can locate a table in the correct database and schema but cannot query it, and holds several assigned roles. What should be checked first?

    1. AWhether the user identity has been converted into a database object

      A user is an account-level object that represents an identity, not a schema-level object such as a table, and query access depends on grants rather than on any conversion.

    2. BWhether every assigned role has been made the single owner of the table

      Ownership belongs to exactly one role, so it cannot be spread across every assigned role, and ownership is not what the query needs anyway.

    3. CWhether an active role has the necessary privileges on the table and its containers

      Right. Location and authorization are separate: the object is in context, so the active role and its grants are what to examine.

    20 / 20

  22. 9 quick checks · then the test

    In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.

    Take this lesson’s test → Next lesson: Snowflake End-to-End Workflow

    Opens in your browser. Nothing to install.

    Start studying

    On your phone, with the same account

    Get it on Google Play Download on the App Store

The whole course, on your computer and your phone

Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.

Opens in your browser. Nothing to install.

Start studying

On your phone, with the same account

Get it on Google Play Download on the App Store

“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”

Abdelhak Y. Google Play review