4.1
Consider the following SQL query that seeks to find a list of titles of all courses taught in Spring 2017 along with the name of the instructor.
SELECT name, title
FROM instructor NATURAL JOIN teaches NATURAL JOIN section NATURAL JOIN course
WHERE semester = 'Spring' AND year = 2017;
What is wrong with this query?
Although the query is syntactically correct, it does not compute the expected answer because dept_name is an attribute of both course and instructor. As a result of the natural join, results are shown only when an instructor teaches a course in her or his own department.