In this lesson, you’ll learn how to use seeds in dbt—CSV files that let you easily load static data into your data warehouse for use in models and tests.

What are the Seeds?

Seeds in dbt are CSV files stored in your project (usually in the seeds/ directory). They typically contain static data such as reference values, mapping tables, or small datasets. You can load them into your data warehouse using the dbt seed command, and then reference them in your models with the ref() function—just like any other dbt model.

Because seeds live in your dbt repository, they are version-controlled and can go through code review, ensuring consistency and reliability in your workflow.

When use the Seed

Best suited for:

  • Static data that rarely changes, such as country code mappings, test email lists, or employee account IDs.

Not suitable for:

  • Large raw data exports.
  • Sensitive production data (e.g., PII or passwords).

Steps to Create a Seed

Bellow are the steps to create a seed:

  1. Create a seeds/ folder in your dbt project.
  2. Place CSV files inside (e.g., seeds/product_categories.csv).
  3. Run the command dbt seed to load the seed into the database.

Seed Example

Now, let’s put in place what learn above about the seeds. The orders table might contain only product_id, but we want to enrich it with product categories. Instead of joining with an external database, we can load a small CSV file as a seed to map product_id to its category.

product_id,category
101,Electronics
102,Clothing
103,Home & Kitchen
104,Beauty

Once you add the file seeds/product_categories.csv, run the command bellow to create to load in the data wharehouse the csv as table.

dbt seed

When the command complete, a table named product_categories should be created.

seed product_categories
product_categories table

 Now, with the help the ref function we’re going to product_categories table the to improve our model stg_orders.

When to Use Seeds vs. Source Tables?

Feature Use a Seed (CSV) Use a Source Table
Data Changes Frequently? ❌ No ✅ Yes
Data Comes from an External System? ❌ No ✅ Yes
Static Reference Data? ✅ Yes ❌ No
Need to be Manually Updated? ✅ Yes ❌ No