COUNT

SQL Count Function

The COUNT function returns the number of items in a group. COUNT function returns an int data type value.

SQL COUNT syntax

SELECT COUNT(*)
FROM table_name;

Training_Course

ID NAME DURATION PRICE
1 SQL 5 200
2 T-SQL 7 700
3 MySQL 5 600
4 PL/SQL 7 800
5 PostgreSQL 6 500

Example

select COUNT(*) 
from Training_Course 
where PRICE > 500;

Results

3