0
0
dbtdata~20 mins

dbt project structure - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
šŸŽ–ļø
dbt Project Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the purpose of the 'models' directory in a dbt project?

In a dbt project, the 'models' directory is a key folder. What is its main purpose?

AIt stores SQL files that define transformations and create tables or views in the data warehouse.
BIt contains configuration files for database connections and credentials.
CIt holds documentation files describing the project goals and team members.
DIt stores raw data files imported directly into the data warehouse.
Attempts:
2 left
šŸ’” Hint

Think about where you write the SQL code that builds your data models.

ā“ Predict Output
intermediate
2:00remaining
What does the 'dbt_project.yml' file configure?

Given a dbt project, what is the main role of the dbt_project.yml file?

AIt defines project-level configurations like model paths, version, and materializations.
BIt contains SQL queries for data transformations.
CIt stores user credentials for the data warehouse connection.
DIt holds the compiled data models after dbt runs.
Attempts:
2 left
šŸ’” Hint

Think about where you set project-wide settings in dbt.

ā“ data_output
advanced
2:00remaining
How many SQL model files are in this 'models' directory structure?

Suppose your dbt project has this 'models' folder structure:

models/
ā”œā”€ā”€ staging/
│   ā”œā”€ā”€ customers.sql
│   └── orders.sql
ā”œā”€ā”€ marts/
│   ā”œā”€ā”€ sales.sql
│   └── inventory.sql
└── README.md

How many SQL model files will dbt compile and run?

A5
B3
C2
D4
Attempts:
2 left
šŸ’” Hint

Count only the .sql files inside the 'models' folder and its subfolders.

šŸ”§ Debug
advanced
2:00remaining
Why does dbt fail to find models in this project?

You have this dbt_project.yml snippet:

name: my_project
version: '1.0'
model-paths: ['sql_models']

But your models are inside a folder named models. What is the cause of the problem?

AThe <code>version</code> number must be an integer, not a string.
BThe <code>model-paths</code> setting points to 'sql_models', but the actual folder is named 'models'.
CThe <code>name</code> field should be inside the 'models' folder.
DThe <code>dbt_project.yml</code> file must be named <code>project.yml</code>.
Attempts:
2 left
šŸ’” Hint

Check if the folder path matches the actual folder name.

šŸš€ Application
expert
2:00remaining
Which folder should you place test SQL files in a dbt project?

You want to add custom data quality tests using SQL in your dbt project. Where should you place these test files?

AInside the 'models' directory alongside your model SQL files.
BInside the 'data' directory used for seed files.
CInside the 'tests' directory at the root of the dbt project.
DInside the 'macros' directory because tests are macros.
Attempts:
2 left
šŸ’” Hint

Think about where dbt expects test files to be stored.