Check out example codes for "postgresql if null then 0". It will help you in understanding the concepts better.

Code Example 1

select coalesce(avg(bar), 0) from foo;

Learn ReactJs, React Native from akashmittal.com