Multiple choice technology databases

With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?

  1. INSERT INTO Persons (LastName) VALUES ('Olsen')

  2. INSERT ('Olsen') INTO Persons (LastName)

  3. INSERT INTO Persons ('Olsen') INTO LastName

  4. INSERT INTO Persons ('Olsen')

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

When inserting into specific columns, the correct SQL syntax is 'INSERT INTO table_name (column_name) VALUES (value)' as shown in option A. Options B, C, and D have incorrect syntax with misplaced or missing column specifications and VALUES keyword.

AI explanation

To insert the value "Olsen" as the "LastName" in the "Persons" table using SQL, you can use the following statement:

A. INSERT INTO Persons (LastName) VALUES ('Olsen')

Explanation: Option A is the correct answer because it follows the correct syntax for the INSERT statement in SQL. The statement starts with "INSERT INTO" followed by the table name "Persons". Then, in parentheses, you specify the column name "LastName" where you want to insert the value. Finally, the keyword "VALUES" is used to specify the value you want to insert, which is 'Olsen' in this case.