How do I do this query?

From: <bit-naughty_at_hotmail.com>
Date: Mon, 5 Feb 2018 22:58:48 -0800 (PST)
Message-ID: <220f74c7-8d66-4368-a7d9-354c9ae290b7_at_googlegroups.com>



[Quoted] [Quoted] [Quoted] I have a "teachers" table with fields for primarykey, name, and collegeid (for the college that they teach in). I have a separate teacherreviews table (cause 1 teacher can have multiple reviews) which has teacherid (the primarykey from the teachers table) and rating fields. Now I want to know the average rating of ALL teachers from a particular college - ie. if the History teacher at that college is rated 5, and the Geography teacher 7, then the average will be 6 for that college. How do I do this? The only thing I can think of is to do a SELECT DISTINCT on the college field, but....my poor brain is burning out at that point! :( How do I do the "all colleges with the same id" bit? I want to order the colleges by the highest no. of teacher ratings.

Thanks. Received on Tue Feb 06 2018 - 07:58:48 CET

Original text of this message