Multiple choice technology databases

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

  1. SELECT COLUMNS(*) FROM Persons

  2. SELECT COUNT() FROM Persons

  3. SELECT COUNT(*) FROM Persons

  4. SELECT COLUMNS() FROM Persons

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

The standard SQL aggregate function to count rows is COUNT(). Standard SQL requires an expression or wildcard inside the parentheses, such as COUNT(*), to return the total number of records in the table, whereas empty parentheses are invalid syntax.