0
0
Snowflakecloud~20 mins

Databases and schemas in Snowflake - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Snowflake Database & Schema Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Snowflake Database and Schema Hierarchy

In Snowflake, which statement correctly describes the relationship between databases and schemas?

ADatabases and schemas are the same and can be used interchangeably.
BA schema contains multiple databases, and each database contains multiple tables.
CTables contain multiple schemas, and schemas contain multiple databases.
DA database contains multiple schemas, and each schema contains multiple tables.
Attempts:
2 left
💡 Hint

Think about how folders and subfolders work on your computer.

Configuration
intermediate
2:00remaining
Creating a Schema in a Specific Database

Which Snowflake SQL command correctly creates a schema named sales_data inside the database company_db?

ACREATE SCHEMA company_db.sales_data;
BCREATE DATABASE company_db.sales_data;
CCREATE SCHEMA sales_data IN DATABASE company_db;
DCREATE sales_data SCHEMA IN company_db;
Attempts:
2 left
💡 Hint

Remember the syntax for creating schemas inside a database.

Architecture
advanced
2:00remaining
Best Practice for Organizing Data in Snowflake

You have multiple teams working on different projects. Which Snowflake structure best isolates data for security and management?

ACreate multiple databases, one per team, each with its own schemas.
BCreate one schema with multiple databases inside it, each for a team.
CStore all data in a single schema and use table names to identify teams.
DCreate one database with multiple schemas, each schema for a team.
Attempts:
2 left
💡 Hint

Think about isolating data for security and easier management.

security
advanced
2:00remaining
Granting Access to a Schema

Which SQL command grants the role analyst_role usage rights on the schema marketing in the database company_db?

AGRANT USAGE ON SCHEMA company_db.marketing TO ROLE analyst_role;
BGRANT ALL ON SCHEMA marketing TO ROLE analyst_role;
CGRANT USAGE ON DATABASE company_db TO ROLE analyst_role;
DGRANT SELECT ON DATABASE company_db TO ROLE analyst_role;
Attempts:
2 left
💡 Hint

Usage on schema allows access to objects inside it without giving full database rights.

service_behavior
expert
2:00remaining
Effect of Dropping a Schema with Dependent Objects

What happens when you run DROP SCHEMA company_db.sales_data; if the schema contains tables and views?

AThe schema and all its objects are dropped immediately without warning.
BThe command fails with an error because the schema is not empty.
CThe schema is dropped, but tables and views remain in the database.
DThe schema is marked for deletion and removed after 7 days automatically.
Attempts:
2 left
💡 Hint

Think about safety measures to prevent accidental data loss.