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
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 
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

Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 

Recently uploaded (20)

Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 

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)