Bird
Raised Fist0
Snowflakecloud~20 mins

Zero-copy cloning in Snowflake - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Zero-copy Cloning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Zero-copy Cloning Basics

What is the primary benefit of using zero-copy cloning in Snowflake?

AIt instantly creates a clone without duplicating data, saving storage space.
BIt creates a full physical copy of the data, increasing storage usage.
CIt compresses the data to reduce storage costs.
DIt moves data to a different region for disaster recovery.
Attempts:
2 left
💡 Hint

Think about how cloning affects storage and speed.

❓ service_behavior
intermediate
2:00remaining
Clone Behavior After Source Data Change

After creating a zero-copy clone of a table in Snowflake, what happens if you update data in the original table?

AThe clone automatically reflects the changes made to the original table.
BThe clone remains unchanged and keeps the original data state at clone time.
CThe clone is deleted automatically to prevent data inconsistency.
DBoth the original and clone tables become locked until changes are synced.
Attempts:
2 left
💡 Hint

Consider how cloning preserves data snapshots.

❓ Architecture
advanced
3:00remaining
Designing a Data Environment Using Zero-copy Cloning

You want to create multiple development environments from a large production database without increasing storage costs significantly. Which Snowflake feature should you use and why?

AUse zero-copy cloning to create instant, storage-efficient copies of the production database.
BExport and import data files for each environment to ensure data isolation.
CCreate full physical copies of the database for each environment to avoid data conflicts.
DUse Snowflake Streams to replicate data changes to each environment.
Attempts:
2 left
💡 Hint

Think about instant copies that save storage and time.

❓ security
advanced
2:30remaining
Security Implications of Zero-copy Cloning

When you create a zero-copy clone of a secure table in Snowflake, what happens to the access permissions on the clone?

AThe clone shares the same access permissions but changes in permissions on the original do not affect the clone.
BThe clone inherits all access permissions from the original table automatically.
CThe clone has no access permissions; you must grant them explicitly after cloning.
DThe clone inherits permissions and any changes to the original's permissions are reflected in the clone.
Attempts:
2 left
💡 Hint

Consider how Snowflake treats object permissions on clones.

✅ Best Practice
expert
3:00remaining
Managing Storage Costs with Zero-copy Cloning

You have created multiple zero-copy clones of large tables for testing. Over time, you notice storage costs increasing unexpectedly. What is the most likely cause?

AStorage costs increase due to automatic backups unrelated to cloning.
BClones physically duplicate all data, so storage grows linearly with each clone.
CStorage costs increase because Snowflake charges extra for cloning operations regardless of data size.
DChanges made to clones or original tables cause Snowflake to store additional data, increasing storage usage.
Attempts:
2 left
💡 Hint

Think about how data changes affect storage in zero-copy clones.

Practice

(1/5)
1. What is the main benefit of zero-copy cloning in Snowflake?
easy
A. It deletes the original data after cloning.
B. It compresses data to save storage space.
C. It encrypts data automatically during cloning.
D. It creates instant copies without duplicating the original data.

Solution

  1. Step 1: Understand zero-copy cloning concept

    Zero-copy cloning creates a copy of data instantly without physically duplicating the data.
  2. Step 2: Identify the main benefit

    This saves storage and time because the clone shares the original data until changes are made.
  3. Final Answer:

    It creates instant copies without duplicating the original data. -> Option D
  4. Quick Check:

    Zero-copy cloning = instant copy without duplication [OK]
Hint: Zero-copy cloning shares data, no extra storage used [OK]
Common Mistakes:
  • Thinking cloning duplicates all data immediately
  • Confusing cloning with data encryption
  • Assuming original data is deleted after cloning
2. Which of the following is the correct syntax to create a zero-copy clone of a table named sales_data in Snowflake?
easy
A. CREATE TABLE sales_data_clone AS CLONE sales_data;
B. CREATE CLONE sales_data_clone FROM sales_data;
C. CREATE TABLE sales_data_clone CLONE sales_data;
D. CLONE TABLE sales_data TO sales_data_clone;

Solution

  1. Step 1: Recall Snowflake cloning syntax

    The correct syntax to clone a table is: CREATE TABLE new_table CLONE original_table;
  2. Step 2: Match syntax with options

    CREATE TABLE sales_data_clone CLONE sales_data; matches the correct syntax exactly.
  3. Final Answer:

    CREATE TABLE sales_data_clone CLONE sales_data; -> Option C
  4. Quick Check:

    CREATE TABLE ... CLONE ... is correct syntax [OK]
Hint: Use CREATE TABLE new_table CLONE original_table [OK]
Common Mistakes:
  • Using CREATE CLONE instead of CREATE TABLE ... CLONE
  • Adding AS before CLONE incorrectly
  • Using CLONE TABLE ... TO syntax which is invalid
3. Consider this Snowflake SQL snippet:
CREATE TABLE original (id INT, value STRING);
INSERT INTO original VALUES (1, 'A'), (2, 'B');
CREATE TABLE clone_table CLONE original;
INSERT INTO clone_table VALUES (3, 'C');
SELECT COUNT(*) FROM original;

What will be the output of the SELECT query?
medium
A. 2
B. Error
C. 0
D. 3

Solution

  1. Step 1: Understand cloning and data insertion

    The clone_table is a zero-copy clone of original, sharing data initially. Inserting into clone_table does not affect original.
  2. Step 2: Count rows in original table

    Original has 2 rows inserted initially and remains unchanged after clone_table insert.
  3. Final Answer:

    2 -> Option A
  4. Quick Check:

    Original rows unchanged after clone insert [OK]
Hint: Inserts to clone don't affect original table [OK]
Common Mistakes:
  • Assuming insert in clone adds rows to original
  • Thinking clone is a full independent copy immediately
  • Expecting error due to cloning
4. You tried to create a zero-copy clone of a database using:
CREATE DATABASE clone_db CLONE original_db;

But received an error. What is the most likely cause?
medium
A. The original database does not exist.
B. You cannot clone a database, only tables.
C. The clone syntax requires the keyword TABLE.
D. You need to specify a schema when cloning a database.

Solution

  1. Step 1: Check cloning rules for databases

    Snowflake supports cloning databases if the original database exists.
  2. Step 2: Identify error cause

    If the original_db does not exist, cloning fails with an error.
  3. Final Answer:

    The original database does not exist. -> Option A
  4. Quick Check:

    Cloning requires existing source database [OK]
Hint: Ensure original database exists before cloning [OK]
Common Mistakes:
  • Thinking databases cannot be cloned
  • Adding TABLE keyword incorrectly
  • Assuming schema must be specified
5. You want to create a zero-copy clone of a large table for testing, but only want to clone data as it was at a specific past time. Which Snowflake feature should you use with cloning?
hard
A. Use a full data export and import instead of cloning.
B. Use Time Travel to specify the past timestamp during cloning.
C. Clone the table and then manually delete unwanted rows.
D. Use a materialized view to clone the data at that time.

Solution

  1. Step 1: Understand cloning with Time Travel

    Snowflake allows cloning data as it existed at a past time using Time Travel feature.
  2. Step 2: Apply Time Travel in cloning

    You specify the timestamp or offset in the clone statement to get data snapshot at that time.
  3. Final Answer:

    Use Time Travel to specify the past timestamp during cloning. -> Option B
  4. Quick Check:

    Time Travel + cloning = snapshot at past time [OK]
Hint: Combine Time Travel with clone for past data snapshot [OK]
Common Mistakes:
  • Thinking cloning alone can get past data
  • Using export/import which is slower
  • Using materialized views which don't clone data
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard