selectcount(*) as aggregate from `schools` innerjoin `school_branches` on `schools`.`id` = `school_branches`.`school_id` innerjoin `school_settlements` on `school_branches`.`id` = `school_settlements`.`school_branch_id` where `schools`.`type_id` =1and `school_settlements`.`year` =2023and `city_id` =36