Multiple choice technology databases

  1. With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

  1. SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'

  2. SELECT FirstName='Peter', LastName='Jackson' FROM Persons

  3. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

  4. None

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

The correct SQL uses WHERE with AND operator to combine two conditions. Option A uses <> which means 'not equal'. Option B has incorrect syntax - column names appear before FROM. The correct syntax is SELECT * FROM table WHERE column1='value1' AND column2='value2'.