Building Intermediate/Marts Models

Developing intermediate and marts models requires understanding table relationships, writing complex joins, applying business logic, and ensuring consistent formatting. This process demands careful consideration of data relationships and performance implications.

DinoAI Agent can analyze your existing models, understand their relationships, and create properly structured intermediate models with appropriate joins.

Example Prompt

I want to create an intermediate model which makes use of or allows me to understand data across races as well as constructor and driver standings for the season.

Optional: Add context by selecting the relevant base models you want to join. Adding specific files as context helps DinoAI understand exactly which tables to include and how they should be related.

After you enter your prompt:

  1. DinoAI analyzes the structure of your provided models

  2. It identifies the relationships between tables (e.g., foreign keys)

  3. It creates a new model with properly structured CTEs and join conditions

  4. If configured, DinoAI applies your .dinorules preferences

Example Output

DinoAI will generate professional quality model(s). See example below:

Intermediate Model example

Key Benefits

  • Relationship Understanding: Correctly identifies and implements join conditions

  • Code Organization: Creates well-structured CTEs that make the logic easy to follow

  • Proper Formatting: Maintains consistent SQL style according to your standards

  • Time Savings: Reduces complex model development from hours to minutes

  • Visualization: Can generate mermaid diagrams to visualize data flow when using .dinorules

When to Use This

  • When building analytical models that combine multiple data sources

  • When implementing complex business logic across several tables

  • When standardizing existing intermediate/marts models

  • When exploring new analytical capabilities from your existing data

Last updated

Was this helpful?