0
0
dbtdata~10 mins

What is dbt - Visual Explanation

Choose your learning style9 modes available
Concept Flow - What is dbt
Write SQL models
dbt compiles models
dbt runs models on warehouse
Transforms raw data
Produces clean tables/views
Enables analysis & reporting
dbt takes your SQL code, prepares it, runs it on your data warehouse, and creates clean tables for analysis.
Execution Sample
dbt
model.sql:
SELECT * FROM raw_data
WHERE status = 'active';
This SQL model selects only active records from raw_data to create a clean table.
Execution Table
StepActionInputOutputNotes
1Write SQL modelSQL code selecting active rowsSQL model file createdUser writes transformation logic
2Compile modelSQL model fileCompiled SQL querydbt prepares SQL for warehouse
3Run modelCompiled SQL queryNew table/view in warehousedbt runs SQL to transform data
4Transform dataRaw data in warehouseFiltered active data tableData is cleaned and ready
5Use outputClean tableReports and dashboardsAnalysts use clean data
6EndAll steps doneClean data availableProcess complete
💡 All models run and data transformed successfully
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
SQL ModelNoneSQL code writtenCompiled SQL queryExecuted queryClean table createdClean table ready for use
Data WarehouseRaw data onlyRaw data onlyRaw data onlyNew clean table addedClean table updatedClean table available
Key Moments - 2 Insights
Why does dbt compile SQL models before running them?
dbt compiles models to convert user-friendly SQL with variables and references into plain SQL that the data warehouse can understand, as shown in step 2 of the execution_table.
What happens to raw data during dbt run?
Raw data stays in the warehouse but dbt creates new clean tables or views based on transformations, shown in steps 3 and 4 of the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the output after step 3?
ANew table/view in warehouse
BSQL model file created
CCompiled SQL query
DClean table ready for use
💡 Hint
Check the 'Output' column for step 3 in the execution_table.
At which step does dbt transform raw data into clean tables?
AStep 1
BStep 2
CStep 4
DStep 5
💡 Hint
Look for the step where 'Filtered active data table' appears in the Output column.
If the SQL model is not written correctly, which step will fail?
AStep 1
BStep 2
CStep 3
DStep 5
💡 Hint
Compilation of SQL happens at step 2; errors in SQL show up there.
Concept Snapshot
dbt (data build tool) lets you write SQL models
It compiles your SQL into queries
Runs them on your data warehouse
Transforms raw data into clean tables
These tables are ready for analysis and reporting
Full Transcript
dbt is a tool that helps you transform raw data into clean, usable tables by writing SQL models. First, you write SQL code that describes how to transform your data. Then, dbt compiles this code into plain SQL that your data warehouse understands. Next, dbt runs these queries on your warehouse, creating new tables or views with the transformed data. Finally, these clean tables can be used for analysis and reporting. This process makes data easier to work with and more reliable.