CREATE PROCEDURE testCheck() SELECT id, IF (given_answer IS NULL, "no answer", CASE WHEN given_answer = correct_answer THEN "correct" ELSE "incorrect" END) AS checks FROM answers ORDER BY id;