Consider the following table "Manager".
Manager
MID MNAME 1 KAMAL 2 ARPIT NULL ANIL 4 NULL 5 ARTI
What will be the output of the following SQL statement?
SELECT COUNT(*) from Manager;
Consider the following table "Manager".
Manager
| MID | MNAME |
|---|---|
| 1 | KAMAL |
| 2 | ARPIT |
| NULL | ANIL |
| 4 | NULL |
| 5 | ARTI |
What will be the output of the following SQL statement?
SELECT COUNT(*) from Manager;
Solution
✅ Correct Option: 2
COUNT(*) counts every row in the table, whether or not any column in that row holds NULL. The table has 5 rows, so the output is .
Option 1: this is the result of COUNT(MID) or COUNT(MNAME), which skip NULL values in that column. Each column has one NULL, so each gives 4. COUNT(*) does not skip them.
Option 3: no common SQL count over this table gives 3.
Related questions:
2026: 20 May Shift 1
2025: 3 June Shift 2
2026: 23 May Shift 2