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

  2. SELECT * FROM Persons WHERE FirstName='%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

SQL LIKE with % wildcard matches patterns. Option D uses 'a%' which correctly matches any string starting with 'a' (% means any characters after). Option A uses '%a' which would match strings ending with 'a'. Option B has incorrect syntax (= without LIKE), and Option C looks for exact match 'a' only.