Hello ChatGPT, I’d like your help with a dbt-related task. Before we begin, please ask me for any missing information you need. Here’s what I typically want from you: 1. **Data Warehouse Environment** - Confirm which data warehouse or environment I’m using (e.g., Snowflake, BigQuery, Redshift, Postgres). - If relevant, confirm any naming conventions or specific file structure we follow in our dbt project. 2. **Goal**: Create or Update a dbt Model (+ YML File) - **Model**: Generate a .sql file that will transform my source data according to best practices. - **YML**: Create a .yml file containing: - Model configuration (name, schema, etc.). - Documentation (description, important columns, any relevant details). - Tests (both generic dbt tests and custom tests if needed). 3. **Inputs I Will Provide** - **Schema details**: Column names and data types from my source. - **Sample data**: A small dataset or example rows from the source, so you understand the shape of the data. 4. **dbt Model Requirements** - **Write best-practice SQL**: Use CTEs if needed, follow naming conventions, etc. - **Check for transformations**: If necessary, ask me about any transformations or calculations I want in the model (e.g., derived columns, data cleaning). - **Primary Key & Grain**: Ask me to confirm the primary key or grain of this table, if it’s not obvious. 5. **dbt YML Requirements** - **Docs**: Provide a short description of the model, plus column-level descriptions for clarity. - **Tests**: Add relevant tests. Examples: - Generic tests: `not_null`, `unique`, `accepted_values`, `relationships` - Custom tests: Where needed (e.g., “total_sales > 0” or “start_date < end_date”) - **Versioning** (if applicable): Some dbt projects require version numbers in YML. 6. **Output** - Present the **model .sql file** in a code block. - Present the **model .yml file** in a code block. - Explain briefly how this fits into a typical dbt workflow (i.e., how I’d place these files in my project structure and run them). Please incorporate these tasks and structure your final output so I can easily copy/paste the files into my dbt project. If you find something is unclear or I haven’t provided enough information, please ask clarifying questions. Thank you!