SlideShare une entreprise Scribd logo
1  sur  22
Introduction to MySQL
Database Normalization
Day 2
Relevance of normalization
• We could have store all the data in a single
table like
• But there are several issues arise here
Emp_id Emp_name Emp_age Emp_email Fk_int_designation Vchr_Desig_roles
1000 Deepak 45 dk@gmail.co
m
Are Manager Handles all the district level
operations
1001 Aneesh 23 an@gmail.com Sales person Will increase sales and ensure
customer satisfaction
1002 Naveen 25 nn@gmail.com Sales person Will increase sales and ensure
customer satisfaction
1003 Jacob 25 dpk@gmail.com Administrator Handles all the district level
operations
Relevance of normalization
• We could have store all the data in a single table like
Emp_id Emp_name Emp_age Emp_email Fk_int_designation Vchr_Desig_roles
1000 Deepak 45 dk@gmail.com Are Manager Handles all the district level
operations
1001 Aneesh 23 an@gmail.com Sales person Will increase sales and ensure
customer satisfaction
1002 Naveen 25 nn@gmail.com Sales person Will increase sales and ensure
customer satisfaction
1003 Jacob 25 dpk@gmail.com Administrator Handles all the district level
operations
Here designation is repeated for all the rows and where ever it repeats the
designation role also has to repeat. This redundancy takes a lot of space to store and
is inefficient
Relevance of normalization
• We could have store all the data in a single table like
Emp_id Emp_name Emp_age Emp_email Fk_int_designation Vchr_Desig_roles
1000 Deepak 45 dk@gmail.com Are Manager Handles all the district level
operations
1001 Aneesh 23 an@gmail.com Sales person Will increase sales and ensure
customer satisfaction
1002 Naveen 25 nn@gmail.com Sales person Will increase sales and ensure
customer satisfaction
1003 Jacob 25 dpk@gmail.com Administrator Handles all the district level
operations
Suppose if i want to modify the roles of any designation, i will have to do the same for
all records in the table. Its time consuming and not an effective way to follow
Normalization
• Normalization is the process of moving data into related
tables
• Will save data dependency and redundancy
• Save typing of repetitive data
• Reduce disk space
Types of Normalization
• There are several levels of normalization
– 1st Normalization
– 2nd Normalization
– 3rd Normalization
First Normal Form
First Normal Form
– Each field contains the smallest meaningful value
– The table does not contain repeating groups of fields or
repeating data within the same field
To attain 1st normalized form what you have to do is
•Create a separate field/table for each set of related data.
•Identify each set of related data with a primary key
Table violating 1st Normal Form
Company (pk) Branches
Baabte Cochin, Calicut
baabtra Calicut,Trivandrum
It really is a bad setup that we are storing multiple values in a single column. For a
table to be in 1st normalised form it should only have atomic values
Table violating 1st Normal Form
Company (Pk) Branche1 Branch2
Baabte Cochin Calicut
baabtra Calicut Trivandrum
It still in a bad set up , as we should not have multiple columns describing the same
property of an entity.
Table conforming to 1st Normal
Form
Company (pk) Branch (pk)
Baabte Cochin
Baabte Calicut
baabtra Calicut
baabtra Trivandrum
We have resulted in a 1st normalised table with primary key consists of two columns
Second Normalisation
Second Normalisation
– usually used in tables with a multiple-field primary key
(composite key)
– each non-key field relates to the entire primary key
– any field that does not relate to the primary key is placed
in a separate table
• To attain 1st normalized form what you have to do is
•eliminate redundant data in a table
•Create separate tables for sets of values that apply to
multiple records
Table violating 2nd Normal Form
Employee (pk) Skill (pk) WorkLocation
John IOS programmer Calicut
Mathew Java programmer Cochin
Thomas Android programmer Trivandrum
Alex PHP programmer Banglore
Ram Java programmer Mumbai
John PHP programmer Delhi
Soozan doNet programmer Calicut
Primary key= { Employee,Skill }
Table violating 2nd Normal Form
Employee (pk) Skill (pk) WorkLocation
John IOS programmer Calicut
Mathew Java programmer Cochin
Thomas Android programmer Trivandrum
Alex PHP programmer Banglore
Ram Java programmer Mumbai
John PHP programmer Delhi
Soozan doNet programmer Calicut
Here non key attribute do not fully depends on compete primary key. Ie
WorkLocation depends only on Employee and doesn’t depend on Skill (partial
dependency)
Primary key= { Employee,Skill }
Table conforming to 2nd Normal
Form
Employee (pk) Skill (pk)
John IOS programmer
Mathew Java programmer
Thomas Android programmer
Alex PHP programmer
Ram Java programmer
John PHP programmer
Soozan doNet programmer
Employee (pk) WorkLocation
John Calicut
Mathew Cochin
Thomas Trivandrum
Alex Banglore
Ram Mumbai
John Delhi
Soozan Calicut
Third Normalisation
Third Normal Form
• Usually used in tables with a single field primary key
--records do not depend on anything other than a table's
primary key
– each non-key field is a fact about the key
– Values in a record that are not part of that record's key do
not belong in the table. In general, any time the contents
of a group of fields may apply to more than a single record
in the table, consider placing those fields in a separate
table.
EMPNO
(Primary Key)
FIRSTNAME LASTNAME WORKDEPTNO DEPTNAME
000290 John Parker OP11 Operations
000320 Ramlal Mehta SE21 Software Support
000310 Maude Setright OP11 Operations
Table violating 3rd Normal Form
EMPNO
(Primary Key)
FIRSTNAME LASTNAME WORKDEPTNO DEPTNAME
000290 John Parker OP11 Operations
000320 Ramlal Mehta SE21 Software Support
000310 Maude Setright OP11 Operations
Table violating 3rd Normal Form
Here all the fields are not completely depend on Primary key.
Ie Dept Name column only depends on DeptNo.And deptno depends on the EMPNO.
Ie its a transitive dependency. Which should be avoided
Table conforming to 3rd Normal
Form
EMPNO
(Primary Key)
FIRSTNAME LASTNAME WORKDEPTNO
000290 John Parker OP11
000320 Ramlal Mehta SE21
000310 Maude Setright OP11
WORKDEPTNO DEPTNAME
OP11 Operations
SE21
Software
Support
OP11 Operations
Here all the fields are completely depend on Primary key.
End of Day2

Contenu connexe

Tendances

Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize outputSyed Zaid Irshad
 
Sub query example with advantage and disadvantages
Sub query example with advantage and disadvantagesSub query example with advantage and disadvantages
Sub query example with advantage and disadvantagesSarfaraz Ghanta
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Finalmukesh24pandey
 
Sql modifying data - MYSQL part I
Sql modifying data - MYSQL part ISql modifying data - MYSQL part I
Sql modifying data - MYSQL part IAhmed Farag
 
Optimizing MySQL Queries
Optimizing MySQL QueriesOptimizing MySQL Queries
Optimizing MySQL QueriesAchievers Tech
 
Webinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuningWebinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuning晓 周
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functionsVikas Gupta
 
Window functions with SQL Server 2016
Window functions with SQL Server 2016Window functions with SQL Server 2016
Window functions with SQL Server 2016Mark Tabladillo
 
Introduction to oracle functions
Introduction to oracle functionsIntroduction to oracle functions
Introduction to oracle functionsNitesh Singh
 
MySQL index optimization techniques
MySQL index optimization techniquesMySQL index optimization techniques
MySQL index optimization techniqueskumar gaurav
 
Advanced functions in PL SQL
Advanced functions in PL SQLAdvanced functions in PL SQL
Advanced functions in PL SQLHosein Zare
 
How mysql choose the execution plan
How mysql choose the execution planHow mysql choose the execution plan
How mysql choose the execution plan辛鹤 李
 
Using Indexed field effectively in Access Queries with Voyager
Using Indexed field effectively in Access Queries with VoyagerUsing Indexed field effectively in Access Queries with Voyager
Using Indexed field effectively in Access Queries with VoyagerAlan Manifold
 
Aggregating Data Using Group Functions
Aggregating Data Using Group FunctionsAggregating Data Using Group Functions
Aggregating Data Using Group FunctionsSalman Memon
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and OperatorsMohan Kumar.R
 

Tendances (19)

Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize output
 
Sub query example with advantage and disadvantages
Sub query example with advantage and disadvantagesSub query example with advantage and disadvantages
Sub query example with advantage and disadvantages
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Final
 
MYSQL join
MYSQL joinMYSQL join
MYSQL join
 
Sql modifying data - MYSQL part I
Sql modifying data - MYSQL part ISql modifying data - MYSQL part I
Sql modifying data - MYSQL part I
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 
Optimizing MySQL Queries
Optimizing MySQL QueriesOptimizing MySQL Queries
Optimizing MySQL Queries
 
Webinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuningWebinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuning
 
Computer Science:Sql Set Operation
Computer Science:Sql Set OperationComputer Science:Sql Set Operation
Computer Science:Sql Set Operation
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
Window functions with SQL Server 2016
Window functions with SQL Server 2016Window functions with SQL Server 2016
Window functions with SQL Server 2016
 
Introduction to oracle functions
Introduction to oracle functionsIntroduction to oracle functions
Introduction to oracle functions
 
MySQL index optimization techniques
MySQL index optimization techniquesMySQL index optimization techniques
MySQL index optimization techniques
 
Advanced functions in PL SQL
Advanced functions in PL SQLAdvanced functions in PL SQL
Advanced functions in PL SQL
 
How mysql choose the execution plan
How mysql choose the execution planHow mysql choose the execution plan
How mysql choose the execution plan
 
Using Indexed field effectively in Access Queries with Voyager
Using Indexed field effectively in Access Queries with VoyagerUsing Indexed field effectively in Access Queries with Voyager
Using Indexed field effectively in Access Queries with Voyager
 
Aggregating Data Using Group Functions
Aggregating Data Using Group FunctionsAggregating Data Using Group Functions
Aggregating Data Using Group Functions
 
Subqueries
SubqueriesSubqueries
Subqueries
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 

En vedette

Mysql Statments
Mysql StatmentsMysql Statments
Mysql StatmentsSHC
 
Normalisation student summary
Normalisation student summaryNormalisation student summary
Normalisation student summarymary_ramsay
 
Digital Normalisation, School Evolution and BYOT
Digital Normalisation, School Evolution and BYOTDigital Normalisation, School Evolution and BYOT
Digital Normalisation, School Evolution and BYOTEduwebinar
 
NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I Mukalele Rogers
 
Quantitative techniques basics of mathematics permutations and combinations_p...
Quantitative techniques basics of mathematics permutations and combinations_p...Quantitative techniques basics of mathematics permutations and combinations_p...
Quantitative techniques basics of mathematics permutations and combinations_p...taniyakhurana
 
Importance of quantitative techniques in managerial decisions
Importance of quantitative techniques in managerial decisionsImportance of quantitative techniques in managerial decisions
Importance of quantitative techniques in managerial decisionsAman Sinha
 
QUANTITATIVE TECHNIQUE IN BUSINESS
QUANTITATIVE TECHNIQUE IN BUSINESSQUANTITATIVE TECHNIQUE IN BUSINESS
QUANTITATIVE TECHNIQUE IN BUSINESSMutahir Bilal
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to AlgorithmsVenkatesh Iyer
 
Quantitative approach 1
Quantitative approach 1Quantitative approach 1
Quantitative approach 1Sri Naga Ramya
 
Quantitative techniques introduction 19 pages
Quantitative techniques introduction 19 pagesQuantitative techniques introduction 19 pages
Quantitative techniques introduction 19 pagestaniyakhurana
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFOum Saokosal
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 

En vedette (17)

Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Mysql Statments
Mysql StatmentsMysql Statments
Mysql Statments
 
Normalisation student summary
Normalisation student summaryNormalisation student summary
Normalisation student summary
 
Digital Normalisation, School Evolution and BYOT
Digital Normalisation, School Evolution and BYOTDigital Normalisation, School Evolution and BYOT
Digital Normalisation, School Evolution and BYOT
 
NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I
 
File operations in c
File operations in cFile operations in c
File operations in c
 
Quantitative techniques basics of mathematics permutations and combinations_p...
Quantitative techniques basics of mathematics permutations and combinations_p...Quantitative techniques basics of mathematics permutations and combinations_p...
Quantitative techniques basics of mathematics permutations and combinations_p...
 
Importance of quantitative techniques in managerial decisions
Importance of quantitative techniques in managerial decisionsImportance of quantitative techniques in managerial decisions
Importance of quantitative techniques in managerial decisions
 
QUANTITATIVE TECHNIQUE IN BUSINESS
QUANTITATIVE TECHNIQUE IN BUSINESSQUANTITATIVE TECHNIQUE IN BUSINESS
QUANTITATIVE TECHNIQUE IN BUSINESS
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
 
Quantitative approach 1
Quantitative approach 1Quantitative approach 1
Quantitative approach 1
 
1st Semester MBA (Dec-2013) Question Papers
1st Semester MBA (Dec-2013) Question Papers1st Semester MBA (Dec-2013) Question Papers
1st Semester MBA (Dec-2013) Question Papers
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 
Quantitative techniques introduction 19 pages
Quantitative techniques introduction 19 pagesQuantitative techniques introduction 19 pages
Quantitative techniques introduction 19 pages
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 

Similaire à Chapter 6 database normalisation

Similaire à Chapter 6 database normalisation (20)

Introduction to mysql part 6
Introduction to mysql part 6Introduction to mysql part 6
Introduction to mysql part 6
 
Topics-Ch4Ch5.ppt
Topics-Ch4Ch5.pptTopics-Ch4Ch5.ppt
Topics-Ch4Ch5.ppt
 
Topics-Ch4Ch5.ppt
Topics-Ch4Ch5.pptTopics-Ch4Ch5.ppt
Topics-Ch4Ch5.ppt
 
Normalisation revision
Normalisation revisionNormalisation revision
Normalisation revision
 
Sql statements function join
Sql statements function joinSql statements function join
Sql statements function join
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
BusinessIDNameStreetAddressCityState1001Computer Accessories Etc362
BusinessIDNameStreetAddressCityState1001Computer Accessories Etc362BusinessIDNameStreetAddressCityState1001Computer Accessories Etc362
BusinessIDNameStreetAddressCityState1001Computer Accessories Etc362
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
 
Sql server ___________session3-normailzation
Sql server  ___________session3-normailzationSql server  ___________session3-normailzation
Sql server ___________session3-normailzation
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Kumar lav
Kumar lavKumar lav
Kumar lav
 
Normalization
NormalizationNormalization
Normalization
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Querying_with_T-SQL_-_03.pptx
Querying_with_T-SQL_-_03.pptxQuerying_with_T-SQL_-_03.pptx
Querying_with_T-SQL_-_03.pptx
 
Querying_with_T-SQL_-_03 (1).pptx
Querying_with_T-SQL_-_03 (1).pptxQuerying_with_T-SQL_-_03 (1).pptx
Querying_with_T-SQL_-_03 (1).pptx
 
Sql notes, sql server,sql queries,introduction of SQL, Beginner in SQL
Sql notes, sql server,sql queries,introduction of SQL, Beginner in SQLSql notes, sql server,sql queries,introduction of SQL, Beginner in SQL
Sql notes, sql server,sql queries,introduction of SQL, Beginner in SQL
 
Lecture 6.pptx
Lecture 6.pptxLecture 6.pptx
Lecture 6.pptx
 
Normalization.ppt
Normalization.pptNormalization.ppt
Normalization.ppt
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptx
 

Plus de baabtra.com - No. 1 supplier of quality freshers

Plus de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 
Baabtra soft skills
Baabtra soft skillsBaabtra soft skills
Baabtra soft skills
 
Cell phone jammer
Cell phone jammerCell phone jammer
Cell phone jammer
 
Apple iwatches
Apple iwatchesApple iwatches
Apple iwatches
 

Dernier

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Dernier (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Chapter 6 database normalisation

  • 1. Introduction to MySQL Database Normalization Day 2
  • 2. Relevance of normalization • We could have store all the data in a single table like • But there are several issues arise here Emp_id Emp_name Emp_age Emp_email Fk_int_designation Vchr_Desig_roles 1000 Deepak 45 dk@gmail.co m Are Manager Handles all the district level operations 1001 Aneesh 23 an@gmail.com Sales person Will increase sales and ensure customer satisfaction 1002 Naveen 25 nn@gmail.com Sales person Will increase sales and ensure customer satisfaction 1003 Jacob 25 dpk@gmail.com Administrator Handles all the district level operations
  • 3. Relevance of normalization • We could have store all the data in a single table like Emp_id Emp_name Emp_age Emp_email Fk_int_designation Vchr_Desig_roles 1000 Deepak 45 dk@gmail.com Are Manager Handles all the district level operations 1001 Aneesh 23 an@gmail.com Sales person Will increase sales and ensure customer satisfaction 1002 Naveen 25 nn@gmail.com Sales person Will increase sales and ensure customer satisfaction 1003 Jacob 25 dpk@gmail.com Administrator Handles all the district level operations Here designation is repeated for all the rows and where ever it repeats the designation role also has to repeat. This redundancy takes a lot of space to store and is inefficient
  • 4. Relevance of normalization • We could have store all the data in a single table like Emp_id Emp_name Emp_age Emp_email Fk_int_designation Vchr_Desig_roles 1000 Deepak 45 dk@gmail.com Are Manager Handles all the district level operations 1001 Aneesh 23 an@gmail.com Sales person Will increase sales and ensure customer satisfaction 1002 Naveen 25 nn@gmail.com Sales person Will increase sales and ensure customer satisfaction 1003 Jacob 25 dpk@gmail.com Administrator Handles all the district level operations Suppose if i want to modify the roles of any designation, i will have to do the same for all records in the table. Its time consuming and not an effective way to follow
  • 5. Normalization • Normalization is the process of moving data into related tables • Will save data dependency and redundancy • Save typing of repetitive data • Reduce disk space
  • 6. Types of Normalization • There are several levels of normalization – 1st Normalization – 2nd Normalization – 3rd Normalization
  • 8. First Normal Form – Each field contains the smallest meaningful value – The table does not contain repeating groups of fields or repeating data within the same field To attain 1st normalized form what you have to do is •Create a separate field/table for each set of related data. •Identify each set of related data with a primary key
  • 9. Table violating 1st Normal Form Company (pk) Branches Baabte Cochin, Calicut baabtra Calicut,Trivandrum It really is a bad setup that we are storing multiple values in a single column. For a table to be in 1st normalised form it should only have atomic values
  • 10. Table violating 1st Normal Form Company (Pk) Branche1 Branch2 Baabte Cochin Calicut baabtra Calicut Trivandrum It still in a bad set up , as we should not have multiple columns describing the same property of an entity.
  • 11. Table conforming to 1st Normal Form Company (pk) Branch (pk) Baabte Cochin Baabte Calicut baabtra Calicut baabtra Trivandrum We have resulted in a 1st normalised table with primary key consists of two columns
  • 13. Second Normalisation – usually used in tables with a multiple-field primary key (composite key) – each non-key field relates to the entire primary key – any field that does not relate to the primary key is placed in a separate table • To attain 1st normalized form what you have to do is •eliminate redundant data in a table •Create separate tables for sets of values that apply to multiple records
  • 14. Table violating 2nd Normal Form Employee (pk) Skill (pk) WorkLocation John IOS programmer Calicut Mathew Java programmer Cochin Thomas Android programmer Trivandrum Alex PHP programmer Banglore Ram Java programmer Mumbai John PHP programmer Delhi Soozan doNet programmer Calicut Primary key= { Employee,Skill }
  • 15. Table violating 2nd Normal Form Employee (pk) Skill (pk) WorkLocation John IOS programmer Calicut Mathew Java programmer Cochin Thomas Android programmer Trivandrum Alex PHP programmer Banglore Ram Java programmer Mumbai John PHP programmer Delhi Soozan doNet programmer Calicut Here non key attribute do not fully depends on compete primary key. Ie WorkLocation depends only on Employee and doesn’t depend on Skill (partial dependency) Primary key= { Employee,Skill }
  • 16. Table conforming to 2nd Normal Form Employee (pk) Skill (pk) John IOS programmer Mathew Java programmer Thomas Android programmer Alex PHP programmer Ram Java programmer John PHP programmer Soozan doNet programmer Employee (pk) WorkLocation John Calicut Mathew Cochin Thomas Trivandrum Alex Banglore Ram Mumbai John Delhi Soozan Calicut
  • 18. Third Normal Form • Usually used in tables with a single field primary key --records do not depend on anything other than a table's primary key – each non-key field is a fact about the key – Values in a record that are not part of that record's key do not belong in the table. In general, any time the contents of a group of fields may apply to more than a single record in the table, consider placing those fields in a separate table.
  • 19. EMPNO (Primary Key) FIRSTNAME LASTNAME WORKDEPTNO DEPTNAME 000290 John Parker OP11 Operations 000320 Ramlal Mehta SE21 Software Support 000310 Maude Setright OP11 Operations Table violating 3rd Normal Form
  • 20. EMPNO (Primary Key) FIRSTNAME LASTNAME WORKDEPTNO DEPTNAME 000290 John Parker OP11 Operations 000320 Ramlal Mehta SE21 Software Support 000310 Maude Setright OP11 Operations Table violating 3rd Normal Form Here all the fields are not completely depend on Primary key. Ie Dept Name column only depends on DeptNo.And deptno depends on the EMPNO. Ie its a transitive dependency. Which should be avoided
  • 21. Table conforming to 3rd Normal Form EMPNO (Primary Key) FIRSTNAME LASTNAME WORKDEPTNO 000290 John Parker OP11 000320 Ramlal Mehta SE21 000310 Maude Setright OP11 WORKDEPTNO DEPTNAME OP11 Operations SE21 Software Support OP11 Operations Here all the fields are completely depend on Primary key.