SQL Count Function
Posted by JeffSep 19
Another arithmetic function is COUNT. This allows us to COUNT up the number of row in a certain table. The syntax is:
SELECT COUNT(“column_name”)
FROM “table_name”
For example, if we want to find the number of store entries in our table, type:
Store Sales Information
| Store Name | Sales |
|---|---|
| Atlanta | $1500 |
| Boston | $250 |
| LA | $300 |
| Dallas | $700 |
SELECT COUNT(store_name)
FROM
Store_Information
Result:
Count(store_name)
4


Leave a Reply