19BNA502B - Data Management - 16 - 18
19BNA502B - Data Management - 16 - 18
Course Leader:
Ms. Shilpa R.G.
Email: [email protected]
1
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Course Code: 19BNA502A
Course Leader:
3
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Session Contents
• Database design using ER-Model
4
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Design Phases
• Initial phase -- Characterize fully the data needs of the
prospective database users.
7
Faculty
©M. S. of Management
Ramaiah andofCommerce
University Applied Sciences © Ramaiah University of Applied Sciences
Design Approaches
8
Faculty
©M. S. of Management
Ramaiah andofCommerce
University Applied Sciences © Ramaiah University of Applied Sciences
ER model -- Database Modeling
9
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Entity Sets
• An entity is an object that exists and is distinguishable from other objects.
• An entity set is a set of entities of the same type that share the same
properties.
– Example:
• A subset of the attributes form a primary key of the entity set; i.e.,
uniquely identifying each member of the set.
10
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Entity Sets -- instructor and student
11
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Representing Entity sets in ER Diagram
12
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Representing Relationship Sets via ER Diagrams
13
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Relationship Sets contd…
• An attribute can also be associated with a relationship set.
• For instance, the advisor relationship set between entity sets instructor and
student may have the attribute date which tracks when the student started
being associated with the advisor
student
14
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Relationship Sets with Attributes
15
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Roles
• Entity sets of a relationship need not be distinct
– Each occurrence of an entity set plays a “role” in the relationship
• The labels “course_id” and “prereq_id” are called roles.
16
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Degree of a Relationship Set
• Binary relationship
• Relationships between more than two entity sets are rare. Most
relationships are binary. (More on this later.)
17
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Non-binary Relationship Sets
18
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Representing Cardinality Constraints in ER Diagram
• We express cardinality constraints by drawing either a directed line (),
signifying “one,” or an undirected line (—), signifying “many,” between the
relationship set and the entity set.
19
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
One-to-Many Relationship
20
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Many-to-One Relationships
21
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Many-to-Many Relationship
• An instructor is associated with several (possibly 0) students via advisor
22
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
E-R Diagram for a University Enterprise
23
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Design Issues
24
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Common Mistakes in E-R Diagrams
Example of erroneous E-R diagrams
25
Faculty
©M. S. of Management
Ramaiah andofCommerce
University Applied Sciences © Ramaiah University of Applied Sciences
Common Mistakes in E-R Diagrams (Cont.)
26
Faculty
©M. S. of Management
Ramaiah andofCommerce
University Applied Sciences © Ramaiah University of Applied Sciences
Entities vs. Attributes
Use of entity sets vs. attributes
27
Faculty
©M. S. of Management
Ramaiah andofCommerce
University Applied Sciences © Ramaiah University of Applied Sciences
Entities vs. Relationship sets
Use of entity sets vs. relationship sets
Possible guideline is to designate a relationship set to describe
an action that occurs between entities
28
Faculty
©M. S. of Management
Ramaiah andofCommerce
University Applied Sciences © Ramaiah University of Applied Sciences
Summary of Symbols Used in E-R Notation
29
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Symbols Used in E-R Notation contd…
30
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Alternative ER Notations
31
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
UML
32
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
ER vs. UML Class Diagrams
33
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
UML Class Diagrams contd…
• Binary relationship sets are represented in UML by just drawing
a line connecting the entity sets. The relationship set name is
written adjacent to the line.
• Functional Requirements
• Schema Evolution
35
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Application Design and Development
• Binary relationship sets are represented in UML by just drawing
a line connecting the entity sets. The relationship set name is
written adjacent to the line.
Semi-Structured Data
37
Faculty of Management and Commerce © Ramaiah University of Applied Sciences
Application Design and Development
Semi-Structured Data
38
Faculty of Management and Commerce © Ramaiah University of Applied Sciences