ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

What will be the output of the following MySQL statement?
SELECT *
FROM employee
WHERE lname LIKE ‘F%’ AND lname LIKE ‘%T’;

Answer & Solution
Correct Answer: Option A
This question asks about how the LIKE operator works in MySQL. Let's break down the code:

SELECT * FROM employee : This part selects all the columns (*) from the table named 'employee'.
WHERE lname LIKE ‘F%’ AND lname LIKE ‘%T’ : This part filters the results based on the 'lname' (last name) column.
LIKE ‘F%’ : This checks if the last name starts with the letter 'F'. The '%' symbol acts as a wildcard, meaning it can match any number of characters.
LIKE ‘%T’ : This checks if the last name ends with the letter 'T'. Again, the '%' symbol allows for any number of characters before the 'T'.

In summary, this query will only return employees whose last name starts with 'F' and ends with 'T'.

Therefore, the correct answer is Option A: All employees whose last name should started with 'F' and end with 'T'.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.