human
Schema:
business (bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state)
category (id, business_id, category_name)
user (uid, user_id, name)
checkin (cid, business_id, count, day)
neighbourhood (id, business_id, neighbourhood_name)
review (rid, business_id, user_id, rating, text, year, month)
tip (tip_id, business_id, text, user_id, likes, year, month)
Please answer with SQL.
assistant
Sure, I understand.
human
Find all Apple Store in ' Los Angeles '
assistant
SELECT business_id FROM business WHERE city = 'Los Angeles' AND name = 'Apple Store';
human
List the addresses of all Walmart in ' Los Angeles '
assistant
SELECT full_address FROM business WHERE city = 'Los Angeles' AND name = 'Walmart';
human
Find all restaurant Seafood in Los Angeles
assistant
SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id WHERE t1.city = 'Los Angeles' AND t2.category_name = 'Seafood' AND t3.category_name = 'restaurant';
human
Find all Bars in ' Los Angeles ' with at least 30 reviews and average rating above 3 stars
assistant
SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = 'Los Angeles' AND t1.rating > 3 AND t1.review_count > 30 AND t2.category_name = 'Bars';
human
How many Target are there in ' Los Angeles ' ?
assistant
SELECT COUNT ( DISTINCT business_id ) FROM business WHERE city = 'Los Angeles' AND name = 'Target';
human
What are all the breweries in ' Los Angeles ' ?
assistant
SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "breweries" ;