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.course_id
EROM grades bart
JOIN grades lisa ON lisa.course_id = bart.course_id
WHERE bart.student id =123
AND lisa.student_i ?bar(d)=888;
problem: requires us to know Bart/Lisa's 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 Bart/Lisa's names, not their IDs.
 A suboptimal query Exercise: What courses have been taken by both

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!