QIAN-ME/bird_schema_data huggingface dataset:
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    Among all asian restaurants in N. Milpitas Blvd., Milpitas, how many of them have restaurant ID greater than 385? asian restaurant refers to food_type = 'asian'; N. Milpitas Blvd. refers to street_name = 'n milpitas blvd'; Milpitas refers to city = 'milpitas'; restaurant ID greater than 385 refers to id_restaurant > 385

    【Evidence】
    asian restaurant refers to food_type = 'asian'; N. Milpitas Blvd. refers to street_name = 'n milpitas blvd'; Milpitas refers to city = 'milpitas'; restaurant ID greater than 385 refers to id_restaurant > 385

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(T1.id_restaurant) AS num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'milpitas' AND T2.food_type = 'asian' AND T1.street_name = 'n milpitas blvd' AND T1.id_restaurant > 385
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    What is the restaurant's name and ID located at Ocean Avenue, San Francisco? restaurant's name refers to label; Ocean Avenue refers to street_name = 'ocean avenue'; San Francisco refers to city = 'san francisco'

    【Evidence】
    restaurant's name refers to label; Ocean Avenue refers to street_name = 'ocean avenue'; San Francisco refers to city = 'san francisco'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.label, T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'ocean avenue'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    What is the full address of the restaurant named "Sanuki Restaurant"? full address refers to city, street_num, street_name; restaurant named "Sanuki Restaurant" refers to label = 'sanuki restaurant'

    【Evidence】
    full address refers to city, street_num, street_name; restaurant named "Sanuki Restaurant" refers to label = 'sanuki restaurant'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.city, T1.street_num, T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'sanuki restaurant'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    List the food type of the restaurant located in 22779 6th St., Hayward City. 22779 refers to street_num = 22779; 6th St. refers to street_name = '6th St'

    【Evidence】
    22779 refers to street_num = 22779; 6th St. refers to street_name = '6th St'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_num = 22779 AND T1.street_name = '6th St' AND T2.city = 'hayward'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    How many American restaurants are located in Front, San Francisco? American restaurant refers to food_type = 'american'; Front refers to street_name = 'front'; San Francisco refers to city = 'san francisco'

    【Evidence】
    American restaurant refers to food_type = 'american'; Front refers to street_name = 'front'; San Francisco refers to city = 'san francisco'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(T2.food_type = 'american') FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'front'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    List the restaurant's ID that has a review greater than the 70% of average review of all American restaurants with street number greater than 2000. American restaurant refers to food_type = 'american'; street number greater than 2000 refers to street_num > 2000; review greater than the 70% of average review refers to review > multiply(avg(review), 0.7)

    【Evidence】
    American restaurant refers to food_type = 'american'; street number greater than 2000 refers to street_num > 2000; review greater than the 70% of average review refers to review > multiply(avg(review), 0.7)

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.food_type = 'american' AND T1.street_num > 2000 GROUP BY T1.id_restaurant ORDER BY AVG(T2.review) * 0.7 DESC
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    Among the restaurants located on the street number ranges from 1000 to 2000, what is the percentage of Afghani restaurants are there? street number ranges from 1000 to 2000 refers to 1000 < = street_num < = 2000; Afghani restaurant refers to food_type = 'afghani'; percentage = divide(count(id_restaurant where food_type = 'afghani'), count(id_restaurant)) * 100%

    【Evidence】
    street number ranges from 1000 to 2000 refers to 1000 < = street_num < = 2000; Afghani restaurant refers to food_type = 'afghani'; percentage = divide(count(id_restaurant where food_type = 'afghani'), count(id_restaurant)) * 100%

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT CAST(SUM(IIF(T2.food_type = 'afghani', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE 1000 <= T1.street_num <= 2000
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    What is the name of the most popular restaurant serving Asian foods in San Francisco? the most popular refers to max(review); Asian food refers to food_type = 'asian'; San Francisco refers to city = 'san francisco'

    【Evidence】
    the most popular refers to max(review); Asian food refers to food_type = 'asian'; San Francisco refers to city = 'san francisco'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT label FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' )
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    How many cities are there in Monterey? Monterey refers to region = 'monterey'

    【Evidence】
    Monterey refers to region = 'monterey'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(DISTINCT city) FROM geographic WHERE region = 'monterey'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    How many deli in Belmont have a review rating of 2 or more? deli ris a food type; Belmont refers to city = 'belmont'; review rating of 2 or more refers to review > 2

    【Evidence】
    deli ris a food type; Belmont refers to city = 'belmont'; review rating of 2 or more refers to review > 2

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(id_restaurant) FROM generalinfo WHERE city = 'belmont' AND review > 2 AND food_type = 'deli'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    Which county in northern California has the highest number of cities? northern California refers to region = 'northern california'; the highest number of cities refers to max(count(city))

    【Evidence】
    northern California refers to region = 'northern california'; the highest number of cities refers to max(count(city))

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT county FROM geographic WHERE region = 'northern california' GROUP BY county ORDER BY COUNT(city) DESC LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    How many restaurants can you find in Concord? Concord refers to city = 'concord'

    【Evidence】
    Concord refers to city = 'concord'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(id_restaurant) FROM location WHERE city = 'concord'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 restaurant
【Schema】
# Table: generalinfo
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(label:TEXT, Examples: [sparky's diner, kabul afghan cuisine, helmand restaurant]),
(food_type:TEXT, Examples: [24 hour diner, afghani, african]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale]),
(review:REAL, Examples: [2.3, 3.8, 4.0])
]
# Table: geographic
[
(city:TEXT, Primary Key, Examples: [alameda, alamo, albany]),
(county:TEXT, Examples: [alameda county, contra costa county, santa clara county]),
(region:TEXT, Examples: [bay area, napa valley, unknown])
]
# Table: location
[
(id_restaurant:INTEGER, Primary Key, Examples: [1, 2, 3]),
(street_num:INTEGER, Examples: [242, 135, 430]),
(street_name:TEXT, Examples: [church st, el camino real, broadway]),
(city:TEXT, Examples: [san francisco, san carlos, sunnyvale])
]
【Foreign keys】
generalinfo.city=geographic.city
location.city=geographic.city
location.id_restaurant=generalinfo.id_restaurant

    【Question】
    In which region can you find the top 4 most popular restaurants? the top 4 most popular restaurant refers to top 4 max(review)

    【Evidence】
    the top 4 most popular restaurant refers to top 4 max(review)

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city ORDER BY T1.review DESC LIMIT 4