ค้นหาชื่อนักศึกษาที่จะเรียนวิชาบัญชีและข้อมูลคอมพิวเตอร์ แผนกระบบไม่จำเป็นต้องใช้ตารางทั้งหมด
Find the first name of student who is taking classes from accounting and Computer Info. Systems departmentsIt is not neccessary to use all the tables.
 CLASS:  (class_code [ VARCHAR ] crs_code [ VARCHAR) ]
SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'