Aryan PrajapatKnowledge Contributor
Is the following query returns the output? SELECT subject_code, AVG (marks) FROM Students WHERE AVG(marks) > 70 GROUP BY subject_code;
Is the following query returns the output? SELECT subject_code, AVG (marks) FROM Students WHERE AVG(marks) > 70 GROUP BY subject_code;
No. The above query does not return the output because we cannot use the WHERE clause to restrict the groups. We need to use the HAVING clause instead of the WHERE clause to get the correct output.