input stringlengths 122 2.7k | output stringlengths 24 805 |
|---|---|
[INST] Here is a database schema:
Indicators :
CountryName [ TEXT ]
CountryCode [ TEXT ] Indicators.CountryCode = Country.CountryCode
IndicatorName [ TEXT ]
IndicatorCode [ TEXT ]
Year [ INTEGER ]
Value [ INTEGER ]
Please write me a SQL statement that answers the following question: Which country has the lowest percen... | SELECT CountryName FROM Indicators WHERE IndicatorName LIKE 'Arable land (% of land area)' ORDER BY Value DESC LIMIT 1; |
[INST] Here is a database schema:
Series :
SeriesCode [ TEXT ] primary_key
Topic [ TEXT ]
IndicatorName [ TEXT ]
ShortDefinition [ TEXT ]
LongDefinition [ TEXT ]
UnitOfMeasure [ TEXT ]
Periodicity [ TEXT ]
BasePeriod [ TEXT ]
OtherNotes [ INTEGER ]
AggregationMethod [ TEXT ]
LimitationsAndExceptions [ TEXT ]
NotesFromO... | SELECT DISTINCT Topic FROM Series WHERE LicenseType = 'Restricted'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT CountryCode FROM Country WHERE IncomeGroup = 'Upper middle income' AND ExternalDebtReportingStatus = 'Preliminary'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT CAST(SUM(CASE WHEN ExternalDebtReportingStatus = 'Actual' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE region = 'Middle East & North Africa'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT SUM(CASE WHEN GovernmentAccountingConcept = 'Budgetary central government' THEN 1 ELSE 0 END), SUM(CASE WHEN GovernmentAccountingConcept = 'Consolidated central government' THEN 1 ELSE 0 END) central_nums FROM country WHERE ExternalDebtReportingStatus = 'Actual'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT COUNT(CountryCode) FROM Country WHERE Region = 'East Asia & Pacific' AND ExternalDebtReportingStatus = 'Estimate'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT SUM(CASE WHEN IncomeGroup = 'Lower middle income' THEN 1 ELSE 0 END) * 100.0 / COUNT(CountryCode) persentage FROM Country WHERE Region = 'Sub-Saharan Africa'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT MAX(T1.Value) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year >= 1961 AND T1.Year < 1981 AND T1.IndicatorName LIKE 'Agricultural land (% of land area)' AND T2.LongName = 'Republic of Benin'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT DISTINCT T2.LongName FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Description = 'Sources: UN Energy Statistics (2014)' LIMIT 3; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.Value FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.LongName = 'Commonwealth of Australia' AND T1.IndicatorName = 'Deposit interest rate (%)' AND T1.Year = 1979; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.Seriescode, T1.Description FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.ShortName = 'Germany'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT DISTINCT T3.Topic FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode INNER JOIN Series AS T3 ON T1.Seriescode = T3.SeriesCode WHERE T2.ShortName = 'Austria'; |
[INST] Here is a database schema:
Series :
SeriesCode [ TEXT ] primary_key
Topic [ TEXT ]
IndicatorName [ TEXT ]
ShortDefinition [ TEXT ]
LongDefinition [ TEXT ]
UnitOfMeasure [ TEXT ]
Periodicity [ TEXT ]
BasePeriod [ TEXT ]
OtherNotes [ INTEGER ]
AggregationMethod [ TEXT ]
LimitationsAndExceptions [ TEXT ]
NotesFromO... | SELECT DISTINCT T1.Topic, T2.Description FROM Series AS T1 INNER JOIN SeriesNotes AS T2 ON T1.SeriesCode = T2.Seriescode WHERE T1.SeriesCode = 'SP.DYN.AMRT.MA'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT COUNT(DISTINCT T1.CountryCode) FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' UNION SELECT T1.LongName FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description ... |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T2.CountryCode FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName LIKE 'Land under cereal production%' AND T1.Value = 3018500 AND T1.Year = 1980 AND T2.ExternalDebtReportingStatus = 'Actual'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT CAST(SUM(CASE WHEN T1.Value > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.CountryCode) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year = 1961 AND T2.Region = 'Latin America & Caribbean' AND indicatorname = 'Agricultural land (% of land area)'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT LongName FROM Country WHERE IncomeGroup = 'Low income' AND Region = 'South Asia'; |
[INST] Here is a database schema:
Indicators :
CountryName [ TEXT ]
CountryCode [ TEXT ] Indicators.CountryCode = Country.CountryCode
IndicatorName [ TEXT ]
IndicatorCode [ TEXT ]
Year [ INTEGER ]
Value [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the indicator code for Mobi... | SELECT DISTINCT IndicatorCode FROM Indicators WHERE CountryName = 'Brazil' AND IndicatorName = 'Mobile cellular subscriptions'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT COUNT(longname) FROM country WHERE region = 'Europe & Central Asia' AND currencyunit = 'Danish krone' UNION SELECT longname FROM country WHERE currencyunit = 'Danish krone' AND region = 'Europe & Central Asia'; |
[INST] Here is a database schema:
Indicators :
CountryName [ TEXT ]
CountryCode [ TEXT ] Indicators.CountryCode = Country.CountryCode
IndicatorName [ TEXT ]
IndicatorCode [ TEXT ]
Year [ INTEGER ]
Value [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the name of the country wit... | SELECT countryname, MAX(value) FROM indicators WHERE indicatorname = 'Rural population (% of total population)'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT COUNT(LongName) FROM country WHERE LatestPopulationCensus = '2011' UNION ALL SELECT LongName FROM country WHERE LatestPopulationCensus = '2011'; |
[INST] Here is a database schema:
Indicators :
CountryName [ TEXT ]
CountryCode [ TEXT ] Indicators.CountryCode = Country.CountryCode
IndicatorName [ TEXT ]
IndicatorCode [ TEXT ]
Year [ INTEGER ]
Value [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the agricultural land area ... | SELECT Value FROM Indicators WHERE IndicatorName = 'Agricultural land (sq. km)' AND Year = 1968 AND CountryName = 'Italy'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT MAX(T1.value), T1.year FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Sub-Saharan Africa' AND T1.IndicatorName = 'Out-of-school children of primary school age, female (number)'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT DISTINCT T3.Seriescode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Number of infant deaths' AND T1.LongName = 'Islamic State of Afghanistan' AND T2.Year = 1965; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT COUNT(DISTINCT T1.CountryCode) FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Middle East & North Africa' AND T2.SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.' AND T1.IndicatorName = 'CO2 emissions FROM solid fuel ... |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT DISTINCT T1.IndicatorCode FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year = 1960 AND T2.LongName = 'Republic of Albania'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.LendingCategory FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Cereal production (metric tons)' AND T2.Value = 6140000 AND T2.Year = 1966; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T2.CountryCode, T2.Region FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Population in largest city' AND T1.Year >= 1960 AND T1.Year < 1980 ORDER BY T2.Region DESC LIMIT 1; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT SUM(T1.Value), T1.Year FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'CO2 emissions (kt)' AND T1.Year >= 1975 AND T1.Year < 1981 AND T1.CountryCode = 'WLD' AND T2.SpecialNotes = 'World aggregate.'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.CountryName, SUM(T1.Value) area, T2.IncomeGroup FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Land area (sq. km)' AND T1.Year >= 1961 AND T1.Year < 1980 GROUP BY T1.CountryCode ORDER BY SUM(T1.Value) ASC LIMIT 1; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT AVG(T1.Value), T2.SystemOfTrade FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Air transport, passengers carried' AND T1.Year >= 1970 AND T1.Year < 1981 AND T1.CountryName = 'Bulgaria'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT LatestHouseholdSurvey, PppSurveyYear FROM Country WHERE ShortName = 'Angola'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT COUNT(CountryCode) FROM Country WHERE VitalRegistrationComplete = 'Yes' AND Region = 'North America'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT 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)'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.LongName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Arms exports (SIPRI trend indicator values)' AND T2.Year = 1960 AND T2.Value = 3000000; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.Alpha2Code FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Rural population' AND T2.Year = 1960; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT DISTINCT T1.CountryCode, T1.SpecialNotes FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Value = ( SELECT Value FROM Indicators WHERE IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND Year = 1960 ORDER BY Value DESC LIMIT 1 ); |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | 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.Count... |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SP.ADO.TFRT' AND T1.ShortName = 'Australia'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T1.ShortName = 'Aruba' AND T3.Topic = 'Environment: Energy production & use'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.ShortName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T3.Seriescode = 'BX.KLT.DINV.CD.WD'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.Region FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T3.IndicatorName = 'Inflation, consumer prices (annual %)'; |
[INST] Here is a database schema:
Series :
SeriesCode [ TEXT ] primary_key
Topic [ TEXT ]
IndicatorName [ TEXT ]
ShortDefinition [ TEXT ]
LongDefinition [ TEXT ]
UnitOfMeasure [ TEXT ]
Periodicity [ TEXT ]
BasePeriod [ TEXT ]
OtherNotes [ INTEGER ]
AggregationMethod [ TEXT ]
LimitationsAndExceptions [ TEXT ]
NotesFromO... | SELECT COUNT(T1.Countrycode) FROM CountryNotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T2.IndicatorName = 'Stocks traded, turnover ratio of domestic shares (%)'; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T2.AggregationMethod FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName INNER JOIN Country AS T3 ON T1.CountryCode = T3.CountryCode WHERE T3.ShortName = 'Arab World' AND T1.Value = 133 AND T1.Year = 1960; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | SELECT T1.Value FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName INNER JOIN Country AS T3 ON T1.CountryCode = T3.CountryCode WHERE T2.LongDefinition = 'Adolescent fertility rate is the number of births per 1,000 women ages 15-19.' AND T3.ShortName = 'Arab World' AND T1.Year = 1960; |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | 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.Coun... |
[INST] Here is a database schema:
Country :
CountryCode [ TEXT ] primary_key
ShortName [ TEXT ]
TableName [ TEXT ]
LongName [ TEXT ]
Alpha2Code [ TEXT ]
CurrencyUnit [ TEXT ]
SpecialNotes [ TEXT ]
Region [ TEXT ]
IncomeGroup [ TEXT ]
Wb2Code [ TEXT ]
NationalAccountsBaseYear [ TEXT ]
NationalAccountsReferenceYear [ TEX... | 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)'; |
[INST] Here is a database schema:
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: List the different director IDs of the movies whose user rating is more tha... | SELECT DISTINCT T2.directorid FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating > 4; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Among the users who gave a rating of 5, how many of them are m... | 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'; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the f... | 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; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: How many movies from the USA which... | 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; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: Among the movies from... | 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'; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average occupation of users whose ratings are not ... | SELECT AVG(T2.occupation) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating < 2; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: List the top 10 USA movies, by des... | 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; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the average n... | SELECT AVG(T2.cast_num) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA'; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: List the top 5 movies from other c... | 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; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following ques... | 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; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average rating of the ... | 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; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Among the most rated UK movies, ho... | 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; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write ... | 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'; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ ... | 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'; |
[INST] Here is a database schema:
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: What is the ID of audiences that gave the most rating of 5? [/INST] [/INST] | SELECT userid FROM u2base WHERE rating = 5 GROUP BY userid ORDER BY COUNT(movieid) DESC LIMIT 1; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
movies2dir... | 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; |
[INST] Here is a database schema:
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: Please list down the ID of actors and directors in action movi... | SELECT T2.actorid, T1.directorid FROM movies2directors AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.genre = 'Action'; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
Please wr... | 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; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
Please wr... | 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'; |
[INST] Here is a database schema:
directors :
directorid [ INTEGER ] primary_key
d_quality [ INTEGER ]
avg_revenue [ INTEGER ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ... | 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; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: UK produced what genr... | SELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'UK'; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the follo... | 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; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the follo... | 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; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Movies with rating 3 are viewed by audiences in which distinct... | SELECT DISTINCT T2.age FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 3; |
[INST] Here is a database schema:
directors :
directorid [ INTEGER ] primary_key
d_quality [ INTEGER ]
avg_revenue [ INTEGER ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ... | 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; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
Please write me a SQL statement that answers the following question: Please list down ID of movies acted by top 5 actors based ... | 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; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: List down 5 non Engli... | SELECT T1.movieid FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'UK' AND T1.genre = 'Adventure' AND T2.isEnglish = 'F' LIMIT 5; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: What is the percentage of female audiences who viewed movies w... | SELECT CAST(SUM(IIF(T2.u_gender = 'F', 1, 0)) AS REAL) * 100 / COUNT(T2.userid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 2; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the follo... | SELECT SUM(IIF(T2.u_gender = 'F', 1, 0)) - SUM(IIF(T2.u_gender = 'M', 1, 0)) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid INNER JOIN movies2directors AS T3 ON T3.movieid = T1.movieid WHERE T3.genre = 'horror'; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the genre... | SELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.year = 4 AND T1.isEnglish = 'T'; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: Among the action movi... | SELECT COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA' AND T1.isEnglish = 'F' AND T2.genre = 'Action'; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: For the male users no older than 18, how many times have they ... | SELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.age < 18 AND T2.u_gender = 'M'; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the ID of the movie that has been mostly rated by ... | SELECT T1.movieid FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T2.u_gender = 'F' GROUP BY T1.movieid ORDER BY COUNT(T2.userid) DESC LIMIT 1; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Among divergent movies that got th... | SELECT COUNT(DISTINCT T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'UK' AND T1.rating = 5; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Please list different IDs of movie... | SELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.year = 4 AND T1.rating = 1; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: For the movies in English that are... | SELECT COUNT(DISTINCT T1.movieid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.year = 1 AND T2.rating = 1 AND T1.isEnglish = 'T'; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write ... | SELECT COUNT(DISTINCT T2.userid) FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T1.u_gender = 'F' AND T3.country = 'France'; |
[INST] Here is a database schema:
directors :
directorid [ INTEGER ] primary_key
d_quality [ INTEGER ]
avg_revenue [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: For different directors who direct well, how m... | SELECT COUNT(DISTINCT T2.directorid) FROM movies2directors AS T2 INNER JOIN directors AS T3 ON T2.directorid = T3.directorid WHERE T2.genre = 'Action' AND T3.d_quality = 4; |
[INST] Here is a database schema:
directors :
directorid [ INTEGER ] primary_key
d_quality [ INTEGER ]
avg_revenue [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the genre of the movies that are d... | SELECT T2.genre FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.avg_revenue = 4; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
Please wr... | SELECT COUNT(DISTINCT T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T3.isEnglish = 'T' AND T1.a_gender = 'M' AND T1.a_quality = 5; |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
Please wr... | SELECT T3.country FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T1.a_gender = 'F' AND T1.a_quality = 0; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL stat... | SELECT AVG(T2.rating) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN movies2directors AS T3 ON T1.movieid = T3.movieid WHERE T1.country = 'USA' AND T3.genre = 'Action' GROUP BY T1.movieid ORDER BY AVG(T2.rating) DESC LIMIT 1; |
[INST] Here is a database schema:
directors :
directorid [ INTEGER ] primary_key
d_quality [ INTEGER ]
avg_revenue [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the fo... | SELECT COUNT(*) FROM ( SELECT DISTINCT T2.movieid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid INNER JOIN u2base AS T3 ON T2.movieid = T3.movieid WHERE T1.d_quality = 5 GROUP BY T2.movieid HAVING AVG(T3.rating) > 3.5 ) AS T1; |
[INST] Here is a database schema:
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Which adventure movie has the highest average rating? [/INST] [/INST] | SELECT T1.movieid FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.genre = 'Adventure' GROUP BY T1.movieid ORDER BY AVG(T2.rating) DESC LIMIT 1; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: How many of the users who rate the movie with the id '2462959'... | SELECT COUNT(T1.userid) FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.userid = 2462959 AND T1.u_gender = 'F'; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: What is the most distinct rated mo... | SELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.runningtime = 0 AND T2.rating = ( SELECT MAX(rating) FROM u2base ); |
[INST] Here is a database schema:
actors :
actorid [ INTEGER ] primary_key
a_gender [ TEXT ]
a_quality [ INTEGER ]
movies2actors :
movieid [ INTEGER ]
actorid [ INTEGER ]
cast_num [ INTEGER ]
Please write me a SQL statement that answers the following question: List the ids and ratings of each actors played in the movi... | SELECT T1.actorid, T1.a_quality FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid WHERE T2.movieid = 1722327; |
[INST] Here is a database schema:
directors :
directorid [ INTEGER ] primary_key
d_quality [ INTEGER ]
avg_revenue [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: Which directors with the best quality directed... | SELECT T1.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 5 GROUP BY T1.directorid ORDER BY COUNT(T2.movieid) DESC LIMIT 1; |
[INST] Here is a database schema:
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: How many drama movie with the rating of 3? [/INST] [/INST] | SELECT COUNT(DISTINCT T2.movieid) FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T2.genre = 'drama' AND T1.rating = 3; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: How many of the movies rated 5 are rated by a user between the... | SELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.age BETWEEN 25 AND 35; |
[INST] Here is a database schema:
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: Please list all horror films that have a rating of 1. [/INST] [/INST] | SELECT T1.movieid FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 1 AND T2.genre = 'Horror'; |
[INST] Here is a database schema:
movies :
movieid [ INTEGER ] primary_key
year [ INTEGER ]
isEnglish [ TEXT ]
country [ TEXT ]
runningtime [ INTEGER ]
movies2directors :
movieid [ INTEGER ]
directorid [ INTEGER ]
genre [ TEXT ]
Please write me a SQL statement that answers the following question: List the IDs of all t... | SELECT T2.directorid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'France'; |
[INST] Here is a database schema:
users :
userid [ INTEGER ] primary_key
age [ TEXT ]
u_gender [ TEXT ]
occupation [ TEXT ]
u2base :
userid [ INTEGER ]
movieid [ INTEGER ]
rating [ TEXT ]
Please write me a SQL statement that answers the following question: List all of the user ids and ages who rated movies with the id... | SELECT T2.userid, T2.age FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.movieid = 1695219; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.