There is a table:
- students: id, name, surname;
- disciplines: id, name;
- marks: id, s_id, d_id, t_id, value.
You need to create a linked subquery that lists the names of students who have grades 3 and 4 at the same time. Did so:
SELECT id, name, surname FROM students WHERE 3 or 4 IN (SELECT value FROM marks WHERE marks.st_id = students.id GROUP BY marks.st_id); This query will display all students, even those who do not have any marks at all. If or replace with and will display the right person. But doesn’t AND mean that there should be an error, because the value cannot be simultaneously 3 and 4.
