Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started