Which aggregate function returns the total number of rows in a table?

Options

  • A. SUM()
  • B. AVG()
  • C. COUNT(*)
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. COUNT(*)

Detailed Explanation

  • COUNT(*): Returns the total number of rows, including rows containing NULL values.
  • COUNT(column): Counts only non-NULL values in the specified column.
  • Example: SELECT COUNT(*) FROM employees;