SlideShare una empresa de Scribd logo
1 de 33
Database Management
Systems
Data Modelling
By Nickkisha Farrell, BSc IT, Dip Ed
February 2014
IN THIS PRESENTATION
What is data modelling?
Types of data Models
Creating a Data Model
Entities, Attributes, Relationships and Cardinality
How to draw Entity Relationship Diagrams
ERD: Problem and Solution

2
INTRODUCTION
• In order ultimately to design databases to support an
organization, one should have:
• a clear understanding of how the organization is
structured
• how it functions
• understand its components, what they do and how they
relate to each other.
• There must be a way of recording (diagramming) the
business

• This is the principle of DATA MODELING.

3
DATA MODELLING
• Process used to define and analyze data requirements
needed to support the business processes, so that
anomalies and inconsistencies may be eliminated
during the physical database design.

• Therefore, the process of data modeling involves
professional data modelers working closely with
business stakeholders, as well as potential users of
the information system.

4
DATA MODELLING
The analysis of data objects and their relationships to
other data objects.

• Types of data models:
1. Conceptual: describes WHAT the system contains
2. Logical: describes HOW the system will be
implemented, regardless of the DBMS
3. Physical: describes HOW the system will be
implemented using a specific DBMS

5
TYPES OF DATA MODELS
• Entity-Relationship (E-R) Models
• The most common method for database modelling
• Only addresses data and relationships
• Classic, simplest
• Best for deriving a sound table design

• Basis for most other modeling approaches

• UML (unified modeling language)
• Class models
• Goes beyond data, also models behaviors

6
ENTITY RELATIONSHIP DIAGRAMS
• a graphical representation of the logical structure of a
database
• identifies the concepts or entities that exist in a system
and the relationships between those entities
• help the database analyst/designer gains a better
understanding of the information to be contained in the
database.
• facilitate documentation of the database design lifecycle.
• used to communicate the logical structure of the database
to users .

7
ENTITY
• Entity
• Generalized category
representing
person, place, thing on
which we store and
maintain information
• Entity Names become
Table Names
• E.g.
Department, Employee

8
Types of Attributes

ATTRIBUTE

Primary key

Atomic
Composite
Multi-valued
Derived

•Attributes:
•Specific characteristics of
each entity, e.g.:
•DEPARTMENT name, address
•EMPLOYEE id, name, contact
number

9
PRIMARY KEY ATTRIBUTES
• Attribute whose value is unique for every entity instance
• Every entity MUST have a PK
• Designate by:
•
•
•

•

Placing as first attribute in the entity
Underline
Label using "PK“

UniversityStudent
PK StudentID
StudentName
StudentDOB
StudentAge

Must be values that are:
• Unique for every possible record
• Do not change
• Best practice: numeric with no blank spaces or
formatting characters
ATOMIC AND COMPOSITE ATTRIBUTES
• Atomic attribute: represents a single data value
• Eg: 17, “Melissa", 11/25/1997

• Composite attribute: can be decomposed into
atomic attributes
• “Melissa K. Jones"
• “VC100 Murrays Vilage, Kingstown, SVG"
• Should be decomposed as much as possible when storing
in a database
COMPOSITE ATTRIBUTES
• Decompose into atomic components for:
• Sorting
• Searching
• Formatting
Student
Student_ID
Student_Name
Student_Address
Student_DOB
Student_Class

Student_First_Name
Student_MI
Student_Last_Name

Student_Address_Line_1
Student_Address_Line_2
Student_City
Student_State
Student_Country
Student_Postal_Code
MULTI-VALUED ATTRIBUTES
• Can have multiple values for the same entity
Student

Employee

Student_ID (PK)
Student_First_Name
Student_Last_Name
Student_Address
Student_DOB
Student_Phone1
Student_Phone2

Employee_ID (PK)
Employee_First_Name
Employee_Last_Name
Employee_Address
Employee_DOB
Employee_Dependent1
Employee_Dependent2
HANDLING MULTI-VALUED ATTRIBUTES
• If it has a definite maximum number, leave as a repeating
attribute
• If the upper limit is variable, make a new entity
Student

Employee

Student_ID
Student_First_Name
Student_Last_Name
Student_Address
Student_DOB
Student_Phone1
Student_Phone2

Employee_ID
Employee_First_Name
Employee_Last_Name
Employee_Address
Employee_DOB
Employee_Dependent1
Employee_Dependent2

has

Dependent
Dependent_ID
Dependent_Name
DERIVED ATTRIBUTES
• Value that can be derived from other attributes
• Student_Age = 17 (DOB = 04/26/1997, current date is
04/30/2014)

• Store the underlying data values from which you can derive
the attribute value …
• Examples:
• DOB => Age

• … unless the underlying values can change!
• PRODUCT_PRICE, COURSE_CREDITS
RELATIONSHIPS
• Relationship:
• A data relationship is a
natural association that
exists between one or
more entities.
• E.g. Employees belong
to departments.

Relationships always
connect two entities

16
CARDINALITY
• Cardinality:
• Defines the number of occurrences of one entity for a single
occurrence of the related entity.
• E.g. a department may have one or more employees, but an
employee can belong to only one department.
• Ordinality :
• Closely linked to cardinality.
• Describes the relationship as either mandatory or optional.
• Specifies the absolute minimum number of relationships.
• When the minimum number is = zero, relationship is optional
• When the minimum number is > than zero , relationship is mandatory

17
HOW TO CREATE ERDs
1. Identify Entities

Identify the roles, events, locations, tangible things or concepts about
which the end-users want to store data.

2. Find Relationships

Find the natural associations between pairs of entities using a relationship
matrix.

3. Fill in Cardinality

Determine the number of occurrences of one entity for a single
occurrence of the related entity.

4. Identify Attributes

Determine the information details (fields) which are essential to the
system under development.

5. Define Primary Keys

Identify the data attribute(s) that uniquely identify one and only one
occurrence of each entity.

6. Draw Key-Based ERD

Eliminate Many-to-Many relationships. Draw ERD and include primary and
foreign keys in each entity.
Adjust the ERD from step 7 to account for entities or relationships

7. Draw fully attributed ERD discovered in step 8.
10. Check Results

Does the final Entity Relationship Diagram accurately depict the system
data?

18
ERD NOTATION
• Crows Foot Notation
Entity
Relationship

Attribute

19
ERD NOTATION
• Chen Notation - Cardinality
Entity
Relationship
Entity

UniversityStudent
PK StudentID

Attributes

StudentName
StudentDOB
StudentAge

Primary key

20
ERD NOTATION
• Bachman Notation - Cardinality
Entity
Relationship

21
DATA MODEL RELATIONSHIPS
• Specify the number of instances of one entity that can
be associated with instances of a related entity
• There are three types of data model relationships:
1:M

1:1

M:M

• One to Many

• One to One

• Many to Many
ONE TO MANY RELATIONSHIP EXAMPLE
Store
Store_ID
Store_Name
Store_Address

Store_ID

Store_Name

Store_Address

1

Northside

3233 Wisconsin St.

2

Southside

4211 Golf Road

Video_ID

Video_Title

Video_Format

1000

The Princess Bride

DVD

1001

Sideways

Bluray

1002

Just Visiting

DVD

1003

Crash

Bluray

Rents
Video

Video_ID
Video_Title
Video_Format
ONE TO ONE RELATIONSHIP EXAMPLE
Spouse
Spouse_ID
Spouse_Name

Spouse_ID

Spouse_Name

52

Ryan, Judy

53

Redmann, Rudy

Has
Customer
Customer_ID
Customer_Name
Customer_Address

Customer_
ID

Customer_
Name

Customer_Address

1

Ryan, Paul

5454 Hyde Court

2

Myers, Mary

112 Birch Place
MANY TO MANY RELATIONSHIP EXAMPLE
Video
Video_ID
Video_Title

Rents

Customer
Customer_ID
Customer_Name
Customer_Address
ERD MODEL EXAMPLE
UniversityInstructor
PK

ServiceProject

InstructorID

PK

InstructorLastName
InstructorFirstName
InstructorOffice

Advises

ProjectDescription
ProjectStartDate

Completes

UniversityStudent
PK

UniversityCourse

StudentID
StudentLastName
StudentFirstName
StudentMI
StudentDOB

ProjectID

PK
EnrollsIn

CourseID
CourseName
CourseTitle
NOW ITS YOUR TURN

• SCENARIO
• A company has several departments. Each department has a
supervisor and at least one employee. Employees must be
assigned to at least one, but possibly more departments. At
least one employee is assigned to a project, but an employee
may be on vacation and not assigned to any projects. The
important data fields are the names of the departments,
projects, supervisors and employees, as well as the
supervisor and employee number and a unique project
number.

27
SOLVING THE PROBLEM
1. Identify Entities
• The entities in this system are Department, Employee, Supervisor and
Project. One is tempted to make Company an entity, but it is a false entity
because it has only one instance in this problem. True entities must have
more than one instance.
2. Find Relationships

We construct the following Entity Relationship Matrix:
Department
Employee
Supervisor
Project

Department Employee
is assigned
belongs to
runs
uses

Supervisor
run by

Project

works on

28
SOLVING THE PROBLEM
3. Fill in Cardinality
From the description of the problem we see that:
•Each department has exactly one supervisor.
•A supervisor is in charge of one and only one department.
•Each department is assigned at least one employee.
•Each employee works for at least one department.
•Each project has at least one employee working on it.
•An employee is assigned to 0 or more projects.

29
SOLVING THE PROBLEM
4. Identify Attributes
• The only attributes indicated
are:
•
•
•
•
•
•
•

Department names
projects
supervisors
employees
supervisor number
employee number
project number

5. Define Primary Keys

• The primary keys are:
• Department Name
• Supervisor Number
• Employee Number
Project Number

6. Draw Key-Based ERD

30
PROBLEM SOLVED
7. Draw fully
attributed
ERD

31
SUMMARY
• ER Modeling models information conceptually
• Based on functional business needs
• “What”, not “How”
• Diagrams provide easy means of communication for both analyst and user
• When creating ERD the most important steps are:
• Define entities
• Define attributes
• Define relationships
• Identify relationship cardinality (1:1, 1:M, M:M)

32
REFERENCES
• Gillenson, Mark L.,2012, Fundamentals of Database
Management Systems / Mark L. Gillenson.—2nd ed., John
Wiley and sons inc
• http://users.csc.calpoly.edu/~jdalbey/308/Lectures/HOWTO
-ERD.html

• http://www.darkopetrovic.com/pdf/Data-Modeling-andRelational-Database-Design.pdf

33

Más contenido relacionado

La actualidad más candente

Relational database
Relational databaseRelational database
Relational databaseSanthiNivas
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
Lecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelLecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelemailharmeet
 
Basic database analysis(database)
Basic database analysis(database)Basic database analysis(database)
Basic database analysis(database)welcometofacebook
 
Entity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMSEntity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMSProf Ansari
 
physical and logical data independence
physical and logical data independencephysical and logical data independence
physical and logical data independenceapoorva_upadhyay
 
E-R Diagram of College Management Systems
E-R Diagram of College Management SystemsE-R Diagram of College Management Systems
E-R Diagram of College Management SystemsOmprakash Chauhan
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbmsNaresh Kumar
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER DiagramsAdri Jovin
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
Relational Database & Database Management System
Relational Database & Database Management SystemRelational Database & Database Management System
Relational Database & Database Management SystemNimrakhan89
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship ModellingBhandari Nawaraj
 
The three level of data modeling
The three level of data modelingThe three level of data modeling
The three level of data modelingsharmila_yusof
 

La actualidad más candente (20)

Database design concept
Database design conceptDatabase design concept
Database design concept
 
Relational database
Relational databaseRelational database
Relational database
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Lecture 03 data abstraction and er model
Lecture 03 data abstraction and er modelLecture 03 data abstraction and er model
Lecture 03 data abstraction and er model
 
Basic database analysis(database)
Basic database analysis(database)Basic database analysis(database)
Basic database analysis(database)
 
Entity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMSEntity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMS
 
Data modeling
Data modelingData modeling
Data modeling
 
physical and logical data independence
physical and logical data independencephysical and logical data independence
physical and logical data independence
 
E-R Diagram of College Management Systems
E-R Diagram of College Management SystemsE-R Diagram of College Management Systems
E-R Diagram of College Management Systems
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
 
RDBMS_Unit 01
RDBMS_Unit 01RDBMS_Unit 01
RDBMS_Unit 01
 
Erd1
Erd1Erd1
Erd1
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
DBMS OF DATA MODEL Deepika 2
DBMS OF DATA MODEL  Deepika 2DBMS OF DATA MODEL  Deepika 2
DBMS OF DATA MODEL Deepika 2
 
Relational Database & Database Management System
Relational Database & Database Management SystemRelational Database & Database Management System
Relational Database & Database Management System
 
Relational Model
Relational ModelRelational Model
Relational Model
 
Er Modeling
Er ModelingEr Modeling
Er Modeling
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
The three level of data modeling
The three level of data modelingThe three level of data modeling
The three level of data modeling
 

Destacado

Bachman style
Bachman styleBachman style
Bachman style28cristy
 
ERD Company Service Working Summary
ERD Company Service Working SummaryERD Company Service Working Summary
ERD Company Service Working SummaryJana Murthy
 
Database Design Project ERD
Database Design Project ERDDatabase Design Project ERD
Database Design Project ERDJames Peck
 
Implementing role based access control on Web Application (sample case)
Implementing role based access control on Web Application (sample case)Implementing role based access control on Web Application (sample case)
Implementing role based access control on Web Application (sample case)Deny Prasetia
 
5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)randhirlpu
 
Role Discovery and RBAC Design: A Case Study with IBM Role and Policy Modeler
Role Discovery and RBAC Design: A Case Study with IBM Role and Policy ModelerRole Discovery and RBAC Design: A Case Study with IBM Role and Policy Modeler
Role Discovery and RBAC Design: A Case Study with IBM Role and Policy ModelerProlifics
 
Er diagram for sales and purchase management system
Er diagram for sales and purchase management systemEr diagram for sales and purchase management system
Er diagram for sales and purchase management systemPramod Redekar
 
Attribute Based Access Control
Attribute Based Access ControlAttribute Based Access Control
Attribute Based Access ControlChandra Sharma
 
Role based access control - RBAC
Role based access control - RBACRole based access control - RBAC
Role based access control - RBACAjit Dadresa
 
Entity relationship Diagram for Online buy and Sale Project
Entity relationship Diagram for Online buy and Sale ProjectEntity relationship Diagram for Online buy and Sale Project
Entity relationship Diagram for Online buy and Sale ProjectNaimul Arif
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationSatya Pal
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramRakhi Mukherji
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Mudasir Qazi
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 

Destacado (20)

Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Bachman style
Bachman styleBachman style
Bachman style
 
ERD Company Service Working Summary
ERD Company Service Working SummaryERD Company Service Working Summary
ERD Company Service Working Summary
 
Database Design Project ERD
Database Design Project ERDDatabase Design Project ERD
Database Design Project ERD
 
Implementing role based access control on Web Application (sample case)
Implementing role based access control on Web Application (sample case)Implementing role based access control on Web Application (sample case)
Implementing role based access control on Web Application (sample case)
 
Erd optionality
Erd optionalityErd optionality
Erd optionality
 
5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)
 
Role Discovery and RBAC Design: A Case Study with IBM Role and Policy Modeler
Role Discovery and RBAC Design: A Case Study with IBM Role and Policy ModelerRole Discovery and RBAC Design: A Case Study with IBM Role and Policy Modeler
Role Discovery and RBAC Design: A Case Study with IBM Role and Policy Modeler
 
ERD - Purchase Order Process
ERD - Purchase Order ProcessERD - Purchase Order Process
ERD - Purchase Order Process
 
Er diagram for sales and purchase management system
Er diagram for sales and purchase management systemEr diagram for sales and purchase management system
Er diagram for sales and purchase management system
 
Attribute Based Access Control
Attribute Based Access ControlAttribute Based Access Control
Attribute Based Access Control
 
Erd (info sys)
Erd (info sys)Erd (info sys)
Erd (info sys)
 
Role based access control - RBAC
Role based access control - RBACRole based access control - RBAC
Role based access control - RBAC
 
Entity relationship Diagram for Online buy and Sale Project
Entity relationship Diagram for Online buy and Sale ProjectEntity relationship Diagram for Online buy and Sale Project
Entity relationship Diagram for Online buy and Sale Project
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Erd practice exercises
Erd practice exercisesErd practice exercises
Erd practice exercises
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 

Similar a Database Management Systems Data Modelling

IT6701 Information Management Unit-I
IT6701 Information Management Unit-IIT6701 Information Management Unit-I
IT6701 Information Management Unit-IMikel Raj
 
Cn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingCn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingg30162363
 
BusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxBusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxjwell817
 
WBC Entity Relationship and data flow diagrams
WBC Entity Relationship and data flow diagramsWBC Entity Relationship and data flow diagrams
WBC Entity Relationship and data flow diagramsArshitSood3
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxMaryJoseph79
 
ER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdfER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdfSadiaSharmin40
 
Lecture#5.pptx
Lecture#5.pptxLecture#5.pptx
Lecture#5.pptxGulRana13
 
Common Data Model - A Business Database!
Common Data Model - A Business Database!Common Data Model - A Business Database!
Common Data Model - A Business Database!Pedro Azevedo
 
IT6701-Information Management Unit 1
IT6701-Information Management Unit 1IT6701-Information Management Unit 1
IT6701-Information Management Unit 1SIMONTHOMAS S
 
Solving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDBSolving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDBMongoDB
 
Entity-Relationship Data Model
Entity-Relationship Data ModelEntity-Relationship Data Model
Entity-Relationship Data ModelBishrul Haq
 
Advance database system(part 4)
Advance database system(part 4)Advance database system(part 4)
Advance database system(part 4)Abdullah Khosa
 
Introductin to Data Modeling.
Introductin to Data Modeling.Introductin to Data Modeling.
Introductin to Data Modeling.Cloudbells.com
 

Similar a Database Management Systems Data Modelling (20)

IT6701 Information Management Unit-I
IT6701 Information Management Unit-IIT6701 Information Management Unit-I
IT6701 Information Management Unit-I
 
Cn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingCn presentation on the topic called as re modelling
Cn presentation on the topic called as re modelling
 
BusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxBusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptx
 
Lecture7.pptx
Lecture7.pptxLecture7.pptx
Lecture7.pptx
 
WBC Entity Relationship and data flow diagrams
WBC Entity Relationship and data flow diagramsWBC Entity Relationship and data flow diagrams
WBC Entity Relationship and data flow diagrams
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
 
ER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdfER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdf
 
Lecture#5.pptx
Lecture#5.pptxLecture#5.pptx
Lecture#5.pptx
 
Common Data Model - A Business Database!
Common Data Model - A Business Database!Common Data Model - A Business Database!
Common Data Model - A Business Database!
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
Database system
Database system Database system
Database system
 
IT6701-Information Management Unit 1
IT6701-Information Management Unit 1IT6701-Information Management Unit 1
IT6701-Information Management Unit 1
 
Solving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDBSolving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDB
 
Entity-Relationship Data Model
Entity-Relationship Data ModelEntity-Relationship Data Model
Entity-Relationship Data Model
 
oracle
oracle oracle
oracle
 
Advance database system(part 4)
Advance database system(part 4)Advance database system(part 4)
Advance database system(part 4)
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
8.pptx
8.pptx8.pptx
8.pptx
 
Introductin to Data Modeling.
Introductin to Data Modeling.Introductin to Data Modeling.
Introductin to Data Modeling.
 

Más de Nickkisha Farrell

Database Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationDatabase Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationNickkisha Farrell
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2Nickkisha Farrell
 
Data security concepts chapter 2
Data security concepts chapter 2Data security concepts chapter 2
Data security concepts chapter 2Nickkisha Farrell
 
Database Management Systems 1
Database Management Systems 1Database Management Systems 1
Database Management Systems 1Nickkisha Farrell
 
About the Rotaract Organization
About the Rotaract OrganizationAbout the Rotaract Organization
About the Rotaract OrganizationNickkisha Farrell
 
Cisco Systems: A company Analysis
Cisco Systems: A company AnalysisCisco Systems: A company Analysis
Cisco Systems: A company AnalysisNickkisha Farrell
 

Más de Nickkisha Farrell (9)

Database Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationDatabase Management Systems 4 - Normalization
Database Management Systems 4 - Normalization
 
Trade Secrets Law
Trade Secrets LawTrade Secrets Law
Trade Secrets Law
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2
 
Data security concepts chapter 2
Data security concepts chapter 2Data security concepts chapter 2
Data security concepts chapter 2
 
Database Management Systems 1
Database Management Systems 1Database Management Systems 1
Database Management Systems 1
 
A Teacher's Heart
A Teacher's HeartA Teacher's Heart
A Teacher's Heart
 
About the Rotaract Organization
About the Rotaract OrganizationAbout the Rotaract Organization
About the Rotaract Organization
 
Cisco Systems: A company Analysis
Cisco Systems: A company AnalysisCisco Systems: A company Analysis
Cisco Systems: A company Analysis
 
Copyright and Technology
Copyright and TechnologyCopyright and Technology
Copyright and Technology
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Database Management Systems Data Modelling

  • 1. Database Management Systems Data Modelling By Nickkisha Farrell, BSc IT, Dip Ed February 2014
  • 2. IN THIS PRESENTATION What is data modelling? Types of data Models Creating a Data Model Entities, Attributes, Relationships and Cardinality How to draw Entity Relationship Diagrams ERD: Problem and Solution 2
  • 3. INTRODUCTION • In order ultimately to design databases to support an organization, one should have: • a clear understanding of how the organization is structured • how it functions • understand its components, what they do and how they relate to each other. • There must be a way of recording (diagramming) the business • This is the principle of DATA MODELING. 3
  • 4. DATA MODELLING • Process used to define and analyze data requirements needed to support the business processes, so that anomalies and inconsistencies may be eliminated during the physical database design. • Therefore, the process of data modeling involves professional data modelers working closely with business stakeholders, as well as potential users of the information system. 4
  • 5. DATA MODELLING The analysis of data objects and their relationships to other data objects. • Types of data models: 1. Conceptual: describes WHAT the system contains 2. Logical: describes HOW the system will be implemented, regardless of the DBMS 3. Physical: describes HOW the system will be implemented using a specific DBMS 5
  • 6. TYPES OF DATA MODELS • Entity-Relationship (E-R) Models • The most common method for database modelling • Only addresses data and relationships • Classic, simplest • Best for deriving a sound table design • Basis for most other modeling approaches • UML (unified modeling language) • Class models • Goes beyond data, also models behaviors 6
  • 7. ENTITY RELATIONSHIP DIAGRAMS • a graphical representation of the logical structure of a database • identifies the concepts or entities that exist in a system and the relationships between those entities • help the database analyst/designer gains a better understanding of the information to be contained in the database. • facilitate documentation of the database design lifecycle. • used to communicate the logical structure of the database to users . 7
  • 8. ENTITY • Entity • Generalized category representing person, place, thing on which we store and maintain information • Entity Names become Table Names • E.g. Department, Employee 8
  • 9. Types of Attributes ATTRIBUTE Primary key Atomic Composite Multi-valued Derived •Attributes: •Specific characteristics of each entity, e.g.: •DEPARTMENT name, address •EMPLOYEE id, name, contact number 9
  • 10. PRIMARY KEY ATTRIBUTES • Attribute whose value is unique for every entity instance • Every entity MUST have a PK • Designate by: • • • • Placing as first attribute in the entity Underline Label using "PK“ UniversityStudent PK StudentID StudentName StudentDOB StudentAge Must be values that are: • Unique for every possible record • Do not change • Best practice: numeric with no blank spaces or formatting characters
  • 11. ATOMIC AND COMPOSITE ATTRIBUTES • Atomic attribute: represents a single data value • Eg: 17, “Melissa", 11/25/1997 • Composite attribute: can be decomposed into atomic attributes • “Melissa K. Jones" • “VC100 Murrays Vilage, Kingstown, SVG" • Should be decomposed as much as possible when storing in a database
  • 12. COMPOSITE ATTRIBUTES • Decompose into atomic components for: • Sorting • Searching • Formatting Student Student_ID Student_Name Student_Address Student_DOB Student_Class Student_First_Name Student_MI Student_Last_Name Student_Address_Line_1 Student_Address_Line_2 Student_City Student_State Student_Country Student_Postal_Code
  • 13. MULTI-VALUED ATTRIBUTES • Can have multiple values for the same entity Student Employee Student_ID (PK) Student_First_Name Student_Last_Name Student_Address Student_DOB Student_Phone1 Student_Phone2 Employee_ID (PK) Employee_First_Name Employee_Last_Name Employee_Address Employee_DOB Employee_Dependent1 Employee_Dependent2
  • 14. HANDLING MULTI-VALUED ATTRIBUTES • If it has a definite maximum number, leave as a repeating attribute • If the upper limit is variable, make a new entity Student Employee Student_ID Student_First_Name Student_Last_Name Student_Address Student_DOB Student_Phone1 Student_Phone2 Employee_ID Employee_First_Name Employee_Last_Name Employee_Address Employee_DOB Employee_Dependent1 Employee_Dependent2 has Dependent Dependent_ID Dependent_Name
  • 15. DERIVED ATTRIBUTES • Value that can be derived from other attributes • Student_Age = 17 (DOB = 04/26/1997, current date is 04/30/2014) • Store the underlying data values from which you can derive the attribute value … • Examples: • DOB => Age • … unless the underlying values can change! • PRODUCT_PRICE, COURSE_CREDITS
  • 16. RELATIONSHIPS • Relationship: • A data relationship is a natural association that exists between one or more entities. • E.g. Employees belong to departments. Relationships always connect two entities 16
  • 17. CARDINALITY • Cardinality: • Defines the number of occurrences of one entity for a single occurrence of the related entity. • E.g. a department may have one or more employees, but an employee can belong to only one department. • Ordinality : • Closely linked to cardinality. • Describes the relationship as either mandatory or optional. • Specifies the absolute minimum number of relationships. • When the minimum number is = zero, relationship is optional • When the minimum number is > than zero , relationship is mandatory 17
  • 18. HOW TO CREATE ERDs 1. Identify Entities Identify the roles, events, locations, tangible things or concepts about which the end-users want to store data. 2. Find Relationships Find the natural associations between pairs of entities using a relationship matrix. 3. Fill in Cardinality Determine the number of occurrences of one entity for a single occurrence of the related entity. 4. Identify Attributes Determine the information details (fields) which are essential to the system under development. 5. Define Primary Keys Identify the data attribute(s) that uniquely identify one and only one occurrence of each entity. 6. Draw Key-Based ERD Eliminate Many-to-Many relationships. Draw ERD and include primary and foreign keys in each entity. Adjust the ERD from step 7 to account for entities or relationships 7. Draw fully attributed ERD discovered in step 8. 10. Check Results Does the final Entity Relationship Diagram accurately depict the system data? 18
  • 19. ERD NOTATION • Crows Foot Notation Entity Relationship Attribute 19
  • 20. ERD NOTATION • Chen Notation - Cardinality Entity Relationship Entity UniversityStudent PK StudentID Attributes StudentName StudentDOB StudentAge Primary key 20
  • 21. ERD NOTATION • Bachman Notation - Cardinality Entity Relationship 21
  • 22. DATA MODEL RELATIONSHIPS • Specify the number of instances of one entity that can be associated with instances of a related entity • There are three types of data model relationships: 1:M 1:1 M:M • One to Many • One to One • Many to Many
  • 23. ONE TO MANY RELATIONSHIP EXAMPLE Store Store_ID Store_Name Store_Address Store_ID Store_Name Store_Address 1 Northside 3233 Wisconsin St. 2 Southside 4211 Golf Road Video_ID Video_Title Video_Format 1000 The Princess Bride DVD 1001 Sideways Bluray 1002 Just Visiting DVD 1003 Crash Bluray Rents Video Video_ID Video_Title Video_Format
  • 24. ONE TO ONE RELATIONSHIP EXAMPLE Spouse Spouse_ID Spouse_Name Spouse_ID Spouse_Name 52 Ryan, Judy 53 Redmann, Rudy Has Customer Customer_ID Customer_Name Customer_Address Customer_ ID Customer_ Name Customer_Address 1 Ryan, Paul 5454 Hyde Court 2 Myers, Mary 112 Birch Place
  • 25. MANY TO MANY RELATIONSHIP EXAMPLE Video Video_ID Video_Title Rents Customer Customer_ID Customer_Name Customer_Address
  • 27. NOW ITS YOUR TURN • SCENARIO • A company has several departments. Each department has a supervisor and at least one employee. Employees must be assigned to at least one, but possibly more departments. At least one employee is assigned to a project, but an employee may be on vacation and not assigned to any projects. The important data fields are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee number and a unique project number. 27
  • 28. SOLVING THE PROBLEM 1. Identify Entities • The entities in this system are Department, Employee, Supervisor and Project. One is tempted to make Company an entity, but it is a false entity because it has only one instance in this problem. True entities must have more than one instance. 2. Find Relationships We construct the following Entity Relationship Matrix: Department Employee Supervisor Project Department Employee is assigned belongs to runs uses Supervisor run by Project works on 28
  • 29. SOLVING THE PROBLEM 3. Fill in Cardinality From the description of the problem we see that: •Each department has exactly one supervisor. •A supervisor is in charge of one and only one department. •Each department is assigned at least one employee. •Each employee works for at least one department. •Each project has at least one employee working on it. •An employee is assigned to 0 or more projects. 29
  • 30. SOLVING THE PROBLEM 4. Identify Attributes • The only attributes indicated are: • • • • • • • Department names projects supervisors employees supervisor number employee number project number 5. Define Primary Keys • The primary keys are: • Department Name • Supervisor Number • Employee Number Project Number 6. Draw Key-Based ERD 30
  • 31. PROBLEM SOLVED 7. Draw fully attributed ERD 31
  • 32. SUMMARY • ER Modeling models information conceptually • Based on functional business needs • “What”, not “How” • Diagrams provide easy means of communication for both analyst and user • When creating ERD the most important steps are: • Define entities • Define attributes • Define relationships • Identify relationship cardinality (1:1, 1:M, M:M) 32
  • 33. REFERENCES • Gillenson, Mark L.,2012, Fundamentals of Database Management Systems / Mark L. Gillenson.—2nd ed., John Wiley and sons inc • http://users.csc.calpoly.edu/~jdalbey/308/Lectures/HOWTO -ERD.html • http://www.darkopetrovic.com/pdf/Data-Modeling-andRelational-Database-Design.pdf 33