Last answered:

08 Feb 2023

Posted on:

08 Feb 2023


question about the query

When i run the code without the Where clause I only get 12 rows returned

My question is, in this case, shouldn't it be returning more than 12 rows since I'm not limiting by hire_date anymore?

Here's how i wrote it, simply removed the 'where hire_date > '1999-01-01''

select first_name, count(first_name) as names_count from employees
group by first_name
having count(first_name) < 200;

1 answers ( 0 marked as helpful)
Posted on:

08 Feb 2023


Hi Douglas!
Thanks for reaching out.

It depends on the condition. In this case removing the WHERE clause gives us only the names which are in the DB less than 200 times and meet the criteria on the condition. So, it depends on the case.

Hope this helps.

Submit an answer