-- Database schema
| businesses : business_id [ INTEGER ] primary_key , name [ TEXT ] , address [ TEXT ] , city [ TEXT ] , postal_code [ TEXT ] , latitude [ REAL ] , longitude [ REAL ] , phone_number [ INTEGER ] , tax_code [ TEXT ] , business_certificate [ INTEGER ] , application_date [ DATE ] , owner_name [ TEXT ] , owner_address [ TEXT ] , owner_city [ TEXT ] , owner_state [ TEXT ] , owner_zip [ TEXT ] | inspections : business_id [ INTEGER ] inspections.business_id = businesses.business_id , score [ INTEGER ] , date [ DATE ] , type [ TEXT ] | violations : business_id [ INTEGER ] violations.business_id = businesses.business_id , date [ DATE ] , violation_type_id [ TEXT ] , risk_category [ TEXT ] , description [ TEXT ] |
-- -- For the business whose business certificate number is 304977, how many violations did it have on 2013/10/7?

SELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.business_certificate = '304977' AND T1.`date` = '2013-10-07';