Data Modeling Basics (Part 2)
This is the second part in a 3-part series on the basics of data modeling.
In the first part of this blog series, we talked about data modeling and we tried to define a data model. In part 2, we will start to look into the three types of data models, the different notations used in data modeling and then jump into Conceptual Data Model (CDM).
Data Models
There are three basic styles of data models - these are Conceptual Data Model (CDM), Logical Data Model (LDM) and Physical Data Model (PDM).
A Conceptual Data Model (CDM) consists of the basic business entities and the relationships that exist between the entities. It is usually used to explore and discuss domain concepts with the stakeholders to gain better understanding of a certain domain (e.g. Banking, Manufacturing, Finance, etc.).
A Logical Data Model (LDM) is the next data model in the progression of data models. In addition to the basic business entities and the relationships between these entities, the LDM now has the attributes and the primary key defined. A primary key is just a way to identify the unique record in a certain entity.
A Physical Data Model (PDM) is the data model representation in an actual database management system (DBMS). The entities, relationships, attributes, primary keys are now represented as tables, foreign-key relationships, columns and primary keys in the database management system. The data types e.g. CHAR (1), VARCHAR (10) or INTEGER is defined for the data values to be stored in each column or field.
Data Modeling Notations
There are several data modeling notations. In the Agile Data web site (link), several are listed. These notations include data modeling notation from Information Engineering (which includes the popular "crow's feet notation"), the Barker notation, IDEF1X notation, the UML notation and the Entity Relationship Diagram (ERD) notation.
All throughout my blog, I will use the "crow's feet notation" because of my familiarity with using this notation. You can choose whatever notation you prefer when you do data modeling.
Here is a link to a web article from Lucidchart on Entity Relationship Diagram or ERD. It is a very informative web page on ERD.
Conceptual Data Model (CDM)
To create a conceptual data model, we first identify the entity types.
An entity type is a thing that exists either physically or logically. An entity may be a physical object such as a house or a car (physical existence), an event such as a house sale or a car service, or a concept such as a customer transaction or order (logical existence as a concept). It is usually a noun.
Below are examples of entity types in a school where typically there is a [Student], [Course] and [Teacher].
Then, we define the relationships between the entity types.
Relationship captures how entity types are related to one another. Relationships can be thought of as verbs, linking two or more nouns.
As part defining the relationships between entity types is to define the right cardinality.
Cardinality is the number of occurrences in one entity which are associated (or linked) to the number of occurrences in another. There are three degrees of relationship, known as: one-to-one (1:1), one-to-many (1:M) and many-to-many (M:M).
An example of a many-to-many relationship is show below.
We now have a Conceptual Data Model. We can now explore and discuss with the stakeholder or a subject matter expert to validate our model and to add more entity types or relationships in the domain (which is a School in this case).
In the the third part of this blog series, we will continue to Logical Data Model (LDM) and Physical Data Model (PDM). We will also talk about concepts on normalization.
Disclaimer
Any external linked site(s) referenced in this blog are owned by their respective owners and are not part of this blog. In addition, the author may at times will not be able to verify fully the information in these external sites.