liveBook · Manning

Data model

As explained in The Well-Grounded Data Analyst

A formal representation of the entities, attributes, relationships, and constraints in a data domain.

A data model is a reusable dataset made from raw data after cleaning and encoding the business rules needed for analysis. It gives shared definitions for entities such as customers, vehicles, and purchases, so later work starts from a consistent representation rather than repeated filtering and interpretation. section 3.0 section 3.1

Figure 3.1 Data modeling and analysis as mapped to the data science process
figure

Data modeling sits between raw data and analysis: it turns data into a useful, analysis-ready form before insight is produced. section 3.1

Build a model around the question it must answer:

  • Define ambiguous business terms with stakeholders, then encode those definitions in the data. section 3.1.1
  • Clean recurring issues, reconcile duplicates, and reshape data into a useful common structure. section 3.1.1 section 3.5.1
  • Choose the grain and schema deliberately—for example, one row per customer—and aggregate or retain fields accordingly. section 3.3.1
  • Assess missingness and uncertainty rather than treating a best-guess model as complete ground truth. section 3.4.4

Counting customers across systems

To answer “How many customers do we have?”, consolidate three customer sources into one row per customer, deduplicate overlapping records, and make counting rows the minimum viable answer. Company and individual names may require text similarity, graph-based linking, or simpler matching decisions. The resulting count remains conditional on assumptions and incomplete records. section 3.0 section 3.2.3 section 3.4.4

Table 3.2 The same football results in a long format, one row per match participant
Match ID
Date
Competition
Round
Team
Home or away?
Goals scored
1
2014-07-04
World Cup 2014
Quarter-final
France
Home
0
1
2014-07-04
World Cup 2014
Quarter-final
Germany
Away
1
2
2014-07-04
World Cup 2014
Quarter-final
Brazil
Home
2
2
2014-07-04
World Cup 2014
Quarter-final
Colombia
Away
1
3
2014-07-05
World Cup 2014
Quarter-final
Argentina
Home
1
3
2014-07-05
World Cup 2014
Quarter-final
Belgium
Away
0

A long layout stores one match participant per row; comparing it with the wide layout makes structure and analytical grain explicit. section 3.1.1

How The Well-Grounded Data Analyst covers it

How deep it goes
Works through cleaning, entity definitions, deduplication, reshaping, grain, schema, and completeness trade-offs rather than formal modeling theory.
Examples
Uses customer consolidation across three sources and football results represented in wide and long formats.
What you can do after
Build a reusable customer dataset by consolidating sources, selecting a grain, encoding definitions, and communicating uncertainty.
How it connects
Connects data cleaning, business logic, entity resolution, wide and long data, schema, granularity, and data analysis.

Also explained in

Compare how 23 books explain data model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Well-Grounded Data Analyst. The section links point to the parts of the book it draws on.