/1 min read
SQL COUNT Tutorial
How COUNT Works
Returns Number of Rows
COUNT counts entries that meet the WHERE condition.
Syntax
SELECT COUNT(column_1) FROM table WHERE condition;
Common Use Case
Counting players on a team — SELECT COUNT(*) FROM players WHERE team = 'C';
Tip: COUNT(*) vs COUNT(column)
COUNT(*) counts all rows; COUNT(column) skips NULLs in that column.
Master SQL at Noble Desktop
Noble Desktop's SQL Bootcamp covers queries, joins, aggregations, and the full SQL toolkit data analysts use every day.
In this tutorial, we'll go through the basics of the COUNT function in SQL, the syntax of it, and walk through an example of the COUNT function.