input
stringlengths
122
2.7k
output
stringlengths
24
805
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] prima...
SELECT T3.business_id FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id WHERE T4.closing_time > '9PM' AND T1.category_name LIKE 'Pets';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] clo...
SELECT COUNT(T2.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id INNER JOIN Days AS T5 ON T4.day_id = T5.day_id WHERE T5.day_of_week L...
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT COUNT(*) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name = 'Active Life' AND T3.city = 'Phoenix';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT T2.business_id FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name LIKE 'Men''s Clothing' AND T3.stars < 5;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_v...
SELECT DISTINCT T1.business_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T2.active LIKE 'FALSE' AND T1.review_votes_useful LIKE 'Low';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_v...
SELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Long' AND T3.category_id BETWEEN 1 AND 20 GROUP BY T...
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key a...
SELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T4.category_name LIKE 'Fashion' AND T1.city LIKE 'Scottsdale'...
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Users_Compliments : compliment_id [ INTEGER ] user_id [ INTEGER ] number_of_compliments [ TEXT ] Bus...
SELECT COUNT(T1.number_of_compliments) FROM Users_Compliments AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.city LIKE 'Phoenix' AND T1.number_of_compliments LIKE 'Medium';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] prima...
SELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id WHERE T3.city LIKE 'Tempe' AND T4.opening_time < '8AM';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] prima...
SELECT COUNT(T1.category_name) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id WHERE T3.city LIKE 'Glendale' AND T4.opening_time LIKE '8AM' AND T4...
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS "num" , CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.city) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_i...
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT SUM(CASE WHEN T2.category_name LIKE 'Active Life' THEN 1 ELSE 0 END) AS "num" , CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / ( SELECT COUNT(T3.review_count) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON ...
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many active businesses are there in Phoenix? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Phoenix' AND active LIKE 'TRUE';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many businesses in Scottsdale are rated as "wonderful experience"? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale' AND stars > 3;
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: What is the average rating of inactive businesses? [/INST] [/INST]
SELECT CAST(SUM(stars) AS REAL) / COUNT(business_id) AS "average" FROM Business WHERE active LIKE 'FALSE';
[INST] Here is a database schema: Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following q...
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T2.attribute_value LIKE 'beer_and_wine' AND T1.state LIKE 'AZ';
[INST] Here is a database schema: Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following q...
SELECT T1.city FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T2.attribute_value LIKE 'full_bar' GROUP BY T1.city;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars = 5 AND T3.category_name LIKE 'Fashion';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT T1.city FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.review_count LIKE 'High' AND T3.category_name LIKE 'Food' GROUP BY T1.city;
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ ...
SELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Mesa' AND T2.review_stars > 3 GROUP BY T1.business_id;
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ ...
SELECT T1.city FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T2.review_votes_funny LIKE 'low' GROUP BY T1.city;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT CAST(SUM(CASE WHEN T1.stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) AS "percentage" FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.city LIKE 'Chan...
[INST] Here is a database schema: Users : user_id [ INTEGER ] primary_key user_yelping_since_year [ INTEGER ] user_average_stars [ TEXT ] user_votes_funny [ TEXT ] user_votes_useful [ TEXT ] user_votes_cool [ TEXT ] user_review_count [ TEXT ] user_fans [ TEXT ] Please write me a SQL statement that answers the followin...
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2012 AND user_votes_funny LIKE 'High';
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Please write me a SQL statement that answers the following question: What is the number of useful v...
SELECT review_votes_useful FROM Reviews WHERE user_id = 52592 AND business_id = 2;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Please write me a SQL statement that answers the following question: What are the attribute numbers that are related to payment? [/INST] [/INST]
SELECT attribute_id FROM Attributes WHERE attribute_name LIKE '%payment%';
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Please write me a SQL statement that answers the following question: How long was the review for bu...
SELECT review_length FROM Reviews WHERE user_id = 612 AND review_stars = 5 AND business_id = 2;
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many businesses are actively running in Gilbert City? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Gilbert' AND active LIKE 'True';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many businesses in the AZ state got low quality of reviews? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND review_count LIKE 'Low';
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ ...
SELECT DISTINCT T2.business_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' AND T1.review_stars = 5 LIMIT 3;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Please write me a SQL statement that answers the following question: Please name one attribute that business number...
SELECT T1.attribute_name FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'none' LIMIT 1;
[INST] Here is a database schema: Compliments : compliment_id [ INTEGER ] primary_key compliment_type [ TEXT ] Users_Compliments : compliment_id [ INTEGER ] user_id [ INTEGER ] number_of_compliments [ TEXT ] Please write me a SQL statement that answers the following question: How many "cool" compliments did user numbe...
SELECT COUNT(T2.compliment_type) FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.user_id = 33 AND T2.compliment_type LIKE 'cool';
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Please write me a SQL statement that answers the following question: What are the opening hours of business number 53 on F...
SELECT T1.closing_time - T1.opening_time AS "opening hours" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Friday' AND T1.business_id = 53;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Please write me a SQL statement that answers the following question: What are the attributes that business number 5...
SELECT T1.attribute_name FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T2.business_id = 56;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Please write me a SQL statement that answers the following question: What are the categories that business number 15 belongs to? [/INST] [/INST...
SELECT T2.category_name FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.business_id = 15;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT COUNT(T2.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.city LIKE 'Scottsdale' AND T1.category_name LIKE 'Beauty & Spas';
[INST] Here is a database schema: Compliments : compliment_id [ INTEGER ] primary_key compliment_type [ TEXT ] Users_Compliments : compliment_id [ INTEGER ] user_id [ INTEGER ] number_of_compliments [ TEXT ] Please write me a SQL statement that answers the following question: Please list any two user numbers that have...
SELECT T1.user_id FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.number_of_compliments LIKE 'Uber' AND T2.compliment_type LIKE 'cute' LIMIT 2;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT COUNT(T2.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.stars > 3 AND T1.category_name LIKE 'Accessories';
[INST] Here is a database schema: Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the fol...
SELECT T2.closing_time - T2.opening_time AS "hour" FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.business_id = 12 AND T1.city LIKE 'Scottsdale' AND T2.day_id = 3;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Checkins : business_id [ INTEGER ] day_id [ INTEGER ] label_time_0 [ TEXT ] label_time_1 [ TEXT ] label_time_2 [ TEXT ] label_time_3 [ TEXT ] label_time_4 [ TEXT ] label_time_5 [ TEXT ] label_time_6 [ TEXT ] label_time_7 [ TEXT...
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Checkins AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.label_time_4 LIKE 'None' AND T1.state LIKE 'AZ' AND T3.day_of_week LIKE 'Thursday';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many businesses of Yelp are in Scottsdale? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: Among the Yelp_Businesses in Arizona, how many of them are still running? [/INST] [/INS...
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'True';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many Yelp_Businesses in Scottsdale have received positive comments in the Elitestar...
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale' AND stars > 3;
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: Which city has more Yelp_Business that's more appealing to users, Scottsdale or Anthem?...
SELECT city FROM Business ORDER BY review_count DESC LIMIT 1;
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many Yelp_Businesses in Arizona have a Elitestar rating of over 4? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars > 4;
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many Yelp_Businesses are there in Arizona in total? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: Please list the cities of the Yelp_Businesses that have gotten a 5 in the Elitestar rat...
SELECT city FROM Business WHERE stars = 5 GROUP BY city;
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Please write me a SQL statement that answers the following question: How many reviews have the user...
SELECT COUNT(review_length) FROM Reviews WHERE user_id = 3;
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Please write me a SQL statement that answers the following question: How many reviews made by user ...
SELECT COUNT(review_length) FROM Reviews WHERE user_id = 3 AND review_length LIKE 'Long';
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Please write me a SQL statement that answers the following question: Among the long reviews made by...
SELECT COUNT(review_length) FROM Reviews WHERE user_id = 3 AND review_length LIKE 'Long' AND review_votes_useful LIKE 'Medium';
[INST] Here is a database schema: Users : user_id [ INTEGER ] primary_key user_yelping_since_year [ INTEGER ] user_average_stars [ TEXT ] user_votes_funny [ TEXT ] user_votes_useful [ TEXT ] user_votes_cool [ TEXT ] user_review_count [ TEXT ] user_fans [ TEXT ] Please write me a SQL statement that answers the followin...
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2012;
[INST] Here is a database schema: Users : user_id [ INTEGER ] primary_key user_yelping_since_year [ INTEGER ] user_average_stars [ TEXT ] user_votes_funny [ TEXT ] user_votes_useful [ TEXT ] user_votes_cool [ TEXT ] user_review_count [ TEXT ] user_fans [ TEXT ] Please write me a SQL statement that answers the followin...
SELECT user_id FROM Users WHERE user_fans LIKE 'High' GROUP BY user_id;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Please write me a SQL statement that answers the following question: How many Yelp_Businesses do not provide alcoho...
SELECT COUNT(T1.attribute_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Alcohol' AND T2.attribute_value LIKE 'none';
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_co...
SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name LIKE 'Alcohol' AND T2.attribute_value LIKE 'none' AND T3.state LIKE 'AZ';
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Please write me a SQL statement that answers the following question: Please list the business IDs of all the Yelp_B...
SELECT T2.business_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Good for Kids' AND T2.attribute_value LIKE 'TRUE';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Please write me a SQL statement that answers the following question: How many Yelp_Business falls under the category of "Shopping"? [/INST] [/I...
SELECT COUNT(T1.category_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.category_name LIKE 'Shopping';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Please write me a SQL statement that answers the following question: Under which categories is Yelp_Business no. 1? [/INST] [/INST]
SELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T2.business_id = 1;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Tips : business_id [ INTEGER ] user_id [ INTEGER ] likes [ INTEGER ] tip_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [...
SELECT COUNT(T3.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Tips AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Food' AND T3.active LIKE 'TRUE';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT COUNT(T3.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name LIKE 'Food' AND T3.city LIKE 'Anthem';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT T2.business_id FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name LIKE 'Food' ORDER BY T3.stars DESC LIMIT 1;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business_Categories : business_id [ INTEGER ...
SELECT COUNT(T3.stars) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Attributes AS T4 ON T3.business_id = T4.business_id INNER JOIN Attributes AS T5 ON T4.attribute_id = T5.attribute_id WHERE...
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ ...
SELECT COUNT(T2.business_id) FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' AND T1.user_id = 3;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.state LIKE 'AZ' GROUP BY T1.category_name;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Please write me a SQL statement that answers the following question: How long does Yelp_Business no.1 open on Tuesdays? [/...
SELECT T1.closing_time - T1.opening_time AS "opening hours" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Tuesday' AND T1.business_id = 1;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Please write me a SQL statement that answers the following question: When does Yelp_Business no.1 open on Tuesdays? [/INST...
SELECT T1.opening_time FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Tuesday' AND T1.business_id = 1;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Please write me a SQL statement that answers the following question: How many Yelp_Business close after 8PM on Mondays? [/...
SELECT COUNT(T1.business_id) FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Monday' AND T1.closing_time > '8PM';
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ T...
SELECT T1.opening_time FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Monday' AND T3.city LIKE 'Anthem' AND T3.active LIKE 'True' GROUP BY T1.opening_time;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ T...
SELECT COUNT(T1.business_id) FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Sunday' AND T1.closing_time LIKE '12PM' AND T3.state LIKE 'AZ';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] clo...
SELECT T4.category_name FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T4.category_id = T4.category_id WHERE T1.closing_time = '12PM' AND T2.day_of_week = 'Sunday' GROUP BY T4.category_name;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER...
SELECT COUNT(T1.business_id) FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business_Attributes AS T3 ON T1.business_id = T3.business_id INNER JOIN Attributes AS T4 ON T4.attribute_id = T4.attribute_id WHERE T2.day_id IN (1, 2, 3, 4, 5, 6, 7) AND T4.attribute_name = 'Good for Kids' ...
[INST] Here is a database schema: Elite : user_id [ INTEGER ] year_id [ INTEGER ] Users : user_id [ INTEGER ] primary_key user_yelping_since_year [ INTEGER ] user_average_stars [ TEXT ] user_votes_funny [ TEXT ] user_votes_useful [ TEXT ] user_votes_cool [ TEXT ] user_review_count [ TEXT ] user_fans [ TEXT ] Please wr...
SELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = T2.year_id;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] clo...
SELECT T1.closing_time + 12 - T1.opening_time AS "hour" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id INNER JOIN Business_Categories AS T4 ON T3.business_id = T4.business_id INNER JOIN Categories AS T5 ON T4.category_id = T5.categor...
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ T...
SELECT T1.business_id FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T1.closing_time + 12 - T1.opening_time > 12 AND T2.day_of_week LIKE 'Sunday' GROUP BY T1.business_id;
[INST] Here is a database schema: Elite : user_id [ INTEGER ] year_id [ INTEGER ] Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Users : user_id [ INTEGER ] primary_key user_yelping...
SELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id INNER JOIN Reviews AS T3 ON T1.user_id = T3.user_id WHERE T3.business_id = 1;
[INST] Here is a database schema: Elite : user_id [ INTEGER ] year_id [ INTEGER ] Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Users : user_id [ INTEGER ] primary_key user_yelping...
SELECT COUNT(T4.user_id) FROM ( SELECT T1.user_id FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id INNER JOIN Reviews AS T3 ON T1.user_id = T3.user_id WHERE T3.user_id IS NOT NULL GROUP BY T3.user_id HAVING COUNT(T3.user_id) > 10 ) T4;
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ ...
SELECT T1.user_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' GROUP BY T1.user_id ORDER BY COUNT(T1.user_id) DESC LIMIT 1;
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ ...
SELECT AVG(T2.review_stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Anthem';
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ ...
SELECT AVG(T2.review_stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.state LIKE 'AZ' AND T2.user_id = 3;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Please write me a SQL statement that answers the following question: What is the average business time for Yelp_Business n...
SELECT T1.closing_time + 12 - T1.opening_time AS "avg opening hours" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T1.business_id = 1 AND (T2.day_of_week = 'Sunday' OR T2.day_of_week = 'Sunday');
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ T...
SELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T1.business_id) AS "average stars" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Sunday' AND T1.closing_time LIKE '12PM';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many of the busineses are in Casa Grande? [/INST] [/INST]
SELECT COUNT(city) FROM Business WHERE city LIKE 'Casa Grande';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: What is the total number of active businesses in AZ with a low review count? [/INST] [/...
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'True' AND review_count LIKE 'low';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: List down the business ID with a star range from 2 to 3, located at Mesa. [/INST] [/INS...
SELECT business_id FROM Business WHERE city LIKE 'Mesa' AND stars BETWEEN 2 AND 3;
[INST] Here is a database schema: Users : user_id [ INTEGER ] primary_key user_yelping_since_year [ INTEGER ] user_average_stars [ TEXT ] user_votes_funny [ TEXT ] user_votes_useful [ TEXT ] user_votes_cool [ TEXT ] user_review_count [ TEXT ] user_fans [ TEXT ] Please write me a SQL statement that answers the followin...
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year BETWEEN 2011 AND 2013 AND user_fans LIKE 'High';
[INST] Here is a database schema: Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_votes_cool [ TEXT ] review_length [ TEXT ] Please write me a SQL statement that answers the following question: What is the review length of u...
SELECT review_length FROM Reviews WHERE user_id = 35026 AND business_id = 2;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_co...
SELECT DISTINCT T3.attribute_id, T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.attribute_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.review_count = 'Low' AND T1.city = 'Chandler';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars < 4 AND T3.category_name LIKE 'Mexican';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT T1.business_id, T1.stars FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T3.category_name LIKE 'Fashion';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id ORDER BY T1.stars DESC LIMIT 1;
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Reviews : business_id [ INTEGER ] user_id [ INTEGER ] review_stars [ INTEGER ] review_votes_funny [ TEXT ] review_votes_useful [ TEXT ] review_v...
SELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Medium' AND T2.business_id BETWEEN 6 AND 9 ORDER BY ...
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_co...
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Caters' AND T1.review_count LIKE 'Low' AND T1.active LIKE 'TRUE';
[INST] Here is a database schema: Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the fol...
SELECT T2.closing_time, T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Tempe' ORDER BY T1.stars DESC LIMIT 1;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business_Categories : business_id [ INTEGER ...
SELECT T3.category_name, T5.attribute_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id INNER JOIN Business_Attributes AS T4 ON T1.business_id = T4.business_id INNER JOIN Attributes ...
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T1.state LIKE 'AZ' AND T1.city LIKE 'Surprise' GROUP BY T3.category_name;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ T...
SELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.closing_time LIKE '9PM' AND T2.opening_time LIKE '8AM' AND T3.day_of_week LIKE 'Friday' GROUP BY T1.city;
[INST] Here is a database schema: Attributes : attribute_id [ INTEGER ] primary_key attribute_name [ TEXT ] Business_Attributes : attribute_id [ INTEGER ] business_id [ INTEGER ] attribute_value [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_co...
SELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.state LIKE 'AZ' AND T1.review_count LIKE 'High' AND T1.active LIKE 'TRUE' AND T1.city LIKE 'Mesa' AND T1.stars = 3;
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ T...
SELECT DISTINCT T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Chandler' AND T1.active LIKE 'TRUE' AND T1.review_count LIKE 'Medium';
[INST] Here is a database schema: Categories : category_id [ INTEGER ] primary_key category_name [ TEXT ] Business_Categories : business_id [ INTEGER ] category_id [ INTEGER ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write m...
SELECT CAST(SUM(CASE WHEN T1.stars < 4 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.stars) AS "percentage" FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T3.category_name LIKE 'A...
[INST] Here is a database schema: Days : day_id [ INTEGER ] primary_key day_of_week [ TEXT ] Business_Hours : business_id [ INTEGER ] day_id [ INTEGER ] opening_time [ TEXT ] closing_time [ TEXT ] Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ T...
SELECT T2.closing_time, T3.day_of_week FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Tempe' AND T1.active LIKE 'TRUE' AND T1.stars > 0.7 * ( SELECT AVG(T1.stars) FROM Business AS T1 INNER JOIN Business_Hours AS T...
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many active businesses are located at Phoenix, Arizona? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Phoenix' AND active LIKE 'True';
[INST] Here is a database schema: Business : business_id [ INTEGER ] primary_key active [ TEXT ] city [ TEXT ] state [ TEXT ] stars [ REAL ] review_count [ TEXT ] Please write me a SQL statement that answers the following question: How many businesses are with high review count? [/INST] [/INST]
SELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'High';