Skip to main content

Relational Decomposition

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

Relational Decomposition


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

678

60

Testing



Now, when these two relations are joined on the common column "EMP_ID", then the resultant relation will look like this:

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.

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).

Comments

Popular posts from this blog

DBMS Keys

DBMS Keys KEYS in DBMS is an attribute or set of attributes which helps you to identify a row (tuple) uniquely in a relation(table). They allow you to find the relation between two tables. Keys help you uniquely identify a row in a table by a combination of one or more columns in that table. Key is also helpful for finding unique record or row from the table. Database key is also helpful for finding unique record or row from the table. Example: Employee ID FirstName LastName 11 Andrew Johnson 22 Tom Wood 33 Alex Hale In the above-given example, employee ID is a primary key because it uniquely identifies an employee record. In this table, no other employee can have the same employee ID. Here are some reasons for using sql key in the DBMS system. Keys help you to identify any row of data in a table. In a real-world application, a table could contain thousands of records. Moreover, the records could be duplicated. Keys in RDBMS ensure that you can uniquely identify a table record despite ...

Mathematical Symbols

Mathematical Symbols (Source: Google Images) Basic mathematical symbols with name, meaning, and examples : The basic mathematical symbols used in Mathematics help us to work with mathematical concepts in a theoretical way. In simple words, without symbols, we cannot do mathematics. Mathematical signs and symbols are considered representative of value. The basic symbols in mathematics are used to express mathematical thoughts.  The relationship between sign and value refers to the fundamental need of mathematics. With the help of symbols, certain concepts and ideas are clearly explained. Here is a list of commonly used math symbols with names and meanings. In addition, an example is provided to understand the use of mathematical symbols. Symbol Symbol Name in Maths Math Symbols Meaning Example ≠ not equal sign inequality 10 ≠ 6 = equal sign equality 3 = 1 + 2 < strict inequality less than 7 < 10 > strict inequality greater than 6 > 2 ≤ inequality less than or equal to x ...

Computer Full Forms

COMPUTER - full form or meaning is :  Common Operating Machine Purposely Used for Technological and Educational Research. COMPUTER ABBREVIATIONS CPU - Central Processing Unit RAM - Random Access Memory ROM - Read Only Memory PROM - Programmable Read Only Memory EPROM - Erasable PROM EEPROM - Electrically EPROM HDD - Hard Disk Drive FDD - Floppy Disk Drive KBD - KeyBoard I/O - Input & Output CD - Compact Disk DVD - Digital Video Disk SMPS - Switch Mode Power Supply POST - Power ON Self Test BIOS - Basic Input Output System VDU - Visible Display Unit LED - Light Embedded Diode LCD - Liquid Crystal Display USB - Universal Serial Bus VGA - Video/Visual Graphic Adapter LAN - Local Area Network WAN - Wide Area Network MAN - Metropolitan Area Network HLL - High-Level Language LLL - Low-Level Language MIPS - Million of Instruction Per Second Mbps - Mega Bytes Per second Kbps - Kilo Bytes per second HTTP - Hyper Text Templates WWW - World Wide Web IP - Int...