Anda di halaman 1dari 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

1.1

Search (1 minute)

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

1.2

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.

1.3

B-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

2.1

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?

2.2

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 .

2.3

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).

2.4

SQL DDL

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

3.1

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

3.2

Normalization

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.

3.3

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?

Anda mungkin juga menyukai