It's UWAweek 47

help1402

This forum is provided to promote discussion amongst students enrolled in CITS1402 Relational Database Management Systems.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 684 articles.
Currently 92 other people reading this forum.


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported

Login to reply

👍?
helpful
7:27pm Fri 6th Sep, Mengxi L.

"Where" filters rows before any grouping or aggregation is done,you cannot use aggregate functions (like AVG, COUNT, etc.) directly in the "WHERE" clause because the aggregation happens after the filtering is done. "Having" is used specifically to filter groups created by GROUP BY based on aggregate functions. In Lab4 Q3 Having allows filtering based on the result of an aggregate function AVG(), because HAVING clause applies after the GROUP BY. So I don' think you can use Where instead of GROUP BY + HAVING in this case. Sometimes your query with WHERE might have returned the correct results, but the proper SQL structure should involve GROUP BY and HAVING in this case.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy