Your query most likely fails in more than one way.
In addition to what @Patashu told you about table-qualifying column names, you need to JOIN
your tables properly. Since Instructor
is ambiguous in your query I am guessing (for lack of information) it could look like this:
SELECT ie.Instructor
,SUM(ie.instreffective_avg + h.howmuchlearned_avg + ir.instrrespect_avg)/5
FROM instreffective_average ie
JOIN howmuchlearned_average h USING (Instructor)
JOIN instrrespect_average ir USING (Instructor)
GROUP BY Instructor
I added table aliases to make it easier to read.
This assumes that the three tables each have a column Instructor
by which they can be joined. Without JOIN
conditions you get a CROSS JOIN
, meaning that every row of every table will be combined with every row of every other table. Very expensive nonsense in most cases.
USING (Instructor)
is short syntax for ON ie.Instructor = h.Instructor
. It also collapses the joined (necessarily identical) columns into one. Therefore, you would get away without table-qualifying Instructor
in the SELECT
list in my example. Not every RDBMS supports this standard-SQL feature, but you failed to provide more information.