SlideShare a Scribd company logo
1 of 46
DATABASE DESIGN: DATA MODELING
AND NORMALIZATION
Dr. R. Khanchana
Assistant Professor
Department of Computer Science
Sri Ramakrishna College of Arts and Science for Women
Data Modeling
Data Modeling:
• Data modeling - A tool used to represent various components and their
relationships.
• Popular modeling tool is Entity Relational Model(E-R Model)
• E-R Model provides
 An excellent communication tools
 A simple graphical representation of data.
• E-R Model uses E-R Diagram(ERD) for graphical representation of the
database components.
• An entity is represented by a rectangle it uses upper case letters and it should
be singular noun Eg. EMPLOYEE,DEPARTMENT etc
• Entity Representation in an E-R Diagram
EMPLOYEE
Representation of Relationship
• The line represents the relationship between the two entities it uses
lowercase letters and it should be active verb
• Passive verb can be used but active verb is preferable.
• Representation of relationship in an E-R diagram
1:1
• The types of relationships (1:1,1:M,M:N) between entities are called
connectivity or multiplicity.
M: N
1: Mmanages
employs
contains
Entity, Relationship, Connectivity
• The types of relationships (1:1,1:M,M:N) between entities are
called Connectivity or Multiplicity
• The connectivity is shown with vertical or angled lines next to
each entity
Cardinality
• The Relationship between two entities can be
given suing the lowercase and uppercase
limits
• Example - (n,m)
• n – lower limit
• m – upper limit
DEPARTMENTEMPLOYEE
FACULTYDIVISION
ITEMINVOICE
Supervises
Employees
Contains
(1, 1)
(1, 1)
(1, N)
(1, 1)
(1, N) (1, N)
Data Model Basic Building Blocks
Cardinality Types
• It has 2 types
– Mandatory
Relationship
– Optional
Relationship
• Oracle set rules for
the minimum and
maximum values for
cardinality. These
types of decision are
known as business
rules.
Minimum Cardinality
Cardinality Representation
Optional Relationship
• Optional relationships are shown with a small circle next to the
optional entity.
• The optional relational relationship can occur in 1:1,1:M or
M:N relationships and it can occur on one or both sides of the
relationship.
• In relational databases many-to-many (M:N) relationships are
allowed but they are not easy to implement.
Composite Entity & Relational Schema
• The decomposition from M:N to1:M involves
a third entity and it is known as Composition
entity or Associative entity
Weak Entity
• There are entities that cannot exist by
themselves.
Other Elements
• Some of the other elements considered in the database design are
 Simple Attributes:
Attributes that cannot be subdivided
Eg. city, gender
 Composite Attributes:
Attributes that can be subdivided
Eg. Full name(Last name, First name, Middle Initial)
 Single valued Attributes:
Attributes with a single value
Eg. Employee Id, Student Id
 Multivalued Attributes:
Attributes with multiple values
Eg. Course details
Quiz
• https://quizizz.com/admin/quiz/5f06a5c1b83
319001b5de46f
Dependency
• A dependency is a constraint that applies to or defines the relationship
between attributes.
• Primary key which uniquely identifies an entity
• The column that do not make up the primary key for the table such columns
are called the nonkey column
• The non key columns are functionally dependent on the primary key columns
• There are three types of dependency in tables
– Total or full dependency: A nonkey column dependent on
all primary key column
– Partial dependency : A nonkey column is dependent on part
of the primary key
– Transitive dependency :A nonkey column is dependent on
another nonkey column.
Dependency Types
Database Design
Normal forms
• Redundancy - Data Repetition
• Anomaly (Data Inconsistency)
• – if a change in piece of data, the change has
to made in many places
Anomalies
Deletion Anomaly
Insertion Anomaly
Update Anomaly
Deletion Anomaly
• Which results when the deletion of information about one
entity leads to the deletion of another entity.
• If someone decides to delete Botany department , he may
end up deleting all student’s data who had the department of
Botany.
Insertion Anomaly
When the information about an entity cannot be inserted
unless the information about another entity is known
and it is said to be Insertion Anomaly
Jerry is a new Student with department id 6. There is no Department with this Dept_ID 6. Hence , the
anomaly. The usual behaviour should be a new department id with 6 and only then Student could have
it.
Update Anomaly
• An update anomaly occurs when data is only
partially updated in a database.
• English department has now Dept_ID 8 , but unfortunately it
was not updated in Student table.
Quiz
• https://quizizz.com/admin/quiz/5f07f8f48538
03001bc75b8c/anamolies-and-depedency
Feedback
• https://docs.google.com/forms/d/1rk0rjFo78J
adkbHRT-SshgN0XavjgYvK5SnCOBqQ8V8/edit
Normalization
• Normalization is the process of organizing the
data in the database.
• Normalization is used to minimize the
redundancy from a relation or set of relations.
• Normalization divides the larger table into the
smaller table and links them using relationship.
• The normal form is used to reduce redundancy
from the database table.
Review
• Data Modeling
– Entity
– Attribute
– Connectivity
– Cardinality -Notation
• Dependency
• Database design
Types of Normal Forms
• Higher Normal Form - Lower the redundancy
i) First Normal Form(1NF)
ii) Second Normal Form(2NF)
iii) Third Normal Form(3NF)
First Normal Form (1NF)
The table said to be first normal form (or) labeled 1NF if the following conditions
exists:
• The primary key is defined
• Also includes composite key if a single column cannot be used as a primary key.
• First normal form disallows the multi-valued attribute/ composite attribute, and
their combinations.
Example: Relation EMPLOYEE is not in 1NF because of multi-valued attribute
EMP_PHONE
Second Normal Form (2NF)
• All 1NF requirements are fulfilled
•No partial dependency
•Suppose the table is in 1NF and does not have composite key and it is said to
be 2NF.
Example: A school can store the data of teachers and the subjects they teach. In a
school, a teacher can teach more than one subject.
Second Normal Form (2NF)
Third Normal Form (3NF)
• Table is said to be third normal form (or) 3NF
if the following requirements are satisfied.
– All 2NF requirements are fulfilled.
– No transitive dependency- non key column is
dependent on another non key column.
Third Normal Form (3NF)
• Super key in the table above:
– {EMP_ID}, {EMP_ID, EMP_NAME}, {EMP_ID, EMP_NAME, EMP_ZIP}....so on
• Candidate key: {EMP_ID}
• Non-prime attributes: all attributes except EMP_ID are non-prime.
– EMP_STATE & EMP_CITY dependent on EMP_ZIP and EMP_ZIP dependent on
EMP_ID.
– The non-prime attributes (EMP_STATE, EMP_CITY) transitively dependent on
super key(EMP_ID). It violates the rule of third normal form.
– Hence need to move the EMP_CITY and EMP_STATE to the new
<EMPLOYEE_ZIP> table, with EMP_ZIP as a Primary key.
Third Normal Form (3NF)
Other Normal forms
• BCNF - BoyceCodd Normal Form(BCNF)
• 4NF –Fourth Normal Form
• 5NF - Fifth Normal Form
• DKNF –Domain Key Normal Form
Dependency Diagram
• Total dependencies arrows are drawn above the boxes.
• Partial & transitive dependencies arrows are drawn below the boxes.
• i)Conversion from 1NF to 2NF
• ii)Conversion from 2NF to 3NF
Conversion from 1NF to 2NF
• The composite primary key is in the table remove partial dependency.
• 1st each primary key component on a separate line , they will become
primary key in two new tables.
• Composite key on the third line it will be the composite key on the third
table.
1NF to 2NF
Decomposition
Table in 2NF
Conversion from 2NF to 3NF
• Invoice table still has transitive dependency but no partial dependency.
• More columns of transitive dependency to a new table.
• Keep the primary key of new table as a foreign key at existing table.
2NF to 3NF
Decomposition
Table in 3NF
Denormaization
• Normalization process - splits tables into smaller
tables
• Smaller tables are joined together by common
columns to retrieve information from different
tables.
• Denomalization process – reverse process
• It reduces normal form and increases
data redundancy
• Duplicate data are stored more storage space is
required
Quiz
• https://quizizz.com/admin/quiz/5f071541f209
7b001e69591a
Feedback
• https://docs.google.com/forms/d/10qpFTAot
HMsCXuhBpCrNKnU3PIso8NtwjktMSc4sru8/e
dit
Assignment –Case Study
• Assume, a video library maintains a database of
movies rented out. Without any normalization, all
information is stored in one table as shown below.
Assignment Results
1NF
Assignment Results
2NF
Assignment Results
3NF

More Related Content

What's hot (20)

Database Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal GulatiDatabase Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal Gulati
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
User defined Function in SQL
User defined Function in SQLUser defined Function in SQL
User defined Function in SQL
 
Index in sql server
Index in sql serverIndex in sql server
Index in sql server
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
basic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptxbasic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptx
 
set operators.pptx
set operators.pptxset operators.pptx
set operators.pptx
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
SQL subquery
SQL subquerySQL subquery
SQL subquery
 
advanced sql(database)
advanced sql(database)advanced sql(database)
advanced sql(database)
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 

Similar to Data Modeling

Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptxZoha681526
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.pptDeependra35
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFBiplap Bhattarai
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDr. GOPINATH D
 
normalization of database management ppt
normalization of database management pptnormalization of database management ppt
normalization of database management pptRabiaKabir
 
Chapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptxChapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptxhaymanot taddesse
 
Feb 2nd Makeup Class
Feb 2nd Makeup ClassFeb 2nd Makeup Class
Feb 2nd Makeup ClassGeorge Saban
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdfBijayNag1
 
1683368767418684.pdf
1683368767418684.pdf1683368767418684.pdf
1683368767418684.pdfJanoakre
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelKunal Anand
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 

Similar to Data Modeling (20)

Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
 
Assignment#11
Assignment#11Assignment#11
Assignment#11
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 
normalization of database management ppt
normalization of database management pptnormalization of database management ppt
normalization of database management ppt
 
Chapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptxChapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptx
 
Normalisation
NormalisationNormalisation
Normalisation
 
Feb 2nd Makeup Class
Feb 2nd Makeup ClassFeb 2nd Makeup Class
Feb 2nd Makeup Class
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdf
 
UNIT II DBMS.pptx
UNIT II DBMS.pptxUNIT II DBMS.pptx
UNIT II DBMS.pptx
 
Research gadot
Research gadotResearch gadot
Research gadot
 
Year 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st TermYear 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st Term
 
1683368767418684.pdf
1683368767418684.pdf1683368767418684.pdf
1683368767418684.pdf
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 

More from DrkhanchanaR

Unit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptxUnit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptxDrkhanchanaR
 
Unit 5 internal sorting &amp; files
Unit 5  internal sorting &amp; filesUnit 5  internal sorting &amp; files
Unit 5 internal sorting &amp; filesDrkhanchanaR
 
Unit 4 external sorting
Unit 4   external sortingUnit 4   external sorting
Unit 4 external sortingDrkhanchanaR
 
Unit 3 graph chapter6
Unit 3  graph chapter6Unit 3  graph chapter6
Unit 3 graph chapter6DrkhanchanaR
 
Unit 3 Tree chapter 5
Unit 3  Tree chapter 5Unit 3  Tree chapter 5
Unit 3 Tree chapter 5DrkhanchanaR
 
Unit 2 linked list
Unit 2   linked listUnit 2   linked list
Unit 2 linked listDrkhanchanaR
 
Unit I-Data structures stack & Queue
Unit I-Data structures stack & QueueUnit I-Data structures stack & Queue
Unit I-Data structures stack & QueueDrkhanchanaR
 
Unit I - Evaluation of expression
Unit I - Evaluation of expressionUnit I - Evaluation of expression
Unit I - Evaluation of expressionDrkhanchanaR
 
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...DrkhanchanaR
 

More from DrkhanchanaR (9)

Unit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptxUnit I-Data Structures_Intoduction.pptx
Unit I-Data Structures_Intoduction.pptx
 
Unit 5 internal sorting &amp; files
Unit 5  internal sorting &amp; filesUnit 5  internal sorting &amp; files
Unit 5 internal sorting &amp; files
 
Unit 4 external sorting
Unit 4   external sortingUnit 4   external sorting
Unit 4 external sorting
 
Unit 3 graph chapter6
Unit 3  graph chapter6Unit 3  graph chapter6
Unit 3 graph chapter6
 
Unit 3 Tree chapter 5
Unit 3  Tree chapter 5Unit 3  Tree chapter 5
Unit 3 Tree chapter 5
 
Unit 2 linked list
Unit 2   linked listUnit 2   linked list
Unit 2 linked list
 
Unit I-Data structures stack & Queue
Unit I-Data structures stack & QueueUnit I-Data structures stack & Queue
Unit I-Data structures stack & Queue
 
Unit I - Evaluation of expression
Unit I - Evaluation of expressionUnit I - Evaluation of expression
Unit I - Evaluation of expression
 
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Recently uploaded (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

Data Modeling

  • 1. DATABASE DESIGN: DATA MODELING AND NORMALIZATION Dr. R. Khanchana Assistant Professor Department of Computer Science Sri Ramakrishna College of Arts and Science for Women
  • 2. Data Modeling Data Modeling: • Data modeling - A tool used to represent various components and their relationships. • Popular modeling tool is Entity Relational Model(E-R Model) • E-R Model provides  An excellent communication tools  A simple graphical representation of data. • E-R Model uses E-R Diagram(ERD) for graphical representation of the database components. • An entity is represented by a rectangle it uses upper case letters and it should be singular noun Eg. EMPLOYEE,DEPARTMENT etc • Entity Representation in an E-R Diagram EMPLOYEE
  • 3. Representation of Relationship • The line represents the relationship between the two entities it uses lowercase letters and it should be active verb • Passive verb can be used but active verb is preferable. • Representation of relationship in an E-R diagram 1:1 • The types of relationships (1:1,1:M,M:N) between entities are called connectivity or multiplicity. M: N 1: Mmanages employs contains
  • 4. Entity, Relationship, Connectivity • The types of relationships (1:1,1:M,M:N) between entities are called Connectivity or Multiplicity • The connectivity is shown with vertical or angled lines next to each entity
  • 5. Cardinality • The Relationship between two entities can be given suing the lowercase and uppercase limits • Example - (n,m) • n – lower limit • m – upper limit DEPARTMENTEMPLOYEE FACULTYDIVISION ITEMINVOICE Supervises Employees Contains (1, 1) (1, 1) (1, N) (1, 1) (1, N) (1, N)
  • 6. Data Model Basic Building Blocks
  • 7. Cardinality Types • It has 2 types – Mandatory Relationship – Optional Relationship • Oracle set rules for the minimum and maximum values for cardinality. These types of decision are known as business rules.
  • 10. Optional Relationship • Optional relationships are shown with a small circle next to the optional entity. • The optional relational relationship can occur in 1:1,1:M or M:N relationships and it can occur on one or both sides of the relationship. • In relational databases many-to-many (M:N) relationships are allowed but they are not easy to implement.
  • 11. Composite Entity & Relational Schema • The decomposition from M:N to1:M involves a third entity and it is known as Composition entity or Associative entity
  • 12. Weak Entity • There are entities that cannot exist by themselves.
  • 13. Other Elements • Some of the other elements considered in the database design are  Simple Attributes: Attributes that cannot be subdivided Eg. city, gender  Composite Attributes: Attributes that can be subdivided Eg. Full name(Last name, First name, Middle Initial)  Single valued Attributes: Attributes with a single value Eg. Employee Id, Student Id  Multivalued Attributes: Attributes with multiple values Eg. Course details
  • 15. Dependency • A dependency is a constraint that applies to or defines the relationship between attributes. • Primary key which uniquely identifies an entity • The column that do not make up the primary key for the table such columns are called the nonkey column • The non key columns are functionally dependent on the primary key columns • There are three types of dependency in tables – Total or full dependency: A nonkey column dependent on all primary key column – Partial dependency : A nonkey column is dependent on part of the primary key – Transitive dependency :A nonkey column is dependent on another nonkey column.
  • 18. Normal forms • Redundancy - Data Repetition • Anomaly (Data Inconsistency) • – if a change in piece of data, the change has to made in many places
  • 20. Deletion Anomaly • Which results when the deletion of information about one entity leads to the deletion of another entity. • If someone decides to delete Botany department , he may end up deleting all student’s data who had the department of Botany.
  • 21. Insertion Anomaly When the information about an entity cannot be inserted unless the information about another entity is known and it is said to be Insertion Anomaly Jerry is a new Student with department id 6. There is no Department with this Dept_ID 6. Hence , the anomaly. The usual behaviour should be a new department id with 6 and only then Student could have it.
  • 22. Update Anomaly • An update anomaly occurs when data is only partially updated in a database. • English department has now Dept_ID 8 , but unfortunately it was not updated in Student table.
  • 25. Normalization • Normalization is the process of organizing the data in the database. • Normalization is used to minimize the redundancy from a relation or set of relations. • Normalization divides the larger table into the smaller table and links them using relationship. • The normal form is used to reduce redundancy from the database table.
  • 26. Review • Data Modeling – Entity – Attribute – Connectivity – Cardinality -Notation • Dependency • Database design
  • 27. Types of Normal Forms • Higher Normal Form - Lower the redundancy i) First Normal Form(1NF) ii) Second Normal Form(2NF) iii) Third Normal Form(3NF)
  • 28. First Normal Form (1NF) The table said to be first normal form (or) labeled 1NF if the following conditions exists: • The primary key is defined • Also includes composite key if a single column cannot be used as a primary key. • First normal form disallows the multi-valued attribute/ composite attribute, and their combinations. Example: Relation EMPLOYEE is not in 1NF because of multi-valued attribute EMP_PHONE
  • 29. Second Normal Form (2NF) • All 1NF requirements are fulfilled •No partial dependency •Suppose the table is in 1NF and does not have composite key and it is said to be 2NF. Example: A school can store the data of teachers and the subjects they teach. In a school, a teacher can teach more than one subject.
  • 31. Third Normal Form (3NF) • Table is said to be third normal form (or) 3NF if the following requirements are satisfied. – All 2NF requirements are fulfilled. – No transitive dependency- non key column is dependent on another non key column.
  • 32. Third Normal Form (3NF) • Super key in the table above: – {EMP_ID}, {EMP_ID, EMP_NAME}, {EMP_ID, EMP_NAME, EMP_ZIP}....so on • Candidate key: {EMP_ID} • Non-prime attributes: all attributes except EMP_ID are non-prime. – EMP_STATE & EMP_CITY dependent on EMP_ZIP and EMP_ZIP dependent on EMP_ID. – The non-prime attributes (EMP_STATE, EMP_CITY) transitively dependent on super key(EMP_ID). It violates the rule of third normal form. – Hence need to move the EMP_CITY and EMP_STATE to the new <EMPLOYEE_ZIP> table, with EMP_ZIP as a Primary key.
  • 34. Other Normal forms • BCNF - BoyceCodd Normal Form(BCNF) • 4NF –Fourth Normal Form • 5NF - Fifth Normal Form • DKNF –Domain Key Normal Form
  • 35. Dependency Diagram • Total dependencies arrows are drawn above the boxes. • Partial & transitive dependencies arrows are drawn below the boxes. • i)Conversion from 1NF to 2NF • ii)Conversion from 2NF to 3NF
  • 36. Conversion from 1NF to 2NF • The composite primary key is in the table remove partial dependency. • 1st each primary key component on a separate line , they will become primary key in two new tables. • Composite key on the third line it will be the composite key on the third table. 1NF to 2NF Decomposition
  • 38. Conversion from 2NF to 3NF • Invoice table still has transitive dependency but no partial dependency. • More columns of transitive dependency to a new table. • Keep the primary key of new table as a foreign key at existing table. 2NF to 3NF Decomposition
  • 40. Denormaization • Normalization process - splits tables into smaller tables • Smaller tables are joined together by common columns to retrieve information from different tables. • Denomalization process – reverse process • It reduces normal form and increases data redundancy • Duplicate data are stored more storage space is required
  • 43. Assignment –Case Study • Assume, a video library maintains a database of movies rented out. Without any normalization, all information is stored in one table as shown below.