SlideShare a Scribd company logo
How to normalize your tables
Keyvan Bashash
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Course enrollment table
CrsID StID Semester FacultyID StName CrsName FacultyN Date
420 111,112 fall 122 Ali,Mark Linux,Java ConEd 10-12-2018
722 111 fall 222 Ali Swimming Physical 11-10-2018
Step 1: get into first normalization format
- In each filed there should be only one value of that type
- if you see multiple values in one field, duplicate the record to cover each value. {in red}
- sure you will have some records that looks same with just one field different
- in fact you shouldn’t have any field in any record empty whilst you don’t have data
CrsID StID Semester FacultyID StName CrsName FacultyN Date
420 111 fall 122 Ali Linux ConEd 10-12-2018
420 112 fall 122 Mark Java ConEd 10-12-2018
722 111 fall 222 Ali Swimming Physical 11-10-2018
Step 2: get into second normalization format
- Find the determinant with full dependency. It means that all other fields should be depended on
this set of fields. {CrsID, StID}
- Now find all partial dependencies, it means all fields that are depended on part of our full
determinant.{CrsID-->Semester, FacultyID, CrsName, FacultyN}
- For each part of our main determinant that has partial dependencies, create a new table, copy the
determinant and move all other dependent fields to new table.
- In your new tables, the part of main table’s determinant would be a PRIMARY-KEY
CrsID StID Semester FacultyID StName CrsName FacultyN Date
420 111 fall 122 Ali Linux ConEd 10-12-2018
420 112 fall 122 Mark Java ConEd 12-11-2018
722 111 fall 222 Ali Swimming Physical 11-10-2018
CrsID Semester FacultyID CrsName FacultyN
420 fall 122 Linux ConEd
420 fall 122 Java ConEd
722 fall 222 Swimming Physical
StID StName
111 Ali
112 Mark
111 Ali
CrsID StID Date
420 111 10-12-2018
420 112 12-11-2018
722 111 11-10-2018
Step 3: get into third normalization format
-Now check in your tables if you have any transitive dependencies, it means any field depends on any
other field than the determinant.{FacultyN-->FacultyID}
-If you have such thing, then separate all fields as a new table.
-Find the primary key in new table, should be the determinant in main table.
-Keep this primary key as foreign key in main table.
CrsID Semester FacultyID CrsName
420 fall 122 Linux
420 fall 122 Java
722 fall 222 Swimming
StID StName
111 Ali
112 Mark
111 Ali
CrsID StID Date
420 111 10-12-2018
420 112 12-11-2018
722 111 11-10-2018
FacultyID FacultyN
122 ConEd
122 ConEd
222 Physical
Step 4: Create relationships
Now all repeated fields in two tables should be used to make a relationship between these tables.
Check if:
-All relations are one-to-one or one-to-many, No many-to-many relationship
-All tables must have at least one relationship
if not you made a mistake, restart and do re-work...
CrsID Semester FacultyID CrsName
420 fall 122 Linux
420 fall 122 Java
722 fall 222 Swimming
StID StName
111 Ali
112 Mark
111 Ali
CrsID StID Date
420 111 10-12-2018
420 112 12-11-2018
722 111 11-10-2018
FacultyID FacultyN
122 ConEd
122 ConEd
222 Physical

More Related Content

PDF
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...
PPTX
Platform business
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
PDF
2024 State of Marketing Report – by Hubspot
PDF
Everything You Need To Know About ChatGPT
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...
Platform business
2024 Trend Updates: What Really Works In SEO & Content Marketing
Storytelling For The Web: Integrate Storytelling in your Design Process
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Spectroscopy.pptx food analysis technology
PPT
Teaching material agriculture food technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Spectroscopy.pptx food analysis technology
Teaching material agriculture food technology
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Empathic Computing: Creating Shared Understanding
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Ad
Ad

How to normalize your tables

  • 1. How to normalize your tables Keyvan Bashash This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
  • 2. Course enrollment table CrsID StID Semester FacultyID StName CrsName FacultyN Date 420 111,112 fall 122 Ali,Mark Linux,Java ConEd 10-12-2018 722 111 fall 222 Ali Swimming Physical 11-10-2018
  • 3. Step 1: get into first normalization format - In each filed there should be only one value of that type - if you see multiple values in one field, duplicate the record to cover each value. {in red} - sure you will have some records that looks same with just one field different - in fact you shouldn’t have any field in any record empty whilst you don’t have data CrsID StID Semester FacultyID StName CrsName FacultyN Date 420 111 fall 122 Ali Linux ConEd 10-12-2018 420 112 fall 122 Mark Java ConEd 10-12-2018 722 111 fall 222 Ali Swimming Physical 11-10-2018
  • 4. Step 2: get into second normalization format - Find the determinant with full dependency. It means that all other fields should be depended on this set of fields. {CrsID, StID} - Now find all partial dependencies, it means all fields that are depended on part of our full determinant.{CrsID-->Semester, FacultyID, CrsName, FacultyN} - For each part of our main determinant that has partial dependencies, create a new table, copy the determinant and move all other dependent fields to new table. - In your new tables, the part of main table’s determinant would be a PRIMARY-KEY CrsID StID Semester FacultyID StName CrsName FacultyN Date 420 111 fall 122 Ali Linux ConEd 10-12-2018 420 112 fall 122 Mark Java ConEd 12-11-2018 722 111 fall 222 Ali Swimming Physical 11-10-2018
  • 5. CrsID Semester FacultyID CrsName FacultyN 420 fall 122 Linux ConEd 420 fall 122 Java ConEd 722 fall 222 Swimming Physical StID StName 111 Ali 112 Mark 111 Ali CrsID StID Date 420 111 10-12-2018 420 112 12-11-2018 722 111 11-10-2018
  • 6. Step 3: get into third normalization format -Now check in your tables if you have any transitive dependencies, it means any field depends on any other field than the determinant.{FacultyN-->FacultyID} -If you have such thing, then separate all fields as a new table. -Find the primary key in new table, should be the determinant in main table. -Keep this primary key as foreign key in main table.
  • 7. CrsID Semester FacultyID CrsName 420 fall 122 Linux 420 fall 122 Java 722 fall 222 Swimming StID StName 111 Ali 112 Mark 111 Ali CrsID StID Date 420 111 10-12-2018 420 112 12-11-2018 722 111 11-10-2018 FacultyID FacultyN 122 ConEd 122 ConEd 222 Physical
  • 8. Step 4: Create relationships Now all repeated fields in two tables should be used to make a relationship between these tables. Check if: -All relations are one-to-one or one-to-many, No many-to-many relationship -All tables must have at least one relationship if not you made a mistake, restart and do re-work...
  • 9. CrsID Semester FacultyID CrsName 420 fall 122 Linux 420 fall 122 Java 722 fall 222 Swimming StID StName 111 Ali 112 Mark 111 Ali CrsID StID Date 420 111 10-12-2018 420 112 12-11-2018 722 111 11-10-2018 FacultyID FacultyN 122 ConEd 122 ConEd 222 Physical