2. Data Modeling
Data modeling :
A technique for organizing and documenting a system’s
DATA. Data modeling is sometimes called database
modeling because a data model is usually implemented
as a database. It is sometimes called information
modeling.
Entity relationship diagram (ERD) :
A data model utilizing several notations to depict data in
terms of the entities and relationships described by that
2
3. Process of creating a data model for an information
system by applying formal data modeling techniques.
Process used to define and analyze data requirements
needed to support the business processes.
3
Data Modeling
4. “ One way to structure
unstructured problems is
to Draw Models ”
4
5. Why is data modeling
considered crucial?
Data is viewed as a resource to be shared by as
many processes as possible. As a result, data
must be organized in a way that is flexible and
adaptable to unanticipated business
requirements – and that is the purpose of data
modeling.
5
6. What is Data Model
Data Model is a collection of conceptual tools for
describing data, data relationships, data semantics
and consistency constraint.
It provides a way to describe the design of a database
at the physical, logical and view levels.
6
7. Conceptual : describes WHAT the system contains
Logical : describes HOW the system will be implemented,
regardless of the DBMS
Physical : describes HOW the system will be implemented
using a specific DBMS
7
Different Data Models
8. There are several notations for data modeling, but
the actual model is frequently called an entity
relationship diagram (ERD).
An ERD depicts data in terms of the entities and
relationships described by the data
8
Data Modeling
10. Data Model Elements 10
ER models have the following core concepts
Entity – A concept to abstractly represent all instances of a group of
similar ‘things.
An entity is a class of persons, places, objects, events, or concepts
about which we need to capture and store data.
An entity instance is a single occurrence of an entity.
Attribute – a descriptive property or characteristic of an entity. It is
a simple, atomic data item like a date, a name, a number [also called
Property or Field ]
11. Data Model Elements 11
A compound attribute is one that actually consists of more
primitive attributes. Synonyms in different data modeling
languages are numerous: concatenated attribute, composite
attribute, and data structure.
Relationship – an association that exists between one or more
entities. The relationship may represent an event that links
the entities or merely a logical affinity that exists between the
entities.
12. Data Model Elements 12
Attributes Domains:
The values for each attribute are defined in terms of three properties: data type,
domain, and default.
The data type for an attribute defines what class of data can be stored in that
attribute.
An attribute’s data type determines its domain.
The domain of an attribute defines what values an attribute can
legitimately take on.
Every attribute should have a logical default value.
The default value for an attribute is that value which will be recorded if
not specified by the user.
13. Data Model Elements 13
Attributes identification:
Every entity must have an identifier or key.
An key is an attribute, or a group of attributes, which assumes a
unique value for each entity instance. It is sometimes called an
identifier.
A group of attributes that uniquely identifies an instance of an
entity is called a concatenated key. Synonyms include composite
key and compound key
A primary key is that candidate key which will most commonly be
used to uniquely identify a single entity instance.
Any candidate key that is not selected to become the primary key
is called an alternate key.
14. Data Model Elements 14
Cardinality:
Each relationship on an ERD also depicts the complexity or
degree of each relationship and this is called cardinality.
Cardinality defines the minimum and maximum
number of occurrences of one entity for a single
occurrence of the related entity. Because all
relationships are bi-directional, cardinality must be
defined in both directions for every relationship.
15. Given that …
“Customer” is an entity.
“Product” is an entity.
For a “Customer” we need to know their
“customer number” attribute and “name”
attribute.
For a “Product” we need to know the
“product name” attribute and “price”
attribute.
“Sale” is an entity that is used to record the
interaction of “Customer” and “Product”.
15
Example
16. Why and When
The purpose of a data model is to describe the
concepts relevant to a domain, the relationships
between those concepts, and information associated
with them
16
19. Definition
The entity set which does not have sufficient
attributes to form a primary key is called as Weak
entity set.
An entity set that has a primary key is called as
Strong entity set
19
21. A weak entity set is represented by doubly outlined box and
corresponding identifying relation by a doubly outlined diamond
Here double lines indicate total participation of weak entity in
strong entity set it means that every payment must be related via
loan-payment to some account. The arrow from loan-payment to
loan indicates that each payment is for a single loan. The
discriminator of a weak entity set is underlined with dashed lines
rather than solid line.
21
Concepts
22. Concepts
The primary key of a weak entity set is formed by the primary
key of the strong entity set on which the weak entity set is
existence dependent plus the weak entity sets discriminator. In
the above example {loan_number, payment_number} acts as
primary key for payment entity set.
A member of a strong entity set is called dominant entity and
member of weak entity set is called as subordinate entity
22