count()
count() is simple if you keep it on paper. Asha uses it for average per subject in a report.
count() order — meaning → GROUP BY subject → one limit. Dumping ten features helps nobody.
Skip count() and SELECT extra column not in GROUP BY shows up in a report.
Use count() when average per subject must stay clear. If a simpler SQL step works, use that instead.
Don’t do this with count() — SELECT extra column not in GROUP BY. Interviewers spot it in ten seconds.
After count(), Asha should still remember SELECT extra column not in GROUP BY.
Close count() with — “If I skip it, average per subject goes wrong like this: SELECT extra column not in GROUP BY.”
Board: average per subject. Dry-run count(). Name the trap: SELECT extra column not in GROUP BY.