Skip to content

cbfacademy/Introduction-to-Data-Build-Tool-DBT-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to dbt - Olist E-Commerce Project

A hands-on dbt training project using the Olist Brazilian E-commerce dataset.

Repo: https://github.com/cbfacademy/Introduction-to-DBT

Getting Started

  1. Clone this repo:

    git clone https://github.com/cbfacademy/Introduction-to-DBT.git
    cd Introduction-to-DBT
  2. Follow Lab 1 instructions in labs/lab_01_setup/README.md

  3. Work through each lab in order — each lab folder contains:

    • A README.md with step-by-step instructions
    • The actual .sql and .yml files to copy into the correct locations

Lab Structure

Lab Folder What You'll Build
1 labs/lab_01_setup/ BigQuery + dbt setup and connection
2 labs/lab_02_source_ref/ Staging models, sources, ref(), materializations
3 labs/lab_03_jinja_macros/ Jinja loops, custom macros, dbt packages
4 labs/lab_04_marts_testing/ Dimension/fact tables, schema & singular tests
5 labs/lab_05_docs_freshness/ Documentation, source freshness

How to Use the Lab Files

Each lab folder has the SQL/YAML files you need. You can either:

  • Follow the README and type/paste the code yourself (recommended for learning)
  • Copy the files from the lab folder to the correct location, e.g.:
    cp labs/lab_02_source_ref/stg_orders.sql models/staging/

Final Project Structure (after all labs)

models/
├── staging/           # Clean raw data (views)
│   ├── _sources.yml
│   ├── _staging.yml
│   ├── stg_orders.sql
│   ├── stg_customers.sql
│   ├── stg_order_items.sql
│   ├── stg_products.sql
│   └── stg_product_categories.sql
├── intermediate/      # Business logic (views)
│   ├── int_orders_enriched.sql
│   ├── int_order_items_enriched.sql
│   └── int_orders_by_status.sql
└── marts/             # Final tables for BI
    ├── _marts.yml
    ├── dim_customers.sql
    ├── fct_orders.sql
    └── fct_daily_revenue.sql
macros/
├── limit_in_dev.sql
└── cents_to_currency.sql
tests/
├── assert_positive_prices.sql
└── assert_orders_have_items.sql

Data

The data/ folder contains 5 CSV files from the Olist dataset:

Table Rows
customers 10,000
orders 10,000
order_items 11,253
products 6,124
product_category_name_translation 71

Prerequisites

  • Python 3.8+
  • Google Cloud account with BigQuery enabled
  • dbt-bigquery (pip install dbt-bigquery)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors