I have a database with 12,000 records with various attributes. One of them is weather_condition (Integer).
This query will return every single car accident with weather type in descending order.
SELECT weather_condition FROM nyccrash ORDER BY weather_condition DESC;
What I want specifically is to display the count of how many accidents associated with each weather_condition. There are 7 conditions: 0 through 7.
For example:
Condition | Count
0 | 452
1 | 558
2 | 1242
3 | 92
... | ...
How about this:
SELECT weather_condition, COUNT(weather_condition) AS Count
FROM nyccrash
GROUP BY weather_condition
ORDER BY weather_condition DESC ;