problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: Tell the number of cases with arrests in North Lawndale community.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What is the percentage of under $500 thefts among all cases that happened in West Englewood?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What is the percentage of larceny cases among all cases that happened in Edgewater community?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: How many crimes were committed at 018XX S KOMENSKY AVEin May 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT SUM(CASE WHEN date LIKE '5/%/2018%' THEN 1 ELSE 0 END) FROM Crime WHERE block = '018XX S KOMENSKY AVE'
Write SQL query to solve given problem: What is the name of the community with the highest population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT community_area_name FROM Community_Area ORDER BY population DESC LIMIT 1
Write SQL query to solve given problem: How many incidents of domestic violence occurred in an abandoned building in 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT SUM(CASE WHEN location_description = 'ABANDONED BUILDING' THEN 1 ELSE 0 END) FROM Crime WHERE date LIKE '%2018%' AND domestic = 'TRUE'
Write SQL query to solve given problem: What is the population of the district with the least population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT SUM(population) FROM Community_Area GROUP BY side ORDER BY SUM(population) LIMIT 1
Write SQL query to solve given problem: How many arrests were made in 2018 in an animal hospital under FBI code 08B?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Give the detailed description of all the crimes against society.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT description FROM FBI_Code WHERE crime_against = 'Society'
Write SQL query to solve given problem: Who is the commanding officer in the district with the highest number of disorderly conduct?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: Which crime was committed the most by criminals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: In Albany Park, how many arrests were made in an apartment due to criminal sexual abuse?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What is the precise location or coordinate where most of the robberies in Rogers Park occurred?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many solicit on public way prostitution crimes were arrested in West Garfield Park?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: In the most populated ward, how many incidents of domestic violence were reported in a bar or tavern?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many neighborhoods are there in Near North Side?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: Out of all the incidents of domestic violence reported at the ward represented by alderman Walter Burnett Jr., how many were arrested?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What is the short description of the crime committed the most by criminals in the least populated community?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: What is the legislative district's office address where 010XX W LAKE ST is located?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: What is the name of the community that has the highest number of crimes related to prostitution?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many vandalisms were arrested in the ward represented by Edward Burke?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: How many domestic violence cases were reported in May 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT COUNT(*) FROM Crime WHERE date LIKE '5/%/2018%' AND domestic = 'TRUE'
Write SQL query to solve given problem: List the IUCR numbers and index status of homicide incidents.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT index_code FROM IUCR WHERE primary_description = 'HOMICIDE'
Write SQL query to solve given problem: Provide the responsible person and his/her email address of Chicago Lawn.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT commander, email FROM District WHERE district_name = 'Chicago Lawn'
Write SQL query to solve given problem: What is the alderman's full name of the most crowded ward?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT alderman_name_suffix, alderman_first_name, alderman_last_name FROM Ward ORDER BY population DESC LIMIT 1
Write SQL query to solve given problem: List the community area names in the Northwest.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT community_area_name FROM Community_Area WHERE side = 'Northwest'
Write SQL query to solve given problem: List down the titles and descriptions of the crimes cases against persons.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT title, description FROM FBI_Code WHERE crime_against = 'Persons'
Write SQL query to solve given problem: Describe the specific description and case locations under IUCR 142.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many crimes were handled by Brendan Reilly on 7th October 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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%'
Write SQL query to solve given problem: How many cases have been arrested among the crimes that happened in the restaurant of Englewood?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Provide case numbers, aldermen's full names, and district names of the crimes that happened in 0000X N FRANCISCO AVE.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many crimes were Misc Non-Index Offense?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: List down the neighborhood areas of Douglas.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Calculate the average crime rate per month in the highest populous area.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: Among the crimes in the Central, calculate the percentage of larceny incidents.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: List the location descriptions and aldermen's full names of the arson by explosive.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Provide the occurrence date and location of the deceptive practice due to the unlawful use of recorded sound.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Among the criminal sexual assaults in the district of Adnardo Gutierrez, how many cases happened in the residence?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: How many percent of domestic violence cases were arrested in West Pullman?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Calculate the percentage of the domestic violence cases handled by Christopher Taliaferro. Among them, list report numbers of cases that happened in the bank.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: How many aldermen have "James" as their first name?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT COUNT(*) FROM Ward WHERE alderman_first_name = 'James'
Write SQL query to solve given problem: How many crimes are commited on January 1, 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT COUNT(*) FROM Crime WHERE date LIKE '1/1/2018%'
Write SQL query to solve given problem: Calculate the average population of community areas in the West side.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT AVG(population) FROM Community_Area WHERE side = 'West '
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many of the crimes that happened in the street have FBI title "Homicide 1st & 2nd Degree"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Who is the alderman in the ward associated with the crime with report number 23769?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: List the case numbers of domestic violence crimes reported in Lincoln Square.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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.'
Write SQL query to solve given problem: What is the total number of crimes that happened in Bridgeport with beat less than 1000?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: List the report number of crimes reported in a community area in the far north side with a population greater than 60,000.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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 '
Write SQL query to solve given problem: List the report number of crimes against property happened in Riverdale.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: How many domestic violence cases were brought in the ward that uses "[email protected]"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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]'
Write SQL query to solve given problem: What is the district address associated with the case JB107731?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT T1.address FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T2.case_number = 'JB107731'
Write SQL query to solve given problem: Calculate the total beat of the crimes reported in a community area in the central side with population of 50,000 and above.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: List the case number of crimes against society that happened in June 2018.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Among the crimes located in the community area with the highest population, what is the percentage of domestic violence?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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 )
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT community_area_name, side FROM Community_Area WHERE side = 'Far North ' AND population BETWEEN 50000 AND 70000
Write SQL query to solve given problem: Give the coordinate of the alleys where a crime was reported and an arrest was made.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT latitude, longitude FROM Crime WHERE location_description = 'ALLEY' AND arrest = 'TRUE' GROUP BY latitude, longitude
Write SQL query to solve given problem: Find the commander's name, email address, and phone number of the Ogden district.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT commander, email, phone FROM District WHERE district_name = 'Ogden'
Write SQL query to solve given problem: What is the FBI code and definition of Gambling?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT fbi_code_no, description FROM FBI_Code WHERE title = 'Gambling'
Write SQL query to solve given problem: Among the crimes, what percentage are severe?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT CAST(COUNT(CASE WHEN index_code = 'I' THEN iucr_no ELSE NULL END) AS REAL) * 100 / COUNT(iucr_no) FROM IUCR
Write SQL query to solve given problem: What kind of location in Austin reported the most number of crimes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: On average, how many community areas are there in a side?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: Which community area has the highest number of crimes reported on the street?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: What is the average number of reckless homicides that happened in a district?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Find the ward office's address and phone number of the ward where the most crimes without arrest occurred.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: Give the case number and coordinates of the places where child abduction is reported.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What is the most reported crime in the Northwest side?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: Find the community area where the least number of domestic crimes happened.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: In drug abuse crimes, what percentage is related to cannabis?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What is the average number of less severe crimes reported a day in February of 2018?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: List the name and population of the communities where more than average solicit for prostitutes were reported.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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 ) )
Write SQL query to solve given problem: Among the incidents reported in Harrison, what percentage are disorderly conduct?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Calculate the difference in the average number of vehicular hijackings and aggravated vehicular hijackings in the districts.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many crimes happened in longitude -8772658001?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT COUNT(*) FROM Crime WHERE longitude = '-87.72658001'
Write SQL query to solve given problem: List all the crimes of the narcotic type that exist.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT secondary_description FROM IUCR WHERE primary_description = 'NARCOTICS' GROUP BY secondary_description
Write SQL query to solve given problem: What is the first name of the aldermen of wards with more than 50,000 inhabitants?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT alderman_first_name FROM Ward WHERE Population > 50000
Write SQL query to solve given problem: List crimes that the FBI has classified as Drug Abuse by their report number.. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_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'
Write SQL query to solve given problem: How many weapons violation crimes have occurred in the Calumet district?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_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'
Write SQL query to solve given problem: What is the exact location of the crimes that occurred in the Belmont Cragin community?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many different types of crimes, according to the primary description, have occurred in the Hermosa neighborhood?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many domestic crime cases has Commander Ronald A. Pontecore Jr. been responsible for investigating?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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.'
Write SQL query to solve given problem: How many crimes against society happened in the Wentworth district according to the FBI?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: How many crimes described as 'The theft of a motor vehicle' by the FBI have taken place in the Lake View community?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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.'
Write SQL query to solve given problem: In which district have there been more intimidation-type crimes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: What types of domestic crimes have occurred the most in the North Lawndale community?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: In which ward of more than 55,000 inhabitants are there more crimes of intimidation with extortion?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: Which commander has had to deal with more cases of criminal sexual abuse?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: What percentage of non-domestic crimes have occurred in the Jefferson Park district?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What is the average population of the wards where apartment crimes have been reported without arrests?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: What are the full names of the top 5 most crowded ward aldermen?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT alderman_first_name, alderman_last_name FROM Ward ORDER BY Population DESC LIMIT 5
Write SQL query to solve given problem: How many crime against property are there?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT COUNT(*) AS cnt FROM FBI_Code WHERE crime_against = 'Property'
Write SQL query to solve given problem: How many districts are there in the police district building with a zip code of 60608?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT COUNT(*) AS cnt FROM District WHERE zip_code = 60608
Write SQL query to solve given problem: Who is the crime against criminal sexual abuse?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
SELECT crime_against FROM FBI_Code WHERE title = 'Criminal Sexual Abuse'
Write SQL query to solve given problem: Which community has the highest number of neighborhoods?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: How many severe crime incidents were reported at coordinate 41.64820151, -87.54430496?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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'
Write SQL query to solve given problem: Who is the commanding officer in the district with the highest number of reported crimes where no arrest has been made?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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
Write SQL query to solve given problem: What are the general and specific descriptions of the most common crime incidents that happened in an aircraft?. Keep the solution inside sql tag ```sql [SQL-Query] ```
chicago_crime
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