Chinastark/bird_dataset huggingface dataset:
Database: movie
Note: movie "Dawn of the Planet of the Apes" refers to title = 'Dawn of the Planet of the Apes'; born after "1970/1/1" refers to date of birth > '1970/1/1'; percentage = divide(count(actorid where date of birth > '1970/1/1'), count(actorid))*100%;
Question: What is the percentage of the actors that showed up in the credit list of movie "Dawn of the Planet of the Apes" that were born after "1970/1/1"?
SQL: SELECT cast(sum(CASE WHEN actor.`date of birth` > '1970-01-01' THEN 1 ELSE 0 END) AS REAL) * 100 / count(actor.`date of birth`) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Dawn of the Planet of the Apes'
Database: movie
Note: a budget of 15000000 refers to budget = 15000000; rating between 7 to 8 refers to rating BETWEEN 7 and 8;
Question: List down the movie ID of movie with a budget of 15000000 and a rating between 7 to 8.
SQL: SELECT movieid FROM movie WHERE rating BETWEEN 7 AND 8 AND budget = 15000000
Database: movie
Note: rated PG refers to mpaa rating = 'PG'; released in June 1990 refers to release date BETWEEN '1990-06-01' and '1990-06-30';
Question: In rated PG movies, how many of them released in June 1990?
SQL: SELECT count(*) FROM movie WHERE `mpaa rating` = 'PG' AND `release date` LIKE '1990-06%'
Database: movie
Note: male refers to gender = 'Male'; white refers to ethnicity = 'White';
Question: What is the name of male and white actor with actor ID 439?
SQL: SELECT name FROM actor WHERE actorid = 439 AND gender = 'Male' AND ethnicity = 'White'
Database: movie
Note: born in New York City refers to birth city = 'New York City'; rating greater than 5 refers to rating > 5;
Question: Among the actors born in New York City, list the genre of their movie with a rating greater than 5.
SQL: SELECT movie.genre FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.`birth city` = 'New York City' AND movie.rating > 5
Database: movie
Note: romantic movies refers to genre = 'Romance'; starred by John Travolta refers to name = 'John Travolta';
Question: In romantic movies, how many of them starred by John Travolta?
SQL: SELECT count(*) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.genre = 'Romance' AND actor.name = 'John Travolta'
Database: movie
Note: Three Men and a Little Lady refers to title = 'Three Men and a Little Lady';
Question: List the height and net worth of actors starred in Three Men and a Little Lady.
SQL: SELECT actor.`height (inches)`, actor.networth FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Three Men and a Little Lady'
Database: movie
Note: PG rated refers to mpaa rating = 'PG';  highest net worth refers to max(networth);
Question: What is the genre of PG rated movie starred by the actor with highest net worth?
SQL: SELECT movie.genre FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.`mpaa rating` = 'PG' ORDER BY cast(replace(replace(actor.networth, ',', ''), '$', '') AS REAL) DESC LIMIT 1
Database: movie
Note: Misery refers to title = 'Misery'; height ranging from 60 to 70 inches refers to height (inches) BETWEEN 60 and 70;
Question: What is the net worth of the actor starred in Misery who has a height ranging from 60 to 70 inches tall?
SQL: SELECT actor.networth FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Misery' AND actor.`height (inches)` BETWEEN 60 AND 70 AND actor.gender = 'Male'
Database: movie
Note: male refers to gender = 'Male'; born in USA refers to birth country = 'USA'; Ghost refers to title = 'Ghost';
Question: Count the male actors born in USA that starred in Ghost.
SQL: SELECT count(*) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Ghost' AND actor.gender = 'Male' AND actor.`birth country` = 'USA'
Database: movie
Note: starred by Leonardo DiCaprio refers to name = 'Leonardo Dicaprio'; highest budget refers to max(budget);
Question: What is the MPAA rating and title of the movie starred by Leonardo DiCaprio with highest budget?
SQL: SELECT movie.`mpaa rating`, movie.title FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.name = 'Leonardo DiCaprio' ORDER BY movie.budget DESC LIMIT 1
Database: movie
Note: Die Hard 2 refers to title = 'Die Hard 2'; height between 60 to 65 refers to height (inches) BETWEEN 60 AND 65;
Question: Among the actors starred in Die Hard 2, list their net worth and birth date of actors with a height between 60 to 65.
SQL: SELECT actor.networth, actor.`date of birth` FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Die Hard 2' AND actor.`height (inches)` BETWEEN 60 AND 65
Database: movie
Note: African-American refers to ethnicity = 'African American'; born on December 28 1954 refers to date of birth = '1954-12-28';
Question: List the runtime of movies starred by an African-American actor born on December 28, 1954.
SQL: SELECT movie.runtime FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.ethnicity = 'African American' AND actor.`date of birth` = '1954-12-28'
Database: movie
Note: actor's name refers to name; as Don Altobello refers to character name = 'Don Altobello'; drama movie refers to genre = 'Drama';
Question: Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.
SQL: SELECT actor.name FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.gross = 136766062 AND characters.`character name` = 'Don Altobello' AND movie.genre = 'Drama'
Database: movie
Note: 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';
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?
SQL: SELECT sum(movie.gross) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE cast(replace(replace(actor.networth, ',', ''), '$', '') AS REAL) > 375000000 AND movie.rating < 7 AND movie.genre = 'Comedy'
Database: movie
Note: starred by Jackie Chan refers to name = 'Jackie Chan'; rating greater than 7 refers to rating > 7;
Question: What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?
SQL: SELECT movie.runtime FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.name = 'Jackie Chan' AND movie.rating > 7
Database: movie
Note: 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%;
Question: Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?
SQL: SELECT sum(CASE WHEN cast(replace(replace(actor.networth, ',', ''), '$', '') AS REAL) > 400000000 THEN 1 ELSE 0 END) - sum(CASE WHEN cast(replace(replace(actor.networth, ',', ''), '$', '') AS REAL) < 400000000 THEN 1 ELSE 0 END) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.genre = 'Drama'
Database: movie
Note: 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);
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.
SQL: SELECT actor.name FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.gender = 'Female' AND movie.title = 'Godzilla' AND actor.`birth city` = 'Sherman Oaks' AND actor.`height (inches)` * 100 > ( SELECT avg(`height (inches)`) FROM actor ) * 50
Database: social_media
Note: english is the language and refers to lang = 'en';
Question: How many tweets are in English?
SQL: SELECT count(tweetid) AS tweet_number FROM twitter WHERE lang = 'en'
Database: social_media
Note: reshared refers to isreshare = 'TRUE';
Question: Please list the texts of all the tweets that are reshared.
SQL: SELECT text FROM twitter WHERE isreshare = 'TRUE'
Database: social_media
Note: seen by more than 1000 unique users refers to reach > 1000;
Question: How many tweets are seen by more than 1000 unique users?
SQL: SELECT count(tweetid) AS tweet_number FROM twitter WHERE reach > 1000
Database: social_media
Note: positive sentiment refers to sentiment > 0; posted on Thursday refers to weekday = 'Thursday';
Question: Among all the tweets that have a positive sentiment, how many of them are posted on Thursday?
SQL: SELECT count(tweetid) AS tweet_number FROM twitter WHERE sentiment > 0 AND weekday = 'Thursday'
Database: social_media
Note: got the most like refers to Max(likes);
Question: What is the text of the tweet that got the most `likes`?
SQL: SELECT text FROM twitter WHERE likes = ( SELECT max( likes) FROM twitter )
Database: social_media
Note: "Argentina" is the country;
Question: Please list all the cities in Argentina.
SQL: SELECT city FROM LOCATION WHERE city IS NOT NULL AND country = 'Argentina'
Database: social_media
Note: "Argentina" is the country;
Question: How many tweets in total were posted by a user in Argentina?
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.country = 'Argentina' LIMIT 1
Database: social_media
Note: "Argentina" is the country; post the most tweets refers to Max(Count(tweetid));
Question: Users in which city of Argentina post the most tweets?
SQL: SELECT LOCATION.city FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.country = 'Argentina' GROUP BY LOCATION.city ORDER BY count(twitter.tweetid) DESC LIMIT 1
Database: social_media
Note: reshared refers to isreshare = 'TRUE'; 'Buenos Aires' is the city;
Question: Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires?
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.city = 'Buenos Aires' AND twitter.isreshare = 'TRUE'
Database: social_media
Note: "Buenos Aires" is the city; positive sentiment refers to sentiment > 0;
Question: Please list the texts of all the tweets posted from Buenos Aires with a positive sentiment.
SQL: SELECT twitter.text FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE twitter.sentiment > 0 AND LOCATION.city = 'Buenos Aires'
Database: social_media
Note: tweet with the most likes refers to Max(likes);
Question: From which country is the tweet with the most likes posted?
SQL: SELECT LOCATION.country FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid ORDER BY twitter.likes DESC LIMIT 1
Database: social_media
Note: "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));
Question: Users in which country has posted more numbers of positive tweets, Argentina or Australia?
SQL: SELECT LOCATION.country FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.country IN ('Argentina', 'Australia') AND twitter.sentiment > 0 GROUP BY LOCATION.country ORDER BY count(twitter.tweetid) DESC LIMIT 1
Database: social_media
Note: "Buenos Aires" is the city; posted on Thursday refers to weekday = 'Thursday';
Question: Among all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.city = 'Buenos Aires' AND twitter.weekday = 'Thursday'
Database: social_media
Note: over 1000 likes refers to likes > 1000; 'Male' is the gender of user;
Question: Among all the users that have posted a tweet with over 1000 likes, how many of them are male?
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.likes > 10 AND USER.gender = 'Male'
Database: social_media
Note: male users refers to gender = 'Male'; total tweets refers to Count(tweetid);
Question: How many tweets have the male users posted in total?
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE USER.gender = 'Male'
Database: social_media
Note: seen by the most number of unique users refers to Max(reach);
Question: What is the gender of the user who has posted the tweet that is seen by the most number of unique users?
SQL: SELECT USER.gender FROM twitter INNER JOIN USER ON twitter.userid = USER.userid ORDER BY twitter.reach DESC LIMIT 1
Database: social_media
Note: "Argentina" is the country; male user refers to gender = 'Male';
Question: How many tweets are posted by male users in Argentina?
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid INNER JOIN USER ON twitter.userid = USER.userid WHERE USER.gender = 'Male' AND LOCATION.country = 'Argentina'
Database: social_media
Note: "Buenos Aires" is the city; male user refers to gender = 'Male';
Question: Please list the texts of all the tweets posted by male users from Buenos Aires.
SQL: SELECT twitter.text FROM twitter INNER JOIN LOCATION ON USER.locationid = twitter.locationid INNER JOIN USER ON USER.userid = twitter.userid INNER JOIN USER ON twitter.userid = USER.userid WHERE USER.city = 'Buenos Aires' AND USER.gender = 'Male'
Database: social_media
Note: "Argentina" is the country; average number of tweets in a city = Divide (Count(tweetid where country = 'Argentina'), Count (city));
Question: What is the average number of tweets posted by the users in a city in Argentina?
SQL: SELECT sum(CASE WHEN LOCATION.city = 'Buenos Aires' THEN 1.0 ELSE 0 END) / count(twitter.tweetid) AS AVG FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.country = 'Argentina'
Database: social_media
Note: positive sentiment refers to sentiment > 0; male user refers to gender = 'Male'; percentage = Divide (Count(tweetid where gender = 'Male'), Count (tweetid)) * 100;
Question: Among all the tweets with a positive sentiment, what is the percentage of those posted by a male user?
SQL: SELECT sum(CASE WHEN USER.gender = 'Male' THEN 1.0 ELSE 0 END) / count(twitter.tweetid) AS per FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.sentiment > 0
Database: social_media
Note: do not show their gender refers to gender = 'Unknown';
Question: Give the number of users who do not show their genders.
SQL: SELECT count(userid) AS user_number FROM USER WHERE gender = 'Unknown'
Database: social_media
Note: "United Kingdom" is the country;
Question: State the number of states in the United Kingdom.
SQL: SELECT count(state) AS state_number FROM LOCATION WHERE country = 'United Kingdom'
Database: social_media
Note: code refers to statecode;
Question: What is the code of Gwynedd State?
SQL: SELECT DISTINCT statecode FROM LOCATION WHERE state = 'Gwynedd'
Database: social_media
Question: Give the location id of West Sussex State.
SQL: SELECT DISTINCT locationid FROM LOCATION WHERE state = 'West Sussex'
Database: social_media
Note: reshared tweet refers to isreshare = 'TRUE'; 'Texas' is the state;
Question: How many reshared tweets are there in Texas?
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.state = 'Texas' AND twitter.isreshare = 'TRUE'
Database: social_media
Note: reach number of 547851 refers to reach = 547851;
Question: For the tweet which got a reach number of 547851, which country did it come from?
SQL: SELECT LOCATION.country FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE twitter.reach = 547851
Database: social_media
Note: positive tweet refers to sentiment > 0; 'Ha Noi' is the state;
Question: State the number of positive tweets from Ha Noi.
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE twitter.sentiment > 0 AND LOCATION.state = 'Ha Noi'
Database: social_media
Note: highest klout refers to Max(klout); 'Connecticut' is the state;
Question: Show the text of the tweet with the highest klout from Connecticut.
SQL: SELECT twitter.text FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE LOCATION.state = 'Connecticut' ORDER BY twitter.klout DESC LIMIT 1
Database: social_media
Note: female users refers to gender = 'Female'; 'Wisconsin' is the state;
Question: How many female Twitter users are there from Wisconsin?
SQL: SELECT count(twitter.likes) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid INNER JOIN USER ON USER.userid = twitter.userid WHERE LOCATION.state = 'Wisconsin' AND USER.gender = 'Female'
Database: social_media
Note: "tw-715909161071091712" is the tweetid;
Question: What is the gender of the user who tweeted `tw-715909161071091712`?
SQL: SELECT USER.gender FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.tweetid = 'tw-715909161071091712'
Database: social_media
Note: "One of our favorite stories is @FINRA_News's move to the cloud with AWS Enterprise Support! https://amp.twimg.com/v/991837f1-4815-4edc-a88f-e68ded09a02a" is the text;
Question: Give the name of the city of the user who tweeted `One of our favorite stories is @FINRA_News's move to the cloud with AWS Enterprise Support! https://amp.twimg.com/v/991837f1-4815-4edc-a88f-e68ded09a02a`.
SQL: SELECT LOCATION.city FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE twitter.text = 'One of our favorite stories is @FINRA_News''s move to the cloud with AWS Enterprise Support! https://amp.twimg.com/v/991837f1-4815-4edc-a88f-e68ded09a02a'
Database: social_media
Note: tweet got 535 retweets refers to retweetcount = 535;
Question: What is the gender of the user whose tweet got 535 retweets?
SQL: SELECT USER.gender FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.retweetcount = 535
Database: social_media
Note: highest klout refers to Max(klout); 'Wednesday' is the weekday;
Question: Give the gender of the user who made the highest klout tweet on Wednesdays.
SQL: SELECT USER.gender FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.weekday = 'Wednesday' ORDER BY twitter.klout DESC LIMIT 1
Database: social_media
Note: most likes refers to Max(likes);
Question: For the tweet which got the most likes, state the gender of the user who tweeted it.
SQL: SELECT USER.gender FROM twitter INNER JOIN USER ON twitter.userid = USER.userid ORDER BY twitter.likes DESC LIMIT 1
Database: social_media
Note: "Michigan" is the state; 'Thursday' is the weekday; number of tweets refers to Count(tweetid);
Question: State the number of tweets from Michigan on Thursdays.
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE twitter.weekday = 'Thursday' AND LOCATION.state = 'Michigan'
Database: social_media
Note: tw-685681052912873473' is the tweetid;
Question: Which state was the tweet `tw-685681052912873473` from? Give the state code.
SQL: SELECT LOCATION.statecode FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE twitter.tweetid = 'tw-685681052912873473'
Database: social_media
Note: "Florida" is the state; male user refers to gender = 'Male'; percentage = Divide (Count(userid where gender = 'Male'), Count (userid)) * 100;
Question: What is the percentage of male Twitter users from Florida?
SQL: SELECT sum(CASE WHEN USER.gender = 'Male' THEN 1.0 ELSE 0 END) / count(twitter.tweetid) AS percentage FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid INNER JOIN USER ON USER.userid = twitter.userid WHERE LOCATION.state = 'Florida'
Database: social_media
Note: "California" is the state; positive tweet refers to sentiment > 0; percentage = Divide (Count(tweetid where sentiment > 0), Count (tweetid)) * 100;
Question: What is the percentage of the tweets from California are positive?
SQL: SELECT sum(CASE WHEN twitter.sentiment > 0 THEN 1.0 ELSE 0 END) / count(twitter.tweetid) AS percentage FROM twitter INNER JOIN LOCATION ON LOCATION.locationid = twitter.locationid WHERE state = 'California'
Database: social_media
Note: "tw-682712873332805633" is the tweetid; day of the week refers to weekday;
Question: What is the day of the week that tweet with ID tw-682712873332805633 was posted?
SQL: SELECT weekday FROM twitter WHERE tweetid = 'tw-682712873332805633'
Database: social_media
Note: "Happy New Year to all those AWS instances of ours!" is the text; seen unique users refers to reach;
Question: How many unique users have seen tweet with text `Happy New Year to all those AWS instances of ours!`?
SQL: SELECT reach FROM twitter WHERE text = 'Happy New Year to all those AWS instances of ours!'
Database: social_media
Note: "en" is the language and refers to lang = 'en';
Question: Count the total number of tweet IDs in `en`.
SQL: SELECT count(DISTINCT tweetid) FROM twitter WHERE lang = 'en'
Database: social_media
Note: "tw-682714048199311366" is the tweetid;
Question: Is 3751 the location ID for tweet with ID tw-682714048199311366?
SQL: SELECT locationid FROM twitter WHERE tweetid = 'tw-682714048199311366'
Database: social_media
Note: "Wednesday" is the weekday;
Question: How many tweets have been posted on Wednesday?
SQL: SELECT count(tweetid) FROM twitter WHERE weekday = 'Wednesday'
Database: social_media
Note: "Thursday" is the weekday;
Question: List down all of the texts posted on Twitter on Thursday.
SQL: SELECT text FROM twitter WHERE weekday = 'Thursday'
Database: social_media
Note: "tw-682714583044243456" is the tweetid;
Question: What is the gender of the user who posted a tweet with ID tw-682714583044243456?
SQL: SELECT USER.gender FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.tweetid = 'tw-682714583044243456'
Database: social_media
Note: unknown gender user refers to gender = 'Unknown';
Question: List down the text of tweets posted by unknown gender users.
SQL: SELECT twitter.text FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE USER.gender = 'Unknown'
Database: social_media
Note: "Male" is the gender;
Question: Calculate the total number of male tweet IDs.
SQL: SELECT count(twitter.tweetid) FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE USER.gender = 'Male'
Database: social_media
Note: "en" is the language and refers to lang = 'en'; most tweet in 'en' refers to Max(Count(text where lang = 'en'));
Question: What gender of users posted the most tweets in `en`?
SQL: SELECT t.gender FROM ( SELECT USER.gender, count( text) AS num FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.lang = 'en' GROUP BY USER.gender ) t ORDER BY t.num DESC LIMIT 1
Database: social_media
Note: retweet more than 30 times refers to retweetcount > 30;
Question: What gender of users retweet more than 30 times?
SQL: SELECT DISTINCT USER.gender FROM twitter INNER JOIN USER ON twitter.userid = USER.userid WHERE twitter.retweetcount > 30