Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Form 4.5 : Display of Sum,avg only

Re: Form 4.5 : Display of Sum,avg only

From: Wryse <wryse_at_aol.com>
Date: 1997/10/18
Message-ID: <19971018041301.AAA17429@ladder02.news.aol.com>#1/1

In article <61i3ik$hrs_at_eng-ser1.erg.cuhk.edu.hk>, kkkong_at_ee.cuhk.hk (Alan Kong) writes:

>I would like to create a form which only displays a listing of Sum and
>average
>of values and seeking your advise on this.
>
>There are 2 tables:
> student: studno, name
> results: studno, year, subject, marks
>
>Example of records in "results":
> studno year subject marks
> ******* **** ****** *****
> s951234 1995 cs101 2.5
> s951234 1995 cs102 2.8
> s951234 1996 cs202 2.6
> s951237 1995 cs101 2.1
> ... etc .....
>
>The display in the form(in descending order of avg):
>
> studno name year sum(marks) avg(marks)
> ******* **** **** ********* *********
> s951234 John 1995 5.3 2.7
> s951237 Jack 1995 6.0 2.4
> ... etc ...
>
>I wonder whether it is a good solution to create a view, a temp view or temp
>table and then base on sql on the view to achieve this.
>
>If not, what is the other method? Thanks.

It seems like you could use student as the base table, and then calculate the sum and average in a post-query trigger.

If you're hyper-sensitive about database hits, and you know this data would be requested a lot, then a view would help. However, it seems like a pretty narrow usage for a view; perhaps the view could include a number of other group (student, year) statistics that you might need, like count of classes or max, min grades.

Mike Received on Sat Oct 18 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US