What is Data Model ?
The Data Model is a description of the data in a database.
Data models can be broadly classified into the following categories
- Object based logical model :- Focuses on describing the data, the relationship among the data and any constraints defined.
- Record based logical model :- Focuses on specification the logical structuring of the database.
Object based logical models :-
The ER model :-
Views the real world as a collection of objects or entities and the relationship among them has a corresponding diagramming technique.
An Entity :-
Is any object, place, person or activity which the data is recorded. Can be categorized as entity type and entity instance. In the ER model diagramming technique, entities are named and represented inside a box
An Attribute :-
Is a property of given entity. Is depicted as eclipse, labeled with the name of the property.
An Relationship :-
Chen defines a relationship as an association among entities. A relationship is depicted as a diamond with the name of the relationship type.
3 Types of relations:-
One to One
Think about a husband and wife.
A husband can only have one wife
A wife can only have one husband
this would be known as a ‘one-to-one relationship’
This relationship can be portrayed diagrammatically as:
One to many
Think about a mother and her children.
A mother can have many children
A child can have only one mother
this would be known as a ‘one-to-many relationship’
This relationship can be portrayed diagrammatically as:
Many to many
Think about videos in a video hire shop and the shop’s customers.
A video can be hired by many customers
Customers can hire many videos
this would be known as a ‘many-to-many relationship’
This relationship can be portrayed diagrammatically as:
Record based logical model :-
Record-based logical data models provide concepts users can understand but are not too far from the way data is stored in the computer. Three well-known data models of this type are relational data models, network data models and hierarchical data models.
- The relational model represents data as relations, or tables. For example, in the membership system at Science World, each membership has many members (see Figure 2.2 in Chapter 2). The membership identifier, expiry date and address information are fields in the membership. The members are individuals such as Mickey, Minnie, Mighty, Door, Tom, King, Man and Moose. Each record is said to be an instance of the membership table.
- The network model represents data as record types. This model also represents a limited type of one to many relationship called a set type.
- The hierarchical model represents data as a hierarchical tree structure. Each branch of the hierarchy represents a number of related records
Join Telegram : Click Here
All Full Stack Java Study Material
Job’s For Fresher