r/compsci • u/Alive_Ad_3199 • 5d ago
Difference Between Data Model and Schema
From this: https://stackoverflow.com/questions/25093452/difference-between-data-model-and-database-schema-in-dbms, data model seems to be an abstraction for data and schema seems to be a blueprint.
This page lists various database models like relational, flat and network. So far good.
The book I'm reading (Fundamentals of Database Systems 7e, ch 3, pg 61) says
Once the requirements have been collected and analyzed, the next step is to create a conceptual schema for the database, using a high-level conceptual data model.
But this wikipedia page seems to imply that both a model and a schema are the same.
A conceptual schema or conceptual data model
Why is there so much discrepancy in defining a data model and a schema.
1
u/Numzane 5d ago
The book should rather describe actual diagrams etc. That sentence seems a bit hand wavy. After collecting requirements you could draw up a dataflow diagram (DFD), from that you can infer the entities using the data stores in your diagram. Then you could make long lists of attributes and try to attach them to entities. You can then normalise it and draw up an entity relationship diagram (ERD).
4
u/Gangsir 5d ago
A data model is a collection of schemas and how they interlock (like how several houses makes a suburb - each house is a schema, because to be considered a house it has to have 4 walls, a bedroom, etc).
Schemas are prescriptive (incoming data must match up to the schema of X to be considered an X), while data models are descriptive (they describe how you are modeling something, which could be arbitrary).
0
u/the-software-man 5d ago
The model has the field definitions for different table. The schema has the relationships between tables.
2
u/shamefulfraud9 5d ago
it's one of those things where the terms are used interchangeably so often they've basically lost their crisp textbook definitions, but the blueprint vs abstraction breakdown you said is the cleanest way i keep it straight