input
stringlengths 236
16.9k
| output
stringlengths 19
805
|
---|---|
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many domestic crime cases has Commander Ronald A. Pontecore Jr. been responsible for investigating?
| SELECT SUM(CASE WHEN T2.domestic = 'TRUE' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T1.commander = 'Ronald A. Pontecore Jr.'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many crimes against society happened in the Wentworth district according to the FBI?
| SELECT SUM(CASE WHEN T1.crime_against = 'Society' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T3.district_name = 'Wentworth'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What phone number does alderman Emma Mitts have to call if she wants to speak to the commander in charge of the investigation of the crimes that have occurred in her ward?
| SELECT T3.phone FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T1.alderman_first_name = 'Emma' AND T1.alderman_last_name = 'Mitts'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many crimes described as 'The theft of a motor vehicle' by the FBI have taken place in the Lake View community?
| SELECT SUM(CASE WHEN T3.community_area_name = 'Lake View' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no WHERE T1.description = 'The theft of a motor vehicle.'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- In which district have there been more intimidation-type crimes?
| SELECT T3.district_name FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T1.primary_description = 'INTIMIDATION' GROUP BY T3.district_name ORDER BY COUNT(T1.primary_description) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What types of domestic crimes have occurred the most in the North Lawndale community?
| SELECT T2.domestic FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'North Lawndale' AND T2.domestic = 'TRUE' GROUP BY T2.domestic ORDER BY COUNT(T2.domestic) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- In which ward of more than 55,000 inhabitants are there more crimes of intimidation with extortion?
| SELECT T3.ward_no FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN Ward AS T3 ON T3.ward_no = T2.ward_no WHERE T1.primary_description = 'INTIMIDATION' AND T1.secondary_description = 'EXTORTION' AND T3.Population > 55000 GROUP BY T3.ward_no ORDER BY COUNT(T3.ward_no) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Which commander has had to deal with more cases of criminal sexual abuse?
| SELECT T3.commander FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T1.secondary_description = 'CRIMINAL SEXUAL ABUSE' GROUP BY T3.commander ORDER BY COUNT(T1.secondary_description) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What percentage of non-domestic crimes have occurred in the Jefferson Park district?
| SELECT CAST(COUNT(CASE WHEN T2.domestic = 'FALSE' THEN T2.case_number END) AS REAL) * 100 / COUNT(T2.case_number) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T1.district_name = 'Jefferson Park'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the average population of the wards where apartment crimes have been reported without arrests?
| SELECT AVG(T2.Population) FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.location_description = 'APARTMENT' AND T1.arrest = 'FALSE'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What are the full names of the top 5 most crowded ward aldermen?
| SELECT alderman_first_name, alderman_last_name FROM Ward ORDER BY Population DESC LIMIT 5; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many crime against property are there?
| SELECT COUNT(*) AS cnt FROM FBI_Code WHERE crime_against = 'Property'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many districts are there in the police district building with a zip code of 60608?
| SELECT COUNT(*) AS cnt FROM District WHERE zip_code = 60608; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Who is the crime against criminal sexual abuse?
| SELECT crime_against FROM FBI_Code WHERE title = 'Criminal Sexual Abuse'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Which community has the highest number of neighborhoods?
| SELECT T1.community_area_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no ORDER BY T2.community_area_no DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many severe crime incidents were reported at coordinate 41.64820151, -87.54430496?
| SELECT SUM(CASE WHEN T1.longitude = '-87.54430496' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.report_no = T2.iucr_no WHERE T2.index_code = 'I' AND T1.latitude = '41.64820251'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Who is the commanding officer in the district with the highest number of reported crimes where no arrest has been made?
| SELECT T2.commander FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.arrest = 'FALSE' GROUP BY T2.commander ORDER BY COUNT(T1.report_no) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What are the general and specific descriptions of the most common crime incidents that happened in an aircraft?
| SELECT T2.primary_description, T2.secondary_description FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.location_description = 'AIRCRAFT' GROUP BY T1.iucr_no ORDER BY COUNT(T1.iucr_no) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Between Deering and Near West districts, which district reported the most number of crime incidents that happened in a library?
| SELECT T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.district_name IN ('Deering', 'Near West') AND T2.location_description = 'LIBRARY' GROUP BY T1.district_name ORDER BY COUNT(T2.district_no) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many arrests have been made due to forcible entry burglary that took place in a day care center?
| SELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.location_description = 'DAY CARE CENTER' AND T1.secondary_description = 'FORCIBLE ENTRY' AND T1.primary_description = 'BURGLARY'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the name of the district with the highest number of domestic violence cases?
| SELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.domestic = 'TRUE' GROUP BY T2.district_name ORDER BY COUNT(T1.district_no) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- In the least populated community, what is the most common location of all the reported crime incidents?
| SELECT T2.location_description FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.population = ( SELECT MIN(population) FROM Community_Area ) AND T2.location_description IS NOT NULL GROUP BY T2.location_description; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many violation of laws are there where no arrest has been made?
| SELECT SUM(CASE WHEN T1.description LIKE '%The violation of laws%' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.Arrest = 'FALSE'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the precise coordinate of the location where simple assault incidents happened the most in Chatham?
| SELECT T2.latitude, T2.longitude FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.title = 'Simple Assault' AND T3.community_area_name = 'Chatham' AND T3.community_area_no = 44 ORDER BY T2.latitude DESC, T2.longitude DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- In the South side community, what is the name of the community with the most reported incidents of unlawful taking, carrying, leading, or riding away of property from the possession or constructive possession of another person?
| SELECT T3.community_area_name FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.side = 'South' AND T1.description = 'The unlawful taking, carrying, leading, or riding away of property FROM the possession or constructive possession of another person.' GROUP BY T3.community_area_name ORDER BY COUNT(T1.fbi_code_no) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many crime against society were reported in Englewood?
| SELECT SUM(CASE WHEN T3.community_area_name = 'Englewood' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.crime_against = 'Society'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the weekly average number of fraud incidents that were reported in January 2018? Provide the description of the location where the majority of fraud incidents occurred in the said month.
| SELECT CAST(COUNT(T1.fbi_code_no) AS REAL) / 4 FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please list any three community areas with a population of more than 50,000.
| SELECT community_area_name FROM Community_Area WHERE population > 50000 LIMIT 3; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What are the communities that are grouped together on the central side?
| SELECT community_area_name FROM Community_Area WHERE side = 'Central'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the difference between the number of communities that are located on the north and south sides with a population of more than 30,000?
| SELECT SUM(CASE WHEN side = 'South ' THEN 1 ELSE 0 END) - SUM(CASE WHEN side = 'North' THEN 1 ELSE 0 END) AS DIFF FROM Community_Area WHERE population > 300000; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please list all of the contact information for the police district Near West.
| SELECT phone, fax, tty, twitter FROM District WHERE district_name = 'Near West'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Who is responsible for crime cases in district Lincoln?
| SELECT commander FROM District WHERE district_name = 'Lincoln'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the general and specific description of incident 275?
| SELECT primary_description, secondary_description FROM IUCR WHERE iucr_no = 275; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the percentage of severe cases that are related to sexual assault?
| SELECT CAST(SUM(CASE WHEN primary_description = 'CRIM SEXUAL ASSAULT' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM IUCR WHERE index_code = 'I'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What are the neighborhoods that are located in the North Center community area?
| SELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name = 'North Center'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many neighborhoods can be found in the Forest Glen community area?
| SELECT SUM(CASE WHEN T2.community_area_name = 'Forest Glen' THEN 1 ELSE 0 END) FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the total population of the neighborhoods Avondale Gardens, Irving Park, Kilbourn Park, Merchant Park, Old Irving Park, and The Villa?
| SELECT SUM(T2.population) AS sum FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.neighborhood_name = 'Avondale Gardens' OR T1.neighborhood_name = 'Irving Park' OR T1.neighborhood_name = 'Kilbourn Park' OR T1.neighborhood_name = 'Merchant Park' OR T1.neighborhood_name = 'Old Irving Park' OR T1.neighborhood_name = 'The Villa'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many crime cases have been classified as "Weapons Violation" by the FBI?
| SELECT SUM(CASE WHEN T2.title = 'Weapons Violation' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please list any three criminal sexual assault cases against persons where the criminals have been arrested.
| SELECT T2.case_number FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.title = 'Criminal Sexual Assault' AND T2.arrest = 'TRUE' AND T1.crime_against = 'Persons' LIMIT 3; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please state the district name where incident number JB106545 took place.
| SELECT T1.case_number FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.title = 'Criminal Sexual Assault' AND T2.crime_against = 'Persons' AND T1.arrest = 'TRUE' LIMIT 3; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the general description for case number JB106010?
| SELECT T1.primary_description FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.case_number = 'JB106010'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please name three communities that experience the fraud incident.
| SELECT T3.community_area_name FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.title = 'Criminal Sexual Assault' LIMIT 3; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What was the major type of crime that happened in the Rogers Park community area?
| SELECT T1.fbi_code_no, T1.title FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.community_area_name = 'Rogers Park' GROUP BY T1.fbi_code_no, T1.title; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- At which district did the multiple homicide case number JB120039 occurred?
| SELECT T1.district_no, T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB120039' GROUP BY T1.district_no, T1.district_name; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the percentage of crime cases that have been classified as "drug abuse" by the FBI and happened on the street?
| SELECT CAST(SUM(CASE WHEN T2.title = 'Drug Abuse' AND T1.location_description = 'STREET' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.fbi_code_no) FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Provide the ward number with the highest population.
| SELECT ward_no FROM Ward ORDER BY Population DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the beat and location description of the case JB112212?
| SELECT beat, location_description FROM Crime WHERE case_number = 'JB112212'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Give the FBI code for the crime described by "The killing of one human being by another."
| SELECT fbi_code_no FROM FBI_Code WHERE description = 'The killing of one human being by another.'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Provide at least 5 ward office addresses associated with the crimes that happened in the community of Montclare.
| SELECT T3.ward_office_address FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Ward AS T3 ON T2.ward_no = T3.ward_no WHERE T1.community_area_name = 'Montclare' GROUP BY T3.ward_office_address LIMIT 5; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- List down the district's commander associated with the crime that happened at the yard and has a beat of 532.
| SELECT T2.address, T2.commander FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.location_description = 'YARD' AND T1.beat = 532; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the neighborhood name in the community area of Lake View?
| SELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name = 'Lake View'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Name the neighborhood of the community area in crime with report number 23843?
| SELECT T3.neighborhood_name FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T2.report_no = 23778; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the FBI description of the crime for report number 23778?
| SELECT T1.description FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.report_no = 23843; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- List down the report number of crimes associated with the district commander named Jill M. Stevens.
| SELECT SUM(CASE WHEN T1.commander = 'Jill M. Stevens' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Among the crimes happened in the neighborhood called "Avalon Park", what is the percentage of crimes that happened inside the house?
| SELECT CAST(SUM(CASE WHEN T2.location_description = 'HOUSE' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.location_description) AS persent FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.neighborhood_name = 'Avalon Park'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the full name of the alderman of ward no.21?
| SELECT alderman_first_name, alderman_last_name, alderman_name_suffix FROM Ward WHERE ward_no = 21; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the ward ID of the most crowded ward?
| SELECT ward_no FROM Ward ORDER BY Population DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many incidents have the general description of "ASSAULT" in the IUCR classification?
| SELECT COUNT(*) FROM IUCR WHERE primary_description = 'ASSAULT'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- How many incidents are considered "severe" in the IUCR classification?
| SELECT COUNT(*) FROM IUCR WHERE index_code = 'I'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Among the crimes with no arrest made, how many of them happened in the ward represented by alderman Pat Dowell?
| SELECT SUM(CASE WHEN T1.alderman_last_name = 'Dowell' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.arrest = 'FALSE' AND T1.alderman_first_name = 'Pat'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Which alderman represents the ward with the most number of crimes in January, 2018? Please give his or her full name.
| SELECT T1.ward_no, T1.alderman_first_name, T1.alderman_last_name, T1.alderman_name_suffix FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' GROUP BY T1.ward_no ORDER BY COUNT(T1.ward_no) DESC LIMIT 1; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Among the crimes in the ward with the most population, how many of them are cases of domestic violence?
| SELECT COUNT(T1.ward_no) AS num FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' ORDER BY T1.Population = ( SELECT Population FROM Ward ORDER BY Population DESC LIMIT 1 ); |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please list the location coordinates of all the incidents that had happened in the ward represented by alderman Pat Dowell.
| SELECT T2.latitude, T2.longitude FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T1.alderman_first_name = 'Pat' AND T1.alderman_last_name = 'Dowell' AND T2.latitude IS NOT NULL AND T2.longitude IS NOT NULL; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- The ward represented by which alderman had more incidents in January, 2018, Pat Dowell or Sophia King?
| SELECT T1.alderman_first_name, T1.alderman_last_name, COUNT(T1.ward_no) AS num FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE (SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' AND T1.alderman_first_name = 'Pat' AND T1.alderman_last_name = 'Dowell') OR (T1.alderman_first_name = 'Sophia' AND T1.alderman_last_name = 'King') GROUP BY T1.ward_no; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please list the case numbers of all the incidents with the generic description of "BATTERY" in the IUCR classification.
| SELECT T2.case_number FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.primary_description = 'BATTERY'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Among the incidents with the generic description of "BATTERY" in the IUCR classification, how many of them do not have arrests made?
| SELECT SUM(CASE WHEN T2.arrest = 'FALSE' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.primary_description = 'BATTERY'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please list the case numbers of all the crimes whose short description of the kind of crime is "Homicide 1st & 2nd Degree" in the FBI classification.
| SELECT T2.case_number FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.title = 'Homicide 1st & 2nd Degree'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Among the incidents in January, 2018, how many of them were stated "against Property" in the FBI classification?
| SELECT SUM(CASE WHEN SUBSTR(T2.date, 5, 4) = '2018' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.crime_against = 'Property' AND SUBSTR(T2.date, 1, 1) = '1'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- District commander Robert A. Rubio was responsible for how many incidents in January, 2018?
| SELECT SUM(CASE WHEN SUBSTR(T2.date, 5, 4) = '2018' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander = 'Robert A. Rubio' AND SUBSTR(T2.date, 1, 1) = '1'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Which district commander was responsible for more incidents in January, 2018, Robert A. Rubio or Glenn White?
| SELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander IN ('Robert A. Rubio', 'Glenn White') AND SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' GROUP BY T1.commander; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Please list the blocks where all the incidents in the district commanded by Robert A. Rubio took place.
| SELECT T2.block FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander = 'Robert A. Rubio'; |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- What is the average number of incidents per month in 2018 in the ward with the most population?
| SELECT COUNT(T1.ward_no) / 12 AS average FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.date LIKE '%2018%' AND T1.Population = ( SELECT MAX(T1.Population) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.date LIKE '%2018%' ); |
-- Database schema
| Community_Area : community_area_no [ INTEGER ] primary_key , community_area_name [ TEXT ] , side [ TEXT ] , population [ TEXT ] | District : district_no [ INTEGER ] primary_key , district_name [ TEXT ] , address [ TEXT ] , zip_code [ INTEGER ] , commander [ TEXT ] , email [ TEXT ] , phone [ TEXT ] , fax [ TEXT ] , tty [ TEXT ] , twitter [ TEXT ] | FBI_Code : fbi_code_no [ TEXT ] primary_key , title [ TEXT ] , description [ TEXT ] , crime_against [ TEXT ] | IUCR : iucr_no [ TEXT ] primary_key , primary_description [ TEXT ] , secondary_description [ TEXT ] , index_code [ TEXT ] | Neighborhood : neighborhood_name [ TEXT ] primary_key , community_area_no [ INTEGER ] Neighborhood.community_area_no = Community_Area.community_area_no | Ward : ward_no [ INTEGER ] primary_key , alderman_first_name [ TEXT ] , alderman_last_name [ TEXT ] , alderman_name_suffix [ TEXT ] , ward_office_address [ TEXT ] , ward_office_zip [ TEXT ] , ward_email [ TEXT ] , ward_office_phone [ TEXT ] , ward_office_fax [ TEXT ] , city_hall_office_room [ INTEGER ] , city_hall_office_phone [ TEXT ] , city_hall_office_fax [ TEXT ] , Population [ INTEGER ] | Crime : report_no [ INTEGER ] primary_key , case_number [ TEXT ] , date [ TEXT ] , block [ TEXT ] , iucr_no [ TEXT ] Crime.iucr_no = IUCR.iucr_no , location_description [ TEXT ] , arrest [ TEXT ] , domestic [ TEXT ] , beat [ INTEGER ] , district_no [ INTEGER ] Crime.district_no = District.district_no , ward_no [ INTEGER ] Crime.ward_no = Ward.ward_no , community_area_no [ INTEGER ] Crime.community_area_no = Community_Area.community_area_no , fbi_code_no [ TEXT ] Crime.fbi_code_no = FBI_Code.fbi_code_no , latitude [ TEXT ] , longitude [ TEXT ] |
-- -- Among all the incidents with no arrest made, what is the percentage of them having a generic description of "BATTERY" in the IUCR classification?
| SELECT CAST(SUM(CASE WHEN T1.primary_description = 'BATTERY' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*)FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.arrest = 'FALSE'; |
-- 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 ] |
-- -- How many restaurants' owners are in California?
| SELECT COUNT(owner_state) FROM businesses WHERE owner_state = 'CA'; |
-- 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 ] |
-- -- How many restaurants have met all requirements in the inspection?
| SELECT COUNT(score) FROM inspections WHERE score = 100; |
-- 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 ] |
-- -- Among the inspections carried out in 2016, how many of them are routine?
| SELECT COUNT(`date`) FROM inspections WHERE STRFTIME('%Y', `date`) = '2016' AND type = 'Routine - Unscheduled'; |
-- 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 ] |
-- -- Please list the names of all the restaurants that have met all requirements in one inspection.
| SELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100; |
-- 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 ] |
-- -- Among the restaurants being inspected in 2016, how many of them are in San Francisco?
| SELECT COUNT(DISTINCT T2.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.city IN ('San Francisco', 'SAN FRANCISCO', 'SF', 'S.F.'); |
-- 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 ] |
-- -- What was the type of inspection Tiramisu Kitchen had on 2014/1/14?
| SELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen'; |
-- 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 ] |
-- -- How many low risk violations were found in the inspection on 2014/1/14 for Tiramisu Kitchen?
| SELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'Low Risk'; |
-- 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 ] |
-- -- Please list the names of the restaurants that had a low risk violation in inspections in 2014.
| SELECT DISTINCT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2014' AND T1.risk_category = 'Low Risk'; |
-- 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 ] |
-- -- What is the description of the low risk violation of Tiramisu Kitchen on 2014/1/14?
| SELECT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'Low Risk'; |
-- 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 ] |
-- -- Please list the descriptions of all the high risk violations of Tiramisu Kitchen.
| SELECT DISTINCT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T2.name = 'Tiramisu Kitchen'; |
-- 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 ] |
-- -- How many routine inspections did Tiramisu Kitchen have?
| SELECT COUNT(T1.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Routine - Unscheduled' AND T2.name = 'Tiramisu Kitchen'; |
-- 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 ] |
-- -- Among the routine inspections of Tiramisu Kitchen, how many of them have a score of over 70?
| SELECT COUNT(T2.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen' AND T1.type = 'Routine - Unscheduled' AND T1.score > 70; |
-- 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 ] |
-- -- Which restaurant had more low risk violation in inspections, Tiramisu Kitchen or OMNI S.F. Hotel - 2nd Floor Pantry?
| SELECT CASE WHEN SUM(CASE WHEN T2.name = 'OMNI S.F. Hotel - 2nd Floor Pantry' THEN 1 ELSE 0 END) > SUM(CASE WHEN T2.name = 'Tiramisu Kitchen' THEN 1 ELSE 0 END) THEN 'OMNI S.F. Hotel - 2nd Floor Pantry' ELSE 'Tiramisu Kitchen' END AS result FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk'; |
-- 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 ] |
-- -- How many high risk violations do the restaurants in San Francisco have in total?
| SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.city IN ('San Francisco', 'SF', 'S.F.', 'SAN FRANCISCO') AND T1.risk_category = 'High Risk'; |
-- 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 ] |
-- -- Which restaurant has the highest total number of high risk violations?
| SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1; |
-- 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 ] |
-- -- What is the average scores of Tiramisu Kitchen in all inspections?
| SELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen'; |
-- 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 ] |
-- -- Which business had the most number of inspections? Give the Id number for that business.
| SELECT business_id FROM inspections GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1; |
-- 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 ] |
-- -- Tell the Id number of the business with the most number of violations.
| SELECT business_id FROM violations GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1; |
-- 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 ] |
-- -- Give the name of the business which met all the required standards during the unscheduled routine inspection on 2016/9/28.
| SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100 AND T1.`date` = '2016-09-28' AND T1.type = 'Routine - Unscheduled'; |
-- 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 ] |
-- -- Which business had the most number of high risk violations? Give the name of the business.
| SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1; |
-- 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 ] |
-- -- How many kinds of violations did "Stacks Restaurant" have on 2016/10/4?
| SELECT COUNT(DISTINCT T1.violation_type_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Stacks Restaurant' AND T1.`date` = '2016-10-04'; |
-- 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 ] |
-- -- Give the description of the moderate risk violation which "Chez Fayala, Inc." had on 2016/7/1.
| SELECT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Chez Fayala, Inc.' AND T1.`date` = '2016-07-01' AND T1.risk_category = 'Moderate Risk'; |
-- 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 ] |
-- -- Which business had the lowest score for the unscheduled routine inspection on 2016/9/26? Give the name of the business.
| SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE score = ( SELECT MIN(score) FROM inspections WHERE `date` = '2016-09-26' AND type = 'Routine - Unscheduled' ) AND T1.`date` = '2016-09-26' AND T1.type = 'Routine - Unscheduled'; |
-- 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 ] |
-- -- Provide the name of the business which had the most number of inspections because of complaint.
| SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Complaint' GROUP BY T2.name ORDER BY COUNT(T1.business_id) DESC LIMIT 1; |
-- 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 ] |
-- -- How many unscheduled routine inspections did "Soma Restaurant And Bar" have?
| SELECT COUNT(T1.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Soma Restaurant And Bar' AND T1.type = 'Routine - Unscheduled'; |
-- 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 ] |
-- -- Give the address of the business with the most number of the low risk violations.
| SELECT T2.address FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk' GROUP BY T2.address ORDER BY COUNT(T1.business_id) DESC LIMIT 1; |
-- 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 ] |
-- -- Which business was the first one to get a low risk violation because of "Permit license or inspection report not posted"? Give the name of the business.
| SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = ( SELECT MIN(`date`) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Permit license or inspection report not posted' ) AND T1.risk_category = 'Low Risk' AND T1.description = 'Permit license or inspection report not posted'; |
Subsets and Splits