Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Natalia Vanetik
December 21, 2010
SELECT SUM(S.sales)
FROM Sales S
1
2 Question [RG] 25.3 (3)
Consider the table in Figure 25.5. (3) Show the result of roll-up on locid
followed by drill-down on pid.
Roll-up on locid.
timeid total
1995 144
1996 145
1997 110
Drill-down of the above table on pid :
timeid pid sales
1 11 70
1 12 56
1 13 28
2 11 30
2 12 40
2 13 60
3 11 25
3 12 70
3 13 15
2
time (scanning leaf level of a B+-tree is cheaper than scanning the entire
relation).
3
A simple index connecting locid and the city name will also help if we do not
wish to access the tuples of Locations relation at all.
SELECT MAX(N.numres)
FROM NumReservations N