Skip to content
← Back to blog

What is a data model?

Data model means different things depending on who you ask. Here's a plain definition, a real example in SQL, and how a model differs from a table, a report and a semantic model.

Joe Fusaro

Founder, Datachef

December 7, 2026

Table of Contents


What does "data model" mean?

A data model is a defined way of organizing raw data so that it can answer business questions.

You'll hear the term used in two ways, which is where the confusion comes from:

  1. Database design - the blueprint of what's stored: which tables exist, what columns they have and how they relate. This is the world of entity-relationship diagrams, star schemas, and fact and dimension tables.
  2. Analytics - a saved SQL query, with a name, that turns raw data into something a team can use. dbt helped make this meaning popular, and it's usually what people on business teams mean.

Both are about the same thing: deciding how data should be structured and what it should mean. This post focuses on the second. (And neither has anything to do with an AI model like Claude, though AI can help you build one.)

What does one look like?

Say you want to report on qualified pipeline. Salesforce has the raw ingredients, but no field that says which opportunities count.

The first model cleans up the source data and joins it together:

-- opportunities_clean
SELECT
  o.id,
  o.amount,
  o.stagename,
  o.type,
  o.isclosed,
  o.closedate,
  a.name AS account,
  a.billingcountry AS country
FROM salesforce.opportunity o
JOIN salesforce.account a ON a.id = o.accountid
WHERE a.name NOT ILIKE '%test%'

The second model builds on the first, and it's where your definition lives:

-- qualified_pipeline
SELECT
  country,
  date_trunc('quarter', closedate) AS close_quarter,
  SUM(amount) AS pipeline
FROM opportunities_clean
WHERE isclosed = false
  AND type = 'New Business'
  AND stagename IN ('Proposal', 'Negotiation')
GROUP BY 1, 2

Now anyone can run SELECT * FROM qualified_pipeline and get the same answer. Your stage names and rules will differ, and that's the point. These definitions are specific to your company, and they don't exist in any source system until someone writes them down.

Layering them also means a fix only happens once. If you find another test account, update opportunities_clean and everything built on it picks up the change.

How is it different from a table, a report or a semantic model?

  • A table stores data. A model usually describes how to produce data, and may or may not store the result.
  • A report shows an answer to one question. A model is what many reports can be built on. If you've ever rebuilt the same filters in five Salesforce reports, those filters wanted to be a model.
  • A semantic model sits on top of your data models and defines metrics, so that a tool can generate new queries from them.

What makes a good data model?

  • A clear name - qualified_pipeline tells you what you're getting. q3_report_final_v2 doesn't.
  • A description - say what it returns and spell out the definitions in it. People read this, and so do AI tools deciding whether it's the right model to use.
  • Visible logic - anyone looking at a number should be able to see how it was calculated.
  • Version history - definitions change. When a number moves, you want to know who changed what, and when.
  • Reuse - if a definition is copied into each report, the copies will drift apart. Build on the model instead.

Where should you start?

Not with a diagram of your entire business. Start with the question that causes the most arguments, then model just that. For many B2B teams, that's one of these:

Traditionally, this has meant a warehouse, a transformation tool and someone who knows both. It doesn't have to anymore.

In Datachef, your Salesforce, Marketo and other data is already synced and queryable. You can write the SQL yourself, or ask in a sentence and let the agent write it, then choose Save as model. From there, your team, the agent and connected AI tools all use the same definition. It's a saved query rather than a stored copy, so it's always as fresh as your latest sync. The docs on models cover the details.



Want shared data models without the stack? Watch a demo, or try Datachef free.

#data model #data modeling #sql #metrics