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='Peter' ;

  2. SELECT * FROM Persons WHERE FirstName='Peter' ;

  3. SELECT * FROM Persons WHERE FirstName LIKE 'Peter' ;

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


Correct Option: B

AI Explanation

To select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter", you can use the following SQL query:

B. SELECT * FROM Persons WHERE FirstName='Peter';

Explanation:

  • The "SELECT" statement is used to retrieve data from a database table.
  • The asterisk (*) is a wildcard character that represents all columns in the table.
  • "FROM Persons" specifies the table name from which the data will be retrieved.
  • "WHERE FirstName='Peter'" is the condition that filters the records to only those where the value of the "FirstName" column is "Peter".

Find more quizzes: