I am using this query to return return a list of songs stored in $sTable along with a COUNT of their total projects which are stored in $sTable2.
/* * SQL
COALESCE() returns the first non-null argument. So if you say COALESCE(count(...),0) it will return the count(...) if it's not null, or it will return 0 if the count(...) is null
COALESCE()
COALESCE(count(...),0)
count(...)