SELECT m.studentId
FROM batch b
JOIN marks m
ON FIND_IN_SET(m.studentId, b.batch)
AND m.subject = 'English'
GROUP BY
m.studentId
HAVING SUM(marks) > 45
SELECT m.studentId
FROM batch b
JOIN marks m
ON FIND_IN_SET(m.studentId, b.batch)
AND m.subject = 'English'
GROUP BY
m.studentId
HAVING SUM(marks) > 45