SELECT
    entry.date,
    entry.class_id,
    entry.created_at,
    entry.absent,
    entry.comment,

    ck.item,
    ck.checked,
    ck.category
FROM classroom_compliance_entry entry
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.student_id = ?
ORDER BY
    entry.date DESC,
    ck.category ASC,
    ck.item ASC