CBSE Class 12 Computer Science
Question 39 of 91
Relational Database and SQL — Question 17
Back to all questions 17
Question With SQL, how do you select all the records from a table named "Persons", where the value of the column "FirstName" ends with an "a"?
SELECT * FROM Persons WHERE FirstName = 'a';SELECT * FROM Persons WHERE FirstName LIKE 'a%';SELECT * FROM Persons WHERE FirstName LIKE '%a';SELECT * FROM Persons WHERE FirstName = '%a%';
SELECT * FROM Persons WHERE FirstName LIKE '%a';
Reason — The SQL query SELECT * FROM Persons WHERE FirstName LIKE '%a'; retrieves all records from the "Persons" table where the "FirstName" column ends with "a". The LIKE keyword with "%" as a wildcard matches any characters preceding "a".