Material Type: Assignment;
Professor: Hua;
Class: Database Systems;
Subject: Computer Programming;
University: University of Central Florida;
Term: Unknown 1989;
Download Homework #5 with Resolution - Database Systems | COP 4710 and more Assignments Deductive Database Systems in PDF only on Docsity!
HOMEWORK #
HOMEWORK #5 Exercise 19.2 Consider a relation # with five attributes ABCDE. You are given the following dependencies: A — B, BC — E, and ED — A 1. List all keys for R. 2. Is Rin 3NF? 3. Is Rin BCNF? Answer 19.2 1. CDE, ACD, BCD 2. Ris in 3NF because B, E and A are all parts of keys. 3. Bis not in BCNF because none of A, BC and ED contain a key. Exercise 19.4 Assume that you are given a relation with attributes ABCD 1. Assume that no record has NULL values. Write an SQL query that checks whether the functional dependency A — B holds. 2. Assume again that no record has NULL values. Write an SQL assertion that enforces the functional dependency A — B. 3. Let us new assume that records could have NULL values. Repeat the previous two questions under this assumption. Answer 19.4 Assuming... 1. The following statement returns 0 if no statement violates the FD A — B. SELECT COUNT (*) FROM RAS RI, RAS R2 WHERE (RIB !=R2.B) and (RLA = R2.A) 2, CREATE ASSERTION ADeterminesE CHECK ((SELECT count (*) FROM) «RAS RI, RAS R2 WHERE (R1.B != R2.B) anp (R1.A = R2.A)) =0)