Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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