0% found this document useful (0 votes)
6 views

SQL Analytics Supply Exercise

This document outlines an SQL Analytics exercise for students in the INFS4497 course at Sultan Qaboos University. It includes multiple questions requiring SQL statements to analyze data from a supply star schema, with specific requirements for output and screenprints. The exercise is individual work, with a due date of November 28th, 9 am.

Uploaded by

Bashar almur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

SQL Analytics Supply Exercise

This document outlines an SQL Analytics exercise for students in the INFS4497 course at Sultan Qaboos University. It includes multiple questions requiring SQL statements to analyze data from a supply star schema, with specific requirements for output and screenprints. The exercise is individual work, with a due date of November 28th, 9 am.

Uploaded by

Bashar almur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Sultan Qaboos University

College of Economics & Political Science


Information Systems Department
INFS4497-Data warehouse
–FALL 2023 –
SQL Analytics Exercise (3%)
Student ID: _____________ Student Name: ______________________________

Total points: 30 Due date: November 28th, 9 am.


Based on the supply star schema ( supply , warehouse, vendor, time and part), develop
SQL statement for each of the below request , show the output and screenprint of the code
and the output on the SQL worksheet*without cutting any part of the screen). Submit
your completed file to the course moodle site.

<< This must be your INDIVIDUAL work ; NO DISCUSSION/SHARING is allowed of


any type with any other individual>>

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.

SQL Statement(4 points):

Output (0.5 point):

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).

SQL Statement(4 points):


Output (0.5 point):

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

SQL Statement(4 points):

Output (0.5 point):

Screenprint(0.5 point):

Question 4: respond to each of the following requests

Question 4a Report the pivot of two aggregates for a vendor country (Oman, UAE, KSA)
and ordered by any applicable columns for decision makers.

SQL Statement(4 points):

Output (0.5 point):

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

SQL Statement(4 points):

Output (0.5 point):

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

SQL Statement(4 points):

Output (0.5 point):

Screenprint(0.5 point):

<< This must be your INDIVIDUAL work ; NO DISCUSSION/SHARING is allowed of


any type with any other individual>>

You might also like