liveBook · Manning

Select count(*) statement

As explained in Delivering Machine Learning Projects: From design to deployment

A SELECT COUNT(*) statement is a SQL query that returns the number of rows selected from a relation.

A SELECT COUNT(*) statement returns the number of rows in a table or other selected relation. Use it during initial data surveying to test whether a dataset contains the expected volume before deeper analysis. section 5.2.2

Checking smart-building sensor coverage

Counting temperature_readings returns 262,944,000 rows. Five years includes one leap year: 5 × 365 + 1 = 1,826 days, and 262,944,000 ÷ 1,826 = 144,000 readings per day. The round result suggests roughly 100 sensors reported every minute, while also flagging an assumption worth checking. section 5.2.2

select count(*) from temperature_readings
>262944000

Inspect the query and returned row count used to establish whether the temperature table contains approximately the expected data volume. section 5.2.2

Use the count as a checkpoint, then reduce uncertainty with targeted inspection:

  • Compare the result with expected dates, reporting frequency, and sensor coverage. section 5.2.2
  • Sample a few rows with SELECT * and LIMIT, probe years with WHERE, and record unexplained fields as backlog investigations. section 5.2.2

How Delivering Machine Learning Projects: From design to deployment covers it

How deep it goes
Explains row counting and validates a five-year sensor estimate, then extends toward filtered counts without covering SQL internals.
Examples
Uses temperature_readings, a 262,944,000-row count, five-year sensor arithmetic, and targeted sample queries.
What you can do after
Diagnose data-volume anomalies by comparing counts with expected sensor coverage and following up with sample checks.
How it connects
Connects SQL querying with SELECT *, LIMIT, WHERE, GROUP BY, data validation, schemas, and project backlogs.

This explainer was generated by Manning's knowledge graph from the text of Delivering Machine Learning Projects: From design to deployment. The section links point to the parts of the book it draws on.