Multiple choice technology databases

Which SQL statement selects all rows from table called Contest, with column ContestDate having values greater or equal to May 25, 2006?

  1. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'

  2. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'

  3. SELECT * FROM Contest WHERE ContestDate < '05/25/2006'

  4. SELECT * FROM Contest IN ContestDate < '05/25/2006'

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

SELECT * FROM Contest WHERE ContestDate >= '05/25/2006' correctly retrieves all columns from the Contest table filtering for dates on or after May 25, 2006. The WHERE clause is used for filtering rows, not HAVING which is for filtering after GROUP BY. Option C uses less than instead of greater than or equal, while D uses invalid SQL syntax.