The SQL COUNT() function returns the number of records returned by a query. It is often used to count rows or specific values within a dataset.