Question: d) Describe what the following SQL statement does? (6 points) SELECT UNIQUE(c.title) FROM courses c, students s, registered r WHERE r.code = c.code AND r.SSN
d) Describe what the following SQL statement does? (6 points)
SELECT UNIQUE(c.title)
FROM courses c, students s, registered r WHERE r.code = c.code AND
r.SSN = s.SSN AND c.code = (SELECT c1.code
FROM courses c1, students s1, registered r1
WHERE r1.code = c1.code AND r1.SSN = s1.SSN
GROUP BY c1.code
HAVING COUNT(c1.code) >= (SELECT MAX(COUNT(c2.code))
FROM courses c2, students s2, registered r2 WHERE r2.code = c2.code AND
r2.SSN = s2.SSN AND
c2.dept <> s2.dept GROUP BY c2.code)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
