Home › Interview Questions › What is the difference between COUNT(*) and COUNT(…

What is the difference between COUNT(*) and COUNT(column) in SQL?

🟢 Easy Conceptual Fresher level
1Times asked
Nov 2026Last seen
Nov 2026First seen

💡 Model Answer

COUNT() counts every row in the result set, regardless of NULL values, because the asterisk represents the entire row. COUNT(column) counts only the rows where the specified column is not NULL. For example, if a table has 10 rows, 3 of which have NULL in the 'email' column, COUNT() will return 10, while COUNT(email) will return 7. Use COUNT(*) when you need the total number of rows, and COUNT(column) when you want the number of non‑NULL values in that column.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500