Solution for SUM() in SQL query returning NULL instead zero (Differen between ISNULL and COALESCE)

When I was working on SQL queries I face this problem and then I have to shake my head to remember why this happen and what I did to solve it. So now I am documenting it here in more detail so that anyone who need help can get information here. Even I can check back when I will do same mistake 😉

Normally what happens is we use COUNT in QSL query and it return 0 if there is resolve fr that query. For example here is my table Keep on reading