Mysql row count returning incorrect values for joined tables

Good day all. I am working on retrieving data from the database across some tables. My query is shown below. SELECT DISTINCT applicable_areas.area, applicable_areas.id as id, count(distinct supreme_applicable_areas.applicable_area_id) as supreme_court_cases, count(distinct appeal_applicable_areas.applicable_area_id) as appeal_court_cases FROM `applicable_areas` JOIN appeal_applicable_areas ON appeal_applicable_areas.applicable_area_id = applicable_areas.id JOIN supreme_applicable_areas ON supreme_applicable_areas.applicable_area_id = applicable_areas.id JOIN cp_cases_counsel ON ( (cp_cases_counsel.suitno = supreme_applicable_areas.suitno) … Read more