Question: A suboptimal query Exercise: What courses have been taken by both Bart and Lisa? SELECT bart.course _ id EROM grades bart JOIN grades lisa ON
A suboptimal query
Exercise: What courses have been taken by both Bart and Lisa?
SELECT bart.courseid
EROM grades bart
JOIN grades lisa ON lisa.courseid bart.courseid
WHERE bart.student id
AND lisa.studenti ;
problem: requires us to know BartLisas Student IDs, and only spits back course IDs,
not names.
Write a version of this query that gets us the course names, and only requires us to
know BartLisas names, not their IDs.
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
