SlideShare a Scribd company logo
1 of 12
DATABASE DESIGN
USING MYSQL
Principles & Normalization
RELATIONAL MODEL RULES
• Each column value must be a single value only.
• All values for a given column must be of the same
data type.
• Each column name must be unique.
• The order of columns is insignificant
• No two rows in a relation can be identical.
• The order of the rows is insignificant.
FUNCTIONAL DEPENDENCIES
A Functional Dependency describes a relationship
between columns within a single relation.
• A column is dependent on another if one value can
be used to determine the value of another.
• Example: first_name is functionally dependent on id
because id can be used to uniquely determine the
value of first_name
COMMON DESIGN MISTAKES
• Tables with too many fields or with fields that do not
relate to each other
• Too many tables with similar data
• Repeated rows
• Using comma separated values or multiple values in
a single row
• Poor naming conventions
• Poor or no planning
• Non-Normalized data
DATABASE NORMALIZATION
Normalization is the process of organizing the fields
and tables of a relational database to
minimize redundancy and dependency
This can involve dividing larger tables into smaller
tables and defining relationships between them.
The objective is to isolate data so that actions in a
field can be made in one table and then
propagated through the rest of the needed tables
using properly defined relationships.
FIRST NORMAL FORM (1NF)
• No repeating or duplicate fields
• Each row should contain only one value
• Each row/record should be unique and
identified by a primary key
1NF EXAMPLE
id name membership
01 John Doe silver
01 John Doe gold
02 Steve Smith gold
id name
01 John Doe
02 Steve Smith
id customer_id membership
01 01 silver
02 01 gold
03 02 gold
Customers
Table
(WRONG)
Customers
Table
(RIGHT)
Memberships
Table
(RIGHT)
SECOND NORMAL FORM (2NF)
• Should be in 1NF
• All non-key fields depend on all components of
the primary key
• No partial dependencies
2NF EXAMPLE
id name membership_id membership
01 John Doe 02 silver
02 Steve Smith 01 gold
id name
01 John Doe
02 Steve Smith
id customer_id membership
01 01 silver
02 01 gold
03 02 gold
Customers
Table
(WRONG)
Customers
Table
(RIGHT)
Memberships
Table
(RIGHT)
THIRD NORMAL FORM (3NF)
• Should be in 2NF
• Every non-prime attribute of table must depend
on primary key
3NF EXAMPLE
id name street city zip
01 John 2 Main Amesbury 01913
02 Steve 4 School Merrimac 01860
id name zip
01 John Doe 01913
02 Steve Smith 01860
zip street city
01913 2 Main Amesbury
01860 4 School Merrimac
Customers
Table
(WRONG)
Customers
Table
(RIGHT)
Address
Table
(RIGHT)
THAT’S IT!

More Related Content

What's hot (20)

Normalization
NormalizationNormalization
Normalization
 
conditional formatting
conditional formattingconditional formatting
conditional formatting
 
Normalisation
NormalisationNormalisation
Normalisation
 
Spreadsheet ml subject tables
Spreadsheet ml subject   tablesSpreadsheet ml subject   tables
Spreadsheet ml subject tables
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
Using SPSS for data analysis in linguistics
Using SPSS for data analysis in linguistics Using SPSS for data analysis in linguistics
Using SPSS for data analysis in linguistics
 
Normalization
NormalizationNormalization
Normalization
 
Spss beginners
Spss beginnersSpss beginners
Spss beginners
 
Normalization
NormalizationNormalization
Normalization
 
ER diagram
ER diagramER diagram
ER diagram
 
An introduction to spss
An introduction to spssAn introduction to spss
An introduction to spss
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
 
SQL Join's
SQL Join'sSQL Join's
SQL Join's
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Spss
SpssSpss
Spss
 
Lesson03 the relational model
Lesson03 the relational modelLesson03 the relational model
Lesson03 the relational model
 
Introduction to spss
Introduction to spssIntroduction to spss
Introduction to spss
 
Joins SQL Server
Joins SQL ServerJoins SQL Server
Joins SQL Server
 
spss teaching
spss teachingspss teaching
spss teaching
 
Normalization
NormalizationNormalization
Normalization
 

Viewers also liked

Discover the History of Grand Bahama | TravGlobe Scam Protection
Discover the History of Grand Bahama | TravGlobe Scam ProtectionDiscover the History of Grand Bahama | TravGlobe Scam Protection
Discover the History of Grand Bahama | TravGlobe Scam ProtectionTravGlobe
 
Serendipity for SharePoint: The Power of Automated Metadata Tagging
Serendipity for SharePoint: The Power of Automated Metadata TaggingSerendipity for SharePoint: The Power of Automated Metadata Tagging
Serendipity for SharePoint: The Power of Automated Metadata TaggingFirestring
 
Jason Tomas by Ryan
Jason Tomas by RyanJason Tomas by Ryan
Jason Tomas by RyanJolinspeeps
 
India's Dream Solar Project
India's Dream Solar ProjectIndia's Dream Solar Project
India's Dream Solar ProjectAnkit Goyal
 
Joshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TN
Joshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TNJoshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TN
Joshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TNjnash2012
 
(141205) Masters_Thesis_Defense_Sundong_Kim
(141205) Masters_Thesis_Defense_Sundong_Kim(141205) Masters_Thesis_Defense_Sundong_Kim
(141205) Masters_Thesis_Defense_Sundong_KimSundong Kim
 
Learn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesLearn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesEduonix Learning Solutions
 
Mercedes Benz Corporate Run
Mercedes Benz Corporate RunMercedes Benz Corporate Run
Mercedes Benz Corporate RunEngineeredTax
 
Joshmart sales paper
Joshmart sales paperJoshmart sales paper
Joshmart sales paperjnash2012
 
Aarad Homer's Visual Resume
Aarad Homer's Visual ResumeAarad Homer's Visual Resume
Aarad Homer's Visual ResumeAarad Homer
 
Multilevel Marketing Success Suggestion : Averting Burnout And Dissatisfaction
Multilevel Marketing Success Suggestion : Averting Burnout And DissatisfactionMultilevel Marketing Success Suggestion : Averting Burnout And Dissatisfaction
Multilevel Marketing Success Suggestion : Averting Burnout And Dissatisfactionznsaja
 

Viewers also liked (20)

Lexicalanalyzer
LexicalanalyzerLexicalanalyzer
Lexicalanalyzer
 
อปท (1)
อปท (1)อปท (1)
อปท (1)
 
Optimization
OptimizationOptimization
Optimization
 
t4 e6 cardona
t4 e6 cardonat4 e6 cardona
t4 e6 cardona
 
Discover the History of Grand Bahama | TravGlobe Scam Protection
Discover the History of Grand Bahama | TravGlobe Scam ProtectionDiscover the History of Grand Bahama | TravGlobe Scam Protection
Discover the History of Grand Bahama | TravGlobe Scam Protection
 
Serendipity for SharePoint: The Power of Automated Metadata Tagging
Serendipity for SharePoint: The Power of Automated Metadata TaggingSerendipity for SharePoint: The Power of Automated Metadata Tagging
Serendipity for SharePoint: The Power of Automated Metadata Tagging
 
Jason Tomas by Ryan
Jason Tomas by RyanJason Tomas by Ryan
Jason Tomas by Ryan
 
Learn hadoop and big data technologies
Learn hadoop and big data technologiesLearn hadoop and big data technologies
Learn hadoop and big data technologies
 
India's Dream Solar Project
India's Dream Solar ProjectIndia's Dream Solar Project
India's Dream Solar Project
 
Int to tourism and hospitality(1)
Int to tourism and hospitality(1)Int to tourism and hospitality(1)
Int to tourism and hospitality(1)
 
Joshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TN
Joshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TNJoshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TN
Joshua Nash 2015 Calendar Project-Burgess Falls State Park- Sparta,TN
 
(141205) Masters_Thesis_Defense_Sundong_Kim
(141205) Masters_Thesis_Defense_Sundong_Kim(141205) Masters_Thesis_Defense_Sundong_Kim
(141205) Masters_Thesis_Defense_Sundong_Kim
 
Learn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesLearn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data types
 
The pencil 184
The pencil 184The pencil 184
The pencil 184
 
Mercedes Benz Corporate Run
Mercedes Benz Corporate RunMercedes Benz Corporate Run
Mercedes Benz Corporate Run
 
internet securityand cyber law Unit2
internet securityand  cyber law Unit2internet securityand  cyber law Unit2
internet securityand cyber law Unit2
 
Joshmart sales paper
Joshmart sales paperJoshmart sales paper
Joshmart sales paper
 
Aarad Homer's Visual Resume
Aarad Homer's Visual ResumeAarad Homer's Visual Resume
Aarad Homer's Visual Resume
 
Multilevel Marketing Success Suggestion : Averting Burnout And Dissatisfaction
Multilevel Marketing Success Suggestion : Averting Burnout And DissatisfactionMultilevel Marketing Success Suggestion : Averting Burnout And Dissatisfaction
Multilevel Marketing Success Suggestion : Averting Burnout And Dissatisfaction
 
Londres cris jas
Londres cris jasLondres cris jas
Londres cris jas
 

Similar to Learn Database Design with MySQL - Chapter 5 - Design principles & normalization

Database design
Database designDatabase design
Database designRiteshkiit
 
5. relational structure
5. relational structure5. relational structure
5. relational structurekhoahuy82
 
Tech Jam 01 - Database Querying
Tech Jam 01 - Database QueryingTech Jam 01 - Database Querying
Tech Jam 01 - Database QueryingRodger Oates
 
Data Base Management System.pdf
Data Base Management System.pdfData Base Management System.pdf
Data Base Management System.pdfTENZING LHADON
 
Distributed database
Distributed databaseDistributed database
Distributed databaseNasIr Irshad
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management SystemMian Abdul Raheem
 
Feb 2nd Makeup Class
Feb 2nd Makeup ClassFeb 2nd Makeup Class
Feb 2nd Makeup ClassGeorge Saban
 
Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdfCynthiaAdzornu
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexingMahabubur Rahaman
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMSPadamNepal1
 
Aggregate functions in SQL.pptx
Aggregate functions in SQL.pptxAggregate functions in SQL.pptx
Aggregate functions in SQL.pptxSherinRappai
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptxZoha681526
 
Aggregate functions in SQL.pptx
Aggregate functions in SQL.pptxAggregate functions in SQL.pptx
Aggregate functions in SQL.pptxSherinRappai1
 

Similar to Learn Database Design with MySQL - Chapter 5 - Design principles & normalization (20)

Sql
SqlSql
Sql
 
Database design
Database designDatabase design
Database design
 
Ms sql server tips 1 0
Ms sql server tips 1 0Ms sql server tips 1 0
Ms sql server tips 1 0
 
5. relational structure
5. relational structure5. relational structure
5. relational structure
 
Tech Jam 01 - Database Querying
Tech Jam 01 - Database QueryingTech Jam 01 - Database Querying
Tech Jam 01 - Database Querying
 
Data Base Management System.pdf
Data Base Management System.pdfData Base Management System.pdf
Data Base Management System.pdf
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Feb 2nd Makeup Class
Feb 2nd Makeup ClassFeb 2nd Makeup Class
Feb 2nd Makeup Class
 
Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdf
 
Join query
Join queryJoin query
Join query
 
Relational Data Model.pptx
Relational Data Model.pptxRelational Data Model.pptx
Relational Data Model.pptx
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
 
ADBMS Unit-II b
ADBMS Unit-II bADBMS Unit-II b
ADBMS Unit-II b
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Aggregate functions in SQL.pptx
Aggregate functions in SQL.pptxAggregate functions in SQL.pptx
Aggregate functions in SQL.pptx
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptx
 
Aggregate functions in SQL.pptx
Aggregate functions in SQL.pptxAggregate functions in SQL.pptx
Aggregate functions in SQL.pptx
 

More from Eduonix Learning Solutions

Learn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design processLearn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design processEduonix Learning Solutions
 
Learn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overviewLearn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overviewEduonix Learning Solutions
 
Learn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage enginesLearn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage enginesEduonix Learning Solutions
 
Learn Database Design with MySQL - Chapter 1 - What is a database
Learn Database Design with MySQL - Chapter 1 -   What is a databaseLearn Database Design with MySQL - Chapter 1 -   What is a database
Learn Database Design with MySQL - Chapter 1 - What is a databaseEduonix Learning Solutions
 

More from Eduonix Learning Solutions (9)

Learn angularjs step by step
Learn angularjs step by stepLearn angularjs step by step
Learn angularjs step by step
 
Learn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design processLearn Database Design with MySQL - Chapter 6 - Database design process
Learn Database Design with MySQL - Chapter 6 - Database design process
 
Learn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overviewLearn Database Design with MySQL - Chapter 2 - My sql overview
Learn Database Design with MySQL - Chapter 2 - My sql overview
 
Learn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage enginesLearn Database Design with MySQL - Chapter 3 - My sql storage engines
Learn Database Design with MySQL - Chapter 3 - My sql storage engines
 
Learn Database Design with MySQL - Chapter 1 - What is a database
Learn Database Design with MySQL - Chapter 1 -   What is a databaseLearn Database Design with MySQL - Chapter 1 -   What is a database
Learn Database Design with MySQL - Chapter 1 - What is a database
 
Ultimate android app development course
Ultimate android app development course Ultimate android app development course
Ultimate android app development course
 
Learn software development
Learn software developmentLearn software development
Learn software development
 
Learn node.js by building projects
Learn node.js by building projectsLearn node.js by building projects
Learn node.js by building projects
 
Java programming course for beginners
Java programming course for beginnersJava programming course for beginners
Java programming course for beginners
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

Learn Database Design with MySQL - Chapter 5 - Design principles & normalization

  • 2. RELATIONAL MODEL RULES • Each column value must be a single value only. • All values for a given column must be of the same data type. • Each column name must be unique. • The order of columns is insignificant • No two rows in a relation can be identical. • The order of the rows is insignificant.
  • 3. FUNCTIONAL DEPENDENCIES A Functional Dependency describes a relationship between columns within a single relation. • A column is dependent on another if one value can be used to determine the value of another. • Example: first_name is functionally dependent on id because id can be used to uniquely determine the value of first_name
  • 4. COMMON DESIGN MISTAKES • Tables with too many fields or with fields that do not relate to each other • Too many tables with similar data • Repeated rows • Using comma separated values or multiple values in a single row • Poor naming conventions • Poor or no planning • Non-Normalized data
  • 5. DATABASE NORMALIZATION Normalization is the process of organizing the fields and tables of a relational database to minimize redundancy and dependency This can involve dividing larger tables into smaller tables and defining relationships between them. The objective is to isolate data so that actions in a field can be made in one table and then propagated through the rest of the needed tables using properly defined relationships.
  • 6. FIRST NORMAL FORM (1NF) • No repeating or duplicate fields • Each row should contain only one value • Each row/record should be unique and identified by a primary key
  • 7. 1NF EXAMPLE id name membership 01 John Doe silver 01 John Doe gold 02 Steve Smith gold id name 01 John Doe 02 Steve Smith id customer_id membership 01 01 silver 02 01 gold 03 02 gold Customers Table (WRONG) Customers Table (RIGHT) Memberships Table (RIGHT)
  • 8. SECOND NORMAL FORM (2NF) • Should be in 1NF • All non-key fields depend on all components of the primary key • No partial dependencies
  • 9. 2NF EXAMPLE id name membership_id membership 01 John Doe 02 silver 02 Steve Smith 01 gold id name 01 John Doe 02 Steve Smith id customer_id membership 01 01 silver 02 01 gold 03 02 gold Customers Table (WRONG) Customers Table (RIGHT) Memberships Table (RIGHT)
  • 10. THIRD NORMAL FORM (3NF) • Should be in 2NF • Every non-prime attribute of table must depend on primary key
  • 11. 3NF EXAMPLE id name street city zip 01 John 2 Main Amesbury 01913 02 Steve 4 School Merrimac 01860 id name zip 01 John Doe 01913 02 Steve Smith 01860 zip street city 01913 2 Main Amesbury 01860 4 School Merrimac Customers Table (WRONG) Customers Table (RIGHT) Address Table (RIGHT)