human
Schema:
geographic (CITY_NAME, COUNTY, REGION)
restaurant (ID, NAME, FOOD_TYPE, CITY_NAME, RATING)
location (RESTAURANT_ID, HOUSE_NUMBER, STREET_NAME, CITY_NAME)
Please answer with SQL.
assistant
Sure, I understand.
human
give me a good restaurant in alameda ?
assistant
SELECT t2.house_number , t1.name FROM restaurant AS t1 JOIN LOCATION AS t2 ON t1.id = t2.restaurant_id WHERE t2.city_name = 'alameda' AND t1.rating > 2.5;
human
where is a good restaurant on buchanan in san francisco for arabic food ?
assistant
SELECT t2.house_number , t1.name FROM restaurant AS t1 JOIN LOCATION AS t2 ON t1.id = t2.restaurant_id WHERE t2.city_name = 'san francisco' AND t2.street_name = 'buchanan' AND t1.food_type = 'arabic' AND t1.rating > 2.5;
human
how many chinese restaurants are there in the bay area ?
assistant
SELECT COUNT ( * ) FROM restaurant AS t1 JOIN geographic AS t2 ON t1.city_name = t2.city_name WHERE t2.region = 'bay area' AND t1.food_type = 'chinese';
human
where can we find some restaurants in the bay area ?
assistant
SELECT t2.house_number , t1.name FROM LOCATION AS t2 JOIN restaurant AS t1 ON t1.id = t2.restaurant_id WHERE t1.city_name IN ( SELECT city_name FROM geographic WHERE region = 'bay area' );
human
give me a good restaurant in the bay area ?
assistant
SELECT t2.house_number , t1.name FROM LOCATION AS t2 JOIN restaurant AS t1 ON t1.id = t2.restaurant_id WHERE t1.city_name IN ( SELECT city_name FROM geographic WHERE region = 'region0' ) AND t1.rating > 2.5;
human
what is the best restaurant in bay area for american food ?
assistant
SELECT t3.house_number , t1.name FROM restaurant AS t1 JOIN geographic AS t2 ON t1.city_name = t2.city_name JOIN LOCATION AS t3 ON t1.id = t3.restaurant_id WHERE t2.region = "bay area" AND t1.food_type = "american" AND t1.rating = ( SELECT MAX( t1.rating ) FROM restaurant AS t1 JOIN geographic AS t2 ON t1.city_name = t2.city_name WHERE t2.region = "bay area" AND t1.food_type = "american" ) ;