Multiple choice technology programming languages

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

  1. SELECT * FROM Persons WHERE FirstName='%a%'

  2. SELECT * FROmPersons WHERE FirstName LIKE '%a'

  3. SELECT * FROM Persons WHERE FirstName='a'

  4. SELECT * FROM Persons WHERE FirstName LIKE 'a%'

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

The LIKE operator with 'a%' pattern matches strings starting with 'a' - the % is a wildcard matching zero or more characters. '%a%' would match 'a' anywhere, and 'a' would be exact match. Option B has syntax errors (missing space, typo 'FROmPersons').