db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 0
673
| SQL
stringlengths 23
804
|
---|---|---|---|
chicago_crime
|
Among the crimes in Woodlawn, how many of them happened in January, 2018?
|
Woodlawn refers to community_area_name = 'Woodlawn'; in January 2018 refers to date like '%1/2018%'
|
SELECT SUM(CASE WHEN T1.community_area_name = 'Woodlawn' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.date LIKE '%1/2018%'
|
chicago_crime
|
More crimes happened in which community area in January, 2018, Woodlawn or Lincoln Square?
|
in January 2018 refers to date like '%1/2018%'; Woodlawn or Lincoln Square refers to community_area_name in ('Woodlawn', 'Lincoln Square'); number of crime refers to COUNT(report_no); the higher the report_no, the more crimes happened in the community;
|
SELECT T1.community_area_name FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name IN ('Woodlawn', 'Lincoln Square') AND T2.date LIKE '%1/2018%' GROUP BY T1.community_area_name ORDER BY COUNT(T1.community_area_name) DESC LIMIT 1
|
chicago_crime
|
What is the fax number for the district with the most number of crimes in January, 2018?
|
fax number refers to fax; the most number of crimes refers to max(count(case_number)); in January 2018 refers to date like '%1/2018%'
|
SELECT T1.fax FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.date LIKE '%1/2018%' GROUP BY T2.district_no ORDER BY COUNT(case_number) DESC LIMIT 1
|
chicago_crime
|
What is the average number of crimes in a neighborhood in Central Chicago?
|
Central Chicago refers to side = 'Central'; average number = divide(count(report_no), count(community_area_no))
|
SELECT CAST(COUNT(T1.report_no) AS REAL) / COUNT(T2.community_area_no) FROM Crime AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.side = 'Central'
|
chicago_crime
|
Among the crimes in all the districts in Chicago, what is the percentage of them happening in the Central district?
|
the Central district refers to district_name = 'Central'; percentage = divide(count(case_number where district_name = 'Central'), count(case_number)) * 100%
|
SELECT CAST(SUM(CASE WHEN T2.district_name = 'Central' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.case_number) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no
|
chicago_crime
|
How many community areas are in the Far North side?
|
the Far North side refers to side = 'Far North'
|
SELECT COUNT(*) FROM Community_Area WHERE side = 'Far North '
|
chicago_crime
|
Who is the commander of Morgan Park district?
|
Morgan Park district refers to district_name = 'Morgan Park'
|
SELECT commander FROM District WHERE district_name = 'Morgan Park'
|
chicago_crime
|
Where did case No. JB100065 happen? Give the name of the district.
|
case No. JB100065 refers to case_number = 'JB100065'; name of the district refers to district_name
|
SELECT T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB100065'
|
chicago_crime
|
Where is the coordinate (41.66236555, -87.63470194) located? Give the name of the district.
|
coordinate (41.66236555, -87.63470194) refers to latitude = '41.66236555' AND longitude = '-87.63470194'; name of the district refers to district_name
|
SELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.longitude = '-87.63470194' AND T1.latitude = '41.66236555'
|
chicago_crime
|
Give the name of the person who was responsible for case No.JB524952.
|
name of the person refers to commander; case No.JB524952 refers to case_number = 'JB524952'
|
SELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB524952'
|
chicago_crime
|
How many simple assaults happened on 2018/9/8?
|
simple assault refers to primary_description = 'ASSAULT'AND secondary_description = 'SIMPLE'; on 2018/9/8 refers to date like '%9/8/2018%'
|
SELECT SUM(CASE WHEN T2.secondary_description = 'SIMPLE' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.date LIKE '%9/8/2018%' AND T2.primary_description = 'ASSAULT'
|
chicago_crime
|
Which district had the most number of first degree murders? Give the district number.
|
the most number refers to max(count(case_number)); first degree murder refers to secondary_description = 'FIRST DEGREE MURDER'; district number refers to district_no
|
SELECT T2.district_no FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.secondary_description = 'FIRST DEGREE MURDER' GROUP BY T2.district_no ORDER BY COUNT(*) DESC LIMIT 1
|
chicago_crime
|
How severe was case JB296775? Give the index code for severity.
|
index code refers to iucr_no; case JB296775 refers to case_number = 'JB296775'
|
SELECT T2.iucr_no FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.case_number = 'JB296775'
|
chicago_crime
|
Give the name of the community area which had the most pocket-picking thefts.
|
name of the community area refers to community_area_name; the most refers to max(case_number); pocket-picking theft refers to primary_description = 'THEFT' AND secondary_description = 'POCKET-PICKING'
|
SELECT T3.community_area_name FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.primary_description = 'THEFT' AND T1.secondary_description = 'POCKET-PICKING' GROUP BY T2.community_area_no ORDER BY T2.case_number DESC LIMIT 1
|
chicago_crime
|
Who was the alderman of the legislative district where case No. JB103470 took place? Give the full name.
|
case No. JB103470 refers to case_number = 'JB103470'; full name refers to alderman_first_name, alderman_last_name
|
SELECT T1.alderman_first_name, T1.alderman_last_name FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.case_number = 'JB103470'
|
chicago_crime
|
Give the neighborhood name of West Englewood community.
|
West Englewood community refers to community_area_name = 'West Englewood'
|
SELECT T1.neighborhood_name FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.community_area_name = 'West Englewood'
|
chicago_crime
|
How many different neighborhoods are there in Roseland community?
|
Roseland community refers to community_area_name = 'Roseland'
|
SELECT SUM(CASE WHEN T1.community_area_name = 'Roseland' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no
|
chicago_crime
|
Give the FBI code description of case No.JB134191.
|
case No.JB134191 refers to case_number = 'JB134191'
|
SELECT description FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.case_number = 'JB134191'
|
chicago_crime
|
Tell the number of cases with arrests in North Lawndale community.
|
number of cases refers to count(case_number); arrest refers to arrest = 'TRUE'; North Lawndale community refers to community_area_name = 'North Lawndale'
|
SELECT SUM(CASE WHEN T1.community_area_name = 'North Lawndale' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.arrest = 'TRUE'
|
chicago_crime
|
What is the percentage of under $500 thefts among all cases that happened in West Englewood?
|
under $500 refers to secondary_description = '$500 AND UNDER'; theft refers to primary_description = 'THEFT'; West Englewood refers to community_area_name = 'West Englewood'; percentage = divide(count(case_number where secondary_description = '$500 AND UNDER'), count(case_number)) where primary_description = 'THEFT' and community_area_name = 'West Englewood' * 100%
|
SELECT CAST(SUM(CASE WHEN T2.secondary_description = '$500 AND UNDER' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.case_number) FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no INNER JOIN Community_Area AS T3 ON T1.community_area_no = T3.community_area_no WHERE T2.primary_description = 'THEFT' AND T3.community_area_name = 'West Englewood'
|
chicago_crime
|
What is the percentage of larceny cases among all cases that happened in Edgewater community?
|
larceny case refers to title = 'Larceny'; Edgewater community refers to community_area_name = 'Edgewater'; percentage = divide(count(case_number where title = 'Larceny'), count(case_number)) where community_area_name = 'Edgewater' * 100%
|
SELECT CAST(SUM(CASE WHEN T3.title = 'Larceny' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.case_number) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T1.community_area_name = 'Edgewater'
|
chicago_crime
|
How many crimes were committed at 018XX S KOMENSKY AVEin May 2018?
|
in May 2018 refers to date LIKE '5/%/2018%'
|
SELECT SUM(CASE WHEN date LIKE '5/%/2018%' THEN 1 ELSE 0 END) FROM Crime WHERE block = '018XX S KOMENSKY AVE'
|
chicago_crime
|
What is the name of the community with the highest population?
|
name of the community refers to community_area_name; the highest population refers to max(population)
|
SELECT community_area_name FROM Community_Area ORDER BY population DESC LIMIT 1
|
chicago_crime
|
How many incidents of domestic violence occurred in an abandoned building in 2018?
|
domestic violence refers to domestic = 'TRUE'; in an abandoned building refers to location_description = 'ABANDONED BUILDING'; in 2018 refers to date LIKE '%2018%'
|
SELECT SUM(CASE WHEN location_description = 'ABANDONED BUILDING' THEN 1 ELSE 0 END) FROM Crime WHERE date LIKE '%2018%' AND domestic = 'TRUE'
|
chicago_crime
|
What is the population of the district with the least population?
|
the least population refers = min(sum(population))
|
SELECT SUM(population) FROM Community_Area GROUP BY side ORDER BY SUM(population) LIMIT 1
|
chicago_crime
|
How many arrests were made in 2018 in an animal hospital under FBI code 08B?
|
arrest refers to arrest = 'TRUE'; in 2018 refers to date LIKE '%2018%'; in an animal hospital refers to location_description = 'ANIMAL HOSPITAL'; FBI code 08B refers to fbi_code_no = '08B'
|
SELECT SUM(CASE WHEN arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Crime WHERE date LIKE '%2018%' AND location_description = 'ANIMAL HOSPITAL' AND fbi_code_no = '08B'
|
chicago_crime
|
Give the detailed description of all the crimes against society.
|
crime against society refers to crime_against = 'Society'
|
SELECT description FROM FBI_Code WHERE crime_against = 'Society'
|
chicago_crime
|
Who is the commanding officer in the district with the highest number of disorderly conduct?
|
commanding officer refers to commander; the highest number refers to max(count(district_no)); disorderly conduct refers to title = 'Disorderly Conduct'
|
SELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T3.title = 'Disorderly Conduct' AND T2.fbi_code_no = 24 GROUP BY T2.fbi_code_no ORDER BY COUNT(T1.district_no) DESC LIMIT 1
|
chicago_crime
|
Which crime was committed the most by criminals?
|
crime refers to title; committed the most refers to max(fbi_code_no)
|
SELECT T2.title FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no ORDER BY T2.fbi_code_no DESC LIMIT 1
|
chicago_crime
|
In Albany Park, how many arrests were made in an apartment due to criminal sexual abuse?
|
Albany Park refers to district_name = 'Albany Park'; in an apartment refers to location_description = 'APARTMENT'; criminal sexual abuse refers to title = 'Criminal Sexual Abuse'
|
SELECT SUM(CASE WHEN T3.title = 'Criminal Sexual Abuse' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T1.district_name = 'Albany Park' AND T2.arrest = 'TRUE' AND T2.location_description = 'APARTMENT'
|
chicago_crime
|
What is the precise location or coordinate where most of the robberies in Rogers Park occurred?
|
precise location or coordinate refers to latitude, longitude; most refers to fbi_code_no = 3; robbery refers to title = 'Robbery'; Rogers Park refers to community_area_name = 'Rogers Park'
|
SELECT T2.latitude, T2.longitude FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T1.community_area_name = 'Rogers Park' AND T3.title = 'Robbery' AND T3.fbi_code_no = 3
|
chicago_crime
|
How many solicit on public way prostitution crimes were arrested in West Garfield Park?
|
solicit on public way prostitution crime refers to secondary_description = 'SOLICIT ON PUBLIC WAY' AND primary_description = 'PROSTITUTION'; arrested refers to arrest = 'TRUE'; West Garfield Park refers to community_area_name = 'West Garfield Park'
|
SELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN IUCR AS T3 ON T2.iucr_no = T3.iucr_no WHERE T1.community_area_name = 'West Garfield Park' AND T3.secondary_description = 'SOLICIT ON PUBLIC WAY' AND T3.primary_description = 'PROSTITUTION'
|
chicago_crime
|
In the most populated ward, how many incidents of domestic violence were reported in a bar or tavern?
|
the most populated refers to max(population); domestic violence refers to domestic = 'TRUE'; in a bar or tavern refers to location_description = 'BAR OR TAVERN'
|
SELECT COUNT(T2.report_no) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' AND T2.location_description = 'BAR OR TAVERN' ORDER BY T1.Population DESC LIMIT 1
|
chicago_crime
|
How many neighborhoods are there in Near North Side?
|
Near North Side refers to community_area_name = 'Near North Side'
|
SELECT SUM(CASE WHEN T1.community_area_name = 'Near North Side' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no
|
chicago_crime
|
Out of all the incidents of domestic violence reported at the ward represented by alderman Walter Burnett Jr., how many were arrested?
|
domestic violence refers to domestic = 'TRUE'; arrested refers to arrest = 'TRUE'
|
SELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T1.alderman_first_name = 'Walter' AND T1.alderman_last_name = 'Burnett' AND alderman_name_suffix = 'Jr.' AND T2.domestic = 'TRUE'
|
chicago_crime
|
What is the short description of the crime committed the most by criminals in the least populated community?
|
short description refers to title; committed the most refers to max(fbi_code_no); the least populated community refers to min(population)
|
SELECT T3.title FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no GROUP BY T3.title ORDER BY T1.population ASC, T3.fbi_code_no DESC LIMIT 1
|
chicago_crime
|
What is the legislative district's office address where 010XX W LAKE ST is located?
|
the legislative district's office address refers to ward_office_address; 010XX W LAKE ST refers to block = '010XX W LAKE ST'
|
SELECT T1.ward_office_address FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.block = '010XX W LAKE ST' GROUP BY T1.ward_office_address
|
chicago_crime
|
What is the name of the community that has the highest number of crimes related to prostitution?
|
name of the community refers to community_area_name; the highest number of crimes refers to max(case_number); prostitution refers to primary_description = 'PROSTITUTION'
|
SELECT T3.community_area_name FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no INNER JOIN Community_Area AS T3 ON T1.community_area_no = T3.community_area_no WHERE T2.primary_description = 'PROSTITUTION' GROUP BY T1.iucr_no ORDER BY T1.case_number DESC LIMIT 1
|
chicago_crime
|
How many vandalisms were arrested in the ward represented by Edward Burke?
|
vandalism refers to title = 'Vandalism'; arrested refers to arrest = 'TRUE'
|
SELECT SUM(CASE WHEN T1.alderman_last_name = 'Burke' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T3.title = 'Vandalism' AND T2.arrest = 'TRUE' AND T1.alderman_first_name = 'Edward'
|
chicago_crime
|
How many domestic violence cases were reported in May 2018?
|
domestic violence refers to domestic = 'TRUE'; in May 2018 refers to date LIKE '5/%/2018%'
|
SELECT COUNT(*) FROM Crime WHERE date LIKE '5/%/2018%' AND domestic = 'TRUE'
|
chicago_crime
|
List the IUCR numbers and index status of homicide incidents.
|
index status refers to index_code; homicide incident refers to primary_description = 'HOMICIDE'
|
SELECT index_code FROM IUCR WHERE primary_description = 'HOMICIDE'
|
chicago_crime
|
Provide the responsible person and his/her email address of Chicago Lawn.
|
responsible person refers to commander; email address refers to email; Chicago Lawn refers to district_name = 'Chicago Lawn'
|
SELECT commander, email FROM District WHERE district_name = 'Chicago Lawn'
|
chicago_crime
|
What is the alderman's full name of the most crowded ward?
|
alderman's full name refers to alderman_name_suffix, alderman_first_name, alderman_last_name; the most crowded refers to max(population)
|
SELECT alderman_name_suffix, alderman_first_name, alderman_last_name FROM Ward ORDER BY population DESC LIMIT 1
|
chicago_crime
|
List the community area names in the Northwest.
|
the Northwest refers to side = 'Northwest'
|
SELECT community_area_name FROM Community_Area WHERE side = 'Northwest'
|
chicago_crime
|
List down the titles and descriptions of the crimes cases against persons.
|
crime case against persons refers to crime_against = 'Persons'
|
SELECT title, description FROM FBI_Code WHERE crime_against = 'Persons'
|
chicago_crime
|
Describe the specific description and case locations under IUCR 142.
|
specific description refers to secondary_description; location refers to latitude, longitude; IUCR 142 refers to iucr_no = 142
|
SELECT T1.secondary_description, T2.latitude, T2.longitude FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.iucr_no = 142
|
chicago_crime
|
How many crimes were handled by Brendan Reilly on 7th October 2018?
|
7th October 2018 refers to date like '10/7/2018%'
|
SELECT SUM(CASE WHEN T2.alderman_last_name = 'Reilly' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN Ward AS T2 ON T1.ward_no = T2.ward_no WHERE T2.alderman_name_suffix IS NULL AND T2.alderman_first_name = 'Brendan' AND date LIKE '10/7/2018%'
|
chicago_crime
|
How many cases have been arrested among the crimes that happened in the restaurant of Englewood?
|
arrested refers to arrest = 'TRUE'; restaurant refers to location_description = 'RESTAURANT'; Englewood refers to district_name = 'Englewood'
|
SELECT SUM(CASE WHEN T1.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Englewood' AND T1.location_description = 'RESTAURANT'
|
chicago_crime
|
Provide case numbers, aldermen's full names, and district names of the crimes that happened in 0000X N FRANCISCO AVE.
|
aldermen's full name refers to alderman_name_suffix, alderman_first_name, alderman_last_name; 0000X N FRANCISCO AVE refers to block = '0000X N FRANCISCO AVE'
|
SELECT T2.case_number, T3.alderman_first_name, T3.alderman_last_name, T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no INNER JOIN Ward AS T3 ON T2.ward_no = T3.ward_no WHERE T2.block = '0000X N FRANCISCO AVE' GROUP BY T2.case_number, T3.alderman_first_name, T3.alderman_last_name, T1.district_name
|
chicago_crime
|
How many crimes were Misc Non-Index Offense?
|
Misc Non-Index Offense refers to title = 'Misc Non-Index Offense'
|
SELECT SUM(CASE WHEN T1.title = 'Misc Non-Index Offense' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no
|
chicago_crime
|
List down the neighborhood areas of Douglas.
|
neighborhood area refers to neighborhood_name; Douglas refers to community_area_name = 'Douglas'
|
SELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Douglas'
|
chicago_crime
|
Calculate the average crime rate per month in the highest populous area.
|
the highest populous refers to max(population); average crime rate per month = divide(count(report_no where population = max(population)), 12)
|
SELECT CAST(COUNT(T2.report_no) AS REAL) / 12 FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no GROUP BY T1.community_area_no HAVING COUNT(T1.population) ORDER BY COUNT(T1.population) LIMIT 1
|
chicago_crime
|
Among the crimes in the Central, calculate the percentage of larceny incidents.
|
Central refers to side = 'Central'; larceny refers to title = 'Larceny'; percentage = divide(count(report_no where title = 'Larceny'), count(report_no)) where side = 'Central' * 100%
|
SELECT CAST(COUNT(CASE WHEN T3.title = 'Larceny' THEN T2.report_no END) AS REAL) * 100 / COUNT(T2.report_no) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T1.side = 'Central'
|
chicago_crime
|
List the location descriptions and aldermen's full names of the arson by explosive.
|
aldermen's full name refers to alderman_name_suffix, alderman_first_name, alderman_last_name; arson by explosive refers to primary_description = 'ARSON' AND secondary_description = 'BY EXPLOSIVE'
|
SELECT T2.location_description, T1.alderman_first_name, T1.alderman_last_name, T1.alderman_name_suffix FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T3.primary_description = 'ARSON' AND T3.secondary_description = 'BY EXPLOSIVE'
|
chicago_crime
|
Provide the occurrence date and location of the deceptive practice due to the unlawful use of recorded sound.
|
location refers to latitude, longitude; deceptive practice refers to primary_description = 'DECEPTIVE PRACTICE'; unlawful use of recorded sound refers to secondary_description = 'UNLAWFUL USE OF RECORDED SOUND'
|
SELECT T2.date, T2.latitude, T2.longitude FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no WHERE T1.primary_description = 'DECEPTIVE PRACTICE' AND T1.secondary_description = 'UNLAWFUL USE OF RECORDED SOUND'
|
chicago_crime
|
Among the criminal sexual assaults in the district of Adnardo Gutierrez, how many cases happened in the residence?
|
criminal sexual assault refers to title = 'Criminal Sexual Assault'; Adnardo Gutierrez refers to commander = 'Adnardo Gutierrez'; in the residence refers to location_description = 'RESIDENCE'
|
SELECT COUNT(T2.report_no) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T3.title = 'Criminal Sexual Assault' AND T1.commander = 'Adnardo Gutierrez' AND T2.location_description = 'RESIDENCE'
|
chicago_crime
|
How many percent of domestic violence cases were arrested in West Pullman?
|
domestic violence refers to domestic = 'TRUE'; arrested refers to arrest = 'TRUE'; West Pullman refers to community_area_name = 'West Pullman'; percent = divide(count(report_no where arrest = 'TRUE'), count(report_no)) where domestic = 'TRUE' and community_area_name = 'West Pullman' * 100%
|
SELECT CAST(COUNT(CASE WHEN T2.arrest = 'TRUE' THEN T2.report_no END) AS REAL) * 100 / COUNT(T2.report_no) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'West Pullman' AND T2.domestic = 'TRUE'
|
chicago_crime
|
Calculate the percentage of the domestic violence cases handled by Christopher Taliaferro. Among them, list report numbers of cases that happened in the bank.
|
domestic violence refers to domestic = 'TRUE'; report number refers to report_no; in the bank refers to location_description = 'BANK'; percentage = divide(count(report_no where domestic = 'TRUE'), count(report_no)) * 100%
|
SELECT CAST(COUNT(CASE WHEN T1.domestic = 'TRUE' THEN T1.report_no END) AS REAL) * 100 / COUNT(T1.report_no), COUNT(CASE WHEN T1.domestic = 'TRUE' AND T1.location_description = 'BANK' THEN T1.report_no END) AS "number" FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T2.alderman_first_name = 'Christopher' AND T2.alderman_last_name = 'Taliaferro'
|
chicago_crime
|
How many aldermen have "James" as their first name?
|
SELECT COUNT(*) FROM Ward WHERE alderman_first_name = 'James'
|
|
chicago_crime
|
How many crimes are commited on January 1, 2018?
|
on January 1 2018 refers to date LIKE '1/1/2018%'
|
SELECT COUNT(*) FROM Crime WHERE date LIKE '1/1/2018%'
|
chicago_crime
|
Calculate the average population of community areas in the West side.
|
the West side refers to side = 'West'; average population = avg(population) where side = 'West'
|
SELECT AVG(population) FROM Community_Area WHERE side = 'West '
|
chicago_crime
|
Among the cases reported in the ward with Edward Burke as the alderman and happened in the community area with the highest population, provide the report number of the crime with the highest beat.
|
the highest population refers to max(population); report number refers to report_no; the highest beat refers to max(beat)
|
SELECT T2.report_no FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no WHERE T1.alderman_first_name = 'Edward' AND T1.alderman_last_name = 'Burke' ORDER BY T2.beat DESC, T3.population DESC LIMIT 1
|
chicago_crime
|
How many of the crimes that happened in the street have FBI title "Homicide 1st & 2nd Degree"?
|
in the street refers to location_description = 'STREET'
|
SELECT SUM(CASE WHEN T2.location_description = 'STREET' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T1.title = 'Homicide 1st & 2nd Degree'
|
chicago_crime
|
Who is the alderman in the ward associated with the crime with report number 23769?
|
alderman refers to alderman_suffix, alderman_first_name, alderman_last_name; report number 23769 refers to report_no = 23769
|
SELECT T2.alderman_first_name, T2.alderman_last_name FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.report_no = 23769
|
chicago_crime
|
List the case numbers of domestic violence crimes reported in Lincoln Square.
|
domestic violence refers to domestic = 'TRUE'; Lincoln Square refers to community_area_name = 'Lincoln Square'
|
SELECT T2.case_number FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Lincoln Square' AND T2.domestic = 'TRUE'
|
chicago_crime
|
Among the crimes reported to the ward located at 1958 N. Milwaukee Ave., list down the report number of the crimes happened inside the apartment.
|
1958 N. Milwaukee Ave. refers to ward_office_address = '1958 N. Milwaukee Ave.'; report number refers to case_number; inside the apartment refers to location_description = 'APARTMENT'
|
SELECT T1.case_number FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.location_description = 'APARTMENT' AND T2.ward_office_address = '1958 N. Milwaukee Ave.'
|
chicago_crime
|
What is the total number of crimes that happened in Bridgeport with beat less than 1000?
|
Bridgeport refers to community_area_name = 'Bridgeport'; with beat less than 1000 refers to beat < 1000; total number = count(beat) where community_area_name = 'Bridgeport' and beat < 1000
|
SELECT SUM(CASE WHEN T2.beat < 1000 THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Bridgeport'
|
chicago_crime
|
List the report number of crimes reported in a community area in the far north side with a population greater than 60,000.
|
report number refers to report_no; the far north side refers to side = 'Far North'; population greater than 60,000 refers to population > '60000'
|
SELECT SUM(CASE WHEN T1.population > 60000 THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.side = 'Far North '
|
chicago_crime
|
List the report number of crimes against property happened in Riverdale.
|
crime against property refers to crime_against = 'Property'; Riverdale refers to community_area_name = 'Riverdale'
|
SELECT SUM(CASE WHEN T1.crime_against = 'Property' 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 T3.community_area_name = 'Riverdale'
|
chicago_crime
|
How many domestic violence cases were brought in the ward that uses "[email protected]"?
|
domestic violence refers to domestic = 'TRUE'; uses "[email protected]" refers to ward_email = '[email protected]'
|
SELECT SUM(CASE WHEN T2.domestic = 'TRUE' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no WHERE T1.ward_email = '[email protected]'
|
chicago_crime
|
What is the district address associated with the case JB107731?
|
case JB107731 refers to case_number = 'JB107731'
|
SELECT T1.address FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T2.case_number = 'JB107731'
|
chicago_crime
|
Calculate the total beat of the crimes reported in a community area in the central side with population of 50,000 and above.
|
the central side refers to side = 'Central'; population of 50,000 and above refers to population > '50000'; total beat = sum(beat) where side = 'Central' and population > '50000'
|
SELECT 1.0 * SUM(CASE WHEN T1.population > 50000 THEN T2.beat ELSE 0 END) AS sum FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.side = 'Central'
|
chicago_crime
|
List the case number of crimes against society that happened in June 2018.
|
crime against society refers to crime_against = 'Society'; in June 2018 refers to date LIKE '6/%/2018%'
|
SELECT T2.case_number FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T2.date LIKE '6/%/2018%' AND T1.crime_against = 'Society'
|
chicago_crime
|
Among the crimes located in the community area with the highest population, what is the percentage of domestic violence?
|
the highest population refers to max(population); domestic violence refers to domestic = 'TRUE'; percentage = divide(count(domestic = 'TRUE'), count(domestic)) where population = max(population) * 100%
|
SELECT CAST(COUNT(CASE WHEN T2.domestic = 'TRUE' THEN T2.domestic END) AS REAL) * 100 / COUNT(T2.domestic) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no GROUP BY T1.community_area_no HAVING COUNT(T1.population) ORDER BY COUNT(T1.population) DESC LIMIT 1
|
chicago_crime
|
List the case number of the crimes in wards with population below 52000 that have beat greater than the 90% of the average beat of all crimes.
|
population below 52000 refers to population < 52000; beat greater than the 90% of the average beat refers to beat > multiply(avg(beat), 0.9) where population < 52000
|
SELECT COUNT(T1.report_no) FROM Crime AS T1 INNER JOIN Ward AS T2 ON T1.ward_no = T2.ward_no WHERE T2.Population < 52000 AND T1.beat > ( SELECT AVG(T1.beat) * 0.9 FROM Crime AS T1 INNER JOIN Ward AS T2 ON T1.ward_no = T2.ward_no WHERE T2.Population < 52000 )
|
chicago_crime
|
Please list the area name of the communities in the Far north side, which has a population of more than 50000 but less than 70000.
|
area name refers to community_area_name; the Far north side refers to side = 'Far North'; a population of more than 50000 but less than 70000 refers to population BETWEEN '50000' AND '70000'
|
SELECT community_area_name, side FROM Community_Area WHERE side = 'Far North ' AND population BETWEEN 50000 AND 70000
|
chicago_crime
|
Give the coordinate of the alleys where a crime was reported and an arrest was made.
|
coordinate refers to latitude, longitude; alley refers to location_description = 'ALLEY'; an arrest was made refers to arrest = 'TRUE'
|
SELECT latitude, longitude FROM Crime WHERE location_description = 'ALLEY' AND arrest = 'TRUE' GROUP BY latitude, longitude
|
chicago_crime
|
Find the commander's name, email address, and phone number of the Ogden district.
|
commander's name refers to commander; email address refers to email; phone number refers to phone
|
SELECT commander, email, phone FROM District WHERE district_name = 'Ogden'
|
chicago_crime
|
What is the FBI code and definition of Gambling?
|
FBI code refers to fbi_code_no; definition refers to description; Gambling refers to title = 'Gambling'
|
SELECT fbi_code_no, description FROM FBI_Code WHERE title = 'Gambling'
|
chicago_crime
|
Among the crimes, what percentage are severe?
|
severe refers to index_code = 'I'; percentage = divide(count(iucr_no where index_code = 'I'), count(iucr_no)) * 100%
|
SELECT CAST(COUNT(CASE WHEN index_code = 'I' THEN iucr_no ELSE NULL END) AS REAL) * 100 / COUNT(iucr_no) FROM IUCR
|
chicago_crime
|
What kind of location in Austin reported the most number of crimes?
|
"Austin" is the district_name; the most number of crime refers to Max(Count(case_number)); kind of location refers to location_description
|
SELECT T2.location_description FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T1.district_name = 'Austin' GROUP BY T2.location_description ORDER BY COUNT(T2.case_number) DESC LIMIT 1
|
chicago_crime
|
On average, how many community areas are there in a side?
|
average = Divide(Count(ward_no), Count(side))
|
SELECT CAST(COUNT(T1.ward_no) AS REAL) / COUNT(DISTINCT T3.side) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no
|
chicago_crime
|
Which community area has the highest number of crimes reported on the street?
|
reported on the street refers to location_description = 'STREET'; community area with highest number of crime refers to Max(Count(location_description)); community area refers to community_area_no
|
SELECT T1.community_area_no FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T2.location_description = 'STREET' GROUP BY T1.community_area_no ORDER BY COUNT(T2.location_description) DESC LIMIT 1
|
chicago_crime
|
What is the average number of reckless homicides that happened in a district?
|
"RECKLESS HOMICIDE" is the secondary_description; average = Divide (Count(report_no), Count(district_name))
|
SELECT CAST(COUNT(T2.report_no) AS REAL) / COUNT(DISTINCT T1.district_name) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T3.secondary_description = 'RECKLESS HOMICIDE'
|
chicago_crime
|
Find the ward office's address and phone number of the ward where the most crimes without arrest occurred.
|
the most crime without arrest refers to Max(Count(arrest = 'FALSE')); phone number refers to ward_office_phone; address refers to ward_office_address
|
SELECT T2.ward_office_address, T2.ward_office_phone FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.arrest = 'FALSE' GROUP BY T2.ward_office_address, T2.ward_office_phone ORDER BY COUNT(T1.arrest) DESC LIMIT 1
|
chicago_crime
|
Give the case number and coordinates of the places where child abduction is reported.
|
"CHILD ABDUCTION" is the secondary_description; coordinates refers to latitude, longitude
|
SELECT T1.case_number, T1.latitude, T1.longitude FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T2.iucr_no = T1.iucr_no WHERE T2.secondary_description = 'CHILD ABDUCTION'
|
chicago_crime
|
What is the most reported crime in the Northwest side?
|
most reported crime refers to max(Count(secondary_description))
|
SELECT T3.secondary_description FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T1.side = 'Northwest ' GROUP BY T3.secondary_description ORDER BY COUNT(*) DESC LIMIT 1
|
chicago_crime
|
Find the community area where the least number of domestic crimes happened.
|
least number of domestic crime refers to Min(Count(domestic = "TRUE")); community area refers to community_area_no
|
SELECT T2.community_area_no FROM Crime AS T1 INNER JOIN Community_Area AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.domestic = 'TRUE' GROUP BY T2.community_area_no ORDER BY COUNT(T2.community_area_no) ASC LIMIT 1
|
chicago_crime
|
In drug abuse crimes, what percentage is related to cannabis?
|
drug abuse crime refer to title = 'Drug Abuse'; percentage = Divide (Count (secondary_description LIKE '%CANNABIS%'), Count (secondary_description)) * 100
|
SELECT CAST(COUNT(CASE WHEN T1.secondary_description LIKE '%CANNABIS%' THEN T1.secondary_description END) AS REAL) * 100 / COUNT(T1.secondary_description) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T3.title = 'Drug Abuse'
|
chicago_crime
|
What is the average number of less severe crimes reported a day in February of 2018?
|
day in February of 2018 refers to date LIKE '2/%/2018'; less severe crime refers to index_code = 'N'; average = Divide (Count(case_number), 28)
|
SELECT CAST(COUNT(T2.case_number) AS REAL) / 28 FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no WHERE T2.date LIKE '2/%/2018%' AND T1.index_code = 'N'
|
chicago_crime
|
List the name and population of the communities where more than average solicit for prostitutes were reported.
|
"SOLICIT FOR PROSTITUTE" is the secondary_description; more than average refers to count(iucr_no) > Divide (Count(secondary_description = 'SOLICIT FOR PROSTITUTE'), Count(iucr_no)); name of community refers to community_area_name
|
SELECT T2.community_area_name, T2.population FROM Crime AS T1 INNER JOIN Community_Area AS T2 ON T2.community_area_no = T1.community_area_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T1.iucr_no WHERE T3.iucr_no = ( SELECT iucr_no FROM IUCR WHERE secondary_description = 'SOLICIT FOR PROSTITUTE' GROUP BY iucr_no HAVING COUNT(iucr_no) > ( SELECT SUM(CASE WHEN secondary_description = 'SOLICIT FOR PROSTITUTE' THEN 1.0 ELSE 0 END) / COUNT(iucr_no) AS average FROM IUCR ) )
|
chicago_crime
|
Among the incidents reported in Harrison, what percentage are disorderly conduct?
|
"Harrison" is the district_name; 'Disorderly Conduct' is the title; percentage = Divide (Count(title = 'Disorderly Conduct'), Count(report_no)) * 100; incident report refers to report_no
|
SELECT COUNT(CASE WHEN T3.title = 'Disorderly Conduct' THEN T2.report_no END) * 100.0 / COUNT(T2.report_no) AS per FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T1.district_name = 'Harrison'
|
chicago_crime
|
Calculate the difference in the average number of vehicular hijackings and aggravated vehicular hijackings in the districts.
|
"VEHICULAR HIJACKING" and "AGGRAVATED VEHICULAR HIJACKING" are both secondary_description; difference in average = Subtract (Divide(Count(secondary_description = 'VEHICULAR HIJACKING'), Count(district_name)), Divide(Count(secondary_description = "AGGRAVATED VEHICULAR HIJACKING"), Count(district_name)))
|
SELECT ROUND(CAST(COUNT(CASE WHEN T1.secondary_description = 'VEHICULAR HIJACKING' THEN T1.iucr_no END) AS REAL) / CAST(COUNT(DISTINCT CASE WHEN T1.secondary_description = 'VEHICULAR HIJACKING' THEN T3.district_name END) AS REAL) - CAST(COUNT(CASE WHEN T1.secondary_description = 'AGGRAVATED VEHICULAR HIJACKING' THEN T1.iucr_no END) AS REAL) / CAST(COUNT(DISTINCT CASE WHEN T1.secondary_description = 'AGGRAVATED VEHICULAR HIJACKING' THEN T3.district_name END) AS REAL), 4) AS "difference" 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
|
chicago_crime
|
How many crimes happened in longitude -8772658001?
|
SELECT COUNT(*) FROM Crime WHERE longitude = '-87.72658001'
|
|
chicago_crime
|
List all the crimes of the narcotic type that exist.
|
narcotic type refers to primary_description = 'NARCOTICS'; crime refers to secondary_description
|
SELECT secondary_description FROM IUCR WHERE primary_description = 'NARCOTICS' GROUP BY secondary_description
|
chicago_crime
|
What is the first name of the aldermen of wards with more than 50,000 inhabitants?
|
more than 50000 inhabitants refers to Population > 50000; first name of alderman refers to alderman_first_name
|
SELECT alderman_first_name FROM Ward WHERE Population > 50000
|
chicago_crime
|
List crimes that the FBI has classified as Drug Abuse by their report number.
|
"Drug Abuse" is the title of crime
|
SELECT T2.report_no FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T1.title = 'Drug Abuse'
|
chicago_crime
|
How many weapons violation crimes have occurred in the Calumet district?
|
"Calumet" is the district_name; 'WEAPON VIOLATION' is the primary_description of crime
|
SELECT SUM(CASE WHEN T3.district_name = 'Calumet' THEN 1 ELSE 0 END) 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 = 'WEAPONS VIOLATION'
|
chicago_crime
|
What is the exact location of the crimes that occurred in the Belmont Cragin community?
|
Belmont Cragin community refers to community_area_name = 'Belmont Cragin'; exact location refers to latitude, longitude
|
SELECT T2.latitude, T2.longitude FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Belmont Cragin' GROUP BY T2.latitude, T2.longitude
|
chicago_crime
|
How many different types of crimes, according to the primary description, have occurred in the Hermosa neighborhood?
|
"Hermosa" is the neighborhood_name
|
SELECT SUM(CASE WHEN T4.neighborhood_name = 'Hermosa' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T4 ON T4.community_area_no = T3.community_area_no
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.