How many businesses from ward 42 have at least 5 failed inspection results between 1/1/2010 to 12/31/2015?
ward 42 refers to ward = 42; at least 5 failed inspection results refers to count(results = 'Fail') > = 5; between 1/1/2010 to 12/31/2015 refers to inspection_date between '2010-01-01' and '2015-12-31'
SELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_date BETWEEN '2010-01-01' AND '2015-12-31' AND T1.ward = 42 AND T1.license_no IN ( SELECT license_no FROM ( SELECT license_no FROM inspection WHERE results = 'Fail' GROUP BY license_no HAVING COUNT(results) >= 5 ) )
database name:db_id food_inspection_2
employee table employee Cols: employee id dtype integer, first name dtype text, last name dtype text, address dtype text, city dtype text, state dtype text, zip dtype integer, phone dtype text, title dtype text, salary dtype integer, supervisor dtype integer, 
establishment table establishment Cols: license number dtype integer, doing business as name dtype text, as know as name dtype text, facility type dtype text, risk level dtype integer, address dtype text, city dtype text, state dtype text, zip dtype integer, latitude dtype real, longitude dtype real, ward dtype integer, 
inspection table inspection Cols: inspection id dtype integer, inspection date dtype date, inspection type dtype text, results dtype text, employee id dtype integer, license number dtype integer, followup to dtype integer, 
inspection_point table inspection_point Cols: point id dtype integer, Description dtype text, category dtype text, code dtype text, fine dtype integer, point_level dtype text, 
violation table violation Cols: inspection id dtype integer, point id dtype integer, fine dtype integer, inspector_comment dtype text, 
