Multiple choice technology databases

Which of the following SQL statements does count the rows in the 'Sales' table?

  1. SELECT COUNT(*) IN Sales

  2. SELECT NUM() FROM Sales

  3. SELECT COUNTER(*) FROM Sales

  4. SELECT COUNT(*) FROM Sales

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

COUNT(*) is the standard SQL aggregate function that returns the total number of rows in a table, including NULL values. The correct syntax requires FROM, not IN, to specify the table source. Option D uses the proper SQL syntax while other options use non-existent functions like NUM(), COUNTER(), or incorrect prepositions.