select country.name, IFNULL(unverified,0) as unverified, IFNULL(verified,0) as verified, IFNULL(format(verified/(IFNULL(unverified,0)+verified)*100,2),'N/A') as average, IFNULL(verified + IFNULL(unverified,0),'N/A') as total from country left join
(select count(*) as verified,country.countryID from school
left join city using(cityID)
left join province using(provinceID)
left join country using(countryID)
where status = 1
group by country.name
order by country.name) as t1 using(countryID)
left join (select count(*) as unverified,country.countryID from school
left join city using(cityID)
left join province using(provinceID)
left join country using(countryID)
where status = 0
group by country.name
order by country.name) as t2 using(countryID)