Question · SQL and MySQL course · Module 11: Capstone project

Difference between WHERE and HAVING

How does HAVING differ from WHERE?

Answer options

  • HAVING filters whole groups after GROUP BY, while WHERE filters single rows before grouping
  • HAVING sorts the results, while WHERE groups them
  • There is no difference - they are synonyms
  • HAVING removes rows, while WHERE adds them

You can check the correct answer by solving this task in the CodeWorlds game.