Question: Problem 4 SQL (24 points, 8 points each) The following three tables contain the information of students, departments, and studentdepartment relationships. The primary key of


Problem 4 SQL (24 points, 8 points each) The following three tables contain the information of students, departments, and studentdepartment relationships. The primary key of each table is underlined. For each query, write the output and provide a brief description of the query. (1) SELECT s.sname, d.dname, sd.startdate FROM Student s, Student_Department sd, Department d WHERE s.sid = sd.sid and d.did = sd.did (2) SELECT did, dname FROM Department WHERE did NOT IN (SELECT did FROM Student_Department GROUP BY did HAVING COUNT ()>1 ) (3) SELECT s.sname, s.gpa, d.dname FROM Student s, Student_Department sd, Department d WHERE s.sid = sd.sid AND d.did = sd.did AND s.gpa =( SELECT MIN (gpa) FROM Student)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
