a) which students are enrolled in database and networking? ( hint: use sectionNo
ID: 3731310 • Letter: A
Question
a) which students are enrolled in database and networking? ( hint: use sectionNo for each class so you can determine the answer from the registration table by itself)
b) which instructors cannot teach both syst analysis and syst design?
c) which courses were taught in the first semester of 2008 but not in the second semester of 2008?
Explanation / Answer
a) SQL query :
Select REGISTRATION.StudentID
from SECTION,REGISTRATION
where SECTION.CourseID in (Select CourseID from COURSE where CourseName = "Database" or CourseName = "Networking" );
First inner query will be executed resulting in couresid ISM 4212 and ISM 4930 then outer query will be executed.
b)
Select FacultyID,count(*)
from QUALIFIED
where CourseID in("ISM 3113" ,"ISM 3112")
group by FacultyID
having count(*)<2 ;
This query will result in FacultyID that cannot teach both syst analysis and syst design.
FacultyID having count(*) =2 means that they can teach both syst analysis and syst design. Therefore,select those facultyid whose count(*)<2.
c) Select CourseName fron COURSE where CourseID
in (Select CourseID
from SECTION
where Semester = "I-2008" and CourseID not in (Select CourseID from SECTION where Semester = "II-2008"));
First inner query will be executed resulting in courseid where Semester ="II-2008" then outer query will be executed.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.