Data Management and Database Design: INFO 6210 Week #2
Data Management and Database Design: INFO 6210 Week #2
and
Database Design
INFO 6210
Week #2
Northeastern University
What we discussed till now....
2
Before we start....
3
So, This week....
• Data modeling
• Relational Data models
By end of the session, we will be pretty much done with Database concepts
4
Data modeling
5
What is Data modeling?
• Graphical representation of –
• Data structures
• Characteristics
• Relations
• Constraints
• It is an Iterative process
• A perfect model meets all business
requirements
6
Why Data modeling?
7
How Data modeling is performed?
• Bottom Up
• Redesign of existing application
• Top Down
• New applications
• Hybrid
• mix of both Bottom up and Top
Down
• Example: Existing system
enrichment with new features
8
Data Model
9
Types of Database models
• Hierarchical
• Network
• Relational
10
Hierarchical Model
• Developed by IBM
• Tree like structure with Single root
• Parent child relationship
• Parent may have one or more child units
• Child is restricted to have only one Parent
• Drawback
• Cannot represent many to many relationship
11
Network Model
• Drawback
• Transaction management via pointers and tracing
12
Relational Model
13
Relational Model
14
Relational Model
Supplier
Part
15
However, How we Design the Model?
16
Database Design
• Conceptual Design
• Identify Entities and relationships
• Data Modeling
• First Level – ER Diagrams
• Second Level – Normalization
• Design Implementation
17
ER Diagram components
• Entity
• Entity is a “Thing” which can be distinctly identified
• Is an Object which has characteristics
• Example: Supplier, Company, Product, Customer, Student, User, Sales
• Entity type(category) is a collection of similar Entities
• A Name that we give to an Entity
• Entity Set is a collection of entities of an entity type (All entities of an entity type)
• All rows/records of a Entity/Table
• Attribute
• Set of Attributes define Entity / Data element(s) that describes an Entity
• Domain of attribute is of permitted values
• Phone number, SSN number, Date of Birth, Zip code
18
Entity Symbols….
• Entity types
• Strong Entity
• Sometimes called as parent entities or Kernels
• Contains primary keys
• Building blocks of Database
• Associative Entity
• Bridge tables
• Created to resolve linkage between many to many relation ships
19
Attribute Symbols….
• Types of Attributes
• Simple Attribute
• Characteristics of an entity and cannot be broken down further
• Example: Product Name
• Multivalued attribute
• Attributes which are capable of taking more than one value
• Derived Attributes
• Calculated fields
• These doesn’t exists in real
• Logical representation
20
ER Diagram Relations
• Relationship
• Association between Entities
• Relates two entities
• Several relationships may exist between same entities
• Dependent Entity
• An Entity whose existence depends on existence of another entity
• Example
• A project comprises of multiple tasks and task cannot be present without
project
21
Subsets and Supersets
• A subset is derived from parent entities called supersets
• Common attributes among subsets are “attributes of superset”
• Identifier of a subset is always superset Identifier
22
Relationship symbols….
• Relationship symbols and its usage
• Relationship
• These are associations/connections between strong entities
• Weak Relationship
• These are connections between weak entities
23
Degree of Relationship
1 :1 1:N
One to One One to Many
N:N
Many to Many
24
One to One Relationship
25
One to Many Relationship
26
Many to Many
Relationship
27
ER Diagram
Conceptual Representation
28
• Social media picture/photo upload (Write
Let’s discuss down requirements)
• What all you can think of for this use case /
with example Interactions
29
Conceptual
Model
30
Now Read
this
Logical
Model
31
Questions?
32