add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE data1(
student int,
answer int
);
INSERT INTO data1(student, answer)
VALUES
(100, 1),
(100, 2),
(101, 1),
(101, 9);
Records: 4  Duplicates: 0  Warnings: 0
select student, if((count(*)>1) and (max(answer)>7), 'INVALID', 'Valid') as Result
from data1
group by student
student Result
100 Valid
101 INVALID