Q:

MySQL :multiple select and join query

I have the following schema :
Department (dept_id, dept_name)

Student (student_id, student_name, major, level, age)

Professor (prof_id, prof_name, dept_id)

Class (name, meets_at, room, prof_id)

Enrolled (student_id, class_name, semester)

I need to Find the names of students with level SR who are enrolled in a class
taught by professor who works in department Computer Science.
based on my relational algebra understanding my attempt was 
SELECT s.student_name FROM ( SELECT d.dept_id FROM department as d WHERE d.dept_name = 'computer science' 

                        JOIN professor as p on d.dept_id = p.dept_id

                        JOIN class as c on p.prof_id = c.prof_id 
                        JOIN enrolled as e on c.name = e.class_name
                        JOIN student as s on s.student_id = e.student_id )
                        WHERE s.level = 'sr' ;

but when i try it out i get sql syntax error.
Any help is much appreciated. 

A:

SELECT s.student_name 
FROM department d
JOIN professor p on d.dept_id = p.dept_id
JOIN class c on p.prof_id = c.prof_id 
JOIN enrolled e on c.name = e.class_name
JOIN student s on s.student_id = e.student_id 
WHERE s.level = 'sr' 
    AND d.dept_name = 'computer science' 

