Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following query select item_name, color, clothes_size, sum(quantity) from sa

ID: 3720451 • Letter: T

Question

The following query

select item_name, color, clothes_size, sum(quantity)

from sales

group by cube (item_name, color)

could be written as:

select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, sum(quantity)

from sales

group by item_name
union

select color, sum(quantity)

from sales

group by color


select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, sum(quantity)

from sales

group by item_name
union

select color, sum(quantity)

from sales

group by color
union

select sum(quantity)

from sales


select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, color, sum(quantity)

from sales

group by item_name
union

select item_name, color, sum(quantity)

from sales

group by color


select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, color, sum(quantity)

from sales

group by item_name
union

select item_name, color, sum(quantity)

from sales

group by color
union

select item_name, color, sum(quantity)

from sales

select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, sum(quantity)

from sales

group by item_name
union

select color, sum(quantity)

from sales

group by color


select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, sum(quantity)

from sales

group by item_name
union

select color, sum(quantity)

from sales

group by color
union

select sum(quantity)

from sales


select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, color, sum(quantity)

from sales

group by item_name
union

select item_name, color, sum(quantity)

from sales

group by color


select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, color, sum(quantity)

from sales

group by item_name
union

select item_name, color, sum(quantity)

from sales

group by color
union

select item_name, color, sum(quantity)

from sales

Explanation / Answer

The following query

select item_name, color, clothes_size, sum(quantity)

from sales

group by cube (item_name, color)

could be written as:

select item_name, color, sum(quantity)

from sales

group by item_name, color
union

select item_name, color, sum(quantity)

from sales

group by item_name
union

select item_name, color, sum(quantity)

from sales

group by color
union

select item_name, color, sum(quantity)

from sales

Option 4 correct.