Chinastark/bird_dataset huggingface dataset:
Database: chicago_crime
Note: "North Lawndale' is the community_area_name; occur the most domestic crime refers to Max(Count(domestic = 'TRUE'));
Question: What types of domestic crimes have occurred the most in the North Lawndale community?
SQL: SELECT crime.domestic FROM community_area INNER JOIN crime ON crime.community_area_no = community_area.community_area_no WHERE community_area.community_area_name = 'North Lawndale' AND crime.domestic = 'TRUE' GROUP BY crime.domestic ORDER BY count(crime.domestic) DESC LIMIT 1
Database: chicago_crime
Note: more than 55000 inhabitants refers to population > 55000; 'INTIMIDATION' is the primary_description; 'EXTORTION' refers to secondary_description; more crime refers to Count(ward_no);
Question: In which ward of more than 55,000 inhabitants are there more crimes of intimidation with extortion?
SQL: SELECT ward.ward_no FROM iucr INNER JOIN crime ON crime.iucr_no = iucr.iucr_no INNER JOIN ward ON ward.ward_no = crime.ward_no WHERE iucr.primary_description = 'INTIMIDATION' AND iucr.secondary_description = 'EXTORTION' AND ward.population > 55000 GROUP BY ward.ward_no ORDER BY count(ward.ward_no) DESC LIMIT 1
Database: chicago_crime
Note: more cases of criminal sexual abuse refers to Max(Count(secondary_description = 'CRIMINAL SEXUAL ABUSE'));
Question: Which commander has had to deal with more cases of criminal sexual abuse?
SQL: SELECT district.commander FROM iucr INNER JOIN crime ON crime.iucr_no = iucr.iucr_no INNER JOIN district ON district.district_no = crime.district_no WHERE iucr.secondary_description = 'CRIMINAL SEXUAL ABUSE' GROUP BY district.commander ORDER BY count(iucr.secondary_description) DESC LIMIT 1
Database: chicago_crime
Note: non domestic crime refers to domestic = 'FALSE'; 'Jefferson Park' is the district_name; percentage = Divide (Count (case_number where domestic = 'FALSE'), Count(case_number)) * 100;
Question: What percentage of non-domestic crimes have occurred in the Jefferson Park district?
SQL: SELECT cast(count(CASE WHEN crime.domestic = 'FALSE' THEN crime.case_number END) AS REAL) * 100 / count(crime.case_number) FROM district INNER JOIN crime ON crime.district_no = district.district_no WHERE district.district_name = 'Jefferson Park'
Database: chicago_crime
Note: apartment crime refers to location_description = 'APARTMENT';  without arrest refers to arrest = 'FALSE'; average population = AVG(population);
Question: What is the average population of the wards where apartment crimes have been reported without arrests?
SQL: SELECT avg(ward.population) FROM crime INNER JOIN ward ON ward.ward_no = crime.ward_no WHERE crime.location_description = 'APARTMENT' AND crime.arrest = 'FALSE'
Database: chicago_crime
Note: most crowded ward refers to Max(population); full name of alderman refers to alderman_first_name, alderman_last_name;
Question: What are the full names of the top 5 most crowded ward aldermen?
SQL: SELECT alderman_first_name, alderman_last_name FROM ward ORDER BY population DESC LIMIT 5
Database: chicago_crime
Question: How many crime against property are there?
SQL: SELECT count(*) AS cnt FROM fbi_code WHERE crime_against = 'Property'
Database: chicago_crime
Note: district refers to district_name;
Question: How many districts are there in the police district building with a zip code of 60608?
SQL: SELECT count(*) AS cnt FROM district WHERE zip_code = 60608
Database: chicago_crime
Note: "Criminal Sexual Abuse" is the title of crime;
Question: Who is the crime against criminal sexual abuse?
SQL: SELECT crime_against FROM fbi_code WHERE title = 'Criminal Sexual Abuse'
Database: chicago_crime
Note: community with highest number of neighborhoods refers to Max(Count(community_area_no)); community refers to community_area_name;
Question: Which community has the highest number of neighborhoods?
SQL: SELECT community_area.community_area_name FROM community_area INNER JOIN neighborhood ON community_area.community_area_no = neighborhood.community_area_no ORDER BY neighborhood.community_area_no DESC LIMIT 1
Database: chicago_crime
Note: coordinates refers to latitude, longitude; severe crime refers to index_code = 'I';
Question: How many severe crime incidents were reported at coordinate 41.64820151, -87.54430496?
SQL: SELECT sum(CASE WHEN crime.longitude = '-87.54430496' THEN 1 ELSE 0 END) FROM crime INNER JOIN iucr ON crime.report_no = iucr.iucr_no WHERE iucr.index_code = 'I' AND crime.latitude = '41.64820251'
Database: chicago_crime
Note: where no arrest refers to arrest = 'FALSE'; highest number of crime refers to Max(Count(report_no)); commanding officer refers to commander;
Question: Who is the commanding officer in the district with the highest number of reported crimes where no arrest has been made?
SQL: SELECT district.commander FROM crime INNER JOIN district ON crime.district_no = district.district_no WHERE crime.arrest = 'FALSE' GROUP BY district.commander ORDER BY count(crime.report_no) DESC LIMIT 1
Database: chicago_crime
Note: in aircraft refers to location_description = 'AIRCRAFT'; general description refers to primary_description; specific description refers to secondary_description; most common crime incidents refers to Max(Count(iucr_no));
Question: What are the general and specific descriptions of the most common crime incidents that happened in an aircraft?
SQL: SELECT iucr.primary_description, iucr.secondary_description FROM crime INNER JOIN iucr ON crime.iucr_no = iucr.iucr_no WHERE crime.location_description = 'AIRCRAFT' GROUP BY crime.iucr_no ORDER BY count(crime.iucr_no) DESC LIMIT 1
Database: chicago_crime
Note: "Deering" and "Near West" are both district_name; 'LIBRARY' is the location_description; district with the most number of crime Max(Count(district_no));
Question: Between Deering and Near West districts, which district reported the most number of crime incidents that happened in a library?
SQL: SELECT district.district_name FROM district INNER JOIN crime ON district.district_no = crime.district_no WHERE district.district_name IN ('Deering', 'Near West') AND crime.location_description = 'LIBRARY' GROUP BY district.district_name ORDER BY count(crime.district_no) DESC LIMIT 1
Database: chicago_crime
Note: "BURGLARY" is the primary_description; 'FORCIBLE ENTRY' is the secondary_description; 'DAY CARE CENTER' is the location_description; arrests have been made refers to arrest = 'TRUE';
Question: How many arrests have been made due to forcible entry burglary that took place in a day care center?
SQL: SELECT sum(CASE WHEN crime.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM iucr INNER JOIN crime ON iucr.iucr_no = crime.iucr_no WHERE crime.location_description = 'DAY CARE CENTER' AND iucr.secondary_description = 'FORCIBLE ENTRY' AND iucr.primary_description = 'BURGLARY'
Database: chicago_crime
Note: domestic violence refers to domestic = 'TRUE'; highest number of case refers to Max(Count(district_no)); name of district refers to distric_name;
Question: What is the name of the district with the highest number of domestic violence cases?
SQL: SELECT district.district_name FROM crime INNER JOIN district ON crime.district_no = district.district_no WHERE crime.domestic = 'TRUE' GROUP BY district.district_name ORDER BY count(crime.district_no) DESC LIMIT 1
Database: chicago_crime
Note: least populated refers to Min(population); community refers to community_area_no; most common location refers to Max(Count(location_description));
Question: In the least populated community, what is the most common location of all the reported crime incidents?
SQL: SELECT crime.location_description FROM community_area INNER JOIN crime ON community_area.community_area_no = crime.community_area_no WHERE community_area.population = ( SELECT min(population) FROM community_area ) AND crime.location_description IS NOT NULL GROUP BY crime.location_description
Database: chicago_crime
Note: "The violation of laws " is the description of incidents; no arrest has been made refers to arrest = 'FALSE';
Question: How many violation of laws are there where no arrest has been made?
SQL: SELECT sum(CASE WHEN fbi_code.description LIKE '%The violation of laws%' THEN 1 ELSE 0 END) FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no WHERE crime.arrest = 'FALSE'
Database: chicago_crime
Note: precise coordinates refers to latitude, longitude; 'Simple Assault' is the title of incident; 'Chatham' is the community_area_name; most incident happened refers to Max(Count(latitude, longitude));
Question: What is the precise coordinate of the location where simple assault incidents happened the most in Chatham?
SQL: SELECT crime.latitude, crime.longitude FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no INNER JOIN community_area ON crime.community_area_no = community_area.community_area_no WHERE fbi_code.title = 'Simple Assault' AND community_area.community_area_name = 'Chatham' AND community_area.community_area_no = 44 ORDER BY crime.latitude DESC, crime.longitude DESC LIMIT 1
Database: chicago_crime
Note: "unlawful taking, carrying, leading, or riding away of property from the possession or constructive possession of another person" is the description; name of community refer to community_area_name; most reported incidents refers to Max(Count(fbi_code_no));
Question: 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?
SQL: SELECT community_area.community_area_name FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no INNER JOIN community_area ON crime.community_area_no = community_area.community_area_no WHERE community_area.side = 'South' AND fbi_code.description = 'The unlawful taking, carrying, leading, or riding away of property FROM the possession or constructive possession of another person.' GROUP BY community_area.community_area_name ORDER BY count(fbi_code.fbi_code_no) DESC LIMIT 1
Database: chicago_crime
Note: "Englewood" is the community_area_name; 'Society' is the crime_against;
Question: How many crime against society were reported in Englewood?
SQL: SELECT sum(CASE WHEN community_area.community_area_name = 'Englewood' THEN 1 ELSE 0 END) FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no INNER JOIN community_area ON crime.community_area_no = community_area.community_area_no WHERE fbi_code.crime_against = 'Society'
Database: chicago_crime
Note: fraud incident refers to title = 'Fraud'; reported in January 2018 refers to Substr(date, 1, 1) = '1' AND Substr(date, 5, 4) = '2018'; description of location refers to location_description; weekly average refers to Divide (Count(report_no), 4); majority of incidents occurred refers to Max(Count(location_description));
Question: 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.
SQL: SELECT cast(count(fbi_code.fbi_code_no) AS REAL) / 4 FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no WHERE substr(crime.date, 1, 1) = '1' AND substr(crime.date, 5, 4) = '2018'
Database: chicago_crime
Note: population of more than 50000 refers to population > 50000; community area refers to community_area_name;
Question: Please list any three community areas with a population of more than 50,000.
SQL: SELECT community_area_name FROM community_area WHERE population > 50000 LIMIT 3
Database: chicago_crime
Note: central side refers to side = 'Central'; community refers to community_area_name;
Question: What are the communities that are grouped together on the central side?
SQL: SELECT community_area_name FROM community_area WHERE side = 'Central'
Database: chicago_crime
Note: population of more than 30000 refers to population > 30000; 'North' and 'South' both are the side; different number of community refers to Subtract(Count(community_area_no where side = 'South'), Count(community_area_no where side = 'North'));
Question: 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?
SQL: 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: chicago_crime
Note: "Near West" is the district_name; all contact information refers to phone, fax, tty, twitter;
Question: Please list all of the contact information for the police district Near West.
SQL: SELECT phone, fax, tty, twitter FROM district WHERE district_name = 'Near West'
Database: chicago_crime
Note: "Lincoln" is the district_name; responsible for crime case refers to commander;
Question: Who is responsible for crime cases in district Lincoln?
SQL: SELECT commander FROM district WHERE district_name = 'Lincoln'
Database: chicago_crime
Note: incident 275 refers to iucr_no = 275; general description refers to primary_description; specific description refers to secondary_description;
Question: What is the general and specific description of incident 275?
SQL: SELECT primary_description, secondary_description FROM iucr WHERE iucr_no = 275
Database: chicago_crime
Note: related to sexual assault refers to primary_description = 'crime SEXUAL ASSAULT'; severe case refers to index_code = 'I'; percentage = Divide (Count (iucr_no where primary_description = 'crime SEXUAL ASSAULT'), Count (iucr_no)) * 100;
Question: What is the percentage of severe cases that are related to sexual assault?
SQL: 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: chicago_crime
Note: "North Center" is the community_area_name; neighborhoods refers to neighborhood_name;
Question: What are the neighborhoods that are located in the North Center community area?
SQL: SELECT neighborhood.neighborhood_name FROM community_area INNER JOIN neighborhood ON community_area.community_area_no = neighborhood.community_area_no WHERE community_area.community_area_name = 'North Center'
Database: chicago_crime
Note: "Forest Glen" is the community_area_name; neighborhoods refers to neighborhood_name;
Question: How many neighborhoods can be found in the Forest Glen community area?
SQL: SELECT sum(CASE WHEN community_area.community_area_name = 'Forest Glen' THEN 1 ELSE 0 END) FROM neighborhood INNER JOIN community_area ON neighborhood.community_area_no = community_area.community_area_no
Database: chicago_crime
Note: "Avoladale Gardens", "Irving Park", "Kilbourn Park", "Merchant Park", "Old Irving Park", "The Villa" are neighborhood_name; total population refers to Sum(population);
Question: What is the total population of the neighborhoods Avondale Gardens, Irving Park, Kilbourn Park, Merchant Park, Old Irving Park, and The Villa?
SQL: SELECT sum(community_area.population) AS SUM FROM neighborhood INNER JOIN community_area ON neighborhood.community_area_no = community_area.community_area_no WHERE neighborhood.neighborhood_name = 'Avondale Gardens' OR neighborhood.neighborhood_name = 'Irving Park' OR neighborhood.neighborhood_name = 'Kilbourn Park' OR neighborhood.neighborhood_name = 'Merchant Park' OR neighborhood.neighborhood_name = 'Old Irving Park' OR neighborhood.neighborhood_name = 'The Villa'
Database: chicago_crime
Note: "Weapons Violation" is the title of crime; crime cases refers to report_no;
Question: How many crime cases have been classified as "Weapons Violation" by the FBI?
SQL: SELECT sum(CASE WHEN fbi_code.title = 'Weapons Violation' THEN 1 ELSE 0 END) FROM crime INNER JOIN fbi_code ON crime.fbi_code_no = fbi_code.fbi_code_no
Database: chicago_crime
Note: "Criminal Sexual Assault" is the title of crime; against person refers to crime_against = 'Persons'; criminals have been arrested refers to arrest = 'TRUE'; cases refers to case_number;
Question: Please list any three criminal sexual assault cases against persons where the criminals have been arrested.
SQL: SELECT crime.case_number FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no WHERE fbi_code.title = 'Criminal Sexual Assault' AND crime.arrest = 'TRUE' AND fbi_code.crime_against = 'Persons' LIMIT 3
Database: chicago_crime
Note: incident number JB106545 refers to case_number = 'JB106545';
Question: Please state the district name where incident number JB106545 took place.
SQL: SELECT crime.case_number FROM crime INNER JOIN fbi_code ON crime.fbi_code_no = fbi_code.fbi_code_no WHERE fbi_code.title = 'Criminal Sexual Assault' AND fbi_code.crime_against = 'Persons' AND crime.arrest = 'TRUE' LIMIT 3
Database: chicago_crime
Note: general description refers to primary_description;
Question: What is the general description for case number JB106010?
SQL: SELECT iucr.primary_description FROM iucr INNER JOIN crime ON iucr.iucr_no = crime.iucr_no WHERE crime.case_number = 'JB106010'
Database: chicago_crime
Note: communities refers to community_area_name; 'Fraud Incident' is the title of crime;
Question: Please name three communities that experience the fraud incident.
SQL: SELECT community_area.community_area_name FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no INNER JOIN community_area ON crime.community_area_no = community_area.community_area_no WHERE fbi_code.title = 'Criminal Sexual Assault' LIMIT 3
Database: chicago_crime
Note: "Rogers Park" is the community_area_name; major type of crime refers to title;
Question: What was the major type of crime that happened in the Rogers Park community area?
SQL: SELECT fbi_code.fbi_code_no, fbi_code.title FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no INNER JOIN community_area ON crime.community_area_no = community_area.community_area_no WHERE community_area.community_area_name = 'Rogers Park' GROUP BY fbi_code.fbi_code_no, fbi_code.title
Database: chicago_crime
Note: multiple homicide refers to Count(case_number) > 1; district refers to district_name;
Question: At which district did the multiple homicide case number JB120039 occurred?
SQL: SELECT district.district_no, district.district_name FROM district INNER JOIN crime ON district.district_no = crime.district_no WHERE crime.case_number = 'JB120039' GROUP BY district.district_no, district.district_name
Database: chicago_crime
Note: "Drug Abuse" is the title of crime; happened on the street refers to location_description = 'STREET';  percentage = Divide (Count(fbi_code_no where location_description = 'STREET'), Count(fbi_code_no)) * 100;
Question: What is the percentage of crime cases that have been classified as "drug abuse" by the FBI and happened on the street?
SQL: SELECT cast(sum(CASE WHEN fbi_code.title = 'Drug Abuse' AND crime.location_description = 'STREET' THEN 1 ELSE 0 END) AS REAL) * 100 / count(crime.fbi_code_no) FROM crime INNER JOIN fbi_code ON crime.fbi_code_no = fbi_code.fbi_code_no
Database: chicago_crime
Note: highest population refers to Max(population); ward number refers to ward_no;
Question: Provide the ward number with the highest population.
SQL: SELECT ward_no FROM ward ORDER BY population DESC LIMIT 1
Database: chicago_crime
Note: case JB112212 refers to case_number = 'JB112212';
Question: What is the beat and location description of the case JB112212?
SQL: SELECT beat, location_description FROM crime WHERE case_number = 'JB112212'
Database: chicago_crime
Note: "The killing of one human being by another" is the description; FBI code refers to fbi_code_no;
Question: Give the FBI code for the crime described by "The killing of one human being by another."
SQL: SELECT fbi_code_no FROM fbi_code WHERE description = 'The killing of one human being by another.'
Database: chicago_crime
Note: "Montclare" is the community_area_name;
Question: Provide at least 5 ward office addresses associated with the crimes that happened in the community of Montclare.
SQL: SELECT ward.ward_office_address FROM community_area INNER JOIN crime ON community_area.community_area_no = crime.community_area_no INNER JOIN ward ON crime.ward_no = ward.ward_no WHERE community_area.community_area_name = 'Montclare' GROUP BY ward.ward_office_address LIMIT 5
Database: chicago_crime
Note: beat of 532 refers to beat = 532; happened in the Yard refers to location_description = 'YARD'; district commander refers to commander;
Question: List down the district's commander associated with the crime that happened at the yard and has a beat of 532.
SQL: SELECT district.address, district.commander FROM crime INNER JOIN district ON crime.district_no = district.district_no WHERE crime.location_description = 'YARD' AND crime.beat = 532
Database: chicago_crime
Note: "Lake View" is the community_area_name;
Question: What is the neighborhood name in the community area of Lake View?
SQL: SELECT neighborhood.neighborhood_name FROM community_area INNER JOIN neighborhood ON community_area.community_area_no = neighborhood.community_area_no WHERE community_area.community_area_name = 'Lake View'
Database: chicago_crime
Note: neighborhood refers to neighborhood_name; '23778' is the report_no;
Question: Name the neighborhood of the community area in crime with report number 23843?
SQL: SELECT neighborhood.neighborhood_name FROM community_area INNER JOIN crime ON community_area.community_area_no = crime.community_area_no INNER JOIN neighborhood ON crime.community_area_no = neighborhood.community_area_no WHERE crime.report_no = 23778
Database: chicago_crime
Note: "23778" is the report_no; FBI description refers to description;
Question: What is the FBI description of the crime for report number 23778?
SQL: SELECT fbi_code.description FROM fbi_code INNER JOIN crime ON fbi_code.fbi_code_no = crime.fbi_code_no WHERE crime.report_no = 23843
Database: chicago_crime
Note: report number refers report_no; 'Jill M. Stevens" is the commander;
Question: List down the report number of crimes associated with the district commander named Jill M. Stevens.
SQL: SELECT sum(CASE WHEN district.commander = 'Jill M. Stevens' THEN 1 ELSE 0 END) FROM district INNER JOIN crime ON district.district_no = crime.district_no
Database: chicago_crime
Note: "Avalon Park" is the neghborhood_name; happened inside the house refers to location_description = 'HOUSE'; percentage = Divide (Count(location_description = 'HOUSE'), Count(location_description)) * 100;
Question: Among the crimes happened in the neighborhood called "Avalon Park", what is the percentage of crimes that happened inside the house?
SQL: SELECT cast(sum(CASE WHEN crime.location_description = 'HOUSE' THEN 1 ELSE 0 END) AS REAL) * 100 / count(crime.location_description) AS persent FROM community_area INNER JOIN crime ON community_area.community_area_no = crime.community_area_no INNER JOIN neighborhood ON crime.community_area_no = neighborhood.community_area_no WHERE neighborhood.neighborhood_name = 'Avalon Park'
Database: chicago_crime
Note: full name of alderman refers to alderman_first_name, alderman_last_name, alderman_name_suffix;
Question: What is the full name of the alderman of ward no.21?
SQL: SELECT alderman_first_name, alderman_last_name, alderman_name_suffix FROM ward WHERE ward_no = 21
Database: chicago_crime
Note: most crowded ward refers to Max(population);
Question: What is the ward ID of the most crowded ward?
SQL: SELECT ward_no FROM ward ORDER BY population DESC LIMIT 1
Database: chicago_crime
Note: general description refers to primary_description; 'ASSAULT' is the primary_description; incidents refers to iucr_no;
Question: How many incidents have the general description of "ASSAULT" in the IUCR classification?
SQL: SELECT count(*) FROM iucr WHERE primary_description = 'ASSAULT'
Database: chicago_crime
Note: severe refers to index_code = 'I'; incidents refers to iucr_no;
Question: How many incidents are considered "severe" in the IUCR classification?
SQL: SELECT count(*) FROM iucr WHERE index_code = 'I'