Song Problem List the clients who live in \'Los Angeles\' or who rented CDs cont
ID: 3754628 • Letter: S
Question
Song Problem List the clients who live in 'Los Angeles' or who rented CDs containing a song titled 'I Have A Dream. (Hint: use Union) (attributes to retrieve: firstName, lastName, clientID) songCode/cha songTitle/char Sweet Dreams Goodnight Lullab Have A Dream How Could You Breathless Ooh La La client Desert Heat Goldilocks clientlD/char firstName/charlastName/char phone/char address/cha James 480-732-1234 Los Angeles' 480-123-3456 New York 480-123-8588 Los Angeles 480-543-4323 Los Angeles' 480-123-8588 Phoenix 480-566-1289 Detroit 480-500-3400 Phoenix 480-772-8888 Detroit 480-634-1245 Phoenix mi Mamma Mia Broken Life Or Death John ent5 ent6' ent7 Johns Another Day in Paradise Fire Goodni lliams S20 Rentedby cdCode/char seqNum/numeric clientiD/chan fromDate/chan toDate/char pricePerDay/numberid entg avis 2005-02-05 2005-02-15 0.5 2005-09-05 2005-010-150.3 2005-02-05 2005-02-15 0.5 05-04-15' 0.5 2005-02-05 2005-02-15 0.5 lient3" 2005-03-15' 2005-03-20 0.5 2005-02-05 2005-02-15 0.5 lient3" 2005-02-05' 2005-02-15 0.5 lient3" 2005-12-052006-01-15" 0.1 2005-12-15 2006-02-01 0.5 2005-12-20 2006-01-14 0.5 lient3 2005-12-05'2005-02-15' 0.5 lient2 2005-10-05'2005-11-15' 0.5 lient9 2005-10-05'2005-11-15' 0.5 2005-10-05 2005-11-15' 0.5 lient5' 2005-10-05'2005-11-15' 0.5 2005-10-05' 2005-11-15' 0.5 2005-10-05' 2005-11-15' 0.5 lient5· "2005-11-05,"2005-12-15.10.5 2005-11-05' 2005-12-25' 0.4 Client4' 2005-11-05' 2005-12-15 0.5 Client5' 2005-11-05' 2005-12-15' 0.5 Client6'2005-11-05 2005-12-15' 0.5 Client22005-11-05 2005-12-15' 0.5 cdTitle/char yearlnumerid numberSold/numeric groupCode/cha 2001 ie 05-03-05 Goodnight Sweet Dreams 500000 C3 ent4 1998 2003 2003 1998 2003 2003 2003 800000 800000 750000 le Desert Heat Golden Hits le roke Golden Road 600000 800000 CT le Function Ranch Horse of a Different Color 2001 Rain Color Wonderful 2003 450000 900000 le 2000 2000 1997 1994 1998 2003 2001 2003 Client1 Moon Lake Summer Fiest Kettie Celebrate 40000 89000 99000 25000 75000 800000 790000 C20Explanation / Answer
SQL QUERY:
select firstName,lastName,clientID from client where address = 'Los Angeles'
UNION
select c.firstName,c.lastName,c.clientId from client c inner join Rentedby r on c.clientID = r.clientID inner join Composedof co on r.cdCode=co.cdCode inner join Song s on co.songCode = s.songCode where s.songTitle = 'I Have A Dream';
This query is UNION of two queries. So output will be the combination of output of two queries.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.