I'm new to sql and i'm having trouble formating a query so that it is actually useful. The database holds information about students at a uni.
The output that i've been trying to get is below. the query is a summary of each unit showing the average mark of the students belonging to each degree(M402, S366 etc are the degree's, scc103, scc104 are the units).
Unit M402 S366 S367 S375 S376
---------------------------------------
SCC103 36.5 64 62.5 63.4 57.4
SCC104 54 72.5 58.3 59 53.1
SCC105 58.5 54 62.9 61.3
SCC107 58.5 54 62.9 61.3
SCC108 61.5 71.5 61.5 61.7 63.4
SCC109 58.5 74 60.8 59.9
SCC203 75.7 62.7 64.5
SCC204 68 66.6 63.2
SCC208 61.5 68.5
SCC209 68.3 69.7
I have two tables an enroll table:
stu_no, unit, result
and a student table
stu_no, degree, stu_name.
I can get the results i need using a select statment, but it is not formated the way i would like.
the only real solution i can think of is using plsql and cursors and RDMS_OUTPUT functions but i'm unsure if i'm going in the right direction. If anyone can give me some hints or some psueocode it would be appreciated.
thanks in advanced.
The output that i've been trying to get is below. the query is a summary of each unit showing the average mark of the students belonging to each degree(M402, S366 etc are the degree's, scc103, scc104 are the units).
Unit M402 S366 S367 S375 S376
---------------------------------------
SCC103 36.5 64 62.5 63.4 57.4
SCC104 54 72.5 58.3 59 53.1
SCC105 58.5 54 62.9 61.3
SCC107 58.5 54 62.9 61.3
SCC108 61.5 71.5 61.5 61.7 63.4
SCC109 58.5 74 60.8 59.9
SCC203 75.7 62.7 64.5
SCC204 68 66.6 63.2
SCC208 61.5 68.5
SCC209 68.3 69.7
I have two tables an enroll table:
stu_no, unit, result
and a student table
stu_no, degree, stu_name.
I can get the results i need using a select statment, but it is not formated the way i would like.
the only real solution i can think of is using plsql and cursors and RDMS_OUTPUT functions but i'm unsure if i'm going in the right direction. If anyone can give me some hints or some psueocode it would be appreciated.
thanks in advanced.