# Wolt Snack Store — dbt package (for evaluators)

This ZIP contains everything needed to run the Task 1 dbt project locally with **DuckDB** — no Snowflake account or complex warehouse setup.

## Package contents

| Path | Purpose |
|------|---------|
| `wolt_analytics/` | Full dbt project (models, tests, analyses, `profiles.yml`) |
| `wolt_snack_store.duckdb` | Pre-loaded DuckDB with raw source tables + built marts |
| `Wolt_snack_store_*.csv` | Original raw assignment CSVs |
| `load_raw_data.py` | Optional helper to rebuild DuckDB from the CSVs |
| `requirements-dbt.txt` | Minimal Python deps for dbt + DuckDB |

## Quick start (recommended)

```bash
# 1) Unzip, then create a venv
python3 -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements-dbt.txt

# 2) Run dbt (profiles.yml already points at ../wolt_snack_store.duckdb)
cd wolt_analytics
dbt run
dbt test
```

`profiles.yml` uses a relative path, so keep this folder layout:

```
<this package>/
  wolt_snack_store.duckdb
  wolt_analytics/
    profiles.yml   # path: "../wolt_snack_store.duckdb"
```

## Optional: rebuild DuckDB from CSVs

If you prefer to start from the raw CSVs only:

```bash
# from the package root (parent of wolt_analytics/)
python3 load_raw_data.py
cd wolt_analytics
dbt run
dbt test
```

## Notes

- Models are Snowflake-portable SQL (CTEs, window functions); DuckDB is used here so reviewers can run without a warehouse.
- Validation queries for the 8 Task 1 business questions are in `wolt_analytics/analyses/business_questions.sql`.
- Task 2 metrics SQL is in `wolt_analytics/analyses/task2_metrics_queries.sql`.
