Which of the following is used to find total number of rows in a table?
Which of the following is used to find total number of rows in a table?
Solution
✅ Correct Option: 4
COUNT(*) counts every row in a table, including rows that contain NULL values. For example, SELECT COUNT(*) FROM student; returns the total number of rows in the table student.
MAX(), SUM() and AVG(): these work on the values of one numeric column (largest value, total, average). They do not count rows.
COUNT(column_name) skips NULL values in that column, so it can give a smaller number than COUNT(*).
Related questions:
2025: 3 June Shift 2
2025: 30 May Shift 2
2026: 23 May Shift 1
2025: 15 May Shift 2