SELECT
    ifnull(TRUNCATE(SUM(5 - cast(`result` AS signed)) / (COUNT(*) / %s) + 0.005, 2), 0) AS `batch_input`
FROM
    enquete_results
    JOIN
        enquete_statuses
    ON  enquete_results.status_id = enquete_statuses.id
    JOIN
        enquete_questions
    ON  enquete_results.question_id = enquete_questions.id
WHERE
    hoikuen_id = %s
AND `year` = %s
AND `result` IS NOT NULL
AND `result` != 5
AND question_id != 60
AND question_number IN(%s)
AND classroom_id IN(%s)
AND enquete_results.deleted_at IS NULL
AND enquete_statuses.deleted_at IS NULL
AND enquete_questions.deleted_at IS NULL
;