db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 1
673
⌀ | SQL
stringlengths 23
804
| schema
stringclasses 69
values |
|---|---|---|---|---|
public_review_platform
|
How many businesses are not closed in the city of Mesa?
|
businesses are not closed refers to active = 'true'
|
SELECT COUNT(business_id) FROM Business WHERE city = 'Mesa' AND active = 'true'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
In how many businesses have customers had a bad or terrible experience?
|
stars = 2 means bad experience; stars = 1 means terrible experience; customers had a bad or terrible experience refers to stars = 2 OR stars = 1
|
SELECT COUNT(business_id) FROM Business WHERE stars IN (1, 2)
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
List by ID the businesses with the reviews with the lowest veracity of Paradise Valley.
|
ID of businesses refers to business_id; reviews with the lowest veracity refers to review_count = 'Low' AND stars > 3; Paradise Valley is a city
|
SELECT business_id FROM Business WHERE stars > 3 AND city = 'Paradise Valley' AND review_count = 'Low'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many businesses have more than 1 attribute?
|
businesses have more than 1 attribute refers to COUNT(attribute_value) > 1
|
SELECT COUNT(business_id) FROM Business_Attributes WHERE attribute_value > 1
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many businesses are opened the same number of hours every day of the week?
|
how much time does this business open refers to SUBTRACT(closing_time, opening_time); every day of the week refers to day_id BETWEEN 1 AND 7
|
SELECT COUNT(business_id) FROM Business_Hours WHERE opening_time = '8AM' AND closing_time = '6PM'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many reviews of businesses that are still open received an uber rating on the funny vote?
|
businesses that still open refers to active = 'true'; business received an uber rating on the funny vote refers to review_votes_funny = 'Uber'
|
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T2.review_votes_funny = 'Uber' AND T1.active = 'true'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many of the users who use a high number of compliments do not have any fans?
|
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
|
SELECT COUNT(T2.user_id) FROM Users_Compliments AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.number_of_compliments = 'High' AND T2.user_fans = 'None'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the most common type of compliments that a user has received from other users?
|
the most common type of compliments refers to MAX(COUNT(compliment_type))
|
SELECT T2.compliment_type FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id GROUP BY T2.compliment_type ORDER BY COUNT(T2.compliment_type) DESC LIMIT 1
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many stars does each of the 3 top users with the most likes in their reviews have?
|
more likes mean this tip is more valuable; the most likes refers to MAX(likes); stars refers to users_average_stars
|
SELECT T2.user_average_stars FROM Tips AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id GROUP BY T2.user_id ORDER BY SUM(T1.likes) DESC LIMIT 3
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
In which categories does the only business located in the city of Arcadia appear?
|
categories refers to category_name
|
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.city = 'Arcadia'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
List by their id all businesses that are open on Sunday.
|
day_of_week = 'Sunday'; open on Sunday refers to day_id = 1
|
SELECT T1.business_id FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T1.day_id = 1
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many businesses with music_karaoke attribute are closed?
|
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
|
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 = 'music_karaoke' AND T3.active = 'false' AND T2.attribute_value IN ('none', 'no', 'false')
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many open businesses in the City of Phoenix have users left a long review?
|
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
|
SELECT COUNT(DISTINCT T2.business_id) FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.review_length = 'Long' AND T2.active = 'true' AND T2.city = 'Phoenix'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many users who have received a low cool vote have also received at least 1 low cool vote for some of their reviews?
|
low cool vote for user refers to user_votes_cool = 'Low'; low cool vote for review refers to review_votes_cool = 'Low'
|
SELECT COUNT(DISTINCT T1.user_id) FROM Users AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id WHERE T1.user_votes_cool = 'Low' AND T2.review_votes_cool = 'Low'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many users with a long tip and 2 likes for their tip have a high number of fans?
|
long tip refers to tip_length = 'Long'; 2 likes refers to likes = 2; high number of fans refers to user_fans = 'High'
|
SELECT COUNT(DISTINCT T1.user_id) FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id WHERE T2.tip_length = 'Long' AND T2.likes = 2 AND T1.user_fans = 'High'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
In how many businesses with the ambience_trendy attribute?
|
ambience_trendy attribute refers to attribute_name = 'ambience_trendy' AND attribute_value = 'false'
|
SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'ambience_trendy' AND T2.attribute_value IN ('none', 'no', 'false')
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many businesses in the city of Scottsdale open on Sunday at 12PM?
|
businesses that opened on Sunday refers to day_of_week = 'Sunday'; businesses that opened at 12PM refers to opening_time = '12PM'
|
SELECT COUNT(DISTINCT T2.business_id) 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 = 'Scottsdale' AND T3.day_of_week = 'Sunday' AND T2.opening_time = '12PM'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the average number of stars for businesses in the Obstetricians & Gynecologists category?
|
Obstetricians & Gynecologists category refers to category_name = 'Obstetricians & Gynecologists'; calculation = AVG(stars)
|
SELECT CAST(SUM(T1.stars) AS REAL) / COUNT(T1.business_id) 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 WHERE T3.category_name = 'Obstetricians & Gynecologists'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
Calculate the percentage of users with a high number of fans who were elite in 2011.
|
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
|
SELECT CAST(SUM(CASE WHEN T3.user_fans = 'High' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.user_fans) FROM Years AS T1 INNER JOIN Elite AS T2 ON T1.year_id = T2.year_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T1.actual_year = 2011
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
How many of the businesses are in Surprise?
|
Surprise is a city
|
SELECT COUNT(business_id) FROM Business WHERE city = 'Surprise'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
List down the business ID with a high review count in Tempe.
|
Tempe is a city; high review count refers to review_count = 'High'
|
SELECT business_id FROM Business WHERE review_count = 'High' AND city = 'Tempe'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the total number of active businesses in AZ with a medium review count?
|
active businesses refers to active = 'true'; AZ is a state; medium review count refers to review_count = 'Medium'
|
SELECT COUNT(business_id) FROM Business WHERE review_count = 'Medium' AND state = 'AZ' AND active = 'true'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
List down the business ID with a star range from 3 to 5, located at Chandler.
|
businesses with a star range from 3 to 5 refers to stars BETWEEN 3 AND 5; Chandler is a city
|
SELECT business_id FROM Business WHERE stars >= 3 AND stars < 6 AND city = 'Chandler'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
In users yelping since 2009 to 2011, how many of them have low count of fans?
|
users in yelping since 2009 to 2011 refers to user_yelping_since_year BETWEEN 2009 AND 2011; low count of fans refers to user_fans = 'Low'
|
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year >= 2009 AND user_yelping_since_year < 2012 AND user_fans = 'Low'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the review length of user 11021 to business with business ID 3?
|
review length refers to review_length; user 11021 refers to user_id = 11021; business ID 3 refers to business_id = 3
|
SELECT review_length FROM Reviews WHERE user_id = 11021 AND business_id = 3
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
Among the businesses in Tempe, list the attribute of the business with a medium review count.
|
Tempe is a city; high review count refers to review_count = 'High'
|
SELECT DISTINCT T3.attribute_name 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.city = 'Tempe' AND T1.review_count = 'Medium'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
In businesses with a category of food, how many of them have a star rating below 3?
|
category of food refers to category_name = 'Food'; star rating below 3 refers to stars < 3
|
SELECT COUNT(DISTINCT T1.business_id) 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 WHERE T3.category_name = 'Food' AND T1.stars < 3
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
List the active business ID and its stars of the businesses fall under the category of Food.
|
active business ID refers to active = 'true'; category of Food refers to category_name = 'Food'
|
SELECT DISTINCT T1.business_id, T1.stars 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 WHERE T3.category_name = 'Food' AND T1.active = 'true'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the category and attributes of businesses with highest star rating?
|
category of the business refers to category_name; attributes of the business refers to attribute_name; the highest star rating refers to MAX(stars)
|
SELECT DISTINCT T3.category_name, T5.attribute_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 INNER JOIN Business_Attributes AS T4 ON T2.business_id = T4.business_id INNER JOIN Attributes AS T5 ON T4.attribute_id = T5.attribute_id WHERE T1.stars = ( SELECT MAX(stars) FROM Business )
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the category of the business with short review length and highest review stars within business ID from 7 to 14?
|
category of the business refers to category_name; short review length refers to review_length = 'Short'; the highest star rating refers to MAX(stars); business ID from 7 to 14 refers to business_id BETWEEN 7 AND 14
|
SELECT DISTINCT T3.category_name FROM Reviews 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 WHERE T2.business_id >= 7 AND T2.business_id < 15 AND T1.review_length = 'Short' AND T1.review_stars = ( SELECT MAX(review_stars) FROM Reviews )
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
Count the active businesses that has an attribute of BYOB with high review count.
|
active business ID refers to active = 'true'; category of Food refers to category_name = 'Food'; attribute of BYOB refers to attribute_name = 'BYOB'; high review count refers to review_count = 'High'
|
SELECT COUNT(DISTINCT 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 = 'BYOB' AND T1.review_count = 'High' AND T1.active = 'true'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the closing and opening time of businesses located at Glendale with highest star rating?
|
Glendale is a city; the highest star rating refers to MAX(stars)
|
SELECT T2.opening_time, T2.closing_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Glendale' ORDER BY T1.stars DESC LIMIT 1
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
Among the active businesses located at Goodyear, AZ, list the category and atrributes of business with a high review count.
|
active business ID refers to active = 'true'; Goodyear is a city; AZ is a state; high review count refers to review_count = 'High'
|
SELECT T3.category_name, T5.attribute_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 INNER JOIN Business_Attributes AS T4 ON T1.business_id = T4.business_id INNER JOIN Attributes AS T5 ON T4.attribute_id = T5.attribute_id WHERE T1.review_count = 'High' AND T1.city = 'Goodyear' AND T1.state = 'AZ' AND T1.active = 'true'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
List the categories of active businesses in Glendale, AZ.
|
active business ID refers to active = 'true'; categories refers to category_name; Glendale is a city; AZ is a state
|
SELECT DISTINCT T3.category_name FROM Business_Categories AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T1.category_id = T3.category_id WHERE T2.active = 'true' AND T2.state = 'AZ' AND T2.city = 'Glendale'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
Find the location of businesses that has business hours from 7 am to 7 pm every Wednesday.
|
location of business refers to city; business hours from 7am to 7pm refers to opening_time = '7AM' AND closing_time = '7PM'; Wednesday refers to day_of_week = 'Wednesday'
|
SELECT DISTINCT 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.opening_time = '7AM' AND T2.closing_time = '7PM' AND T3.day_of_week = 'Wednesday'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the attribute value of an active business with a low review count and 3 stars which is located at Goodyear, AZ?
|
active business ID refers to active = 'true'; low review count refers to review_count = 'Low'; 3 stars refers to stars = 3; Goodyear is a city; AZ is a state
|
SELECT DISTINCT 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 = 'AZ' AND T1.city = 'Goodyear' AND T1.active = 'true' AND T1.stars = 3 AND T1.review_count = 'Low'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
What is the opening time of the active businesses in Glendale that have a medium review count.
|
active business ID refers to active = 'true'; Glendale is a city; medium review count refers to review_count = 'Medium'
|
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 = 'Glendale' AND T1.review_count = 'Medium' AND T1.active = 'true'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
Among the businesses with a category of Food, what is the percentage of the business with greater than 3 stars?
|
category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars))
|
SELECT CAST(SUM(CASE WHEN T1.stars > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.stars) 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 WHERE T3.category_name = 'Food'
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
public_review_platform
|
List the closing time and day of week of active businesses in Goodyear with stars greater than the 80% of average age of star rating.
|
active business ID refers to active = 'true'; Goodyear is a city; Calculation = AVG(stars) * 0.8; businesses with stars greater than 80% of average star rating refers to stars > AVG(stars) * 0.8
|
SELECT DISTINCT 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.active = 'true' AND T1.city = 'Goodyear' AND T1.stars > ( SELECT AVG(stars) * 0.8 FROM Business WHERE active = 'true' AND city = 'Goodyear' )
|
database name:db_id public_review_platform
Attributes table Attributes Cols: attribute id dtype integer, attribute name dtype text,
Categories table Categories Cols: category id dtype integer, category name dtype text,
Compliments table Compliments Cols: compliment id dtype integer, compliment type dtype text,
Days table Days Cols: day id dtype integer, day of week dtype text,
Years table Years Cols: year id dtype integer, actual year dtype integer,
Business_Attributes table Business_Attributes Cols: attribute id dtype integer, business id dtype integer, attribute value dtype text,
Business_Categories table Business_Categories Cols: business id dtype integer, category id dtype integer,
Business_Hours table Business_Hours Cols: business id dtype integer, day id dtype integer, opening time dtype text, closing time dtype text,
Checkins table Checkins Cols: business id dtype integer, day id dtype integer, label_time_0 dtype text, label_time_1 dtype text, label_time_2 dtype text, label_time_3 dtype text, label_time_4 dtype text, label_time_5 dtype text, label_time_6 dtype text, label_time_7 dtype text, label_time_8 dtype text, label_time_9 dtype text, label_time_10 dtype text, label_time_11 dtype text, label_time_12 dtype text, label_time_13 dtype text, label_time_14 dtype text, label_time_15 dtype text, label_time_16 dtype text, label_time_17 dtype text, label_time_18 dtype text, label_time_19 dtype text, label_time_20 dtype text, label_time_21 dtype text, label_time_22 dtype text, label_time_23 dtype text,
Elite table Elite Cols: user id dtype integer, year id dtype integer,
Reviews table Reviews Cols: business id dtype integer, user id dtype integer, review stars dtype integer, review votes funny dtype text, review votes useful dtype text, review votes cool dtype text, review length dtype text,
Tips table Tips Cols: business id dtype integer, user id dtype integer, Likes dtype integer, tip length dtype text,
Users_Compliments table Users_Compliments Cols: compliment id dtype integer, user id dtype integer, number of compliments dtype text,
Business table Business Cols: business id dtype integer, active dtype text, city dtype text, state dtype text, stars dtype real, review count dtype text,
Users table Users Cols: user id dtype integer, user yelping since year dtype integer, user average stars dtype text, user votes funny dtype text, user votes useful dtype text, user votes cool dtype text, user review count dtype text, user fans dtype text,
|
citeseer
|
Among all the citation, what is the percentage of paper ID under the Agents classification?
|
classification refers to class_label; class_label = 'Agents'; percentage = (divide(count(paper_id where class_label = 'Agents')), (count(paper_id)))*100;
|
SELECT CAST(COUNT(CASE WHEN class_label = 'Agents' THEN paper_id ELSE NULL END) AS REAL) * 100 / COUNT(paper_id) FROM paper
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
What is the most cited word? How many papers was that word cited in?
|
most cited word refers to max(count(word_cited_id);
|
SELECT word_cited_id, COUNT(paper_id) FROM content GROUP BY word_cited_id ORDER BY COUNT(word_cited_id) DESC LIMIT 1
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
What is the total number of word cited under that class labelled 'AI'?
| null |
SELECT COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
For all words cited in paper ID 315017, state the other paper ID and class label which also cited those words.
| null |
SELECT T1.class_label, T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 315017
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
Among all the DB class type citation, which word is the most frequently cited?
|
class type refers to class_label; class_label = 'DB'; word that is most frequently cited refers to max(count(word_cited_id);
|
SELECT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T2.word_cited_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
Calculate the percentage of words used in Agents class label.
|
percentage = (divide(count(word_cited_id where class_label = 'Agents')), (count(word_cited_id)))*100;
|
SELECT CAST(COUNT(DISTINCT CASE WHEN T1.class_label = 'Agents' THEN T2.word_cited_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
Which paper ID cited the most word? In which class label does it belongs to?
|
most cited word refers to max(word_cited_id);
|
SELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T1.paper_id, T1.class_label ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
List all the paper ID and its class type that cited the word 'word1002'.
|
class type refers to class_label;
|
SELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1002'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
List all words cited in the AI class label.
| null |
SELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
What is the class label of paper ID 'chakrabarti01integrating'. How many words were cited by this paper ID?
| null |
SELECT DISTINCT T1.class_label, COUNT(T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 'chakrabarti01integrating' GROUP BY T1.class_label
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
List all paper ID and its class type with more than 20 cited words.
|
class type refers to class_label; count(word_cited_id)>20
|
SELECT DISTINCT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T2.paper_id, T1.class_label HAVING COUNT(T2.word_cited_id) > 20
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
List the words that are cited in both AI and IR class label.
| null |
SELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI' OR T1.class_label = 'IR'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
Name the paper which is cited most times and the paper which is cited least times? Also, find the number of times each one is cited.
| null |
SELECT cited_paper_id, COUNT(cited_paper_id), ( SELECT cited_paper_id FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) ASC LIMIT 1 ), ( SELECT COUNT(cited_paper_id) FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) ASC LIMIT 1 ) FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) DESC LIMIT 1
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
On average, how many papers are under the ML class?
|
class refers to class_label; average = divide(count(paper_id where class_label = 'M')), (count(paper_id)));
|
SELECT CAST(COUNT(CASE WHEN class_label = 'ML' THEN paper_id ELSE NULL END) AS REAL) / COUNT(paper_id) FROM paper
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
Find the words cited in papers that are cited by sima01computational?
|
paper cited by refers to citing_paper_id; citing_paper_id = 'sima01computational';
|
SELECT DISTINCT T2.word_cited_id FROM cites AS T1 INNER JOIN content AS T2 ON T1.cited_paper_id = T2.paper_id WHERE T1.citing_paper_id = 'sima01computational'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
How many papers were cited by schmidt99advanced cited word3555?
|
paper cited by refers to citing_paper_id; citing_paper_id = 'schmidt99advanced';
|
SELECT COUNT(T2.paper_id) FROM cites AS T1 INNER JOIN content AS T2 ON T1.cited_paper_id = T2.paper_id WHERE T1.citing_paper_id = 'schmidt99advanced' AND T2.word_cited_id = 'word3555'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
Under what classification do the papers that cited word1163 belong?
| null |
SELECT DISTINCT T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1163'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
Among the papers under DB classification, which paper has the highest number of words cited?
|
classification refers to class_label; class_label = 'DB';
|
SELECT T1.paper_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T1.paper_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
citeseer
|
In the papers classified as ML, how many cited butz01algorithmic?
|
classification refers to class_label; paper cited by refers to citing_paper_id; citing_paper_id = 'butz01algorithmic';
|
SELECT COUNT(T1.paper_id) FROM paper AS T1 INNER JOIN cites AS T2 ON T1.paper_id = T2.citing_paper_id WHERE T1.class_label = 'ML' AND T2.cited_paper_id = 'butz01algorithmic'
|
database name:db_id citeseer
cites table cites Cols: cited_paper_id dtype text, citing_paper_id dtype text,
paper table paper Cols: paper id dtype text, class label dtype text,
content table content Cols: paper id dtype text, word cited id dtype text,
|
simpson_episodes
|
Which crew member of the simpson 20s is the oldest?
|
oldest refers to Min(birthdate)
|
SELECT name FROM Person WHERE birthdate IS NOT NULL ORDER BY birthdate ASC LIMIT 1;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What's the nickname for Dan Castellaneta?
|
"Dan Castellaneta" is the name of Person
|
SELECT nickname FROM Person WHERE name = 'Dan Castellaneta';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Among the crew members of the simpson 20s born in the New York city, how many of them were born after the year 1970?
|
born in New York city refers to birth_region = 'New York'; born after year 1970 refers to ('%Y', birthdate) > 1970
|
SELECT COUNT(name) FROM Person WHERE birth_region = 'New York' AND SUBSTR(birthdate, 1, 4) > '1970';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
In which country was the winner of the Outstanding Voice-Over Performance award of 2009 born?
|
"Outstanding Voice-Over Performance" is the award; 2009 refers to year = 2009; 'Winner' is the result; country refers to birth_country
|
SELECT T1.birth_country FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Outstanding Voice-Over Performance' AND T2.year = 2009 AND T2.result = 'Winner';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Please list the names of all the awards won by the crew member whose nickname is Doofus.
|
award won refers to result = 'Winner'
|
SELECT T2.award FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.nickname = 'Doofus' AND T2.result = 'Winner';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many crew members who were born in the USA were nominated for the Outstanding Animated Program (For Programming Less Than One Hour) award in 2009?
|
born in USA refers to birth_country = 'USA'; were nominated refers to result = 'Nominee'; 'Outstanding Animated Program (For Programming Less Than One Hour)' is the award; in 2009 refers to year = 2009
|
SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'USA' AND T2.result = 'Nominee' AND T2.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.year = 2009;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Which character won the Outstanding Voice-Over Performance award in 2009?
|
won refers to result = 'Winner'
|
SELECT DISTINCT T1.character FROM Character_Award AS T1 INNER JOIN Award AS T2 ON T1.award_id = T2.award_id WHERE T2.award = 'Outstanding Voice-Over Performance' AND T2.year = 2009 AND T2.result = 'Winner';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Please list all the keywords of the episode Lost Verizon.
|
"Lost Verizon" is the title of episode
|
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Lost Verizon';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many keywords does the episode that was aired on 2008/10/19 have?
|
aired on 2008/10/19 refers to air_date = '2008-10-19'
|
SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.air_date = '2008-10-19';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What's the rating of the episode in which Dan Castellaneta won the Outstanding Voice-Over Performance award in 2009?
|
"Dan Castellaneta" is the person; 2009 is year; won refers result = 'Winner'
|
SELECT T2.rating FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Outstanding Voice-Over Performance' AND SUBSTR(T1.year, 1, 4) = '2009' AND T1.person = 'Dan Castellaneta';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many 7-star votes in star score did the episode Lost Verizon have?
|
7-stars vote refers to stars = 7; 'Lost Verizon' is the title of episode
|
SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon' AND T2.stars = 7;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many stars did most of the voters give in star score for the episode Lost Verizon?
|
"Lost Verizon" is the title of episode; most voters refers to Max(votes)
|
SELECT T2.stars FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon' ORDER BY T2.votes DESC LIMIT 1;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Please list the titles of the episodes that have over 200 voters voting a 10 in star score.
|
over 200 votes refers to votes > 200; 10 in star score refers to stars = 10
|
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.votes > 200 AND T2.stars = 10;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many episodes aired in the year 2009 have over 15% of voters giving 10 stars in star score?
|
aired in the year 2009 refers to air_date like '2009%'; 10 stars in star score refers to stars = 10; over 15% of voters refers to Votes.percent > 15
|
SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2009' AND T2.stars = 10 AND T2.percent > 15;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What's the title of the episode that got the most 7-star votes in star score?
|
7-stars vote refers to stars = 7; most refers to Max(votes)
|
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 ORDER BY T2.votes DESC LIMIT 1;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many stars on average does the episode Lost Verizon have?
|
"Lost Verizon" is the title of episode; stars on average = Divide( Sum (Multiply (votes, stars)), Sum(votes))
|
SELECT CAST(SUM(T2.votes * T2.stars) AS REAL) / SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What is the percentage of Primetime Emmy nominated episodes with a rating over 7 to all the episodes that have a rating over 7?
|
"Primetime Emmy' is the award_category; rating over 7 refers to rating > 7; nominated refers to result = 'Nominee'; percentage = Divide(Count(episode_id(award_category = 'Primetime Emmy')), Count (episode_id)) * 100
|
SELECT CAST(SUM(CASE WHEN T1.award_category = 'Primetime Emmy' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.rating > 7 AND T1.result = 'Nominee';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Name the title of the episode where Pamela Hayden voiced the character 'Ruthie.'
|
"Pamela Hayden" is the person; voice the character 'Ruthie' refers to role = 'Ruthie'
|
SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Pamela Hayden' AND T2.role = 'Ruthie';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
List down all the roles of Matt Groening on the episode titled 'In the Name of the Grandfather' along with the episode number and series number.
|
"Matt Groening" is the person; 'In the Name of the Grandfather' is the title of episode; episode number refers to episode; series number refers to number_in_series
|
SELECT T2.role, T1.episode, T1.number_in_series FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Matt Groening' AND T1.title = 'In the Name of the Grandfather';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Write down the title and summary of the episode with the keyword 'eviction.'
| null |
SELECT T1.title, T1.summary FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'eviction';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What is the average number of stars received by the episode titled 'Wedding for Disaster.'
|
"Wedding for Disaster" is the title of episode; average number of stars = Divide(Sum(stars), Count(stars))
|
SELECT AVG(T2.stars) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Wedding for Disaster';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Write the title and all the keywords of the episode that was aired on 3/22/2009.
|
aired on 3/22/2009 refers to air_date = '2009-03-22'
|
SELECT T1.title, T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.air_date = '2009-03-22';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What is the birth name of the person who voiced 'Helen Lovejoy?'
|
voiced refers to role; role = 'Helen Lovejoy"
|
SELECT DISTINCT T1.birth_name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.role = 'Helen Lovejoy';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What is the percentage ratio between uncredited and credited roles on the episode that won the 2017 Jupiter Award for Best International TV Series? Please include the title of the episode and the names of the persons who were uncredited alongside their role in that episode.
|
uncredited refers to credited = ''; credited refers to credited = 'true'; won refers to result = 'Winner'; 2017 is the year; 'Jupiter Award' is the award_category; 'Best International TV Series' is the award; percentage ratio = Divide (SUM(credited = ''), SUM(credited = 'true')) * 100
|
SELECT CAST(SUM(CASE WHEN T2.credited = 'false' THEN 1 END) AS REAL) * 100 / SUM(CASE WHEN T2.credited = 'true' THEN 1 END), T3.title, T2.person FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2017' AND T1.award_category = 'Jupiter Award' AND T1.award = 'Best International TV Series' AND T1.result = 'Winner';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many episodes have more than 1000 votes?
|
more than 1000 votes refers to votes > 1000
|
SELECT COUNT(episode_id) FROM Episode WHERE votes > 1000;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many persons were born in New York, USA?
|
"New York" is the birth_place; 'USA' is the birth_region
|
SELECT COUNT(name) FROM Person WHERE birth_place = 'New York City' AND birth_country = 'USA';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
List the name of all awards along with the award category, nominated by Marc Wilmore.
|
"Marc Wilmore" is the name of person
|
SELECT award_id, award_category FROM Award WHERE person = 'Marc Wilmore';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
How many crew have their own nickname? List their full name along with the nickname.
|
crew refers to Person; full name refers to name; have nickname refers to nickname IS NOT NULL
|
SELECT COUNT(name) FROM Person WHERE nickname IS NOT NULL;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Find the average height for each person.
|
average high = Divide(Sum(height_meters), Count(name))
|
SELECT AVG(height_meters) FROM Person;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Calculate the difference between the highest votes for episode and the lowest votes for episode.
|
highest vote refers to Max(votes); lowest vote refers to Min(votes); difference = Subtract(Max(votes), Min(votes))
|
SELECT MAX(votes) - MIN(votes) FROM Vote;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
List the name character awarded for the Outstanding Voice-Over Performance award in 2009.
|
in 2009 refers to year = 2009
|
SELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009 AND T1.award = 'Outstanding Voice-Over Performance';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Among the person nominated for the Comedy Series Award in 2009, how many of them were born in California?
|
nominated refers to result = 'Nominee'; born in California refers to birth_place = 'California'; in 2009 refers to year = 2009
|
SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.year = 2009 AND T2.award = 'Comedy Series' AND T1.birth_region = 'California';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What is the title of episode that won the Best International TV Series Award in 2017?
|
won refers to result = 'Winner'; in 2017 refers to year = 2017
|
SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2017' AND T1.award = 'Best International TV Series' AND T1.result = 'Winner';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
List the name of persons who were not included in the credit for the 'How the Test Was Won' episode.
|
"How the Test Was Won" is the title of episode; not included in the credit refers to credited = ' '; name of person refers to person
|
SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'How the Test Was Won' AND T2.credited = 'false';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What is the title of episode that has a keyword of 'riot' and 'cake'?
|
"riot" and "cake" are both keyword
|
SELECT DISTINCT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('riot', 'cake');
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Which episode has the most vote for 10 stars rating?
|
10 stars rating refers to stars = 10; most vote refers to Max(votes)
|
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.votes DESC LIMIT 1;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Name all the person who involved in the making of simpson 20s episode that aired between October to November.
|
aired between October to November refers to strftime('%m', air_date) between '10' and '11';
|
SELECT DISTINCT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.air_date, 6, 2) BETWEEN '10' AND '11';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
State the name of director for the 'Treehouse of Horror XIX' episode.
|
"Treehouse of Horror XIX" is the title of episode; 'director' is the role of person; name refers to person
|
SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = 'director';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Based on the credits, state how many roles were played in the 5th episode of simpson 20.
|
5th episode refers to episode = 5
|
SELECT COUNT(DISTINCT T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 5;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
List all the keyword for 'Take My Life, Please' episode.
|
"Take My Life,Please" is the title of episode
|
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Take My Life, Please';
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
Among the episode that get more than 950 votes, how many of the episodes were nominated for the 'Outstanding Voice-Over Performance Award in 2009'? Find the percentage of the episodes.
|
more than 950 votes refers to votes > 950; in 2009 refers to year = 2009; number of episode = Count(episode_id); nominated refers to result = 'Nominee'; percentage = Divide(Count(award = 'Outstanding Voice-Over Performance'), Count(episode_id)) * 100
|
SELECT CAST(SUM(CASE WHEN T1.award = 'Outstanding Voice-Over Performance' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.episode_id) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.votes > 950 AND T1.year = 2009;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
simpson_episodes
|
What is the ratio between the 5 stars votes for 'No Loan Again, Naturally' episode and 'Coming to Homerica' episode?
|
5 stars votes refers to stars = 5 ; 'No Loan Again, Naturally' and 'Coming to Homerica' are both the title of episode; ratio = Divide (votes where title = 'No Loan Again, Naturally', votes where title = 'Coming to Homerica')
|
SELECT CAST(SUM(CASE WHEN T1.title = 'No Loan Again, Naturally' THEN T1.votes ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Coming to Homerica' THEN T1.votes ELSE 0 END) AS ratio FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5;
|
database name:db_id simpson_episodes
Episode table Episode Cols: episode id dtype text, season dtype integer, episode dtype integer, number in series dtype integer, title dtype text, summary dtype text, air date dtype text, episode image dtype text, rating dtype real, votes dtype integer,
Person table Person Cols: name dtype text, birth date dtype text, birth name dtype text, birth place dtype text, birth region dtype text, birth country dtype text, height meters dtype real, nickname dtype text,
Award table Award Cols: award id dtype integer, organization dtype text, year dtype integer, award_category dtype text, award dtype text, person dtype text, role dtype text, episode id dtype text, season dtype text, song dtype text, result dtype text,
Character_Award table Character_Award Cols: award id dtype integer, character dtype text,
Credit table Credit Cols: episode id dtype text, category dtype text, person dtype text, role dtype text, credited dtype text,
Keyword table Keyword Cols: episode id dtype text, keyword dtype text,
Vote table Vote Cols: episode id dtype text, stars dtype integer, votes dtype integer, percent dtype real,
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.