Count SQL Tutorial

Count Syntax:

SELECT COUNT(column_name) FROM table_name
SELECT COUNT(*) FROM table_name

Sales table:

IDPRICENAME
1200A
2500B
3900C
4500D

Count Example 1:

SELECT COUNT(id) FROM store WHERE price=500;

Count Result: 2

Count Example 2:

SELECT COUNT(*) FROM store;

Count Result: 4