0
0
dbtdata~20 mins

Seeds for static reference data in dbt - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Seed Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of a dbt seed CSV import
Given a seed CSV file named countries.csv with the following content:
country_code,country_name
US,United States
CA,Canada
MX,Mexico

and a dbt project configured to load this seed, what will be the output of the SQL query select * from {{ ref('countries') }}?
A[{'country_code': 'US', 'country_name': 'United States'}, {'country_code': 'CA', 'country_name': 'Canada'}, {'country_code': 'MX', 'country_name': 'Mexico'}]
B[{'country_code': 'US', 'country_name': 'United States'}, {'country_code': 'CA', 'country_name': 'Canada'}]
C[]
DSyntaxError: table 'countries' does not exist
Attempts:
2 left
💡 Hint
Think about what dbt seeds do with CSV files and how they become tables.
data_output
intermediate
1:00remaining
Number of rows in a seeded table after dbt seed
If you have a seed CSV file with 10 rows (excluding header) and run dbt seed, how many rows will the resulting table contain?
A9
B11
C10
D0
Attempts:
2 left
💡 Hint
Remember that the header row is not counted as data.
🔧 Debug
advanced
2:00remaining
Why does dbt seed fail to load a CSV with inconsistent columns?
You have a seed CSV file where some rows have fewer columns than the header row. Running dbt seed results in an error. What is the most likely cause?
Adbt seed requires the CSV file to be sorted alphabetically.
BThe CSV file has inconsistent number of columns per row causing parsing errors.
CThe CSV file must have no header row for dbt seed to work.
Ddbt seed only supports CSV files with exactly 5 columns.
Attempts:
2 left
💡 Hint
Think about how CSV parsers handle rows with missing columns.
🚀 Application
advanced
2:30remaining
Using seeds for static lookup tables in dbt models
You want to use a static lookup table for country codes in your dbt models. Which approach correctly uses a seed for this purpose?
ACreate a CSV file with country codes, add it to the seeds folder, run <code>dbt seed</code>, then reference it in models using <code>{{ ref('filename_without_extension') }}</code>.
BWrite the country codes directly inside the model SQL using a VALUES clause.
CCreate a separate model with hardcoded country codes and join it in other models.
DUse an external API call inside the dbt model to fetch country codes dynamically.
Attempts:
2 left
💡 Hint
Seeds are designed to load static CSV data as tables for easy reference.
🧠 Conceptual
expert
3:00remaining
Best practice for updating static reference data with dbt seeds
You have a seed CSV file used for static reference data in production. What is the best practice to update this data safely?
ARename the seed CSV file and add a new seed to avoid overwriting existing data.
BManually delete the seed table in the warehouse, then run <code>dbt seed</code>.
CEdit the seed table directly in the warehouse using SQL UPDATE statements.
DUpdate the CSV file, run <code>dbt seed --full-refresh</code> to reload the table with new data.
Attempts:
2 left
💡 Hint
Think about how dbt manages seed tables and refreshing data.