Multiple choice technology databases

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 * FROM Persons WHERE FirstName='a_'

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

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

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

In SQL, the LIKE operator combined with the '%' wildcard matches any sequence of characters. 'a%' matches any string starting with 'a'. Using '=' searches for exact literal matches, and '_' only matches a single character.