

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A database theory midterm exam from the university of california, berkeley, cs 186 course in spring 1994. The exam covers topics such as functional dependencies, normalization, and relational database design. Students are required to solve problems related to hierarchical databases, relational database schemes, and functional dependencies.
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Suppose you are database administrator at a large university that is (still) using a hierarchical database system. You have chosen the following scheme to represent information about its faculty, students, departments, and courses.
Let R denote a relational database scheme and F a set of functional dependencies defined on R. Furthermore, let G denote a minimal cover of F. (a) Prove that any attribute that does not appear in any functional dependency in G belongs to every key of R. (b) Prove that if there is a functional dependency in the minimal cover G in which all attributes of R appear, then R is in third normal form with respect to F.
Give an example for a relational database scheme R and a set F of functional dependencies defined on R , such that (i) R is not in third normal form (3NF) with respect to F , and (ii) there are at least two ways to decompose R into a minimum number of relations R1,...,Rk such that each Ri is in 3NF with respect to the corresponding projection of F , and the decomposition has a lossless join and preserves dependencies. Give at least two of the possible 3NF-decompositions.
Consider the relational database scheme R = ABCD with a set of functional dependencies F:={AB -> C, BC -> D}. (a) Give all candidate keys for R (with respect to F). (b) Show that R is not in 3NF (with respect to F). (c) Find a 3NF-decomposition of R that has a lossless join, preserves dependencies, and consists of a
CS 186, Midterm, Spring 1994
CS 186 Spring 1994 Midterm Professor Gunther A. Vahdat 1
minimum number of relations. (d) Is G:={AB -> C, AB -> D} a minimal cover of F? Prove your answer.
Give an example of a view built on the relation EMP(name, salary, age, dept, manager) and two updates for that view which cannot be unambiguously translated to updates on the underlying base relation. Credit will be awarded proportional to the complexity of your examples.
Consider the relations
HOUSE(house-id, h-address, h-age) PERSON(person-id, p-name, p-age) OWNS(house-id, person-id) LIVES-IN(house-id, person-id)
with the condition that a person can live in and own multiple houses. Write SQL queries for the following tasks. Credit will be awarded inversely proportional to the complexity of your queries. (a) Find the names of people who are part or full owners of at least one of the houses in which they live. (b) Find the name of the person who owns the most houses. (c) Find the names of the people who do not live anywhere. (d) Find the names of all people who live in a house which is the same age as the person's age.
CS 186, Midterm, Spring 1994
Problem #4 (15 Credits) 2