Multiple choice technology databases

With SQL, how do you select all the columns from a table named "Persons"?

  1. SELECT [all] FROM Persons ;

  2. SELECT *. FROM Persons ;

  3. SELECT *.Persons ;

  4. SELECT * FROM Persons ;

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

The correct SQL syntax to select all columns is 'SELECT * FROM tablename' where the asterisk (*) is a wildcard representing all columns. Option A incorrectly uses square brackets, option B has an erroneous period after the asterisk, and option C has incorrect dot notation. The semicolon at the end is optional but correct.