Vidyalelo
MySQL · Q113

MySQL

Programming · MySQL · question 113

Q113

What will be the output of the following MySQL statement? SELECT * FROM employee WHERE start_date BETWEEN ‘2007-01-01’ AND ‘2008-01-01’;

A.
All employees details between 2007 and 2008
Answer
B.
All employees details before 2008
C.
All employees details from 2007 to 2008
D.
None of the mentioned

Answer: Option A

Solution

Answer: Option A
Solution:
This MySQL statement uses the BETWEEN operator to filter data from the 'employee' table.

The statement is:

SELECT * FROM employee WHERE start_date BETWEEN ‘2007-01-01’ AND ‘2008-01-01’

This means it will select all rows (SELECT *) from the 'employee' table where the 'start_date' column value is between '2007-01-01' and '2008-01-01', including both dates.

Therefore, the correct answer is Option C: All employees details from 2007 to 2008.

Let me know if you have any other MySQL questions!