SlideShare a Scribd company logo
WEL COME
TO
OUR PRESENTATION
18/8/2017
PRESENTED
BY: Presented to:
Normalization & JOIN
28/8/2017
Md . Sohag
Em@il : sohag.0315@gmail.com
Daffodil international University
NORMALIZATION OF DATABASE
Database Normalization is a technique of organizing the data in the
database. Normalization is a systematic approach of decomposing
tables to eliminate data redundancy and undesirable characteristics like
Insertion, Update and Deletion Anomalies .
 Normalization is used for mainly two purpose
 Eliminating redundant(useless) data.
 The problem usually happens when an existing system uses unstructured file, e.g. in M
8/8/2017 3
PROBLEM WITHOUT NORMALIZATION
 Without Normalization, it becomes difficult to handle and update
the database, without facing data loss. Insertion, Updation and
Deletion Anomalies are very frequent if Database is not Normalized.
S_id S_Name S_Address Subject_opted
401 Adam Noida Bio
402 Alex Panipat Maths
403 Stuart Jammu Maths
404 Adam Noida Physics
8/8/2017 4
PROBLEM WITHOUT NORMALIZATION
 Updation Anomaly
 Insertion Anomaly
 Deletion Anomaly
S_id S_Name S_Address Subject_opted
401 Adam Noida Bio
402 Alex Panipat Maths
403 Stuart Jammu Maths
404 Adam Noida Physics
8/8/2017 5
NORMALIZATION RULE
 Normalization rule are divided into following normal
form :
 First Normal Form
 Second Normal Form
 Third Normal Form
8/8/2017 6
FIRST NORMAL FORM(1NF)
THE OFFICIAL QUALIFICATIONS FOR 1NF ARE:
1. Each Attribute Name Must Be Unique.
2. Each Attribute Value Must Be Single.
3. Each Row Must Be Unique.
4. There Is No Repeating Groups.
78/8/2017
FIRST NORMAL FORM(1NF)
8
Example of a table not in 1NF :
 It violates the 1NF.
Student Age Subject
Adam 15 Biology, Maths
Alex 14 Maths
Stuart 17 Maths
8/8/2017
FIRST NORMAL FORM (1NF)
9
 Now it is in 1NF.
 However, it might still violate 2NF and so on.
Student Age Subject
Adam 15 Biology
Adam 15 Maths
Alex 14 Maths
Stuart 17 Maths
8/8/2017
FUNCTIONAL DEPENDENCIES
10
We say an attribute, B, has a functional dependency on another attribute, A, if for any two
records, which have
the same value for A, then the values for B in these two records must be the same. We
illustrate this as:
A  B (read as: A determines B or B depends on A)
employee name  email address
employee name project email address
Sok San POS Mart Sys soksan@yahoo.com
Sao Ry Univ Mgt Sys sao@yahoo.com
Sok San Web Redesign soksan@yahoo.com
Chan Sokna POS Mart Sys chan@gmail.com
Sao Ry DB Design sao@yahoo.com
8/8/2017
FUNCTIONAL DEPENDENCIES
11
EmpNum EmpEmail EmpFname EmpLname
123 jdoe@abc.com John Doe
456 psmith@abc.com Peter Smith
555 alee1@abc.com Alan Lee
633 pdoe@abc.com Peter Doe
787 alee2@abc.com Alan Lee
If EmpNum is the PK then the FDs:
EmpNum  EmpEmail, EmpFname, EmpLname
must exist.
8/8/2017
FUNCTIONAL DEPENDENCIES
12
EmpNum  EmpEmail, EmpFname, EmpLname
EmpNum
EmpEmail
EmpFname
EmpLname
EmpNum EmpEmail EmpFname EmpLname
8/8/2017
DETERMINANT
13
Functional Dependency
EmpNum  EmpEmail
Attribute on the left hand side is known as the
determinant
• EmpNum is a determinant of EmpEmail
8/8/2017
SECOND NORMAL FORM(2NF)
THE OFFICIAL QUALIFICATIONS FOR 2NF
ARE:
1. A TABLE IS ALREADY IN 1NF.
2. ALL NONKEY ATTRIBUTES ARE FULLY DEPENDENT ON THE PRIMARY KEY.
ALL PARTIAL DEPENDENCIES ARE REMOVED TO PLACE IN ANOTHER TABLE.
128/8/2017
CourseID SemesterID Num Student Course Name
IT101 201301 25 Database
IT101 201302 25 Database
IT102 201301 30 Web Prog
IT102 201302 35 Web Prog
IT103 201401 20 Networking
Example of a table not in 2NF:
Primary Key
The Course Name depends on only CourseID, a part of the primary key
not the whole primary {CourseID, SemesterID}.It’s called partial
dependency.
15
SECOND NORMAL FORM(2NF)
8/8/2017
CourseID Course Name
IT101 Database
IT101 Database
IT102 Web Prog
IT102 Web Prog
IT103 Networking
SemesterDone? Oh no, it is still
not in 1NF yet.
Remove the repeating
groups too.
Finally, connect the
relationship.
CourseID Course Name
IT101 Database
IT102 Web Prog
IT103 Networking
CourseID SemesterID Num Student
IT101 201301 25
IT101 201302 25
IT102 201301 30
IT102 201302 35
IT103 201401 20
16
SECOND NORMAL FORM(2NF)
8/8/2017
THIRD NORMAL FORM (3NF)
THE OFFICIAL QUALIFICATIONS FOR 3NF ARE:
1. A TABLE IS ALREADY IN 2NF.
2. NONPRIMARY KEY ATTRIBUTES DO NOT DEPEND ON OTHER NONPRIMARY
KEY ATTRIBUTES
178/8/2017
StudyID Course Name Teacher Name Teacher Tel
1 Database Sok Piseth 012 123 456
2 Database Sao Kanha 0977 322 111
3 Web Prog Chan Veasna 012 412 333
4 Web Prog Chan Veasna 012 412 333
5 Networking Pou Sambath 077 545 221
Example of a Table not in 3NF:
Primary Key
18
THIRD NORMAL FORM (3NF)
8/8/2017
Teacher Name Teacher Tel
Sok Piseth 012 123 456
Sao Kanha 0977 322 111
Chan Veasna 012 412 333
Chan Veasna 012 412 333
Pou Sambath 077 545 221
Done?
Oh no, it is still not in 1NF yet.
Remove Repeating row.
Teacher Name Teacher Tel
Sok Piseth 012 123 456
Sao Kanha 0977 322 111
Chan Veasna 012 412 333
Pou Sambath 077 545 221
Note about primary key:
- In theory, you can choose
Teacher Name to be a primary key.
- But in practice, you should add
Teacher ID as the primary key.
ID Teacher Name Teacher Tel
T1 Sok Piseth 012 123 456
T2 Sao Kanha 0977 322
111
T3 Chan Veasna 012 412 333
T4 Pou Sambath 077 545 221
StudyID Course Name T.ID
1 Database T1
2 Database T2
3 Web Prog T3
4 Web Prog T3
5 Networking T4
198/8/2017
JOIN
 Join Is A Special Form Of Cross Product
Of Two Tables.
 In Cartesian Product We Join A Tuple Of
One Table With The Tuples Of The
Second Table. But In Join There Is A
Special Requirement Of Relationship
Between Tuples.
8/8/2017 20
JOIN TYPES
SQL JOIN
Inner
Join
Outer
Join
Self Join
Cross
Join
Theta Join
Equi Join
Natural
Join
Left Outer JOIN
Right Outer
JOIN
Full Outer JOIN 8/8/2017 21
INNER JOIN
AN INNER JOIN IS THE MOST COMMON JOIN OPERATION USED IN
APPLICATIONS AND CAN BE REGARDED AS THE DEFAULT JOIN-
TYPE.
 INNER JOIN CREATES A NEW RESULT TABLE BY COMBINING
COLUMN VALUES OF TWO TABLES (A AND B) BASED UPON THE
JOIN-PREDICATE.
8/8/2017 22
Θ-JOIN
CONSIDER TABLES CAR AND BOAT WHICH LIST MODELS OF CARS
AND BOATS AND THEIR RESPECTIVE PRICES.
 SUPPOSE A CUSTOMER WANTS TO BUY A CAR AND A BOAT, BUT
SHE DOES NOT WANT TO SPEND MORE MONEY FOR THE BOAT
THAN FOR THE CAR.
8/8/2017 23
EQUI JOIN
AN EQUI-JOIN, ALSO KNOWN AS AN EQUIJOIN, IS A SPECIFIC TYPE
OF COMPARATOR-BASED JOIN, OR THETA JOIN, THAT USES
ONLY EQUALITY COMPARISONS IN THE JOIN-PREDICATE. USING
OTHER COMPARISON OPERATORS (SUCH AS <) DISQUALIFIES A
JOIN AS AN EQUI-JOIN.
8/8/2017 24
EQUI JOIN EXAMPLE
8/8/2017 25
NATURAL JOIN
NATURAL JOIN ( ) IS A BINARY OPERATOR THAT IS WRITTEN AS
(R S) WHERE R AND S ARE RELATIONS.
 IN PARTICULAR, NATURAL JOIN ALLOWS THE COMBINATION OF
RELATIONS THAT ARE ASSOCIATED BY A FOREIGN KEY.
8/8/2017 26
OUTER JOIN
 An Outer Join Does Not Require Each Record In The Two Joined
Tables To Have A Matching Record. The Joined Table Retains Each
Record—even If No Other Matching Record Exists.
8/8/2017 27
LEFT OUTER JOIN
The Result Of A Left Outer Join (Or Simply Left Join) For Table A And B Always
Contains All Records Of The "Left" Table (A), Even If The Join-condition Does
Not Find Any Matching Record In The "Right" Table (B).
Employee
Dept
Employee =X Dept
8/8/2017 28
LEFT OUTER JOIN EXAMPLE
8/8/2017 29
RIGHT OUTER JOIN
A RIGHT OUTER JOIN (OR RIGHT JOIN) CLOSELY RESEMBLES A LEFT OUTER JOIN,
EXCEPT WITH THE TREATMENT OF THE TABLES REVERSED
Employee X= Dept
Employee
Dept
8/8/2017 30
RIGHT OUTER JOIN EXAMPLE
8/8/2017 31
FULL OUTER JOIN
Conceptually, A Full Outer Join Combines The Effect Of Applying Both Left And
Right Outer Joins.
Employee =X= Dept
Employee
Dept
8/8/2017 32
FULL OUTER JOIN (EXAMPLE)
8/8/2017 33
8/8/2017 34

More Related Content

What's hot

DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
Bharati Ugale
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
Operating system 11 system calls
Operating system 11 system callsOperating system 11 system calls
Operating system 11 system calls
Vaibhav Khanna
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
honglee71
 
802.15.5 mesh topology
802.15.5  mesh topology802.15.5  mesh topology
802.15.5 mesh topology
sunil raj kumar
 
System Case
System CaseSystem Case
System Case
Ashish KC
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
kamlesh deshmukh
 
Online Examination System in .NET & DB2
Online Examination System in .NET & DB2Online Examination System in .NET & DB2
Online Examination System in .NET & DB2
Abhay Ananda Shukla
 
Anomalies in database
Anomalies in databaseAnomalies in database
Library management system
Library management systemLibrary management system
Library management system
Imdad Ul Haq
 
Unit 1 ppt
Unit 1 pptUnit 1 ppt
Unit 1 ppt
GRajendra
 
Unicode Fundamentals
Unicode Fundamentals Unicode Fundamentals
Unicode Fundamentals
SamiHsDU
 
Types of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal GulatiTypes of keys in database management system by Dr. Kamal Gulati
Direct Memory Access
Direct Memory AccessDirect Memory Access
Direct Memory Access
Hetauda City College
 
08 Dynamic SQL and Metadata
08 Dynamic SQL and Metadata08 Dynamic SQL and Metadata
08 Dynamic SQL and Metadata
rehaniltifat
 
Unit-4 (IO Interface).pptx
Unit-4 (IO Interface).pptxUnit-4 (IO Interface).pptx
Unit-4 (IO Interface).pptx
Medicaps University
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
John Cutajar
 
Database Programming Techniques
Database Programming TechniquesDatabase Programming Techniques
Database Programming Techniques
Raji Ghawi
 
memory allocation methods
memory allocation methodsmemory allocation methods
memory allocation methods
Anshul gour
 
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
IIUM
 

What's hot (20)

DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Operating system 11 system calls
Operating system 11 system callsOperating system 11 system calls
Operating system 11 system calls
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
802.15.5 mesh topology
802.15.5  mesh topology802.15.5  mesh topology
802.15.5 mesh topology
 
System Case
System CaseSystem Case
System Case
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
 
Online Examination System in .NET & DB2
Online Examination System in .NET & DB2Online Examination System in .NET & DB2
Online Examination System in .NET & DB2
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
Library management system
Library management systemLibrary management system
Library management system
 
Unit 1 ppt
Unit 1 pptUnit 1 ppt
Unit 1 ppt
 
Unicode Fundamentals
Unicode Fundamentals Unicode Fundamentals
Unicode Fundamentals
 
Types of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal GulatiTypes of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal Gulati
 
Direct Memory Access
Direct Memory AccessDirect Memory Access
Direct Memory Access
 
08 Dynamic SQL and Metadata
08 Dynamic SQL and Metadata08 Dynamic SQL and Metadata
08 Dynamic SQL and Metadata
 
Unit-4 (IO Interface).pptx
Unit-4 (IO Interface).pptxUnit-4 (IO Interface).pptx
Unit-4 (IO Interface).pptx
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
 
Database Programming Techniques
Database Programming TechniquesDatabase Programming Techniques
Database Programming Techniques
 
memory allocation methods
memory allocation methodsmemory allocation methods
memory allocation methods
 
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
 

Similar to Normalization & join

Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
Om Vikram Thapa
 
Normalization in Database Management System.pptx
Normalization in Database Management System.pptxNormalization in Database Management System.pptx
Normalization in Database Management System.pptx
Roshni814224
 
Normalization
NormalizationNormalization
Normalization
Ali Asghar Manjotho
 
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
honey725342
 
Presentation on SQL At Batra Computer Cente
Presentation on SQL At Batra Computer CentePresentation on SQL At Batra Computer Cente
Presentation on SQL At Batra Computer Cente
Batra Computer Centre
 
Preparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dPreparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001d
Gihan Wikramanayake
 
final home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docxfinal home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docx
mydrynan
 
CSCI 4140-AA Pre-Req.ppt
CSCI 4140-AA Pre-Req.pptCSCI 4140-AA Pre-Req.ppt
CSCI 4140-AA Pre-Req.ppt
ZahidKhan671907
 
Ms office excel
Ms office excelMs office excel
Ms office excel
Erlie Balanay
 
SAS/Tableau integration
SAS/Tableau integrationSAS/Tableau integration
SAS/Tableau integration
Patrick Spedding
 
Chapter5.pptx
Chapter5.pptxChapter5.pptx
Web Quest Baseball
Web Quest BaseballWeb Quest Baseball
Web Quest Baseball
cubsfan3371
 
ICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptx
ICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptxICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptx
ICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptx
Amanda783100
 
Sql Lab 4 Essay
Sql Lab 4 EssaySql Lab 4 Essay
Sql Lab 4 Essay
Lorie Harris
 
Unit-3-SQL-part1.ppt
Unit-3-SQL-part1.pptUnit-3-SQL-part1.ppt
Unit-3-SQL-part1.ppt
vipinpanicker2
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Biplap Bhattarai
 
Chapter 4 notes DBMS.pdf
Chapter 4 notes DBMS.pdfChapter 4 notes DBMS.pdf
Chapter 4 notes DBMS.pdf
Subrahmanya6
 
SQL and E R diagram
SQL and E R diagramSQL and E R diagram
SQL and E R diagram
Mahbubur Rahman Shimul
 
Intro to SQL for Beginners
Intro to SQL for BeginnersIntro to SQL for Beginners
Intro to SQL for Beginners
Product School
 
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
hyacinthshackley2629
 

Similar to Normalization & join (20)

Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
 
Normalization in Database Management System.pptx
Normalization in Database Management System.pptxNormalization in Database Management System.pptx
Normalization in Database Management System.pptx
 
Normalization
NormalizationNormalization
Normalization
 
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
 
Presentation on SQL At Batra Computer Cente
Presentation on SQL At Batra Computer CentePresentation on SQL At Batra Computer Cente
Presentation on SQL At Batra Computer Cente
 
Preparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dPreparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001d
 
final home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docxfinal home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docx
 
CSCI 4140-AA Pre-Req.ppt
CSCI 4140-AA Pre-Req.pptCSCI 4140-AA Pre-Req.ppt
CSCI 4140-AA Pre-Req.ppt
 
Ms office excel
Ms office excelMs office excel
Ms office excel
 
SAS/Tableau integration
SAS/Tableau integrationSAS/Tableau integration
SAS/Tableau integration
 
Chapter5.pptx
Chapter5.pptxChapter5.pptx
Chapter5.pptx
 
Web Quest Baseball
Web Quest BaseballWeb Quest Baseball
Web Quest Baseball
 
ICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptx
ICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptxICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptx
ICT NOTESmbjbujbhbuhuhhipv;ihsjhis 7.pptx
 
Sql Lab 4 Essay
Sql Lab 4 EssaySql Lab 4 Essay
Sql Lab 4 Essay
 
Unit-3-SQL-part1.ppt
Unit-3-SQL-part1.pptUnit-3-SQL-part1.ppt
Unit-3-SQL-part1.ppt
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
Chapter 4 notes DBMS.pdf
Chapter 4 notes DBMS.pdfChapter 4 notes DBMS.pdf
Chapter 4 notes DBMS.pdf
 
SQL and E R diagram
SQL and E R diagramSQL and E R diagram
SQL and E R diagram
 
Intro to SQL for Beginners
Intro to SQL for BeginnersIntro to SQL for Beginners
Intro to SQL for Beginners
 
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
 

More from Sohag Babu

Dead Lock
Dead LockDead Lock
Dead Lock
Sohag Babu
 
Twisted pair cable
Twisted pair cableTwisted pair cable
Twisted pair cable
Sohag Babu
 
Software testing lifecycle
Software testing lifecycleSoftware testing lifecycle
Software testing lifecycle
Sohag Babu
 
Social networking
Social networkingSocial networking
Social networking
Sohag Babu
 
Simple web browser
Simple web browserSimple web browser
Simple web browser
Sohag Babu
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
Sohag Babu
 
Presentation of transistor
Presentation of transistorPresentation of transistor
Presentation of transistor
Sohag Babu
 
Hamilton paths and circuit
Hamilton paths and circuitHamilton paths and circuit
Hamilton paths and circuit
Sohag Babu
 
E learning
E learningE learning
E learning
Sohag Babu
 
Applications of differential equations
Applications of differential equationsApplications of differential equations
Applications of differential equations
Sohag Babu
 
Application of numerical methods
Application of numerical methodsApplication of numerical methods
Application of numerical methods
Sohag Babu
 
Application layer
Application layerApplication layer
Application layer
Sohag Babu
 
4th generation computer
4th generation computer4th generation computer
4th generation computer
Sohag Babu
 

More from Sohag Babu (13)

Dead Lock
Dead LockDead Lock
Dead Lock
 
Twisted pair cable
Twisted pair cableTwisted pair cable
Twisted pair cable
 
Software testing lifecycle
Software testing lifecycleSoftware testing lifecycle
Software testing lifecycle
 
Social networking
Social networkingSocial networking
Social networking
 
Simple web browser
Simple web browserSimple web browser
Simple web browser
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Presentation of transistor
Presentation of transistorPresentation of transistor
Presentation of transistor
 
Hamilton paths and circuit
Hamilton paths and circuitHamilton paths and circuit
Hamilton paths and circuit
 
E learning
E learningE learning
E learning
 
Applications of differential equations
Applications of differential equationsApplications of differential equations
Applications of differential equations
 
Application of numerical methods
Application of numerical methodsApplication of numerical methods
Application of numerical methods
 
Application layer
Application layerApplication layer
Application layer
 
4th generation computer
4th generation computer4th generation computer
4th generation computer
 

Recently uploaded

Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 

Recently uploaded (20)

Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 

Normalization & join

  • 2. PRESENTED BY: Presented to: Normalization & JOIN 28/8/2017 Md . Sohag Em@il : sohag.0315@gmail.com Daffodil international University
  • 3. NORMALIZATION OF DATABASE Database Normalization is a technique of organizing the data in the database. Normalization is a systematic approach of decomposing tables to eliminate data redundancy and undesirable characteristics like Insertion, Update and Deletion Anomalies .  Normalization is used for mainly two purpose  Eliminating redundant(useless) data.  The problem usually happens when an existing system uses unstructured file, e.g. in M 8/8/2017 3
  • 4. PROBLEM WITHOUT NORMALIZATION  Without Normalization, it becomes difficult to handle and update the database, without facing data loss. Insertion, Updation and Deletion Anomalies are very frequent if Database is not Normalized. S_id S_Name S_Address Subject_opted 401 Adam Noida Bio 402 Alex Panipat Maths 403 Stuart Jammu Maths 404 Adam Noida Physics 8/8/2017 4
  • 5. PROBLEM WITHOUT NORMALIZATION  Updation Anomaly  Insertion Anomaly  Deletion Anomaly S_id S_Name S_Address Subject_opted 401 Adam Noida Bio 402 Alex Panipat Maths 403 Stuart Jammu Maths 404 Adam Noida Physics 8/8/2017 5
  • 6. NORMALIZATION RULE  Normalization rule are divided into following normal form :  First Normal Form  Second Normal Form  Third Normal Form 8/8/2017 6
  • 7. FIRST NORMAL FORM(1NF) THE OFFICIAL QUALIFICATIONS FOR 1NF ARE: 1. Each Attribute Name Must Be Unique. 2. Each Attribute Value Must Be Single. 3. Each Row Must Be Unique. 4. There Is No Repeating Groups. 78/8/2017
  • 8. FIRST NORMAL FORM(1NF) 8 Example of a table not in 1NF :  It violates the 1NF. Student Age Subject Adam 15 Biology, Maths Alex 14 Maths Stuart 17 Maths 8/8/2017
  • 9. FIRST NORMAL FORM (1NF) 9  Now it is in 1NF.  However, it might still violate 2NF and so on. Student Age Subject Adam 15 Biology Adam 15 Maths Alex 14 Maths Stuart 17 Maths 8/8/2017
  • 10. FUNCTIONAL DEPENDENCIES 10 We say an attribute, B, has a functional dependency on another attribute, A, if for any two records, which have the same value for A, then the values for B in these two records must be the same. We illustrate this as: A  B (read as: A determines B or B depends on A) employee name  email address employee name project email address Sok San POS Mart Sys soksan@yahoo.com Sao Ry Univ Mgt Sys sao@yahoo.com Sok San Web Redesign soksan@yahoo.com Chan Sokna POS Mart Sys chan@gmail.com Sao Ry DB Design sao@yahoo.com 8/8/2017
  • 11. FUNCTIONAL DEPENDENCIES 11 EmpNum EmpEmail EmpFname EmpLname 123 jdoe@abc.com John Doe 456 psmith@abc.com Peter Smith 555 alee1@abc.com Alan Lee 633 pdoe@abc.com Peter Doe 787 alee2@abc.com Alan Lee If EmpNum is the PK then the FDs: EmpNum  EmpEmail, EmpFname, EmpLname must exist. 8/8/2017
  • 12. FUNCTIONAL DEPENDENCIES 12 EmpNum  EmpEmail, EmpFname, EmpLname EmpNum EmpEmail EmpFname EmpLname EmpNum EmpEmail EmpFname EmpLname 8/8/2017
  • 13. DETERMINANT 13 Functional Dependency EmpNum  EmpEmail Attribute on the left hand side is known as the determinant • EmpNum is a determinant of EmpEmail 8/8/2017
  • 14. SECOND NORMAL FORM(2NF) THE OFFICIAL QUALIFICATIONS FOR 2NF ARE: 1. A TABLE IS ALREADY IN 1NF. 2. ALL NONKEY ATTRIBUTES ARE FULLY DEPENDENT ON THE PRIMARY KEY. ALL PARTIAL DEPENDENCIES ARE REMOVED TO PLACE IN ANOTHER TABLE. 128/8/2017
  • 15. CourseID SemesterID Num Student Course Name IT101 201301 25 Database IT101 201302 25 Database IT102 201301 30 Web Prog IT102 201302 35 Web Prog IT103 201401 20 Networking Example of a table not in 2NF: Primary Key The Course Name depends on only CourseID, a part of the primary key not the whole primary {CourseID, SemesterID}.It’s called partial dependency. 15 SECOND NORMAL FORM(2NF) 8/8/2017
  • 16. CourseID Course Name IT101 Database IT101 Database IT102 Web Prog IT102 Web Prog IT103 Networking SemesterDone? Oh no, it is still not in 1NF yet. Remove the repeating groups too. Finally, connect the relationship. CourseID Course Name IT101 Database IT102 Web Prog IT103 Networking CourseID SemesterID Num Student IT101 201301 25 IT101 201302 25 IT102 201301 30 IT102 201302 35 IT103 201401 20 16 SECOND NORMAL FORM(2NF) 8/8/2017
  • 17. THIRD NORMAL FORM (3NF) THE OFFICIAL QUALIFICATIONS FOR 3NF ARE: 1. A TABLE IS ALREADY IN 2NF. 2. NONPRIMARY KEY ATTRIBUTES DO NOT DEPEND ON OTHER NONPRIMARY KEY ATTRIBUTES 178/8/2017
  • 18. StudyID Course Name Teacher Name Teacher Tel 1 Database Sok Piseth 012 123 456 2 Database Sao Kanha 0977 322 111 3 Web Prog Chan Veasna 012 412 333 4 Web Prog Chan Veasna 012 412 333 5 Networking Pou Sambath 077 545 221 Example of a Table not in 3NF: Primary Key 18 THIRD NORMAL FORM (3NF) 8/8/2017
  • 19. Teacher Name Teacher Tel Sok Piseth 012 123 456 Sao Kanha 0977 322 111 Chan Veasna 012 412 333 Chan Veasna 012 412 333 Pou Sambath 077 545 221 Done? Oh no, it is still not in 1NF yet. Remove Repeating row. Teacher Name Teacher Tel Sok Piseth 012 123 456 Sao Kanha 0977 322 111 Chan Veasna 012 412 333 Pou Sambath 077 545 221 Note about primary key: - In theory, you can choose Teacher Name to be a primary key. - But in practice, you should add Teacher ID as the primary key. ID Teacher Name Teacher Tel T1 Sok Piseth 012 123 456 T2 Sao Kanha 0977 322 111 T3 Chan Veasna 012 412 333 T4 Pou Sambath 077 545 221 StudyID Course Name T.ID 1 Database T1 2 Database T2 3 Web Prog T3 4 Web Prog T3 5 Networking T4 198/8/2017
  • 20. JOIN  Join Is A Special Form Of Cross Product Of Two Tables.  In Cartesian Product We Join A Tuple Of One Table With The Tuples Of The Second Table. But In Join There Is A Special Requirement Of Relationship Between Tuples. 8/8/2017 20
  • 21. JOIN TYPES SQL JOIN Inner Join Outer Join Self Join Cross Join Theta Join Equi Join Natural Join Left Outer JOIN Right Outer JOIN Full Outer JOIN 8/8/2017 21
  • 22. INNER JOIN AN INNER JOIN IS THE MOST COMMON JOIN OPERATION USED IN APPLICATIONS AND CAN BE REGARDED AS THE DEFAULT JOIN- TYPE.  INNER JOIN CREATES A NEW RESULT TABLE BY COMBINING COLUMN VALUES OF TWO TABLES (A AND B) BASED UPON THE JOIN-PREDICATE. 8/8/2017 22
  • 23. Θ-JOIN CONSIDER TABLES CAR AND BOAT WHICH LIST MODELS OF CARS AND BOATS AND THEIR RESPECTIVE PRICES.  SUPPOSE A CUSTOMER WANTS TO BUY A CAR AND A BOAT, BUT SHE DOES NOT WANT TO SPEND MORE MONEY FOR THE BOAT THAN FOR THE CAR. 8/8/2017 23
  • 24. EQUI JOIN AN EQUI-JOIN, ALSO KNOWN AS AN EQUIJOIN, IS A SPECIFIC TYPE OF COMPARATOR-BASED JOIN, OR THETA JOIN, THAT USES ONLY EQUALITY COMPARISONS IN THE JOIN-PREDICATE. USING OTHER COMPARISON OPERATORS (SUCH AS <) DISQUALIFIES A JOIN AS AN EQUI-JOIN. 8/8/2017 24
  • 26. NATURAL JOIN NATURAL JOIN ( ) IS A BINARY OPERATOR THAT IS WRITTEN AS (R S) WHERE R AND S ARE RELATIONS.  IN PARTICULAR, NATURAL JOIN ALLOWS THE COMBINATION OF RELATIONS THAT ARE ASSOCIATED BY A FOREIGN KEY. 8/8/2017 26
  • 27. OUTER JOIN  An Outer Join Does Not Require Each Record In The Two Joined Tables To Have A Matching Record. The Joined Table Retains Each Record—even If No Other Matching Record Exists. 8/8/2017 27
  • 28. LEFT OUTER JOIN The Result Of A Left Outer Join (Or Simply Left Join) For Table A And B Always Contains All Records Of The "Left" Table (A), Even If The Join-condition Does Not Find Any Matching Record In The "Right" Table (B). Employee Dept Employee =X Dept 8/8/2017 28
  • 29. LEFT OUTER JOIN EXAMPLE 8/8/2017 29
  • 30. RIGHT OUTER JOIN A RIGHT OUTER JOIN (OR RIGHT JOIN) CLOSELY RESEMBLES A LEFT OUTER JOIN, EXCEPT WITH THE TREATMENT OF THE TABLES REVERSED Employee X= Dept Employee Dept 8/8/2017 30
  • 31. RIGHT OUTER JOIN EXAMPLE 8/8/2017 31
  • 32. FULL OUTER JOIN Conceptually, A Full Outer Join Combines The Effect Of Applying Both Left And Right Outer Joins. Employee =X= Dept Employee Dept 8/8/2017 32
  • 33. FULL OUTER JOIN (EXAMPLE) 8/8/2017 33