Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

GALERO, REANNE ADVANCED DATABASE SYSTEMS

BT502 MS. BARTOLOME

11/08/20

a
04 LABORATORY EXERCISE

vi
ROLLUP AND CUBE

d
1. Open the

e
text file

ar
named
Data_Insert

sh
1. Execute
the following
commands

as
by copying
the contents
of the file

w
and pasting
it to the
query

m e
section of
the website
then click co rc
o. ou
Run. The
commands
that have
er res
been
executed will
automatically
insert the
se dy

data that will


be used for
this exercise.
ur tu

See the table


below.
s
H
is
Th

This study source was downloaded by 100000822044607 from CourseHero.com on 11-18-2021 09:22:12 GMT -06:00
2. Using the
ROLLUP
operator,
write
queries that
will

a
compute

vi
the total
amount of
the items

d
purchased

e
per brand

ar
and its
grand total.

sh
See the
output
below.

as
w
m e
co rc
o. ou
er res
se dy
ur tus
H
is
Th

This study source was downloaded by 100000822044607 from CourseHero.com on 11-18-2021 09:22:12 GMT -06:00
3. Using the
ROLLUP
operator,
write
queries that
will

a
compute all

vi
the item
purchased
per brand

d
and per

e
month, as

ar
well as its
grand total

sh
of all
purchased
items in all

as
date.

w
m e
co rc
o. ou
er res
se dy
ur tus
H
is
Th

This study source was downloaded by 100000822044607 from CourseHero.com on 11-18-2021 09:22:12 GMT -06:00
a
vi
de
ar
sh
as
w
m e
co rc
o. ou
er res
se dy
ur tus
H
is
Th

This study source was downloaded by 100000822044607 from CourseHero.com on 11-18-2021 09:22:12 GMT -06:00
4. Using the
CUBE
operator,
write queries
that will do
the following:

a
vi
Display
the item

d
purchase

e
d per

ar
brand
and its

sh
month.
Compute
the

as
grand
total per
brand,

w
and the
grand

m e
total for
all items.
Displ co rc
o. ou
ay
the
total
er res

amou
nt of
all
items
se dy

purch
ased
ur tu

each
mont
s

h.
H
is
Th

This study source was downloaded by 100000822044607 from CourseHero.com on 11-18-2021 09:22:12 GMT -06:00
See
the
outpu
t
below
.

a
vi
de
ar
sh
as
w
m e
co rc
o. ou
er res
se dy
ur tus
H
is
Th

This study source was downloaded by 100000822044607 from CourseHero.com on 11-18-2021 09:22:12 GMT -06:00
Powered by TCPDF (www.tcpdf.org)

You might also like