Data science and big data analytics
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
6 years ago
5
Purchase the answer to view it

- SqlqueryusingtheGROUPINGSETSisgivenbelow.docx
Purchase the answer to view it

- fortran 90 expert
- 3. A firm has decided to replace an existing asset with a newer Model. The existing asset originally cost...
- Each answer must be 75-100 words each. NO plagiarism. ALso have the question to the answer included please 4. What are the two ways government can finance a budget deficit? 16. Why is debt service an important measure of whether debt is a problem? 17. How
- Fin 571 Week 5 Assignment
- The cost of debt: Bellamee, Inc., has semiannual bonds outstanding
- Erika and Kitty, who are twins, just received $30,000 each for their 29th birthdays.
- FIN 534 Week 6 Discussion 2
- FIN 534 Homework Chapter 2 NEW
- PDF Homework Assignment
- Long Term Care Today