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 WHERE ContestDate >= '05/25/2006'

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

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

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


Correct Option: A
Explanation:

To solve this question, the user needs to know the syntax of SQL SELECT statements, how to select all rows from a table, how to specify column names, and how to use the WHERE clause to filter rows based on a certain condition.

Now, let's go through each option and explain why it is right or wrong:

A. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006': This option is correct. This statement selects all columns and rows from the Contest table where the ContestDate column has a value greater than or equal to May 25, 2006. The date is specified in the format MM/DD/YYYY, which is a valid format for SQL.

B. SELECT * FROM Contest GROUPBY ContestDate >= '05/25/2006': This option is incorrect because it contains a syntax error. The GROUP BY clause is used to group rows based on a certain criteria, not to filter them. Also, the condition is not valid in the GROUP BY clause.

C. SELECT * FROM Contest WHERE ContestDate < '05/25/2006': This option is incorrect because it selects all rows from the Contest table where the ContestDate column has a value less than May 25, 2006. The question asks for values greater than or equal to that date.

D. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006': This option is incorrect because the HAVING clause is used to filter rows based on a condition that involves an aggregate function. It cannot be used to filter rows based on a simple comparison like the one specified in this question.

The Answer is: A

Find more quizzes: