SELECT
    student.id,
    student.name,
    student.desk_number,
    student.removed,

    entry.date,
    entry.created_at,
    entry.absent,
    entry.comment,

    ck.item,
    ck.checked,
    ck.category
FROM classroom_compliance_entry entry
LEFT JOIN classroom_compliance_student student
    ON student.id = entry.student_id
LEFT JOIN classroom_compliance_entry_checklist_item ck
    ON ck.class_id = entry.class_id AND
        ck.student_id = entry.student_id AND
        ck.date = entry.date
WHERE
    entry.class_id = ?
    AND entry.date >= ?
    AND entry.date <= ?
ORDER BY
    student.id ASC,
    entry.date ASC,
    ck.category ASC,
    ck.item ASC