SlideShare a Scribd company logo
1 of 45
Download to read offline
Functional Dependency
• The functional dependency is a relationship that exists between two
attributes. It typically exists between the primary key and non-key
attribute within a table.
X → Y
• The left side of FD is known as a determinant, the right side of the
production is known as a dependent.
For example:
• Assume we have an employee table with attributes: Emp_Id, Emp_Name,
Emp_Address.
• Here Emp_Id attribute can uniquely identify the Emp_Name attribute of
employee table because if we know the Emp_Id, we can tell that
employee name associated with it.
• Functional dependency can be written as:
• Emp_Id → Emp_Name
• We can say that Emp_Name is functionally dependent on Emp_Id.
Types of Functional dependency
1. Trivial functional dependency
A → B has trivial functional dependency if B is a subset of A OR EQUAL TO A
i.e A ⊇ B
The following dependencies are also trivial like: A → A, B → B
Example:
Consider a table with two columns Employee_Id and Employee_Name.
{Employee_id, Employee_Name} → Employee_Id is a trivial functional dep
endency as
Employee_Id is a subset of {Employee_Id, Employee_Name}.
Also, Employee_Id → Employee_Id and Employee_Name → Employee_Na
me are trivial dependencies too.
2. Non-trivial functional dependency
• A → B has a non-trivial functional dependency if B is not a subset of A.
• When A intersection B is NULL i.e. A∩B=Ф then A → B is called as
complete non-trivial.
Example:
• ID → Name,
• Name → DOB
3.Semi Non trivial functional dependency
Employee_Id → Employee_Id Employee_Name
Employee_Id → Employee_Id Employee_Id → Employee_Name
Inference Rule (IR):
• The Armstrong's axioms are the basic inference rule.
• Armstrong's axioms are used to conclude functional dependencies on a
relational database.
• The inference rule is a type of assertion. It can apply to a set of
FD(functional dependency) to derive other FD.
• Using the inference rule, we can derive additional functional dependency
from the initial set.
• The Functional dependency has 6 types of inference rule:
• 1. Reflexive Rule (IR1
)
• In the reflexive rule, if Y is a subset of X, then X determines Y.
• If X ⊇ Y then X → Y
• Example:
2. Augmentation Rule (IR2
)
• The augmentation is also called as a partial dependency. In augmentation,
if X determines Y, then XZ determines YZ for any Z.
• If X → Y then XZ → YZ
Example:
• For R(ABCD), if A → B then AC → BC
3. Transitive Rule (IR3
)
• In the transitive rule, if X determines Y and Y determine Z, then X must
also determine Z.
• If X → Y and Y → Z then X → Z
4. Union Rule (IR4
)
• Union rule says, if X determines Y and X determines Z, then X must also
determine Y and Z.
• If X → Y and X → Z then X → YZ
5. Decomposition Rule (IR5
)
• Decomposition rule is also known as project rule. It is the reverse of union
rule.
• This Rule says, if X determines Y and Z, then X determines Y and X
determines Z separately.
• If X → YZ then X → Y and X → Z
Proof:
1. X → YZ (given)
2. YZ → Y (using IR1
Rule)
3. X → Y (using IR3
on 1 and 2)
6. Pseudo transitive Rule (IR6
)
• In Pseudo transitive Rule, if X determines Y and YZ determines W, then XZ
determines W.
• If X → Y and YZ → W then XZ → W
Proof:
1. X → Y (given)
2. WY → Z (given)
3. WX → WY (using IR2
on 1 by augmenting with W)
4. WX → Z (using IR3
on 3 and 2)
Relational Decomposition
• When a relation in the relational model is not in appropriate
normal form then the decomposition of a relation is required.
• In a database, it breaks the table into multiple tables.
• If the relation has no proper decomposition, then it may lead to
problems like loss of information.
• Decomposition is used to eliminate some of the problems of bad
design like anomalies, inconsistencies, and redundancy.
Types of Decomposition
1.Lossless Decomposition
2.Dependency Preserving
Dependency Preserving
• It is an important constraint of the database.
• In the dependency preservation, at least one decomposed
table must satisfy every dependency.
• If a relation R is decomposed into relation R1 and R2, then the
dependencies of R either must be a part of R1 or R2 or must
be derivable from the combination of functional
dependencies of R1 and R2.
• For example, suppose there is a relation R (A, B, C, D) with
functional dependency set (A->BC). The relational R is
decomposed into R1(ABC) and R2(AD) which is dependency
preserving because FD A->BC is a part of relation R1(ABC).
Lossless Decomposition
• If the information is not lost from the relation that is decomposed,
then the decomposition will be lossless.
• The lossless decomposition guarantees that the join of relations will
result in the same relation as it was decomposed.
• The relation is said to be lossless decomposition if natural joins of
all the decomposition give the original relation.
Example:
EMPLOYEE_DEPARTMENT table:
EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME
22 Denim 28 Mumbai 827 Sales
33 Alina 25 Delhi 438 Marketing
46 Stephan 30 Bangalore 869 Finance
52 Katherine 36 Mumbai 575 Production
60 Jack 40 Noida 678 Testing
The above relation is decomposed into two relations EMPLOYEE and DEPARTMENT
EMPLOYEE table:
EMP_ID EMP_NAME EMP_AGE EMP_CITY
22 Denim 28 Mumbai
33 Alina 25 Delhi
46 Stephan 30 Bangalore
52 Katherine 36 Mumbai
60 Jack 40 Noida
DEPARTMENT table:
DEPT_ID EMP_ID DEPT_NAME
827 22 Sales
438 33 Marketing
869 46 Finance
575 52 Production
• Now, when these two relations are joined on the common column
"EMP_ID", then the resultant relation will look like:
• Employee ⋈ Department
EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME
22 Denim 28 Mumbai 827 Sales
33 Alina 25 Delhi 438 Marketing
46 Stephan 30 Bangalore 869 Finance
52 Katherine 36 Mumbai 575 Production
60 Jack 40 Noida 678 Testing
Hence, the decomposition is Lossless join decomposition.
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf

More Related Content

What's hot

Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningeVideoTuition
 
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
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries InformationNishant Munjal
 
Difference between File system And DBMS.pptx
Difference between File system And DBMS.pptxDifference between File system And DBMS.pptx
Difference between File system And DBMS.pptxShayanMujahid2
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidancewahab13
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 
Types of Database Models
Types of Database ModelsTypes of Database Models
Types of Database ModelsMurassa Gillani
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptxAnusha sivakumar
 
Database administrator
Database administratorDatabase administrator
Database administratorTech_MX
 
Type of Database Management System
Type of Database Management SystemType of Database Management System
Type of Database Management SystemParam Radadiya
 
Chapter-1 Introduction to Database Management Systems
Chapter-1 Introduction to Database Management SystemsChapter-1 Introduction to Database Management Systems
Chapter-1 Introduction to Database Management SystemsKunal Anand
 

What's hot (20)

DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
Join dependency
Join dependencyJoin dependency
Join dependency
 
Database recovery
Database recoveryDatabase recovery
Database recovery
 
Normalisation and anomalies
Normalisation and anomaliesNormalisation and anomalies
Normalisation and anomalies
 
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
 
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
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
EER modeling
EER modelingEER modeling
EER modeling
 
Difference between File system And DBMS.pptx
Difference between File system And DBMS.pptxDifference between File system And DBMS.pptx
Difference between File system And DBMS.pptx
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Advantages of DBMS
Advantages of DBMSAdvantages of DBMS
Advantages of DBMS
 
Types of Database Models
Types of Database ModelsTypes of Database Models
Types of Database Models
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
Normalization
NormalizationNormalization
Normalization
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Database administrator
Database administratorDatabase administrator
Database administrator
 
Type of Database Management System
Type of Database Management SystemType of Database Management System
Type of Database Management System
 
Chapter-1 Introduction to Database Management Systems
Chapter-1 Introduction to Database Management SystemsChapter-1 Introduction to Database Management Systems
Chapter-1 Introduction to Database Management Systems
 

Similar to DBMS 3.pdf

Normalization.pdf
Normalization.pdfNormalization.pdf
Normalization.pdfabhijose1
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancyVisakh V
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization TechniquesNishant Munjal
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management SystemDrishti Bhalla
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management SystemKevin Jadiya
 
functional dependency in engineering.pptx
functional dependency in engineering.pptxfunctional dependency in engineering.pptx
functional dependency in engineering.pptxamanchouhan9917
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational databaseJyoti Ranjan Pattnaik
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdfShivani139202
 
normalization ppt.pptx
normalization ppt.pptxnormalization ppt.pptx
normalization ppt.pptxAbdusSadik
 

Similar to DBMS 3.pdf (20)

Functional Dependency.pptx
Functional  Dependency.pptxFunctional  Dependency.pptx
Functional Dependency.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Normalization.pdf
Normalization.pdfNormalization.pdf
Normalization.pdf
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
 
Unit 3 dbms
Unit 3 dbmsUnit 3 dbms
Unit 3 dbms
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization Techniques
 
UNIT-IV.ppt
UNIT-IV.pptUNIT-IV.ppt
UNIT-IV.ppt
 
DBMS.ppt
DBMS.pptDBMS.ppt
DBMS.ppt
 
Normalization
NormalizationNormalization
Normalization
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
 
ch7-clean.ppt
ch7-clean.pptch7-clean.ppt
ch7-clean.ppt
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
Normalisation
NormalisationNormalisation
Normalisation
 
functional dependency in engineering.pptx
functional dependency in engineering.pptxfunctional dependency in engineering.pptx
functional dependency in engineering.pptx
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational database
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdf
 
normalization ppt.pptx
normalization ppt.pptxnormalization ppt.pptx
normalization ppt.pptx
 
DBMS unit-3.pdf
DBMS unit-3.pdfDBMS unit-3.pdf
DBMS unit-3.pdf
 
DBMS 3.pdf
DBMS 3.pdfDBMS 3.pdf
DBMS 3.pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 

Recently uploaded (20)

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

DBMS 3.pdf

  • 1. Functional Dependency • The functional dependency is a relationship that exists between two attributes. It typically exists between the primary key and non-key attribute within a table. X → Y • The left side of FD is known as a determinant, the right side of the production is known as a dependent. For example: • Assume we have an employee table with attributes: Emp_Id, Emp_Name, Emp_Address. • Here Emp_Id attribute can uniquely identify the Emp_Name attribute of employee table because if we know the Emp_Id, we can tell that employee name associated with it. • Functional dependency can be written as: • Emp_Id → Emp_Name • We can say that Emp_Name is functionally dependent on Emp_Id.
  • 2.
  • 3. Types of Functional dependency 1. Trivial functional dependency A → B has trivial functional dependency if B is a subset of A OR EQUAL TO A i.e A ⊇ B The following dependencies are also trivial like: A → A, B → B Example: Consider a table with two columns Employee_Id and Employee_Name. {Employee_id, Employee_Name} → Employee_Id is a trivial functional dep endency as Employee_Id is a subset of {Employee_Id, Employee_Name}. Also, Employee_Id → Employee_Id and Employee_Name → Employee_Na me are trivial dependencies too.
  • 4. 2. Non-trivial functional dependency • A → B has a non-trivial functional dependency if B is not a subset of A. • When A intersection B is NULL i.e. A∩B=Ф then A → B is called as complete non-trivial. Example: • ID → Name, • Name → DOB 3.Semi Non trivial functional dependency Employee_Id → Employee_Id Employee_Name Employee_Id → Employee_Id Employee_Id → Employee_Name
  • 5.
  • 6. Inference Rule (IR): • The Armstrong's axioms are the basic inference rule. • Armstrong's axioms are used to conclude functional dependencies on a relational database. • The inference rule is a type of assertion. It can apply to a set of FD(functional dependency) to derive other FD. • Using the inference rule, we can derive additional functional dependency from the initial set. • The Functional dependency has 6 types of inference rule: • 1. Reflexive Rule (IR1 ) • In the reflexive rule, if Y is a subset of X, then X determines Y. • If X ⊇ Y then X → Y • Example:
  • 7. 2. Augmentation Rule (IR2 ) • The augmentation is also called as a partial dependency. In augmentation, if X determines Y, then XZ determines YZ for any Z. • If X → Y then XZ → YZ Example: • For R(ABCD), if A → B then AC → BC 3. Transitive Rule (IR3 ) • In the transitive rule, if X determines Y and Y determine Z, then X must also determine Z. • If X → Y and Y → Z then X → Z 4. Union Rule (IR4 ) • Union rule says, if X determines Y and X determines Z, then X must also determine Y and Z. • If X → Y and X → Z then X → YZ
  • 8. 5. Decomposition Rule (IR5 ) • Decomposition rule is also known as project rule. It is the reverse of union rule. • This Rule says, if X determines Y and Z, then X determines Y and X determines Z separately. • If X → YZ then X → Y and X → Z Proof: 1. X → YZ (given) 2. YZ → Y (using IR1 Rule) 3. X → Y (using IR3 on 1 and 2) 6. Pseudo transitive Rule (IR6 ) • In Pseudo transitive Rule, if X determines Y and YZ determines W, then XZ determines W. • If X → Y and YZ → W then XZ → W Proof: 1. X → Y (given) 2. WY → Z (given) 3. WX → WY (using IR2 on 1 by augmenting with W) 4. WX → Z (using IR3 on 3 and 2)
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Relational Decomposition • When a relation in the relational model is not in appropriate normal form then the decomposition of a relation is required. • In a database, it breaks the table into multiple tables. • If the relation has no proper decomposition, then it may lead to problems like loss of information. • Decomposition is used to eliminate some of the problems of bad design like anomalies, inconsistencies, and redundancy. Types of Decomposition 1.Lossless Decomposition 2.Dependency Preserving
  • 23.
  • 24. Dependency Preserving • It is an important constraint of the database. • In the dependency preservation, at least one decomposed table must satisfy every dependency. • If a relation R is decomposed into relation R1 and R2, then the dependencies of R either must be a part of R1 or R2 or must be derivable from the combination of functional dependencies of R1 and R2. • For example, suppose there is a relation R (A, B, C, D) with functional dependency set (A->BC). The relational R is decomposed into R1(ABC) and R2(AD) which is dependency preserving because FD A->BC is a part of relation R1(ABC).
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. Lossless Decomposition • If the information is not lost from the relation that is decomposed, then the decomposition will be lossless. • The lossless decomposition guarantees that the join of relations will result in the same relation as it was decomposed. • The relation is said to be lossless decomposition if natural joins of all the decomposition give the original relation. Example: EMPLOYEE_DEPARTMENT table: EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME 22 Denim 28 Mumbai 827 Sales 33 Alina 25 Delhi 438 Marketing 46 Stephan 30 Bangalore 869 Finance 52 Katherine 36 Mumbai 575 Production 60 Jack 40 Noida 678 Testing
  • 30. The above relation is decomposed into two relations EMPLOYEE and DEPARTMENT EMPLOYEE table: EMP_ID EMP_NAME EMP_AGE EMP_CITY 22 Denim 28 Mumbai 33 Alina 25 Delhi 46 Stephan 30 Bangalore 52 Katherine 36 Mumbai 60 Jack 40 Noida DEPARTMENT table: DEPT_ID EMP_ID DEPT_NAME 827 22 Sales 438 33 Marketing 869 46 Finance 575 52 Production
  • 31. • Now, when these two relations are joined on the common column "EMP_ID", then the resultant relation will look like: • Employee ⋈ Department EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME 22 Denim 28 Mumbai 827 Sales 33 Alina 25 Delhi 438 Marketing 46 Stephan 30 Bangalore 869 Finance 52 Katherine 36 Mumbai 575 Production 60 Jack 40 Noida 678 Testing Hence, the decomposition is Lossless join decomposition.