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" is "Peter"?

  1. SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'

  2. SELECT * FROM Persons WHERE FirstName<>'Peter'

  3. SELECT [all] FROM Persons WHERE FirstName='Peter'

  4. SELECT * FROM Persons WHERE FirstName='Peter'

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

The correct SQL syntax for exact match is the equals operator. Option D uses SELECT * FROM Persons WHERE FirstName='Peter' which is the standard way to select all columns with an exact match condition. Option A incorrectly uses [all] brackets, Option B uses <> (not equals operator), and Option C combines [all] brackets with exact match - [all] is not valid SQL syntax.