What a Data Model Is

A data model is the set of concepts used to describe data, relationships, semantics and constraints. Models are grouped as high level, representational and low level, and each level serves a different audience.

Concept

A data model is a collection of concepts for describing four things about data:

  1. Structure — what shapes the data may take.
  2. Relationships — how one piece of data connects to another.
  3. Semantics — what the data means.
  4. Constraints — what values and combinations are legal.

Most notes mention only structure. All four belong in the definition, and the fourth is where marks are usually lost.

Why a data model is needed

Without an agreed model, everyone describes data differently and no design can be discussed, checked or implemented. The model provides a shared vocabulary — entity, attribute, relation, key — that designers, programmers and the DBMS all understand the same way.

The three categories of data model

CategoryAlso calledDescribes data usingAudienceExamples
High levelConceptualEntities, attributes, relationships — concepts close to how people thinkUsers and designersER model, extended ER model
RepresentationalImplementationStructures a DBMS can implement, still understandable to peopleDesigners and programmersRelational, hierarchical, network
Low levelPhysicalRecord formats, orderings, access pathsThe DBMS and the DBAInternal storage models, index structures
   HOW A DESIGN TRAVELS DOWN THE CATEGORIES

   requirements in English
            |
            v
   HIGH LEVEL      ER diagram: STUDENT enrols in COURSE
            |
            v
   REPRESENTATIONAL  tables: students, courses, enrolments
            |          with primary and foreign keys
            v
   LOW LEVEL       heap file for courses, B+ tree on roll_no,
                   16 KB pages, rows stored unordered

   Each step down loses freedom and gains precision.

Schema and instance, in model terms

A data model gives you the vocabulary for a schema. Applying the model produces a schema; filling the schema with data produces an instance. The model itself is neither — it is the rulebook both obey.

Important terminology

TermMeaning
Data modelConcepts for describing structure, relationships, semantics and constraints.
Structural partThe shapes the model allows.
Manipulation partThe operations the model defines for retrieving and changing data.
Integrity partThe rules the model can enforce.
Conceptual modelA high level model, independent of any product.
Logical modelA representational model, tied to a family of products.
Physical modelHow it is actually stored.
A complete data model has three parts: structure, operations and integrity rules. The relational model is famous partly because it defined all three precisely, and the earlier models did not.

Example

The same fact in three models

 HIGH LEVEL (ER)
   entity STUDENT with attributes roll_no, name
   entity COURSE  with attributes code, title
   relationship ENROLS, many to many, with attribute marks

 REPRESENTATIONAL (relational)
   students   ( roll_no, name )
   courses    ( code, title )
   enrolments ( roll_no, code, marks )
     roll_no references students
     code    references courses

 LOW LEVEL (physical)
   students   heap file, B+ tree on roll_no
   enrolments clustered on ( roll_no, code )
   marks      2 byte integer, page size 16 KB

Common mistakes

  • Defining a data model as only structure. Relationships, semantics and constraints belong in the definition.
  • Confusing the model with the schema. The relational model is the rulebook; your college tables are a schema written using it.
  • Treating the ER model as a database. It is a high level design notation, later converted to tables. No DBMS stores an ER diagram.
  • Skipping the operations part. A model that describes shapes but not operations is incomplete.

Exam and interview questions

  1. Define a data model and list the four things it describes.
  2. Name the three categories of data model with two examples each.
  3. What are the three parts of a complete data model?
  4. Differentiate conceptual, logical and physical models.
  5. Where does the ER model sit, and where does the relational model sit?

Practice

  1. Classify each as high level, representational or low level: ER diagram, table definition, B+ tree index, extended ER diagram, record layout in a page.
  2. Take a library requirement in English and express it in all three categories, as in the example.
  3. Explain in two sentences why the constraints part of a model matters as much as the structure part.

Conclusion

A data model supplies the concepts for describing structure, relationships, meaning and rules. High level models are for people, representational models are for implementation, and low level models are for storage — and every real design travels down all three.

Written by Lorens Mishra

Default administrator account created by the installer.

Continue reading

All DBMS notes →

Discussion

0 comments
Sign in to join the discussion.

No comments yet. Be the first to say something.