What is the difference between COUNT(*) AND COUNT([attribute]) in the following scenario?
In terms of the speed:


As I know that both the queries (select count(*) or Select Count(id)) are using same execution plan, so should use same amount of CPU as long as blocks are fetched from either buffer pool or from disk not mix.


  In terms of the result, and in your case:



if you said count(*), then it will count the row even if you don't have employees since you are making left join.
if you said count(employee_id), then this will only count the rows "which are exists", means not the null rows.. I think this is what you need to have 0 for your case
If you want to mention the field and you want to count it even if there's no row you have to say count(NVL(employee_id, 123)) while 123 is any value in case null