6. 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
7. Levels of data modeling:
• There three level of data modeling:
1. Conceptual data model
2. Logical data model
3. Physical data model
8. Conceptual Data Model
• A conceptual data model identifies the highestlevel relationships between the different entities.
9. 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.
10. Physical Data Model
• Physical data model represents how the model will
be built in the database.
12. 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
13. 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.
14. 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
21. 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.