db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
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.'
Question: how many domestic crime cases has commander ronald a. pontecore jr. been responsible for investigating? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_c...
how many domestic crime cases has commander ronald a. pontecore jr. been responsible for investigating?
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'
Question: how many crimes against society happened in the wentworth district according to the fbi? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, ...
how many crimes against society happened in the wentworth district according to the fbi?
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'
Question: 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? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip...
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?
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.'
Question: how many crimes described as 'the theft of a motor vehicle' by the fbi have taken place in the lake view community? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_C...
how many crimes described as 'the theft of a motor vehicle' by the fbi have taken place in the lake view community?
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
Question: in which district have there been more intimidation-type crimes? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_again...
in which district have there been more intimidation-type crimes?
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
Question: what types of domestic crimes have occurred the most in the north lawndale community? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, des...
what types of domestic crimes have occurred the most in the north lawndale community?
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
Question: in which ward of more than 55,000 inhabitants are there more crimes of intimidation with extortion? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_...
in which ward of more than 55,000 inhabitants are there more crimes of intimidation with extortion?
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
Question: which commander has had to deal with more cases of criminal sexual abuse? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, cr...
which commander has had to deal with more cases of criminal sexual abuse?
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'
Question: what percentage of non-domestic crimes have occurred in the jefferson park district? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, desc...
what percentage of non-domestic crimes have occurred in the jefferson park district?
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'
Question: what is the average population of the wards where apartment crimes have been reported without arrests? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_co...
what is the average population of the wards where apartment crimes have been reported without arrests?
chicago_crime
select alderman_first_name, alderman_last_name from ward order by population desc limit 5
Question: what are the full names of the top 5 most crowded ward aldermen? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_again...
what are the full names of the top 5 most crowded ward aldermen?
chicago_crime
select count(*) as cnt from fbi_code where crime_against = 'property'
Question: how many crime against property are there? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUCR -> iucr_no, p...
how many crime against property are there?
chicago_crime
select count(*) as cnt from district where zip_code = 60608
Question: how many districts are there in the police district building with a zip code of 60608? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, de...
how many districts are there in the police district building with a zip code of 60608?
chicago_crime
select crime_against from fbi_code where title = 'criminal sexual abuse'
Question: who is the crime against criminal sexual abuse? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUCR -> iucr_...
who is the crime against criminal sexual abuse?
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
Question: which community has the highest number of neighborhoods? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUCR...
which community has the highest number of neighborhoods?
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'
Question: how many severe crime incidents were reported at coordinate 41.64820151, -87.54430496? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, de...
how many severe crime incidents were reported at coordinate 41.64820151, -87.54430496?
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
Question: who is the commanding officer in the district with the highest number of reported crimes where no arrest has been made? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. F...
who is the commanding officer in the district with the highest number of reported crimes where no arrest has been made?
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
Question: what are the general and specific descriptions of the most common crime incidents that happened in an aircraft? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code ...
what are the general and specific descriptions of the most common crime incidents that happened in an aircraft?
chicago_crime
select t1.district_name from district as t1 inner join crime as t2 on t1.district_no = t2.district_no where t1.district_name in ('deering', 'near west') and t2.location_description = 'library' group by t1.district_name order by count(t2.district_no) desc limit 1
Question: between deering and near west districts, which district reported the most number of crime incidents that happened in a library? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, tw...
between deering and near west districts, which district reported the most number of crime incidents that happened in a library?
chicago_crime
select sum(case when t2.arrest = 'true' then 1 else 0 end) from iucr as t1 inner join crime as t2 on t1.iucr_no = t2.iucr_no where t2.location_description = 'day care center' and t1.secondary_description = 'forcible entry' and t1.primary_description = 'burglary'
Question: how many arrests have been made due to forcible entry burglary that took place in a day care center? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code...
how many arrests have been made due to forcible entry burglary that took place in a day care center?
chicago_crime
select t2.district_name from crime as t1 inner join district as t2 on t1.district_no = t2.district_no where t1.domestic = 'true' group by t2.district_name order by count(t1.district_no) desc limit 1
Question: what is the name of the district with the highest number of domestic violence cases? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, desc...
what is the name of the district with the highest number of domestic violence cases?
chicago_crime
select t2.location_description from community_area as t1 inner join crime as t2 on t1.community_area_no = t2.community_area_no where t1.population = ( select min(population) from community_area ) and t2.location_description is not null group by t2.location_description
Question: in the least populated community, what is the most common location of all the reported crime incidents? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_c...
in the least populated community, what is the most common location of all the reported crime incidents?
chicago_crime
select sum(case when t1.description like '%the violation of laws%' then 1 else 0 end) from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no where t2.arrest = 'false'
Question: how many violation of laws are there where no arrest has been made? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_ag...
how many violation of laws are there where no arrest has been made?
chicago_crime
select t2.latitude, t2.longitude from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no inner join community_area as t3 on t2.community_area_no = t3.community_area_no where t1.title = 'simple assault' and t3.community_area_name = 'chatham' and t3.community_area_no = 44 order by t2.latitude desc, ...
Question: what is the precise coordinate of the location where simple assault incidents happened the most in chatham? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> f...
what is the precise coordinate of the location where simple assault incidents happened the most in chatham?
chicago_crime
select t3.community_area_name from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no inner join community_area as t3 on t2.community_area_no = t3.community_area_no where t3.side = 'south' and t1.description = 'the unlawful taking, carrying, leading, or riding away of property from the possession ...
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? | Tables: Community_Area -> community_area_no, community_area_name, side, populati...
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?
chicago_crime
select sum(case when t3.community_area_name = 'englewood' then 1 else 0 end) from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no inner join community_area as t3 on t2.community_area_no = t3.community_area_no where t1.crime_against = 'society'
Question: how many crime against society were reported in englewood? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IU...
how many crime against society were reported in englewood?
chicago_crime
select cast(count(t1.fbi_code_no) as real) / 4 from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no where substr(t2.date, 1, 1) = '1' and substr(t2.date, 5, 4) = '2018'
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. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, dist...
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.
chicago_crime
select community_area_name from community_area where population > 50000 limit 3
Question: please list any three community areas with a population of more than 50,000. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description,...
please list any three community areas with a population of more than 50,000.
chicago_crime
select community_area_name from community_area where side = 'central'
Question: what are the communities that are grouped together on the central side? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crim...
what are the communities that are grouped together on the central side?
chicago_crime
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
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? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone...
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?
chicago_crime
select phone, fax, tty, twitter from district where district_name = 'near west'
Question: please list all of the contact information for the police district near west. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description...
please list all of the contact information for the police district near west.
chicago_crime
select commander from district where district_name = 'lincoln'
Question: who is responsible for crime cases in district lincoln? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUCR ...
who is responsible for crime cases in district lincoln?
chicago_crime
select primary_description, secondary_description from iucr where iucr_no = 275
Question: what is the general and specific description of incident 275? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against....
what is the general and specific description of incident 275?
chicago_crime
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'
Question: what is the percentage of severe cases that are related to sexual assault? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, c...
what is the percentage of severe cases that are related to sexual assault?
chicago_crime
select t2.neighborhood_name from community_area as t1 inner join neighborhood as t2 on t1.community_area_no = t2.community_area_no where t1.community_area_name = 'north center'
Question: what are the neighborhoods that are located in the north center community area? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, descripti...
what are the neighborhoods that are located in the north center community area?
chicago_crime
select sum(case when t2.community_area_name = 'forest glen' then 1 else 0 end) from neighborhood as t1 inner join community_area as t2 on t1.community_area_no = t2.community_area_no
Question: how many neighborhoods can be found in the forest glen community area? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime...
how many neighborhoods can be found in the forest glen community area?
chicago_crime
select sum(t2.population) as sum from neighborhood as t1 inner join community_area as t2 on t1.community_area_no = t2.community_area_no where t1.neighborhood_name = 'avondale gardens' or t1.neighborhood_name = 'irving park' or t1.neighborhood_name = 'kilbourn park' or t1.neighborhood_name = 'merchant park' or t1.neighb...
Question: what is the total population of the neighborhoods avondale gardens, irving park, kilbourn park, merchant park, old irving park, and the villa? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phon...
what is the total population of the neighborhoods avondale gardens, irving park, kilbourn park, merchant park, old irving park, and the villa?
chicago_crime
select sum(case when t2.title = 'weapons violation' then 1 else 0 end) from crime as t1 inner join fbi_code as t2 on t1.fbi_code_no = t2.fbi_code_no
Question: how many crime cases have been classified as 'weapons violation' by the fbi? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description,...
how many crime cases have been classified as 'weapons violation' by the fbi?
chicago_crime
select t2.case_number from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no where t1.title = 'criminal sexual assault' and t2.arrest = 'true' and t1.crime_against = 'persons' limit 3
Question: please list any three criminal sexual assault cases against persons where the criminals have been arrested. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> f...
please list any three criminal sexual assault cases against persons where the criminals have been arrested.
chicago_crime
select t1.case_number from crime as t1 inner join fbi_code as t2 on t1.fbi_code_no = t2.fbi_code_no where t2.title = 'criminal sexual assault' and t2.crime_against = 'persons' and t1.arrest = 'true' limit 3
Question: please state the district name where incident number jb106545 took place. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, cr...
please state the district name where incident number jb106545 took place.
chicago_crime
select t1.primary_description from iucr as t1 inner join crime as t2 on t1.iucr_no = t2.iucr_no where t2.case_number = 'jb106010'
Question: what is the general description for case number jb106010? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUC...
what is the general description for case number jb106010?
chicago_crime
select t3.community_area_name from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no inner join community_area as t3 on t2.community_area_no = t3.community_area_no where t1.title = 'criminal sexual assault' limit 3
Question: please name three communities that experience the fraud incident. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_agai...
please name three communities that experience the fraud incident.
chicago_crime
select t1.fbi_code_no, t1.title from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no inner join community_area as t3 on t2.community_area_no = t3.community_area_no where t3.community_area_name = 'rogers park' group by t1.fbi_code_no, t1.title
Question: what was the major type of crime that happened in the rogers park community area? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, descrip...
what was the major type of crime that happened in the rogers park community area?
chicago_crime
select t1.district_no, t1.district_name from district as t1 inner join crime as t2 on t1.district_no = t2.district_no where t2.case_number = 'jb120039' group by t1.district_no, t1.district_name
Question: at which district did the multiple homicide case number jb120039 occurred? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, c...
at which district did the multiple homicide case number jb120039 occurred?
chicago_crime
select cast(sum(case when t2.title = 'drug abuse' and t1.location_description = 'street' then 1 else 0 end) as real) * 100 / count(t1.fbi_code_no) from crime as t1 inner join fbi_code as t2 on t1.fbi_code_no = t2.fbi_code_no
Question: what is the percentage of crime cases that have been classified as 'drug abuse' by the fbi and happened on the street? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FB...
what is the percentage of crime cases that have been classified as 'drug abuse' by the fbi and happened on the street?
chicago_crime
select ward_no from ward order by population desc limit 1
Question: provide the ward number with the highest population. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUCR -> ...
provide the ward number with the highest population.
chicago_crime
select beat, location_description from crime where case_number = 'jb112212'
Question: what is the beat and location description of the case jb112212? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_agains...
what is the beat and location description of the case jb112212?
chicago_crime
select fbi_code_no from fbi_code where description = 'the killing of one human being by another.'
Question: give the fbi code for the crime described by 'the killing of one human being by another.' | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title,...
give the fbi code for the crime described by 'the killing of one human being by another.'
chicago_crime
select t3.ward_office_address from community_area as t1 inner join crime as t2 on t1.community_area_no = t2.community_area_no inner join ward as t3 on t2.ward_no = t3.ward_no where t1.community_area_name = 'montclare' group by t3.ward_office_address limit 5
Question: provide at least 5 ward office addresses associated with the crimes that happened in the community of montclare. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code...
provide at least 5 ward office addresses associated with the crimes that happened in the community of montclare.
chicago_crime
select t2.address, t2.commander from crime as t1 inner join district as t2 on t1.district_no = t2.district_no where t1.location_description = 'yard' and t1.beat = 532
Question: list down the district's commander associated with the crime that happened at the yard and has a beat of 532. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code ->...
list down the district's commander associated with the crime that happened at the yard and has a beat of 532.
chicago_crime
select t2.neighborhood_name from community_area as t1 inner join neighborhood as t2 on t1.community_area_no = t2.community_area_no where t1.community_area_name = 'lake view'
Question: what is the neighborhood name in the community area of lake view? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_agai...
what is the neighborhood name in the community area of lake view?
chicago_crime
select t3.neighborhood_name from community_area as t1 inner join crime as t2 on t1.community_area_no = t2.community_area_no inner join neighborhood as t3 on t2.community_area_no = t3.community_area_no where t2.report_no = 23778
Question: name the neighborhood of the community area in crime with report number 23843? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, descriptio...
name the neighborhood of the community area in crime with report number 23843?
chicago_crime
select t1.description from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no where t2.report_no = 23843
Question: what is the fbi description of the crime for report number 23778? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_agai...
what is the fbi description of the crime for report number 23778?
chicago_crime
select sum(case when t1.commander = 'jill m. stevens' then 1 else 0 end) from district as t1 inner join crime as t2 on t1.district_no = t2.district_no
Question: list down the report number of crimes associated with the district commander named jill m. stevens. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_...
list down the report number of crimes associated with the district commander named jill m. stevens.
chicago_crime
select cast(sum(case when t2.location_description = 'house' then 1 else 0 end) as real) * 100 / count(t2.location_description) as persent from community_area as t1 inner join crime as t2 on t1.community_area_no = t2.community_area_no inner join neighborhood as t3 on t2.community_area_no = t3.community_area_no where t3....
Question: among the crimes happened in the neighborhood called 'avalon park', what is the percentage of crimes that happened inside the house? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tt...
among the crimes happened in the neighborhood called 'avalon park', what is the percentage of crimes that happened inside the house?
chicago_crime
select alderman_first_name, alderman_last_name, alderman_name_suffix from ward where ward_no = 21
Question: what is the full name of the alderman of ward no.21? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUCR -> ...
what is the full name of the alderman of ward no.21?
chicago_crime
select ward_no from ward order by population desc limit 1
Question: what is the ward id of the most crowded ward? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime_against. IUCR -> iucr_no...
what is the ward id of the most crowded ward?
chicago_crime
select count(*) from iucr where primary_description = 'assault'
Question: how many incidents have the general description of 'assault' in the iucr classification? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, ...
how many incidents have the general description of 'assault' in the iucr classification?
chicago_crime
select count(*) from iucr where index_code = 'i'
Question: how many incidents are considered 'severe' in the iucr classification? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, title, description, crime...
how many incidents are considered 'severe' in the iucr classification?
chicago_crime
select sum(case when t1.alderman_last_name = 'dowell' then 1 else 0 end) from ward as t1 inner join crime as t2 on t1.ward_no = t2.ward_no where t2.arrest = 'false' and t1.alderman_first_name = 'pat'
Question: among the crimes with no arrest made, how many of them happened in the ward represented by alderman pat dowell? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code ...
among the crimes with no arrest made, how many of them happened in the ward represented by alderman pat dowell?
chicago_crime
select t1.ward_no, t1.alderman_first_name, t1.alderman_last_name, t1.alderman_name_suffix from ward as t1 inner join crime as t2 on t1.ward_no = t2.ward_no where substr(t2.date, 1, 1) = '1' and substr(t2.date, 5, 4) = '2018' group by t1.ward_no order by count(t1.ward_no) desc limit 1
Question: which alderman represents the ward with the most number of crimes in january, 2018? please give his or her full name. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI...
which alderman represents the ward with the most number of crimes in january, 2018? please give his or her full name.
chicago_crime
select count(t1.ward_no) as num from ward as t1 inner join crime as t2 on t1.ward_no = t2.ward_no where t2.domestic = 'true' order by t1.population = ( select population from ward order by population desc limit 1 )
Question: among the crimes in the ward with the most population, how many of them are cases of domestic violence? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_c...
among the crimes in the ward with the most population, how many of them are cases of domestic violence?
chicago_crime
select t2.latitude, t2.longitude from ward as t1 inner join crime as t2 on t1.ward_no = t2.ward_no where t1.alderman_first_name = 'pat' and t1.alderman_last_name = 'dowell' and t2.latitude is not null and t2.longitude is not null
Question: please list the location coordinates of all the incidents that had happened in the ward represented by alderman pat dowell. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitte...
please list the location coordinates of all the incidents that had happened in the ward represented by alderman pat dowell.
chicago_crime
select t1.alderman_first_name, t1.alderman_last_name, count(t1.ward_no) as num from ward as t1 inner join crime as t2 on t1.ward_no = t2.ward_no where (substr(t2.date, 1, 1) = '1' and substr(t2.date, 5, 4) = '2018' and t1.alderman_first_name = 'pat' and t1.alderman_last_name = 'dowell') or (t1.alderman_first_name = 'so...
Question: the ward represented by which alderman had more incidents in january, 2018, pat dowell or sophia king? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_co...
the ward represented by which alderman had more incidents in january, 2018, pat dowell or sophia king?
chicago_crime
select t2.case_number from iucr as t1 inner join crime as t2 on t1.iucr_no = t2.iucr_no where t1.primary_description = 'battery'
Question: please list the case numbers of all the incidents with the generic description of 'battery' in the iucr classification. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. F...
please list the case numbers of all the incidents with the generic description of 'battery' in the iucr classification.
chicago_crime
select sum(case when t2.arrest = 'false' then 1 else 0 end) from iucr as t1 inner join crime as t2 on t1.iucr_no = t2.iucr_no where t1.primary_description = 'battery'
Question: among the incidents with the generic description of 'battery' in the iucr classification, how many of them do not have arrests made? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tt...
among the incidents with the generic description of 'battery' in the iucr classification, how many of them do not have arrests made?
chicago_crime
select t2.case_number from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no where t1.title = 'homicide 1st & 2nd degree'
Question: please list the case numbers of all the crimes whose short description of the kind of crime is 'homicide 1st & 2nd degree' in the fbi classification. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, emai...
please list the case numbers of all the crimes whose short description of the kind of crime is 'homicide 1st & 2nd degree' in the fbi classification.
chicago_crime
select sum(case when substr(t2.date, 5, 4) = '2018' then 1 else 0 end) from fbi_code as t1 inner join crime as t2 on t1.fbi_code_no = t2.fbi_code_no where t1.crime_against = 'property' and substr(t2.date, 1, 1) = '1'
Question: among the incidents in january, 2018, how many of them were stated 'against property' in the fbi classification? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code...
among the incidents in january, 2018, how many of them were stated 'against property' in the fbi classification?
chicago_crime
select sum(case when substr(t2.date, 5, 4) = '2018' then 1 else 0 end) from district as t1 inner join crime as t2 on t1.district_no = t2.district_no where t1.commander = 'robert a. rubio' and substr(t2.date, 1, 1) = '1'
Question: district commander robert a. rubio was responsible for how many incidents in january, 2018? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, titl...
district commander robert a. rubio was responsible for how many incidents in january, 2018?
chicago_crime
select t1.commander from district as t1 inner join crime as t2 on t1.district_no = t2.district_no where t1.commander in ('robert a. rubio', 'glenn white') and substr(t2.date, 1, 1) = '1' and substr(t2.date, 5, 4) = '2018' group by t1.commander
Question: which district commander was responsible for more incidents in january, 2018, robert a. rubio or glenn white? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code ->...
which district commander was responsible for more incidents in january, 2018, robert a. rubio or glenn white?
chicago_crime
select t2.block from district as t1 inner join crime as t2 on t1.district_no = t2.district_no where t1.commander = 'robert a. rubio'
Question: please list the blocks where all the incidents in the district commanded by robert a. rubio took place. | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_c...
please list the blocks where all the incidents in the district commanded by robert a. rubio took place.
chicago_crime
select count(t1.ward_no) / 12 as average from ward as t1 inner join crime as t2 on t1.ward_no = t2.ward_no where t2.date like '%2018%' and t1.population = ( select max(t1.population) from ward as t1 inner join crime as t2 on t1.ward_no = t2.ward_no where t2.date like '%2018%' )
Question: what is the average number of incidents per month in 2018 in the ward with the most population? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, phone, fax, tty, twitter. FBI_Code -> fbi_code_no, ...
what is the average number of incidents per month in 2018 in the ward with the most population?
chicago_crime
select cast(sum(case when t1.primary_description = 'battery' then 1 else 0 end) as real) * 100 / count(*)from iucr as t1 inner join crime as t2 on t1.iucr_no = t2.iucr_no where t2.arrest = 'false'
Question: among all the incidents with no arrest made, what is the percentage of them having a generic description of 'battery' in the iucr classification? | Tables: Community_Area -> community_area_no, community_area_name, side, population. District -> district_no, district_name, address, zip_code, commander, email, p...
among all the incidents with no arrest made, what is the percentage of them having a generic description of 'battery' in the iucr classification?
food_inspection
select count(owner_state) from businesses where owner_state = 'ca'
Question: how many restaurants' owners are in california? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> business_id, score, date, ty...
how many restaurants' owners are in california?
food_inspection
select count(score) from inspections where score = 100
Question: how many restaurants have met all requirements in the inspection? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> business_i...
how many restaurants have met all requirements in the inspection?
food_inspection
select count(`date`) from inspections where strftime('%y', `date`) = '2016' and type = 'routine - unscheduled'
Question: among the inspections carried out in 2016, how many of them are routine? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> bus...
among the inspections carried out in 2016, how many of them are routine?
food_inspection
select distinct t2.name from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.score = 100
Question: please list the names of all the restaurants that have met all requirements in one inspection. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_z...
please list the names of all the restaurants that have met all requirements in one inspection.
food_inspection
select count(distinct t2.business_id) from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where strftime('%y', t1.`date`) = '2016' and t2.city in ('san francisco', 'san francisco', 'sf', 's.f.')
Question: among the restaurants being inspected in 2016, how many of them are in san francisco? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspe...
among the restaurants being inspected in 2016, how many of them are in san francisco?
food_inspection
select t1.type from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.`date` = '2014-01-14' and t2.name = 'tiramisu kitchen'
Question: what was the type of inspection tiramisu kitchen had on 2014/1/14? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> business_...
what was the type of inspection tiramisu kitchen had on 2014/1/14?
food_inspection
select count(t1.business_id) from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.`date` = '2014-01-14' and t2.name = 'tiramisu kitchen' and t1.risk_category = 'low risk'
Question: how many low risk violations were found in the inspection on 2014/1/14 for tiramisu kitchen? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip...
how many low risk violations were found in the inspection on 2014/1/14 for tiramisu kitchen?
food_inspection
select distinct t2.name from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where strftime('%y', t1.`date`) = '2014' and t1.risk_category = 'low risk'
Question: please list the names of the restaurants that had a low risk violation in inspections in 2014. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_z...
please list the names of the restaurants that had a low risk violation in inspections in 2014.
food_inspection
select t1.description from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.`date` = '2014-01-14' and t2.name = 'tiramisu kitchen' and t1.risk_category = 'low risk'
Question: what is the description of the low risk violation of tiramisu kitchen on 2014/1/14? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspect...
what is the description of the low risk violation of tiramisu kitchen on 2014/1/14?
food_inspection
select distinct t1.description from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.risk_category = 'high risk' and t2.name = 'tiramisu kitchen'
Question: please list the descriptions of all the high risk violations of tiramisu kitchen. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspectio...
please list the descriptions of all the high risk violations of tiramisu kitchen.
food_inspection
select count(t1.business_id) from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.type = 'routine - unscheduled' and t2.name = 'tiramisu kitchen'
Question: how many routine inspections did tiramisu kitchen have? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> business_id, score, ...
how many routine inspections did tiramisu kitchen have?
food_inspection
select count(t2.business_id) from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t2.name = 'tiramisu kitchen' and t1.type = 'routine - unscheduled' and t1.score > 70
Question: among the routine inspections of tiramisu kitchen, how many of them have a score of over 70? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip...
among the routine inspections of tiramisu kitchen, how many of them have a score of over 70?
food_inspection
select case when sum(case when t2.name = 'omni s.f. hotel - 2nd floor pantry' then 1 else 0 end) > sum(case when t2.name = 'tiramisu kitchen' then 1 else 0 end) then 'omni s.f. hotel - 2nd floor pantry' else 'tiramisu kitchen' end as result from violations as t1 inner join businesses as t2 on t1.business_id = t2.busine...
Question: which restaurant had more low risk violation in inspections, tiramisu kitchen or omni s.f. hotel - 2nd floor pantry? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city...
which restaurant had more low risk violation in inspections, tiramisu kitchen or omni s.f. hotel - 2nd floor pantry?
food_inspection
select count(t2.business_id) from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t2.city in ('san francisco', 'sf', 's.f.', 'san francisco') and t1.risk_category = 'high risk'
Question: how many high risk violations do the restaurants in san francisco have in total? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspection...
how many high risk violations do the restaurants in san francisco have in total?
food_inspection
select t2.name from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.risk_category = 'high risk' group by t2.name order by count(t2.name) desc limit 1
Question: which restaurant has the highest total number of high risk violations? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> busin...
which restaurant has the highest total number of high risk violations?
food_inspection
select avg(t1.score) from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t2.name = 'tiramisu kitchen'
Question: what is the average scores of tiramisu kitchen in all inspections? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> business_...
what is the average scores of tiramisu kitchen in all inspections?
food_inspection
select business_id from inspections group by business_id order by count(business_id) desc limit 1
Question: which business had the most number of inspections? give the id number for that business. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. in...
which business had the most number of inspections? give the id number for that business.
food_inspection
select business_id from violations group by business_id order by count(business_id) desc limit 1
Question: tell the id number of the business with the most number of violations. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> busin...
tell the id number of the business with the most number of violations.
food_inspection
select t2.name from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.score = 100 and t1.`date` = '2016-09-28' and t1.type = 'routine - unscheduled'
Question: give the name of the business which met all the required standards during the unscheduled routine inspection on 2016/9/28. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owne...
give the name of the business which met all the required standards during the unscheduled routine inspection on 2016/9/28.
food_inspection
select t2.name from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.risk_category = 'high risk' group by t2.name order by count(t2.name) desc limit 1
Question: which business had the most number of high risk violations? give the name of the business. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. ...
which business had the most number of high risk violations? give the name of the business.
food_inspection
select count(distinct t1.violation_type_id) from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t2.name = 'stacks restaurant' and t1.`date` = '2016-10-04'
Question: how many kinds of violations did 'stacks restaurant' have on 2016/10/4? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections -> busi...
how many kinds of violations did 'stacks restaurant' have on 2016/10/4?
food_inspection
select t1.description from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t2.name = 'chez fayala, inc.' and t1.`date` = '2016-07-01' and t1.risk_category = 'moderate risk'
Question: give the description of the moderate risk violation which 'chez fayala, inc.' had on 2016/7/1. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_z...
give the description of the moderate risk violation which 'chez fayala, inc.' had on 2016/7/1.
food_inspection
select t2.name from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where score = ( select min(score) from inspections where `date` = '2016-09-26' and type = 'routine - unscheduled' ) and t1.`date` = '2016-09-26' and t1.type = 'routine - unscheduled'
Question: which business had the lowest score for the unscheduled routine inspection on 2016/9/26? give the name of the business. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_c...
which business had the lowest score for the unscheduled routine inspection on 2016/9/26? give the name of the business.
food_inspection
select t2.name from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.type = 'complaint' group by t2.name order by count(t1.business_id) desc limit 1
Question: provide the name of the business which had the most number of inspections because of complaint. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_...
provide the name of the business which had the most number of inspections because of complaint.
food_inspection
select count(t1.business_id) from inspections as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t2.name = 'soma restaurant and bar' and t1.type = 'routine - unscheduled'
Question: how many unscheduled routine inspections did 'soma restaurant and bar' have? | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspections ->...
how many unscheduled routine inspections did 'soma restaurant and bar' have?
food_inspection
select t2.address from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.risk_category = 'low risk' group by t2.address order by count(t1.business_id) desc limit 1
Question: give the address of the business with the most number of the low risk violations. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, owner_name, owner_address, owner_city, owner_state, owner_zip. inspectio...
give the address of the business with the most number of the low risk violations.
food_inspection
select t2.name from violations as t1 inner join businesses as t2 on t1.business_id = t2.business_id where t1.`date` = ( select min(`date`) from violations where risk_category = 'low risk' and description = 'permit license or inspection report not posted' ) and t1.risk_category = 'low risk' and t1.description = 'permit ...
Question: which business was the first one to get a low risk violation because of 'permit license or inspection report not posted'? give the name of the business. | Tables: businesses -> business_id, name, address, city, postal_code, latitude, longitude, phone_number, tax_code, business_certificate, application_date, o...
which business was the first one to get a low risk violation because of 'permit license or inspection report not posted'? give the name of the business.