





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
Material Type: Exam; Professor: Chang; Class: Database Systems; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2010;
Typology: Exams
1 / 9
This page cannot be seen from the preview
Don't miss anything!






Problem 1 (36 points) Misc. Concepts
For each of the following statements:
You will get 3point for each correct answer with correct explanations, and no penalty (of negative points) for wrong answers.
(1) Answer: T rue F alse An E-R diagram with m entities and n relationships will translate to m+n tables.
⇒ Explain:
(2) Answer: T rue F alse A table with two attributes, such as R(A, B), must be in BCNF.
⇒ Explain:
(3) Answer: T rue F alse An SQL query can often be translated into multiple relational algebra expressions.
⇒ Explain:
(4) Give a relation that is in 3NF but not in BCNF.
⇒ Answer&Explain:
(5) Answer: T rue F alse In relational algebra, join is a derived operator.
⇒ Explain:
(11) For the above relation R(A, B, C, D), write a relational algebra expression to return the lowest value of D.
⇒ Answer&Explain:
(12) What is the result of the following query, for the above relation R(A, B, C, D)?
select A, B from R where C > (select D from R where A = 3)
⇒ Answer&Explain:
Problem 2 (28 points) Database Design
You have been asked to design a database for the university administration, which records the following information:
(a) Draw an ER diagram for this application. Be sure to mark the multiplicity of each relationship of the diagram. Decide the key attributes and identify them on the diagram. Please state all assumptions you make in your answers. (16 points)
Problem 3 (18 points) Relational Algebra
Nowadays, web search engine is widely used by people all over the world to find useful information. To analyze users’ search behaviors, a query log stores the history of users’ queries and clicked URLs.
There are two relations in a query log:
For both Request and Click relation, the attributes (T ime, U serID) forms the only key which implies one user can request only one query or click on only one URL each time.
Example instances of these two relations are given here:
Request Relation Time UserID Query Results 2010-02-12 19:00:00 U001 NBC 100 2010-02-12 19:01:00 U001 NBC Olympics 50 2010-02-12 18:54:00 U002 NBC 2010 80 2010-02-13 09:00:05 U001 Olympics wiki 70 2010-02-15 19:27:08 U003 Olympics 2010 medals 5 2010-02-16 13:24:45 U004 NBC Olympics 50 2010-02-16 13:25:55 U004 Vancouver 2010 95 2010-02-16 17:11:56 U002 NBC 2010 80 2010-02-20 20:13:45 U005 Olympics ski 54 2010-02-20 20:45:34 U005 Olympics Austria medals 7
Click Relation QueryID UserID Query URL 2010-02-12 19:01:06 U001 NBC Olympics www.nbcolympics.com 2010-02-12 19:01:34 U001 NBC Olympics www.nbcolympics.com/video 2010-02-12 18:54:01 U002 NBC 2010 www.nbcolympics.com 2010-02-15 19:27:22 U003 Olympics 2010 medals www.vancouver2010.com 2010-02-15 19:29:01 U003 Olympics 2010 medals www.vancouver2010.com/olympic-medals/ 2010-02-16 13:25:58 U004 Vancouver 2010 www.vancouver2010.com 2010-02-16 17:12:56 U002 NBC 2010 www.nbcolympics.com 2010-02-20 20:14:00 U005 Olympics ski www.usskiteam.com 2010-02-20 20:45:40 U005 Olympics Austria medals en.wikipedia.org/wiki/Austria at the Olympics 2010-02-20 20:45:50 U005 Olympics Austria medals www.vancouver2010.com
Note that not all the queries have corresponding clicked URLs since a user might not be interested in any returned URL. Sometimes user may click on multiple URLs using one query.
Though different from the actual case, you can assume that the number of returned search results associated with the same query doesn’t change no matter when and who request this query.
Answer the following queries using relational algebra. Your answer should work for any instance of the database, not just this one.
(a) List all the queries that do not have any corresponding URL. (8 points)
(b) List all the queries that have been requested by different users. (10 points)