Question

Od 43) The latsst scoras krom the Japanss Basaball Laague are in tha table with schama ScorsTeam, Day, Opporant, Rurs) Cives the sco in ths Japanese Basaball Lsagus for ewo conecue days. Tha data n this table sas follorwa allows unday Stars allows Bay Stans iants y Stars 5 allows Monday Giants Bay Stars Rers allows 5 Deisrminsthe resuof tha solle query SELECT Team Day FROM Scorss S WHERE NOTEXISTS ISELECT FROM Scors: S2 WHERE St.Runs-S2Runa AND Hint Ivhan ing tunderstand what a query dos, ronw of scoras the asas varlable S1 rafarto ts oftenstowork Inalds-. Thai s, trs understand the subquary. Noice that tha subqusry in this problam has an nput, S1.Day, thats dsbamirad ouiside tha subqueyand depends on wihich Idantlky, tn the below, ora of the tuples in the rt Od all Suriy QUE BTION 12

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer -

( Tigers, Sunday)

select Team, Day
FROM SCORES s1
where not exists (select * from SCORES s2
where s1.Runs = s2.Runs AND
(s1.Team <> s2.Team OR s1.Day <> s2.Day));

In this query, each row from table s1 is compared to all the rows of s2

Inner query checks if row in s1 has same runs as row in s2 AND (team in s1 is not equal to s2 OR day in s1 is not equal to s2)

Now the outer query will select rows which are not returned by inner query because of this statement

(WHERE NOT EXISTS)

Add a comment
Know the answer?
Add Answer to:
Od 43) The latsst scoras krom the Japanss Basaball Laague are in tha table with schama...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT