Multiple choice technology programming languages

With SQL, how can you return the number of records in the "Persons" table?

  1. SELECT COUNT() FROM Persons

  2. SELECT COLUMNS() FROM Persons

  3. SELECT COLUMNS(*) FROM Persons

  4. SELECT COUNT(*) FROM Persons

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

COUNT(*) is the correct SQL aggregate function to return the number of records in a table. COUNT() without the asterisk is incomplete, and COLUMNS is not a valid aggregate function in SQL.