SQL Analytics Supply Exercise
SQL Analytics Supply Exercise
Question : report the warehouse city, the part name, , the total sold unit quantity and
its rank ascending, and the total returned unit quantity and its rank ascending. The
report must be grouped by the warehouse city, part name. in the same query, add a
condition on a column from another table not required by the initial listed columns.
Screenprint(0.5 point):
Question 2: Report the part name, the vendor country, the highest sold unit quantity,
and the rank of highest sold unit quantity descending grouped by cube of part name,
the vendor country. The ranking is partitioned by a grouping_ID (part name, the
vendor country).
Screenprint(0.5 point):
Question 3: Report the warehouse city that is in the first group in terms of the latest
supply date, and 2nd or third group in terms of total sold unit quality. Hint use “WITH”
and “NTILE” of 3 in ascending order. In the same query, in addition to warehouse city,
reports the latest supply date, the total unit sold and their ntiles
Screenprint(0.5 point):
Question 4a Report the pivot of two aggregates for a vendor country (Oman, UAE, KSA)
and ordered by any applicable columns for decision makers.
Screenprint(0.5 point):
Question 4b Use the ” case” clause to report an aggregate for a column based on 3
different conditions. You must use at least two tables
Screenprint(0.5 point):
Question 4c Report an average of any of the reported quantity in the supply fact table,
grouped by rollup of three columns ( one is extract year from supply date and the other
twos each from different table). Use round to round the average quantity to 0 decimal
Screenprint(0.5 point):