Chapter 3
Chapter 3
Agenda
❑ Introduction
❑ Entity-Relationship Diagramming
❑ ERD components
❑ Database normalization
Introduction
❑ Data modeling: the process of analyzing the things of interest to your organization and how these things are related to
each other.
❑ data model delivers value by enhancing communication and understanding business requirements.
❑ When databases are built from a well-designed data model, the resultant structures provide:
d. increased stability.
f. increased consistency.
❑ Another benefit of data modeling is the opportunity to discover new uses for data. A data model can clarify data
patterns and potential uses for data that might otherwise remain hidden. Discovery of such patterns can change the
way your business operates and can potentially lead to a competitive advantage and increased revenue for your
organization.
ERD Model
❑ ER Model stands for Entity Relationship Model is a high-level conceptual data model diagram. ER model helps to
❑ The ER Model represents real-world entities and the relationships between them.
❑ mainly contains three basic symbols which are rectangle, oval and diamond.
❑ A real-world thing either living or non-living that is easily recognizable and nonrecognizable that is to be represented
in our database.
❑ An entity can be place, person, object, event or a concept, which stores data in the database.
❑ An entity set is a group of similar kind of entities. It may contain entities with attribute sharing similar values.
Strong Entity vs weak entity
Strong Entity vs weak entity
ERD components [Attributes ]
❑ Attributes are the characteristic properties that define all the items belonging to a specific category.
❑ simple attributes :Attributes that cannot be further sub-divided into several attributes are called.
ERD components [Attributes ]
❑ Single-valued Attribute : attributes are properties that have a single particular value for a particular entity. This means
that single-valued attributes don't have more than one value for an item.
ERD components [Attributes ]
❑ Multi-valued Attribute : Attributes that can have multiple sets of values for a single entity.
ERD components [Attributes ]
❑ Relationships define how the different entities are associated with each other.
1. One-to-One Relationship.
3. Many-to-Many Relationship.
ERD components [relationship ]
❑ Constraints : define the number of instances of an entity participating in the relationship type.
2. Partial (optional) participation : entity can exist without participating in a relationship with another entity
ERD components [keys]
❑ keys in DBMS is an attribute or set of attributes which helps you to identify a row(tuple) in a relation(table).
❑ Keys help you uniquely identify a row in a table by a combination of one or more columns in that table.
❑ Each entity will have one, and only one, primary key.
❑ It acts as a cross-reference between two tables as it references the primary key of another table.
ERD components [Foreign key]
Types of Data Models in DBMS
❑ The purpose of creating a conceptual data model is to establish entities, their attributes, and relationships.
❑ Business stakeholders and data architects typically create a conceptual data model.
Data models [logical ]
❑ logical data model is constructed by taking the data descriptions depicted in a conceptual data model and introducing
associated elements, definitions and greater context for the data’s structure.
❑ detail includes defining the owned attributes, primary keys, foreign keys, relationship cardinality and describing
entities and classes.
Data models [physical ]
❑ A physical data model is a framework or schema that describes how data is actually kept in a database.
❑ The physical data model is created to transform the logical data model into a physical implementation using a specific
❑ Normalization is a database design technique that reduces data redundancy and eliminates undesirable characteristics
like Insertion, Update and Deletion Anomalies.
❑ Normalization rules divides larger tables into smaller tables and links them using relationships.
❑ Non Prime attribute : An attribute that is not member of the primary key .
Database normalization [First Normal Form]
❑ All columns of a table must have a single atomic value in each row of a table.
❑ Each row of a table should have an unique identifier to uniquely identify the rows of the table .
Database normalization [First Normal Form]
❑ All columns of a table must have a single atomic value in each row of a table.
❑ Each row of a table should have an unique identifier to uniquely identify the rows of the table .
Database normalization [second Normal Form]
❑ All attributes determined only by the key. (Does not have transitive dependency).