• Keine Ergebnisse gefunden

Relational Databases 2 Exercise Sheet 6

N/A
N/A
Protected

Academic year: 2021

Aktie "Relational Databases 2 Exercise Sheet 6"

Copied!
3
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Relational Databases 2

Exercise Sheet 6

Exercise 1.

Assume the relations given in Appendix A. Draw a canonical operator tree for following queries and denote the number of rows of the intermediate result sets of each operation in the tree:

a) SELECT firstname, lastname FROM students WHERE sex=’f’

b) SELECT s.firstname, s.lastname, r.result, c.title FROM students s, results r, courses c WHERE s.matNr=r.matNr AND r.crsNr=c.crsNr AND c.crsNr=100

c) A query for creating a list of aliases and the according first names and last names.

Exercise 2.

Assume the relations given in Appendix A.

a) Rewrite query c) from exercise 1 using Algebraic Transformation Rules in such a way that the intermediate results are reduced significantly. Please mark which rule you used and draw the resulting operator tree annotated with the new rows per intermediate result count.

b) Discuss where and why pipelining could be used in your result.

Exercise 3.

Assume the relations given in Appendix B. You want to retrieve all actors of the movie “Metropolis”.

a) Create an SQL query for performing that task and draw the canonical operator tree.

b) Give your best estimation for the size of each intermediate result set in the operator tree in such a way that it is clear how you reached to that result.

c) Give your best estimation for the necessary number of block accesses to perform the query.

Exercise 4.

Assume the relations given in Appendix B. You want to retrieve all actors off all movies of type

“cinema movie” released after 1980.

a) Create an SQL query for performing that task and draw the canonical operator tree.

b) Give your best estimation for the size of each intermediate result set in the operator tree in such a way that it is clear how you reached to that result.

c) Give your best estimation for the necessary number of block accesses to perform the query.

d) Discuss the effect of creating a secondary index on title.production_year.

(2)

Appendix A

(3)

Appendix B

Referenzen

ÄHNLICHE DOKUMENTE

c) Describe briefly the 3 phases of ARIES. d) What does steal/no-steal and force/no-force mean with regard to buffer management for

Considering a large company: Would they prefer role-based access control or discretionary access control.. Please explain

Provide an example on how perturbation-based techniques can improve statistical database

What are the main steps that need to be processed in order to answer a user’s query.. What needs to be optimized in

Exercises will be discussed on Friday on week after the respective lecture was given. The handouts are optional and do not have to be handed in. They only serve as optional

actor(person → Person, movie → Movie, role) director(person → Person, movie → Movie) hasGenre(movie → Movie, genre → Genre) connection(from → Movie, to → Movie, type)..

CREW(movie, person not null , type not null , creditpos) REMARK(movie, person not null , remark not null ) GENRE(movie, genre not null )b. COUNTRY(movie, country not

“Matrikelnummer” on your solutions. Please note: all exercises are optional. Draw a canonical operator tree for following queries and denote the number of rows of the