Assuming the field names are correct, if we were asked to only return records where an Xbox Series X or a PS5 was purchased between September 2020 and October 2020, which of the following WHERE clauses would make logical sense?
Select one:
a.
WHERE purchaseDate BETWEEN “09-01-2020” AND “10-31-2020” AND itemDescription IN (“PS5”, “XBOX SERIES X”)
b.
WHERE purchaseDate < “09-01-2020” AND purchaseDate > “10-31-2020” AND itemDescription = “PS5” AND itemDescription = “XBOX SERIES X”
c.
WHERE purchaseDate < “09-01-2020” AND > “10-31-2020” AND itemDescription = “PS5” OR “XBOX SERIES X”
d.
WHERE purchaseDate <> “09-01-2020” AND > “10-31-2020” AND itemDescription IN (“PS5”, “XBOX SERIES X”)
ANSWER: A) WHERE purchaseDate BETWEEN “09-01-2020” AND “10-31-2020” AND itemDescription IN (“PS5”, “XBOX SERIES X”)
Explanation :
Option A :Correct -
This will return the correct answer as stated in Quetion, where an Xbox Series X or a PS5 was purchased between September 2020 and October 2020
Option B : Wrong
As the WHERE clause contains Xbox AND PS5, it will return records which have both Xbox and PS5 (Both should be there)
Option C: Wrong
This will return records with the date less than September 2020 and greater than October 31, therefore it is wrong.
Option D :
Wrong - This will return the records with date not equal to September 1st and date after October 31st. Therefore it is wrong.
Get Answers For Free
Most questions answered within 1 hours.