home / aphis

Inspection Trends by Year

Annual inspection counts with violation breakdowns.

Custom SQL query returning 13 rows (hide)

SELECT CAST(strftime('%Y', inspection_date) AS INTEGER) AS year, COUNT(*) AS inspections, SUM(CASE WHEN critical_count > 0 THEN 1 ELSE 0 END) AS with_critical, SUM(critical_count) AS total_critical, SUM(noncritical_count) AS total_noncritical, SUM(direct_count) AS total_direct FROM inspections WHERE inspection_date IS NOT NULL GROUP BY year ORDER BY year DESC

Edit SQL

This data as json, CSV

yearinspectionswith_criticaltotal_criticaltotal_noncriticaltotal_direct
2026 696 8 8 150 7
2025 8096 178 205 2225 96
2024 9515 232 285 3289 124
2023 9777 249 297 4295 194
2022 9744 193 234 3275 197
2021 8606 177 209 2807 249
2020 4229 53 58 755 76
2019 9064 63 71 1518 80
2018 9424 62 67 1466 61
2017 10451 124 143 3829 180
2016 10755 147 180 4808 215
2015 10219 132 186 5684 299
2014 9824 116 169 5165 302
Powered by Datasette · Queries took 680.551ms