1sf/bird-sql-train-with-schema huggingface dataset:
Database: movie
Tables: actor, movie, characters
Columns (table index, column name): -1, *, 0, ActorID, 0, Name, 0, Date of Birth, 0, Birth City, 0, Birth Country, 0, Height (Inches), 0, Biography, 0, Gender, 0, Ethnicity, 0, NetWorth, 1, MovieID, 1, Title, 1, MPAA Rating, 1, Budget, 1, Gross, 1, Release Date, 1, Genre, 1, Runtime, 1, Rating, 1, Rating Count, 1, Summary, 2, MovieID, 2, ActorID, 2, Character Name, 2, creditOrder, 2, pay, 2, screentime
Question: Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.
Evidence: actor's name refers to Name; as Don Altobello refers to Character Name = 'Don Altobello'; drama movie refers to Genre = 'Drama'
SQL: SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Gross = 136766062 AND T2.`Character Name` = 'Don Altobello' AND T1.Genre = 'Drama'
Database: movie
Tables: actor, movie, characters
Columns (table index, column name): -1, *, 0, ActorID, 0, Name, 0, Date of Birth, 0, Birth City, 0, Birth Country, 0, Height (Inches), 0, Biography, 0, Gender, 0, Ethnicity, 0, NetWorth, 1, MovieID, 1, Title, 1, MPAA Rating, 1, Budget, 1, Gross, 1, Release Date, 1, Genre, 1, Runtime, 1, Rating, 1, Rating Count, 1, Summary, 2, MovieID, 2, ActorID, 2, Character Name, 2, creditOrder, 2, pay, 2, screentime
Question: What is the gross of a comedy movie with a rating lower than 7 and starred by an actor with a net worth greater than $375,000,000.00?
Evidence: comedy movie refers to Genre = 'Comedy'; rating lower than 7 refers to Rating < 7; net worth greater than $375,000,000.00 refers to NetWorth > '$375,000,000.00'
SQL: SELECT SUM(T1.Gross) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 375000000 AND T1.Rating < 7 AND T1.Genre = 'Comedy'
Database: movie
Tables: actor, movie, characters
Columns (table index, column name): -1, *, 0, ActorID, 0, Name, 0, Date of Birth, 0, Birth City, 0, Birth Country, 0, Height (Inches), 0, Biography, 0, Gender, 0, Ethnicity, 0, NetWorth, 1, MovieID, 1, Title, 1, MPAA Rating, 1, Budget, 1, Gross, 1, Release Date, 1, Genre, 1, Runtime, 1, Rating, 1, Rating Count, 1, Summary, 2, MovieID, 2, ActorID, 2, Character Name, 2, creditOrder, 2, pay, 2, screentime
Question: What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?
Evidence: starred by Jackie Chan refers to Name = 'Jackie Chan'; rating greater than 7 refers to Rating > 7
SQL: SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Jackie Chan' AND T1.Rating > 7
Database: movie
Tables: actor, movie, characters
Columns (table index, column name): -1, *, 0, ActorID, 0, Name, 0, Date of Birth, 0, Birth City, 0, Birth Country, 0, Height (Inches), 0, Biography, 0, Gender, 0, Ethnicity, 0, NetWorth, 1, MovieID, 1, Title, 1, MPAA Rating, 1, Budget, 1, Gross, 1, Release Date, 1, Genre, 1, Runtime, 1, Rating, 1, Rating Count, 1, Summary, 2, MovieID, 2, ActorID, 2, Character Name, 2, creditOrder, 2, pay, 2, screentime
Question: Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?
Evidence: drama genre refers to Genre = 'Drama'; net worth greater than $400,000,000.00 refers to NetWorth > '$400,000,000.00'; percentage = divide(count(ActorID where NetWorth > '$400,000,000.00'), COUNT(ActorID))*100%
SQL: SELECT SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 400000000 THEN 1 ELSE 0 END) - SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) < 400000000 THEN 1 ELSE 0 END) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Drama'
Database: movie
Tables: actor, movie, characters
Columns (table index, column name): -1, *, 0, ActorID, 0, Name, 0, Date of Birth, 0, Birth City, 0, Birth Country, 0, Height (Inches), 0, Biography, 0, Gender, 0, Ethnicity, 0, NetWorth, 1, MovieID, 1, Title, 1, MPAA Rating, 1, Budget, 1, Gross, 1, Release Date, 1, Genre, 1, Runtime, 1, Rating, 1, Rating Count, 1, Summary, 2, MovieID, 2, ActorID, 2, Character Name, 2, creditOrder, 2, pay, 2, screentime
Question: List the character's name of actress born in Sherman Oaks and starred in the movie Bruce Almighty with height greater than the 50% of average height of all actors listed.
Evidence: actress refers to Gender = 'Female'; born in Sherman Oaks refers to Birth City = 'Sherman Oaks'; movie Bruce Almighty refers to Title = 'Bruce Almighty'; height greater than the 50% of average height refers to Height (Inches) > multiply(avg(Height (Inches)), 0.5)
SQL: SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Gender = 'Female' AND T1.Title = 'Godzilla' AND T3.`Birth City` = 'Sherman Oaks' AND T3.`Height (Inches)` * 100 > ( SELECT AVG(`Height (Inches)`) FROM actor ) * 50
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: How many tweets are in English?
Evidence: english is the language and refers to Lang = 'en'
SQL: SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Lang = 'en'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Please list the texts of all the tweets that are reshared.
Evidence: reshared refers to Isreshare = 'TRUE'
SQL: SELECT text FROM twitter WHERE IsReshare = 'TRUE'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: How many tweets are seen by more than 1000 unique users?
Evidence: seen by more than 1000 unique users refers to Reach > 1000
SQL: SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Reach > 1000
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Among all the tweets that have a positive sentiment, how many of them are posted on Thursday?
Evidence: positive sentiment refers to Sentiment > 0; posted on Thursday refers to Weekday = 'Thursday'
SQL: SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Sentiment > 0 AND Weekday = 'Thursday'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: What is the text of the tweet that got the most `likes`?
Evidence: got the most like refers to Max(Likes)
SQL: SELECT text FROM twitter WHERE Likes = ( SELECT MAX( Likes) FROM twitter )
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Please list all the cities in Argentina.
Evidence: "Argentina" is the Country
SQL: SELECT City FROM location WHERE City IS NOT NULL AND Country = 'Argentina'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: How many tweets in total were posted by a user in Argentina?
Evidence: "Argentina" is the Country
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' LIMIT 1
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Users in which city of Argentina post the most tweets?
Evidence: "Argentina" is the Country; post the most tweets refers to Max(Count(TweetID))
SQL: SELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' GROUP BY T2.City ORDER BY COUNT(T1.TweetID) DESC LIMIT 1
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires?
Evidence: reshared refers to Isreshare = 'TRUE'; 'Buenos Aires' is the City
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.IsReshare = 'TRUE'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Please list the texts of all the tweets posted from Buenos Aires with a positive sentiment.
Evidence: "Buenos Aires" is the City; positive sentiment refers to Sentiment > 0
SQL: SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Sentiment > 0 AND T2.City = 'Buenos Aires'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: From which country is the tweet with the most likes posted?
Evidence: tweet with the most likes refers to Max(Likes)
SQL: SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID ORDER BY T1.Likes DESC LIMIT 1
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Users in which country has posted more numbers of positive tweets, Argentina or Australia?
Evidence: "Argentina" and "Australia" are both Country; positive tweets refers to Sentiment > 0; Country posted more number of tweets refers to Country where Max(Count(TweetID))
SQL: SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country IN ('Argentina', 'Australia') AND T1.Sentiment > 0 GROUP BY T2.Country ORDER BY COUNT(T1.TweetID) DESC LIMIT 1
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Among all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?
Evidence: "Buenos Aires" is the City; posted on Thursday refers to Weekday = 'Thursday'
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.Weekday = 'Thursday'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Among all the users that have posted a tweet with over 1000 likes, how many of them are male?
Evidence: over 1000 likes refers to Likes > 1000; 'Male' is the Gender of user
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Likes > 10 AND T2.Gender = 'Male'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: How many tweets have the male users posted in total?
Evidence: male users refers to Gender = 'Male'; total tweets refers to Count(TweetID)
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: What is the gender of the user who has posted the tweet that is seen by the most number of unique users?
Evidence: seen by the most number of unique users refers to Max(Reach)
SQL: SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Reach DESC LIMIT 1
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: How many tweets are posted by male users in Argentina?
Evidence: "Argentina" is the Country; male user refers to Gender = 'Male'
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T3.Gender = 'Male' AND T2.Country = 'Argentina'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Please list the texts of all the tweets posted by male users from Buenos Aires.
Evidence: "Buenos Aires" is the City; male user refers to Gender = 'Male'
SQL: SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T2 ON T2.UserID = T1.UserID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T2.City = 'Buenos Aires' AND T3.Gender = 'Male'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: What is the average number of tweets posted by the users in a city in Argentina?
Evidence: "Argentina" is the Country; average number of tweets in a city = Divide (Count(TweetID where Country = 'Argentina'), Count (City))
SQL: SELECT SUM(CASE WHEN T2.City = 'Buenos Aires' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS avg FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Among all the tweets with a positive sentiment, what is the percentage of those posted by a male user?
Evidence: positive sentiment refers to Sentiment > 0; male user refers to Gender = 'Male'; percentage = Divide (Count(TweetID where Gender = 'Male'), Count (TweetID)) * 100
SQL: SELECT SUM(CASE WHEN T2.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS per FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Sentiment > 0
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Give the number of users who do not show their genders.
Evidence: do not show their gender refers to Gender = 'Unknown'
SQL: SELECT COUNT(UserID) AS user_number FROM user WHERE Gender = 'Unknown'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: State the number of states in the United Kingdom.
Evidence: "United Kingdom" is the Country
SQL: SELECT COUNT(State) AS State_number FROM location WHERE Country = 'United Kingdom'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: What is the code of Gwynedd State?
Evidence: code refers to StateCode
SQL: SELECT DISTINCT StateCode FROM location WHERE State = 'Gwynedd'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Give the location id of West Sussex State.
SQL: SELECT DISTINCT LocationID FROM location WHERE State = 'West Sussex'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: How many reshared tweets are there in Texas?
Evidence: reshared tweet refers to IsReshare = 'TRUE'; 'Texas' is the State
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.State = 'Texas' AND T1.IsReshare = 'TRUE'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: For the tweet which got a reach number of 547851, which country did it come from?
Evidence: reach number of 547851 refers to Reach = 547851
SQL: SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Reach = 547851
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: State the number of positive tweets from Ha Noi.
Evidence: positive tweet refers to Sentiment > 0; 'Ha Noi' is the State
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Sentiment > 0 AND T2.State = 'Ha Noi'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: Show the text of the tweet with the highest klout from Connecticut.
Evidence: highest klout refers to Max(Klout); 'Connecticut' is the State
SQL: SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.State = 'Connecticut' ORDER BY T1.Klout DESC LIMIT 1
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: How many female Twitter users are there from Wisconsin?
Evidence: female users refers to Gender = 'Female'; 'Wisconsin' is the State
SQL: SELECT COUNT(T1.Likes) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T3.UserID = T1.UserID WHERE T2.State = 'Wisconsin' AND T3.Gender = 'Female'
Database: social_media
Tables: location, user, twitter
Columns (table index, column name): -1, *, 0, LocationID, 0, Country, 0, State, 0, StateCode, 0, City, 1, UserID, 1, Gender, 2, TweetID, 2, Weekday, 2, Hour, 2, Day, 2, Lang, 2, IsReshare, 2, Reach, 2, RetweetCount, 2, Likes, 2, Klout, 2, Sentiment, 2, text, 2, LocationID, 2, UserID
Question: What is the gender of the user who tweeted `tw-715909161071091712`?
Evidence: "tw-715909161071091712" is the TweetID
SQL: SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.TweetID = 'tw-715909161071091712'