DATA MODELING
BASICS
What is a Data?
• “Data are values of qualitative or quantitative
variables, belonging to a set of items”
What is a set of items?
• “Set of items” means “set of objects you are interested in”
What is a variable?
• Variables are a measurement or characteristics of an item
Qualitative Vs Quantitative variables?
What is a Data Model?
• Data modeling is often the first step in creating a
database
• A data model is a conceptual representation of the data
structures that are required by a database.
• The data structures include the data objects, the
association between data objects
• Data model focuses on what data is required and how it
should be organized rather than what operations are
performed on the data
• Data model is independent of hardware or software
constraints
Levels of data modeling:
• There three level of data modeling:
1. Conceptual data model
2. Logical data model
3. Physical data model
Conceptual Data Model
• A conceptual data model identifies the highestlevel relationships between the different entities.
Logical Data Model
• A logical data model describes the data in as much
detail as possible, without regard to how they will
be physical implemented in the database.
• Identify entity and relationships.
• All attributes of each entity.
• Identify primary and foreign key.
Physical Data Model
• Physical data model represents how the model will
be built in the database.
Entity
• An entity is a Person, place, object, event or
concept about which data is to be maintained
• When implementing a database an entity would
transmit to a table
Attribute
• An attribute is a property of an entity which
describes the characteristics of a particular entity
instance.
An attribute can be of three types:
a. Unique Identifier: A UID is an attribute whose
value uniquely identifies an entity instance. A UID is
implemented as a Primary Key.
b. Mandatory Attribute: A mandatory attribute is
one whose value cannot be null.
c. Optional Attribute: An optional attribute is one
whose value can be null.
Entity Relationship Models
• Cardinality: Cardinality specifies how many
instances of an entity relate to one instance of
another entity
1. One-to-One Relationships
2. One-to-Many Relationships
3. Many-to-Many Relationships

• Ordinality: Ordinality describes the relationship as
either mandatory or optional
1. Mandatory Relationships
2. Optional Relationships

• Recursive Relationships
Mandatory, Many-to-Many

INSTRUCTOR

STUDENT
Optional, Many-to-Many

DEPARTMENT

STUDENT
Optional/Mandatory,
Many-to-Many

INSTRUCTOR

SKILL
Optional/Mandatory,
One-to-Many

PRODUCT

VENDOR
Mandatory, One-to-One

AUTOMOBILE

ENGINE
Recursive

EMPLOYEE

is supervised by

supervises
Resolving Many-to-Many Relationships
• Many-to-many relationships should be avoided. We
can resolve a many-to-many relationship by dividing it
into two one-to-many relationships.
Resolving Many-to-Many Relationships

SALES ORDERS

SALES ORDERS

INV. ITEMS

ORDER ITEMS

INV. ITEMS
CUSTOMERS

SALES ORDERS

ORDER ITEMS

INV. ITEMS

Data Modeling Basics