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

2017

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

Answer: A. SELECT COUNT (*) FROM PersonsCorrect query: SELECT COUNT(*) FROM Persons; COUNT(*) counts all rows in the table, including rows where column values are NULL. COUNT(column_name) counts…

  1. A.

    SELECT COUNT (*) FROM Persons

  2. B.

    SELECT COUNT () FROM Persons

  3. C.

    SELECT COUNT (** ) FROM Persons

  4. D.

    SELECT COLUMN (+) FROM Persons

Attempted by 2441 students.

Show answer & explanation

Correct answer: A

Correct query: SELECT COUNT(*) FROM Persons; COUNT(*) counts all rows in the table, including rows where column values are NULL.

COUNT(column_name) counts only the non-NULL values in that column.

Forms like empty parentheses, COUNT(**), or using COLUMN(+) are invalid for counting rows; use COUNT(*) instead.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…