Where clause is used to filter out rows from all over the database. But Having clause is used to filter out rows from a specific group of database. Having clause can also help in aggregate function like min/max/average
for more detail.. what's the difference between WHERE and HAVING what is the difference between WHERE and HAVING