1. With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
  1. DELETE ROW FirstName='Peter' FROM Persons

  2. DELETE FROM Persons WHERE FirstName = 'Peter'

  3. DELETE FirstName='Peter' FROM Persons

  4. None


Correct Option: B

AI Explanation

To delete records where the "FirstName" is "Peter" in the Persons Table, you would use the DELETE statement with the WHERE clause to specify the condition.

Let's go through each option to understand why it is correct or incorrect:

Option A) DELETE ROW FirstName='Peter' FROM Persons - This option is incorrect because the correct syntax is DELETE FROM, not DELETE ROW. Additionally, the WHERE clause is missing.

Option B) DELETE FROM Persons WHERE FirstName = 'Peter' - This option is correct. The DELETE statement is used to delete records from a table, and the WHERE clause is used to specify the condition. In this case, it is deleting records where the "FirstName" is "Peter" from the "Persons" table.

Option C) DELETE FirstName='Peter' FROM Persons - This option is incorrect because the correct syntax is DELETE FROM, not DELETE. Additionally, the WHERE clause is missing.

Option D) None - This option is incorrect because there is a correct option.

The correct answer is B. This option is correct because it uses the correct syntax with the DELETE statement and the WHERE clause to delete records where the "FirstName" is "Peter" from the "Persons" table.

Find more quizzes: