What are the first names of all students who are taking classes from the accounting department?
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'
What are the first names of all students who are taking classes from the Computer Info. Systems department?
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'
What are the first names of all students who are taking classes from both the accounting department and the Computer Info. Systems department?
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'