How a query can b done using joins. i am new in database. this query is working fine..
but i want to make it more rubust
$query = "SELECT student_id
FROM students
WHERE student_id
IN (
SELECT student_id
FROM class_students
WHERE class_id
IN (
SELECT class_id
FROM class_course
WHERE teacher_id =". $_SESSION['teacher_id']."))";
is there anyother way to do that
Using
INcan be converted to proper joins:Note that I have removed the (irrelevant) application language specifics (perl?) to leave just the SQL that answers the question.