Multiple choice technology

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 LIKE '%a'

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

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

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

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

The SQL LIKE operator is used for pattern matching in string columns. The percent sign (%) is a wildcard that matches zero or more characters. To find values starting with 'a', use 'a%' (matches 'a' followed by anything). Option A ('%a') finds values ending with 'a', option B uses equality instead of pattern matching, and option D has incorrect wildcard placement.