Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is semi-structured data?
Semi-structured data is data that does not follow a strict table format but has some organizational properties like tags or keys, for example, JSON or Avro files.
Click to reveal answer
beginner
How does Snowflake store JSON data?
Snowflake stores JSON data in a VARIANT column type, which allows flexible storage and querying of nested JSON structures.
Click to reveal answer
intermediate
Which Snowflake function extracts a value from a JSON object?
The function is called GET_PATH or the simpler : operator, for example, data:field extracts the value of 'field' from the JSON stored in 'data'.
Click to reveal answer
intermediate
What is Avro and why is it used?
Avro is a compact, fast, binary data serialization format often used for big data. It supports schema evolution and is efficient for storage and transport.
Click to reveal answer
intermediate
How do you query nested JSON arrays in Snowflake?
You use the LATERAL FLATTEN function to expand arrays into rows, allowing you to query each element individually.
Click to reveal answer
Which Snowflake data type is best for storing JSON data?
AVARIANT
BVARCHAR
CINTEGER
DBOOLEAN
✗ Incorrect
VARIANT is designed to store semi-structured data like JSON in Snowflake.
What does the Snowflake function LATERAL FLATTEN do?
AConverts JSON arrays into multiple rows
BCompresses JSON data
CEncrypts data
DJoins two tables
✗ Incorrect
LATERAL FLATTEN expands JSON arrays into rows for easier querying.
Avro files are primarily used because they are:
APlain text and human-readable
BBinary and support schema evolution
COnly for images
DUnstructured data format
✗ Incorrect
Avro is a binary format that supports schema changes over time.
How do you extract a nested field 'name' from a JSON column 'data' in Snowflake?
Adata.name
Bdata->name
Cdata:name
Ddata[name]
✗ Incorrect
Snowflake uses the colon operator to extract JSON fields, e.g., data:name.
Which of the following is NOT a characteristic of semi-structured data?
AOften stored as JSON or Avro
BFlexible schema
CContains nested structures
DFixed schema with strict columns
✗ Incorrect
Semi-structured data does not have a fixed schema with strict columns.
Explain how Snowflake handles querying JSON data stored in a VARIANT column.
Think about how you would get data from a nested folder in your computer.
You got /4 concepts.
Describe the advantages of using Avro format for big data storage and querying.
Consider why a small, flexible box is better for shipping many items.
You got /4 concepts.
Practice
(1/5)
1. What is the Snowflake data type used to store semi-structured data like JSON or Avro?
easy
A. INTEGER
B. VARIANT
C. VARCHAR
D. BOOLEAN
Solution
Step 1: Understand Snowflake data types
Snowflake uses specific data types for different data. VARIANT is designed for semi-structured data.
Step 2: Identify the correct type for JSON/Avro
VARIANT can store JSON, Avro, XML, and other semi-structured formats directly.
Final Answer:
VARIANT -> Option B
Quick Check:
Semi-structured data type = VARIANT [OK]
Hint: Remember VARIANT stores JSON/Avro data in Snowflake [OK]
Common Mistakes:
Choosing VARCHAR which stores plain text only
Confusing INTEGER or BOOLEAN with semi-structured types
Thinking JSON needs special external storage
2. Which of the following is the correct way to extract the value of the key name from a VARIANT column data containing JSON in Snowflake as a string?
easy
A. data:name
B. data['name']
C. data:name::string
D. data->'name'
Solution
Step 1: Understand JSON field extraction syntax in Snowflake