F of functional dependencies. 1. Create an initial matrix S with one row for each relation Ri in D, and one column for each attribute Aj in R. 2. Set S(i,j)= bij for all matrix entries.( Note that each bij is a distinct symbol associated with indices (i,j) ). 3. For each row i representing relation schema Ri For each column j representing attribute Aj IF the relation Ri includes attribute Aj then set S(i,j)= aj. ( Note that aj is a distinct symbol associate

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

How to code in Python or Java below

Algorithm # 10 General Algorithm for Testing Loosless Join Decomposition
Input: A universal relation R, a decomposition D={R1,R2,...Rm}
of R , and a set F of functional dependencies.
1. Create an initial matrix S with one row for each relation Ri
in D, and one column for each attribute Aj in R.
2. Set S(i,j)= bij for all matrix entries.( Note that each bij is
a distinct symbol associated with indices (i,j) ).
3. For each row i representing relation schema Ri
For each column j representing attribute Aj
IF the relation Ri includes attribute Aj then set S(i,j)= aj.
( Note that aj is a distinct symbol associated with index j)
4. Repeat the following loop until a complete loop execution results in no changes to S
For each functional dependency X→Y in F
For all rows in S that have the same symbols in the columns corresponding to
attributes in X.
Make the symbols in each column that correspond to an
attribute in Y be the same in all these rows as follows:
▪ If any of the rows has an “a” symbol for the column,
set the other rows to that same “a” symbol in the column.

▪If no “a” symbol exists for the attribute in any of the rows,

choose one of the “b” symbols that appears in one of the
rows for the attribute and set the other rows to that same “b”
symbol in the column.
5. If a row made up entirely of “a” symbols, then the decomposition has looless join
property ; otherwise , it does not.

Please help me to code this with running code output.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Data Recovery Approaches
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education