5) Answer the following questions about the schema instance below (100 points) A
ID: 3746029 • Letter: 5
Question
5) Answer the following questions about the schema instance below (100 points) A) List the functional dependencies that might hold B) List the candidate keys C) List update, insertion, and deletion anomalies associated with this schema Model Accord Accord Accord S2000 Civic Civic M3 M3 330ci E500 ML500 Make Honda Honda Honda Honda Honda Honda BMW BMW BMW Mercedes Luxu Mercedes SUV Sedan Coupe Sedan Sports Cou Compact Sports Sports Compact Color Black Blue Green Gre White Red Blue Black Black Gre Black Countr Japan Japan Japan Japan Japan Japan German German German German German Year 1999 2000 2001 2000 2003 2003 2002 2003 2003 2003 2004 Expensive No No No Yes No No Yes Yes No Yes Yes GRADUATE STUDENT QUESTION (100 points): Generate the closure of the following set F of functional dependencies for relation schema R C,D E E-A (A, B, C, D, E) List the candidate keys for R (show ALL steps needed to get here)Explanation / Answer
1)
A) For the functional dependency to hold one attribute should uniquely identify the other attribute that is if X->Y is the functional dependency the value of Y that is corresponding to value of X is unique.
From the above table we can derive the following functional dependencies
Model->Make,
For every value of model the value of Make value is unique that is
Accord->Honda
Civic->Honda ..etc
Next Fd is Model->Country
Model->Expensive
Model,Color->Year
B) From the above functional dependencies there exists only one candidate key
Candidate key is a minimal superkey which can unquiely identify the attributes of relation
Closure of a candidate key should contain every attribute of a table
So {Model,Color,Type} is the candidate key for the above relation .
C) Update Anamoly is anamoly undesired condition in an database that results due to partial update
In the above table if we want to update Model value in the above table we have to make sure that the Model->Make .If we want to update Make attribute corresponding to Model accord attribute then it should be updated thrice.
Model->Country is also one of the functional dependency which can result in Update anamoly it not updated properly.
Similarily Model->Expensive also
Insertion anamoly is inappropriate insertion of the data items into the schema.for example the insertion into Make attribute column will not allowed until it has a Model attribute.These are the fds that result in insertiona anamoly.
Model->Make,Model->Expensive,Model->Country.
Deletion anamoly is unusual loss of data due to deletion of other data .To eliminate this we either Cascade or Set null to other attributes.If we delete a model Accord then the values corresponding to that values of the functional of that attribute should either be set Null or cascade these are the fds that result in Deletion anamoly.
Model->Make,Model->Expensive,Model->Country.
2)Here R=(A,B,C,D,E)
To determine the Candidate keys fro any schema first of all we have to find the closure of every attribute .closure of any attribute can be derived using Fds that is the attributes that are functionally depending on that attribute
Here
Closure of A={B,C,D,E,A} This is one of the Candidate key because it can obtain every attribute in the given schema
Closure of CD={C,D,E,A,B} this is also a candidate key to the given schema
Closure of BE={B,E,D,A,B} this is another candidate key
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.