Download presentation
Presentation is loading. Please wait.
1
Review of Week 1 Database DBMS File systems vs. database systems
Evolution of data models Basic data modeling components Database Management Systems
2
Module 2 Database Design Concepts
3
Chapter 4 Entity Relationship (ER) Modeling
Module 2: Database Design Concepts
4
Introduction to the E-R Model
Data modeling is about documenting rules and policies that govern data. Entity relationship data model is a detailed logical representation of the entities, associations and data elements for an organization or business arena. Entity-relationship diagram is a graphical representation of an E-R model. Database Management Systems
5
Business Rules Statements that define or constrain some aspect of the business Assert business structure Control/influence business behavior Expressed in terms familiar to end users Automated through DBMS software Database Management Systems
6
Entity Relationship (ER) Model
ERD represents the conceptual database as viewed by end user ERDs depict the ER model’s three main components: Entities Attributes Relationships Database Management Systems
7
Entity (Entity Type) Refers to the entity set and not to a single entity occurrence Is a collection of entities that share common properties or characteristics Corresponds to a table and not to a row in the relational environment Entity name, a noun, is usually written in capital letters Database Management Systems
8
What Should an Entity Be?
Should be: An object that will have many instances in the database An object that will be composed of multiple attributes An object that we are trying to model Should not be: A user of the database system An output of the database system (e.g. A report) Database Management Systems
9
Attributes Characteristics of entities Classifications of attributes:
Simple versus composite attribute Single-valued versus multi-valued attribute Stored versus derived attributes Identifier attributes Database Management Systems
10
The Attributes of the STUDENT Entity
Database Management Systems
11
Domains Attributes have a domain: Attributes may share a domain
The attribute’s set of possible values Attributes may share a domain Database Management Systems
12
Primary Keys (Identifiers)
Identifier (key) - an attribute (or combination of attributes) that uniquely identifies individual instances of an entity type Candidate key – an attribute that could be a key…satisfies the requirements for being a key Underlined in the ER diagram Database Management Systems
13
Characteristics of Identifiers
Will not change in value Will not be null No intelligent identifiers (e.g. containing locations or people that might change) Substitute new, simple keys for long, composite keys Database Management Systems 7
14
The CLASS Table (Entity) Components and Contents
Database Management Systems
15
A Multivalued Attribute in an Entity
Database Management Systems
16
Resolving Multivalued Attribute Problems
Although the conceptual model can handle multivalued attributes, you should not implement them in the relational DBMS Within original entity, create several new attributes, one for each of the original multivalued attribute’s components Create a new entity composed of original multivalued attribute’s components Database Management Systems
17
Splitting the Multivalued Attribute into New Attributes
Database Management Systems
18
A New Entity for a Multivalued Attribute’s Components
Database Management Systems
19
Derived Attributes Attribute whose value may be calculated (derived) from other attributes Need not be physically stored within the database Can be derived by using an algorithm Database Management Systems
20
Depiction of a Derived Attribute
Database Management Systems
21
Relationships Association between entities Participants:
Entities that participate in a relationship Relationships between entities always operate in both directions Database Management Systems
22
Connectivity or Cardinality
One – to – One: Each entity instance will have exactly one related entity instance One – to – Many: An entity instance on one side can have many related entity instances, but an entity instance on the other side will have a maximum of one related entity instance Many – to – Many: Entity instances on both sides can have many related entity instances on the other side Established by very concise statements known as business rules Database Management Systems
23
Cardinality in an ERD Database Management Systems
24
Relationship Participation
Optional: One entity occurrence does not require a corresponding entity occurrence in a particular relationship Mandatory: One entity occurrence requires a corresponding entity occurrence in a particular relationship Database Management Systems
25
Mandatory Participation
Database Management Systems
26
Optional Participation
Database Management Systems
27
Cardinality in an ERD Database Management Systems 8
28
Strong vs. Weak Entities
Strong entities exist independently of other types of entities has its own unique identifier Weak entity dependent on a strong entity…cannot exist on its own Has primary key that is partially or totally derived from the parent entity in the relationship Database Management Systems
29
A Weak Entity in an ERD Database Management Systems
30
Weak Entity Data Sample
Database Management Systems
31
Relationship Degree Indicates number of associated entities or participants Unary relationship – Association is maintained within a single entity Binary relationship - Two entities are associated Ternary relationship - Three entities are associated Database Management Systems
32
Three Types of Relationships
Database Management Systems
33
The Implementation of a Ternary Relationship
Database Management Systems
34
Recursive Relationships
Database Management Systems
35
1:1 Recursive Example Database Management Systems
36
M:N Recursive Example Database Management Systems
37
1:M Recursive Example Database Management Systems
38
Composite Entities Also known as bridge entities, associative entities
Composed of the primary keys of each of the entities to be connected May also contain additional attributes of the relationship Database Management Systems
39
M:N Relationship Database Management Systems
40
Converting M:N Relationship with Composite Entity
Database Management Systems
41
Composite Entity Data Sample
Database Management Systems
42
Developing an ER Diagram
Database design is an iterative rather than a linear or sequential process Iterative process Determine all of the entities Determine the attributes for each entity Determine the central or key entity and start the diagram with it Determine the relationship between each of the entities Complete the diagram with cardinality, etc. Database Management Systems
43
Completed Tiny College ERD
Database Management Systems
44
Activity of ER Modeling
View “diagramming a database” Class discussion of ERD Database Management Systems
45
Wrap Up Assignment 2-1 Look ahead of assignment 3-1
Problem 5 on Page 172 Look ahead of assignment 3-1 Search for a business problem Database Management Systems
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.