Answers for "sql how to get courses that i have made prerequisites"

SQL
0

sql how to get courses that i have made prerequisites

SET @courses_completed = '2';
SELECT c.course_id
FROM course c
LEFT JOIN course_prerequisites p ON p.course_id = c.course_id
WHERE NOT FIND_IN_SET(c.course_id, @courses_completed)
GROUP BY c.course_id
HAVING SUM(COALESCE(FIND_IN_SET(p.prerequisite_course_id, @courses_completed), 0) > 0) = COUNT(p.prerequisite_course_id);
Posted by: Guest on March-21-2021

Code answers related to "sql how to get courses that i have made prerequisites"

Code answers related to "SQL"

Browse Popular Code Answers by Language