Data Science & Big Data Analy

Are you pressed for time and haven’t started working on your assignment yet? Would you like to buy an assignment? Use our custom writing services for better grades. Even if your deadline is approaching fast, our writers can handle your task right when you need it.


Order a Similar Paper Order a Different Paper

Q1:

1. How would you use GROUPING SETS to produce the same results as the following GROUP BY CUBE?

SELECT state, productID, SUM(volume) FROM sales GROUP BY CUBE (state, productID) ORDER BY state, productID

2. How would you show the sub totals for each week, for each state, and for each product? (No other totals or grand totals are required.) Suppose the table structure is

TABLE sales (productID VARCHAR, state CHAR(2), week DATE, volume INT)

3. Discuss the utility of grouping and group_id functions

Q2: Describe below how this code will work:

SELECT dt, region, revenue,
count(*) OVER (twdw) AS moving_count,
avg(revenue) OVER (twdw) AS moving_average
FROM moving_average_data mad
WINDOW twdw AS (PARTITION BY region
ORDER BY dt RANGE BETWEEN
‘7 days’::interval PRECEDING AND
‘0 days’::interval FOLLOWING
ORDER BY region, dt

Writerbay.net

Most students find it hard to finish papers at some point in their studies. If it ever happens to you, don’t get desperate—we have a service for every writing emergency! Whether you’re stuck with a problem, equation, or a piece of creative writing, we will definitely come to your rescue. Fill in the order form with the details of your paper. Write your personal instructions so we can meet your expectations.


Order a Similar Paper Order a Different Paper