Is the following query returns the output?
SELECT Subject, AVG (marks)
WHERE AVG(marks) > 70
GROUP BY Subject
Answers (1)Add Answer
No, this Query will not work. it will throw you an error.
you can not use an aggregate function with a where clause.
if you still want to filter out data whose average makes is greater than 70 then you can use the HAVING clause. as below.
SELECT Subject, AVG (marks) FROM Students GROUP BY Subject HAVING AVG(marks) > 70