You are on page 1of 5

CS54100 Spring 2012 Pre-quiz Turn in by campus mail to CS/LWSN (or better still, directly to the Lawson mailroom)

by 5pm January 17 addressed to Prof. Chris Clifton This is an ungraded quiz - please dont put your name on it. My goal is to learn what the class knows and doesnt know, so I can adjust the pace accordingly. This is an open book exam, but each question is timed - the allotted time is the MAXIMUM you should spend on each question. In other words, you can use the book to look up things you basically know, but I dont want you spending hours learning specics needed to answer a question you dont know. Be honest - otherwise you may nd yourself spending 30 minutes looking up something on a REAL exam that I gured youd already know and be able to do in a minute.

Search Trees (10 minutes)

Given below is a balanced binary search tree.

6 3 2 4 8 9


Search (1 minute)

How long does it take to look up an item in a balanced binary search tree?


Insertion (5 minutes)

Insert item 5 into the tree (you can draw on the above diagram). Is it still a binary search tree? Is it still a balanced binary search tree? If so, discuss why. If not, show how to balance the tree.



Is the above tree a B-tree? If not, how would your answers have been dierent for a B-tree?

Entity-Relationship Model (15 minutes)

Given below is an entity-relationship diagram.

B A X k Y C


What does it mean? (2 minutes)

1. Describe the relationship between A and X.

2. What does the arrow between X, k, and Y mean?


Extend it (2 minutes)

Add an entity set 1, with attribute 2, to the ER diagram. There should be at most one 1 in the data for each instance of a Y .


Convert to Relational (4 minutes)

Give a set of relational tables that represent the same schema as the ER diagram (i.e., labeled with A, B, C, X, Y , and k).



Give SQL statements to generate the relational tables in part 2.3.

Relational Databases (20 minutes)

Conference KDD SIGMOD ICDM SDM Year 2011 2010 2011 2011 Location Conference San Diego Indianapolis ICDM Vancouver SDM Phoenix Conference Sponsor KDD ACM ICDM IEEE ICDE IEEE SDM SIAM SIGMOD ACM

Here are a set of three relational tables. Year 2011 2011 Attendee Chris Clifton Chris Clifton


Simple query (5 minutes)

Give a query that lists the sponsors of conferences Chris Clifton has attended a conference in. Express the query in both 1. SQL, and

2. Relational Algebra



Is the database in Boyce-Codd Normal Form? Third-Normal form? If you would need to know more before answering this question, state what you would need to know and provide a reasonable guess at this information before answering.


Complex query

Give a query that determines the best location if you want your conference to have high attendance, i.e., for each conference, what location gives the highest attendance? Which location does this for the most conferences?