What will be the output of the following query on table 'STUDENTS'?
SELECT COUNT(*) FROM STUDENTS;
What will be the output of the following query on table 'STUDENTS'?
SELECT COUNT(*) FROM STUDENTS;
Solution
✅ Correct Option: 3
COUNT(*) counts every row in the table, whether or not some columns hold NULL values. It does not look at individual column values, so each row is counted once.
Option 2: this describes COUNT(column_name), which skips NULLs in that column.
Option 1: COUNT(*) counts rows, not columns.
Related questions:
2025: 16 May Shift 1
2025: 22 May Shift 1
2025: 14 May Shift 1
2025: 15 May Shift 2
