1sf/bird-sql-train-with-schema huggingface dataset:
Database: world_development_indicators
Tables: Country, Series, CountryNotes, Footnotes, Indicators, SeriesNotes
Columns (table index, column name): -1, *, 0, CountryCode, 0, ShortName, 0, TableName, 0, LongName, 0, Alpha2Code, 0, CurrencyUnit, 0, SpecialNotes, 0, Region, 0, IncomeGroup, 0, Wb2Code, 0, NationalAccountsBaseYear, 0, NationalAccountsReferenceYear, 0, SnaPriceValuation, 0, LendingCategory, 0, OtherGroups, 0, SystemOfNationalAccounts, 0, AlternativeConversionFactor, 0, PppSurveyYear, 0, BalanceOfPaymentsManualInUse, 0, ExternalDebtReportingStatus, 0, SystemOfTrade, 0, GovernmentAccountingConcept, 0, ImfDataDisseminationStandard, 0, LatestPopulationCensus, 0, LatestHouseholdSurvey, 0, SourceOfMostRecentIncomeAndExpenditureData, 0, VitalRegistrationComplete, 0, LatestAgriculturalCensus, 0, LatestIndustrialData, 0, LatestTradeData, 0, LatestWaterWithdrawalData, 1, SeriesCode, 1, Topic, 1, IndicatorName, 1, ShortDefinition, 1, LongDefinition, 1, UnitOfMeasure, 1, Periodicity, 1, BasePeriod, 1, OtherNotes, 1, AggregationMethod, 1, LimitationsAndExceptions, 1, NotesFromOriginalSource, 1, GeneralComments, 1, Source, 1, StatisticalConceptAndMethodology, 1, DevelopmentRelevance, 1, RelatedSourceLinks, 1, OtherWebLinks, 1, RelatedIndicators, 1, LicenseType, 2, Countrycode, 2, Seriescode, 2, Description, 3, Countrycode, 3, Seriescode, 3, Year, 3, Description, 4, CountryName, 4, CountryCode, 4, IndicatorName, 4, IndicatorCode, 4, Year, 4, Value, 5, Seriescode, 5, Year, 5, Description
Question: What is the percentage of increase of the indicator on Adolescent fertility rate from 1960 to 1961 in the country whose Alpha2Code is 1A?
Evidence: the percentage of increase from 1960 to 1961 = divide(subtract(sum(value where Year = 1961), sum(Value where Year = 1960)), sum(Value where Year = 1960)) *100%; indicator on Adolescent fertility rate refers to IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)%'


SQL: SELECT (( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1961 ) - ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 )) * 1.0 / ( SELECT SUM(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 )
Database: world_development_indicators
Tables: Country, Series, CountryNotes, Footnotes, Indicators, SeriesNotes
Columns (table index, column name): -1, *, 0, CountryCode, 0, ShortName, 0, TableName, 0, LongName, 0, Alpha2Code, 0, CurrencyUnit, 0, SpecialNotes, 0, Region, 0, IncomeGroup, 0, Wb2Code, 0, NationalAccountsBaseYear, 0, NationalAccountsReferenceYear, 0, SnaPriceValuation, 0, LendingCategory, 0, OtherGroups, 0, SystemOfNationalAccounts, 0, AlternativeConversionFactor, 0, PppSurveyYear, 0, BalanceOfPaymentsManualInUse, 0, ExternalDebtReportingStatus, 0, SystemOfTrade, 0, GovernmentAccountingConcept, 0, ImfDataDisseminationStandard, 0, LatestPopulationCensus, 0, LatestHouseholdSurvey, 0, SourceOfMostRecentIncomeAndExpenditureData, 0, VitalRegistrationComplete, 0, LatestAgriculturalCensus, 0, LatestIndustrialData, 0, LatestTradeData, 0, LatestWaterWithdrawalData, 1, SeriesCode, 1, Topic, 1, IndicatorName, 1, ShortDefinition, 1, LongDefinition, 1, UnitOfMeasure, 1, Periodicity, 1, BasePeriod, 1, OtherNotes, 1, AggregationMethod, 1, LimitationsAndExceptions, 1, NotesFromOriginalSource, 1, GeneralComments, 1, Source, 1, StatisticalConceptAndMethodology, 1, DevelopmentRelevance, 1, RelatedSourceLinks, 1, OtherWebLinks, 1, RelatedIndicators, 1, LicenseType, 2, Countrycode, 2, Seriescode, 2, Description, 3, Countrycode, 3, Seriescode, 3, Year, 3, Description, 4, CountryName, 4, CountryCode, 4, IndicatorName, 4, IndicatorCode, 4, Year, 4, Value, 5, Seriescode, 5, Year, 5, Description
Question: What is the average value of Adolescent fertility rate in the country whose Alpha2Code is 1A?
Evidence: average value = AVG(Value) where IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'
SQL: SELECT CAST(SUM(T2.Value) AS REAL) * 100 / COUNT(T2.Year) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: List the different director IDs of the movies whose user rating is more than 4.
SQL: SELECT DISTINCT T2.directorid FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating > 4
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Among the users who gave a rating of 5, how many of them are male?
Evidence: Male users mean that u_gender = 'M'
SQL: SELECT COUNT(T1.userid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.u_gender = 'M'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: List the genres of the movies which actor id 851 is the star.
SQL: SELECT T2.genre FROM movies2actors AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T1.actorid = T3.actorid WHERE T3.actorid = 851
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: How many movies from the USA which user rating is less than 3?
SQL: SELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' AND T1.rating < 3
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Among the movies from France, how many of them are drama?
Evidence: France a one country
SQL: SELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'France' AND T1.genre = 'drama'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What is the average occupation of users whose ratings are not more than 2 ?
SQL: SELECT AVG(T2.occupation) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating < 2
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: List the top 10 USA movies, by descending order, from the highest to the lowest, the user rating.
Evidence: USA is a country
SQL: SELECT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' GROUP BY T1.movieid ORDER BY AVG(T1.rating) DESC LIMIT 10
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What is the average number of casts of movies that are from the USA?
Evidence: USA is a country
SQL: SELECT AVG(T2.cast_num) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: List the top 5 movies from other countries which to language is not in English.
Evidence: not in English can be represented by isEnglish = 'F'
SQL: SELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'other' AND T2.isEnglish = 'F' LIMIT 5
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Among the best actors, how many of them got a rating of 5 to the movies they starred?
SQL: SELECT COUNT(T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN u2base AS T3 ON T2.movieid = T3.movieid WHERE T1.a_quality = 5 AND T3.rating = 5
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What is the average rating of the newest movies from France?
Evidence: France is a country; year = 4 represents the newest date.
SQL: SELECT AVG(T1.rating) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'france' AND T2.year = 4
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Among the most rated UK movies, how many of them has running time of less than 2?
Evidence: UK is a country
SQL: SELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'UK' AND T2.runningtime < 2 AND T1.rating = 5
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: List the id of male users who gave ratings of less than 3 to French movies with running time of 2.
Evidence: Male users mean that u_gender = 'M'; France is a country
SQL: SELECT T1.userid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T1.userid = T3.userid WHERE T2.country = 'France' AND T2.runningtime = 2 AND T1.rating < 3 AND T3.u_gender = 'M'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Among the worst actresses, how many of them got a rating of more than 3 to the movies they starred?
Evidence: Worst actresses means a_quality is the least; The least a_quality is 0
SQL: SELECT COUNT(T1.userid) FROM u2base AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid INNER JOIN users AS T4 ON T1.userid = T4.userid WHERE T3.a_quality = 0 AND T1.rating > 3 AND T4.u_gender = 'F'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What is the ID of audiences that gave the most rating of 5?
Evidence: The audience and users are the same meaning
SQL: SELECT userid FROM u2base WHERE rating = 5 GROUP BY userid ORDER BY COUNT(movieid) DESC LIMIT 1
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What are the ID of actors that had worked together with director 22397? What was the genre of that movie?
SQL: SELECT T2.actorid, T4.genre FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid INNER JOIN movies2directors AS T4 ON T1.movieid = T4.movieid WHERE T4.directorid = 22397
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Please list down the ID of actors and directors in action movies.
SQL: SELECT T2.actorid, T1.directorid FROM movies2directors AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.genre = 'Action'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: How many female actors acted in the movies of year 4?
Evidence: Female actors mean that a_gender = 'F'
SQL: SELECT COUNT(T2.actorid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T3.a_gender = 'F' AND T1.year = 4
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What are the ID of actors with quality rating of 3 acted in English USA movies?
Evidence: English movies refers to isEnglish = 'T'; USA is a country
SQL: SELECT T2.actorid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T3.a_quality = 3 AND T1.country = 'USA' AND T1.isEnglish = 'T'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: List down the ID of movies with running time of 3 and average revenue of 1?
SQL: SELECT T1.movieid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN directors AS T3 ON T2.directorid = T3.directorid WHERE T1.runningtime = 3 AND T3.avg_revenue = 1
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: UK produced what genre of movies?
Evidence: UK is a country
SQL: SELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'UK'
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What is the favourite movie genre for audiences of age 18?
Evidence: The audience and users are the same meaning
SQL: SELECT T1.genre FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T3.age = 18 GROUP BY T1.genre ORDER BY COUNT(T1.movieid) DESC LIMIT 1
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: What is the ID of actors that acted in the movies most viewed by audience with occupation 5?
Evidence: The audience and users are the same meaning
SQL: SELECT T3.actorid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid INNER JOIN movies2actors AS T3 ON T2.movieid = T3.movieid WHERE T1.occupation = 5 GROUP BY T2.movieid ORDER BY COUNT(T1.userid) DESC LIMIT 1
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Movies with rating 3 are viewed by audiences in which distinct age group?
Evidence: The audience and users are the same meaning
SQL: SELECT DISTINCT T2.age FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 3
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Action movies are mostly directed by directors of which country?
SQL: SELECT T3.country FROM movies2directors AS T1 INNER JOIN directors AS T2 ON T1.directorid = T2.directorid INNER JOIN movies AS T3 ON T1.movieid = T3.movieid WHERE T1.genre = 'Action' GROUP BY T3.country ORDER BY COUNT(T3.country) DESC LIMIT 1
Database: movielens
Tables: users, directors, actors, movies, movies2actors, movies2directors, u2base
Columns (table index, column name): -1, *, 0, userid, 0, age, 0, u_gender, 0, occupation, 1, directorid, 1, d_quality, 1, avg_revenue, 2, actorid, 2, a_gender, 2, a_quality, 3, movieid, 3, year, 3, isEnglish, 3, country, 3, runningtime, 4, movieid, 4, actorid, 4, cast_num, 5, movieid, 5, directorid, 5, genre, 6, userid, 6, movieid, 6, rating
Question: Please list down ID of movies acted by top 5 actors based on actor rating.
SQL: SELECT T2.movieid FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid GROUP BY T2.actorid ORDER BY AVG(T1.a_quality) DESC LIMIT 5