Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the Chess database on atr, and the following query: SELECT Name FROM Players WHERE NOT EXISTS (SELECT Events.eID FROM Events WHERE Date = 2018-07-24

image text in transcribed

Consider the Chess database on atr, and the following query: SELECT Name FROM Players WHERE NOT EXISTS (SELECT Events.eID FROM Events WHERE Date = "2018-07-24" AND NOT EXISTS (SELECT * FROM Games WHERE ( PID = BlackPlayer OR PID = WhitePlayer ) AND Games. eID = Events.eID)); This query is supposed to find the names of players who played during all events that took place on 2018-07-24, but it may or may not work. What is wrong with the query? Hint: there is no need to run this query on the instance data in the real database, since it will return 0 rows. Remember to avoid query by instance, and your answer should assume that the query needs to work on all possible instances of the Chess database. In other words, don't look at the actual rows, just think about the query and the schemas. The date filter needs to be in the innermost nested select instead of the middle one There is a problem with the order of operations (precedence) in the innermost where clause The nested selects are out of order There is nothing wrong with it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

What is the formula to calculate the mth Fibonacci number?

Answered: 1 week ago