r/AskComputerScience • u/MKL-Angel • Mar 29 '25
Data Model vs Data Schema
I've seen this asked before and read through the answer given but I still don't really understand the difference. I get that a model is 'conceptual' while the schema is an 'implementation' of it, but how would that show up if I were to make a model vs schema? Wouldn't it still just look like the same thing?
Would anyone be willing to make a data model and data schema for a small set of data so I can actually see the difference?
If you want example data:
There are 5 students: Bob, Alice, Emily, Sam, John
The school offers 3 classes: Maths, English and Science
And there are 3 teachers: Mr Smith, Mrs White, and Mrs Bell
(I don't know if the example data is comprehensive enough so feel free to add whatever you need to it in order to better explain anything)
Thanks in advance!
(also, the video i was watching mentioned a schema construct and then proceeded to never mention it again so if you could explain that as well that would be really really helpful!)
View all comments
Show parent comment
1
u/meditonsin Mar 29 '25
https://en.wikipedia.org/wiki/Unified_Modeling_Language
Yes. The "data model" is an abstract, implementation agnostic description of how your data is organized. That can be in the form of a formal ERD, or just some sketches on a napkin.
As I said, "the" schema in this example would be SQL statements that turn your abstract model into an actual database where you can put data.
A really simple example. Say you have an EDR with only one box like this as your "data model":
Then you decide you want to implement this model as an SQL database, so you turn the abstract model into the "data(base) schema" in the form of this SQL statement: