input
stringlengths 358
16.1k
| output
stringlengths 24
805
|
---|---|
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What are the official languages used in Greece? [/INST] | SELECT T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T2.name = 'Greece'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Give the population of the country where Queimados city belongs. [/INST] | SELECT T2.Population FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Queimados'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What are the official languages of the country where you can find the city with the least population? [/INST] | SELECT T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.Population ASC LIMIT 1; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the surface area and GNP of the country where Namibe district belongs? [/INST] | SELECT T2.SurfaceArea, T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Namibe'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: List the names of the country that officially uses English as their language. [/INST] | SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T1.Language = 'English'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What are the districts that belong to the country with the lowest surface area? [/INST] | SELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T2.SurfaceArea ASC LIMIT 1; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: List down the country names of countries that have a GNP lower than 1000 and have Dutch as their language. [/INST] | SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GNP < 1000 AND T1.IsOfficial = 'T' AND T1.Language = 'Dutch'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the GNP of the country where district "Entre Rios" belongs? [/INST] | SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Entre Rios' LIMIT 1; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the local name of the country where "The Valley" city belongs? [/INST] | SELECT T2.LocalName FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'The Valley'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: List down the cities belongs to the country that has surface area greater than 7000000. [/INST] | SELECT T2.Name, T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea > 7000000; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the life expectancy of the countries that uses Japanese as their language? [/INST] | SELECT AVG(T2.LifeExpectancy) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Japanese'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: How many cities are there in the country with the surface area of 652090? [/INST] | SELECT T2.Name, COUNT(T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea = 652090 GROUP BY T2.Name; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: List down the languages of countries with an independence year between 1980 to 1995. [/INST] | SELECT T2.Name, T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.IndepYear BETWEEN 1980 AND 1995; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: What is the life expectancy of the people living in Calama city? [/INST] | SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Calama'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Provide the language used in the country ruled by Pierre Buyoya. [/INST] | SELECT T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Pierre Buyoya'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: In countries with constitutional monarchy, what is the percentage of cities located in the district of England? [/INST] | SELECT CAST(SUM(CASE WHEN T1.District = 'England' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GovernmentForm = 'Constitutional Monarchy'; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Among the cities with a population between 140000 and 150000, list the country that has life expectancy greater than 80% life expectancy of all countries. [/INST] | SELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Population BETWEEN 140000 AND 150000 GROUP BY T2.Name, LifeExpectancy HAVING LifeExpectancy < ( SELECT AVG(LifeExpectancy) FROM Country ) * 0.8; |
[INST] Here is a database schema:
City :
ID [ INTEGER ] primary_key
Name [ TEXT ]
CountryCode [ TEXT ] City.CountryCode = Country.Code
District [ TEXT ]
Population [ INTEGER ]
Country :
Code [ TEXT ] primary_key
Name [ TEXT ]
Continent [ TEXT ]
Region [ TEXT ]
SurfaceArea [ REAL ]
IndepYear [ INTEGER ]
Population [ INTEGER ]
LifeExpectancy [ REAL ]
GNP [ REAL ]
GNPOld [ REAL ]
LocalName [ TEXT ]
GovernmentForm [ TEXT ]
HeadOfState [ TEXT ]
Capital [ INTEGER ]
Code2 [ TEXT ]
CountryLanguage :
CountryCode [ TEXT ] CountryLanguage.CountryCode = Country.Code
Language [ TEXT ]
IsOfficial [ TEXT ]
Percentage [ REAL ]
Please write me a SQL statement that answers the following question: Among the countries that use Italian as their language, what is the percentage of republic countries? [/INST] | SELECT CAST(SUM(CASE WHEN T2.GovernmentForm = 'Republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Italian'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many podcasts are there in the category which has the most podcasts? [/INST] | SELECT COUNT(podcast_id) FROM categories WHERE category = ( SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the percentage of the podcast that are categorized in four or more categories? [/INST] | SELECT COUNT(T1.podcast_id) FROM ( SELECT podcast_id FROM categories GROUP BY podcast_id HAVING COUNT(category) >= 4 ) AS T1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Provide the itunes id and url for podcast titled 'Brown Suga Diaries'. [/INST] | SELECT itunes_id, itunes_url FROM podcasts WHERE title = 'Brown Suga Diaries'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all podcast with its itunes url for all title containing the word 'Dream'. [/INST] | SELECT itunes_url FROM podcasts WHERE title LIKE '%Dream%' GROUP BY itunes_url; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Name all the categories for podcast titled 'I Heart My Life Show'. [/INST] | SELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'I Heart My Life Show'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all the podcast title and its itunes url under the 'society-culture' category. [/INST] | SELECT T2.title, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'society-culture'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many people rated 5 for the podcast which title contains the word 'spoiler' under the 'art' category '? [/INST] | SELECT COUNT(T3.podcast_id) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title LIKE '%spoilers%' AND T1.category = 'arts' AND T3.rating = 5; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List the authors who created review for podcast titled 'Pop Rocket' in 2016 with rating less than 5. [/INST] | SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Pop Rocket' AND T2.created_at LIKE '2016-%' AND T2.rating < 5; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Name all the podcast title and its category with average rating of more than 3.0. [/INST] | SELECT T2.title, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id GROUP BY T3.podcast_id HAVING AVG(T3.rating) > 3; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all content reviewed for podcast with the best rating under the 'fiction' category. State the podcast title. [/INST] | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.rating = 5 AND T1.category = 'fiction'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: State the podcast title, content review and rating for all reviews with titled 'Love it!' [/INST] | SELECT DISTINCT T1.title, T2.content, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Love it!'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Find the author, rating and review creation date of review for podcast title 'In The Thick'. [/INST] | SELECT T2.author_id, T2.rating, T2.created_at FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'In The Thick' GROUP BY T2.author_id, T2.rating, T2.created_at; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which podcast was reviewed the latest? State the date of creation, podcast tile and rating. [/INST] | SELECT T1.podcast_id, T2.created_at, T2.title, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id ORDER BY T2.created_at DESC LIMIT 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Name the podcast title, rating and review content created by '76A4C24B6038145'. [/INST] | SELECT T2.title, T2.rating, T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = '76A4C24B6038145'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: For all reviews with the worst rating, state the podcast title as well as the review title and content. [/INST] | SELECT DISTINCT T1.title, T2.title, T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.rating = 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all reviews created in May 2019. State the title of podcast and review rating. [/INST] | SELECT DISTINCT T1.title, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at LIKE '2019-05-%'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average rating for the podcast that is most reviewed? [/INST] | SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id GROUP BY T1.podcast_id ORDER BY COUNT(T2.content) DESC LIMIT 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which category does the podcast titled 'SciFi Tech Talk' belong to? [/INST] | SELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'SciFi Tech Talk'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the name of the podcast in which a commentor left a comment with the title 'Long time listener, calling it quits?' Include the URL of the podcast as well. [/INST] | SELECT podcast_id, itunes_url FROM podcasts WHERE podcast_id = ( SELECT podcast_id FROM reviews WHERE title = 'Long time listener, calling it quits' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all the names of podcasts under the 'true crime' category. [/INST] | SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'true-crime'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Write all the review content belonging to StormCast: The Official Warhammer Age of Sigmar Podcast. [/INST] | SELECT content FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'StormCast: The Official Warhammer Age of Sigmar Podcast' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Write all the review titles and the contents belonging to the podcast 'More Stupider: A 90-Day Fiance Podcast' with a review rating of 1. [/INST] | SELECT title, content FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'More Stupider: A 90-Day Fiance Podcast' ) AND rating = 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many reviews does 'LifeAfter/The Message' have which were rated below 3? [/INST] | SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'LifeAfter/The Message' AND T2.rating <= 3; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: The 'More Stupider: A 90-Day Fiance Podcast' belongs to which category and what is the average rating of the podcast? [/INST] | SELECT AVG(T3.rating) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'More Stupider: A 90-Day Fiance Podcast'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Of the arts-books and arts-design categories, which one has more podcasts and what is the numerical difference between them? [/INST] | SELECT ( SELECT category FROM categories WHERE category = 'arts-books' OR category = 'arts-design' GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 ) "has more podcasts" , ( SELECT SUM(CASE WHEN category = 'arts-books' THEN 1 ELSE 0 END) - SUM(CASE WHEN category = 'arts-design' THEN 1 ELSE 0 END) FROM categories ) "differenct BETWEEN arts-books and arts-design"; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many total reviews runned at in June 2022 were added to the podcasts? [/INST] | SELECT SUM(reviews_added) FROM runs WHERE run_at LIKE '2022-06-%'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many podcast reviews with a rating of 3 were created during the first quarter of 2015? [/INST] | SELECT COUNT(podcast_id) FROM reviews WHERE rating = 3 AND created_at BETWEEN '2015-01-01T00:00:00-07:00' AND '2015-03-31T23:59:59-07:00'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Calculate the percentage of podcasts in the fiction-science-fiction category. [/INST] | SELECT CAST(SUM(CASE WHEN category = 'fiction-science-fiction' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(podcast_id) OR '%' "percentage" FROM categories; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average rating of all the podcasts with reviews created in 2019? [/INST] | SELECT AVG(rating) FROM reviews WHERE created_at BETWEEN '2019-01-01T00:00:00-07:00' AND '2019-12-31T23:59:59-07:00'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the percentage of reviews added each year of the total reviews added? [/INST] | SELECT CAST((SUM(CASE WHEN run_at LIKE '2022-%' THEN reviews_added ELSE 0 END) - SUM(CASE WHEN run_at LIKE '2021-%' THEN reviews_added ELSE 0 END)) AS REAL) * 100 / SUM(reviews_added) OR '%' "percentage" FROM runs; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Indicates the title of all podcasts in the fiction category. [/INST] | SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'fiction'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the rating and category of the podcast entitled Sitcomadon? [/INST] | SELECT DISTINCT T3.rating, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'Sitcomadon'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Indicate the id of the reviewer whose itunes id is 1516665400. [/INST] | SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.itunes_id = 1516665400; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What are the titles of the podcasts whose reviews were created between 2018-08-22T11:53:16-07:00 and 2018-11-20T11:14:20-07:00? [/INST] | SELECT DISTINCT T1.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2018-08-22T11:53:16-07:00' AND '2018-11-20T11:14:20-07:00'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: To which categories do the podcasts of the reviewer whose id is EFB34EAC8E9397C belong? [/INST] | SELECT DISTINCT T1.category FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'EFB34EAC8E9397C'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Indicate the slug and the itunes url of the podcast whose review content was written Can't stop listening. [/INST] | SELECT slug, itunes_url FROM podcasts WHERE podcast_id IN ( SELECT podcast_id FROM reviews WHERE content = 'Can''t stop listening' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What dates were the Don't Lie To Your Life Coach podcast reviews created? [/INST] | SELECT created_at FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'Don''t Lie To Your Life Coach' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: In how many categories were podcast reviews created in the last six months of 2016? List them. [/INST] | SELECT COUNT(DISTINCT T1.category) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2016-07-01T00:00:00-07:00' AND '2016-12-31T23:59:59-07:00'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Calculate the average rating of the true crime category. [/INST] | SELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'true-crime'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List the titles of the art category. [/INST] | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average rating of all the podcasts in category art? [/INST] | SELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Provide the names of podcasts in the art category in 2018. [/INST] | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts' AND T2.created_at LIKE '2018-%'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Write the names of the podcasts in the music category that have a rating greater than 3. [/INST] | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' AND T2.rating > 3; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which titles have the content "love" but the category is art produced between 2018 and 2019. [/INST] | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE (T2.created_at LIKE '2018-%' AND T1.category = 'arts' AND T2.content LIKE '%love%') OR (T2.created_at LIKE '2019-%' AND T1.category = 'arts' AND T2.content LIKE '%love%'); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the category and itune url of the title "Scaling Global"? [/INST] | SELECT T1.category, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Scaling Global'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average rating of podcasts in comedy category? [/INST] | SELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'comedy'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the least common category? [/INST] | SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) ASC LIMIT 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the longest review? [/INST] | SELECT title FROM reviews ORDER BY LENGTH(content) DESC LIMIT 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the review with the title "Hosts bring the show down" for? [/INST] | SELECT title FROM podcasts WHERE podcast_id = ( SELECT podcast_id FROM reviews WHERE title = 'Hosts bring the show down' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which "music" podcast has the longest title? [/INST] | SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' ORDER BY LENGTH(T2.title) DESC LIMIT 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all the cagetories for all the podcasts with "jessica" in the title. [/INST] | SELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title LIKE '%jessica%' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the category for the "Moist Boys" podcast? [/INST] | SELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title = 'Moist Boys' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all of the two-star reviews and their categories. [/INST] | SELECT T1.category FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.rating = 2; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List all the podcasts reviewed by a reviewer who has a review titled "Inspired & On Fire!". [/INST] | SELECT T1.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Inspired & On Fire!'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What are the titles and categories of all the podcasts with a review that has "Absolutely fantastic" in it? [/INST] | SELECT T2.title, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.content LIKE '%Absolutely fantastic%'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which category has the most reviews? [/INST] | SELECT T1.category FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id GROUP BY T1.category ORDER BY COUNT(T2.podcast_id) DESC LIMIT 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: List the urls for all the "fiction-science-fiction" podcasts. [/INST] | SELECT itunes_url FROM podcasts WHERE podcast_id IN ( SELECT podcast_id FROM categories WHERE category = 'fiction-science-fiction' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the content of the earliest review for the "Stuff You Should Know" podcast? [/INST] | SELECT T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Stuff You Should Know' ORDER BY T2.created_at ASC LIMIT 1; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many reviews does "Planet Money" have? [/INST] | SELECT COUNT(T2.podcast_id) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Planet Money'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average rating for the "crime-junkie" podcast? [/INST] | SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Crime Junkie'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What percentage of podcasts are "technology" podcasts? List all of them. [/INST] | SELECT CAST(SUM(CASE WHEN T1.category = 'technology' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.title) OR '%' "percentage" FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the content of the review under the title "really interesting!" and is created on 2018-04-24 at 12:05:16? [/INST] | SELECT content FROM reviews WHERE title = 'really interesting!' AND created_at = '2018-04-24T12:05:16-07:00'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which category is the podcast "Scaling Global" under? [/INST] | SELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title = 'Scaling Global' ); |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the titles of all the podcasts under the category "arts-performing-arts". [/INST] | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts-performing-arts'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many reviews are created for the podcast "Scaling Global" under? [/INST] | SELECT COUNT(T2.content) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Scaling Global'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Among the reviews for the podcast "Please Excuse My Dead Aunt Sally", how many of them are made in the year 2019? [/INST] | SELECT COUNT(T2.created_at) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.created_at LIKE '2019-%'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: Please list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review. [/INST] | SELECT T2.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'F7E5A318989779D'; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many ratings of 5 have been given to the podcast "Please Excuse My Dead Aunt Sally"? [/INST] | SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.rating = 5; |
[INST] Here is a database schema:
runs :
run_at [ TEXT ]
max_rowid [ INTEGER ]
reviews_added [ INTEGER ]
podcasts :
podcast_id [ TEXT ] primary_key
itunes_id [ INTEGER ]
slug [ TEXT ]
itunes_url [ TEXT ]
title [ TEXT ]
reviews :
podcast_id [ TEXT ]
title [ TEXT ]
content [ TEXT ]
rating [ INTEGER ]
author_id [ TEXT ]
created_at [ TEXT ]
categories :
podcast_id [ TEXT ]
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the average rating of the podcast "Please Excuse My Dead Aunt Sally"? [/INST] | SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally'; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: How many universities have at least 80,000 students in the year 2011? [/INST] | SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the ranking system ID of the award criteria? [/INST] | SELECT ranking_system_id FROM ranking_criteria WHERE criteria_name = 'Award'; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: How many state universities are there? [/INST] | SELECT COUNT(*) FROM university WHERE university_name LIKE '%State%'; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the student staff ratio of the university with the highest student staff ratio of all time? [/INST] | SELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year ); |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: How many criteria belong to ranking system ID 3? [/INST] | SELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the ID of the university that has only 1% of international students between 2011 to 2015? [/INST] | SELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: Give the name of the country that has the most universities. [/INST] | SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id GROUP BY T2.country_name ORDER BY COUNT(T1.university_name) DESC LIMIT 1; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the name of the university that had the highest number of international students for 6 consecutive years? [/INST] | SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.pct_international_students DESC LIMIT 1; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: In 2014, what is the name of the university which was considered a leader in the publications rank? [/INST] | SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Publications Rank' AND T2.year = 2014 AND T1.id = 17 ORDER BY T2.score DESC LIMIT 1; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the name of the university that has the lowest number of students of all time? [/INST] | SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.num_students LIMIT 1; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: How many universities are there in the United States of America? [/INST] | SELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'United States of America'; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: In 2016, what is the name of the university in Australia with the highest score in Citations criteria? [/INST] | SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id INNER JOIN country AS T4 ON T4.id = T3.country_id WHERE T1.criteria_name = 'Citations' AND T2.year = 2016 AND T1.id = 4 AND T4.country_name = 'Australia' ORDER BY T2.score DESC LIMIT 1; |
[INST] Here is a database schema:
country :
id [ INTEGER ] primary_key
country_name [ TEXT ]
ranking_system :
id [ INTEGER ] primary_key
system_name [ TEXT ]
ranking_criteria :
id [ INTEGER ] primary_key
ranking_system_id [ INTEGER ] ranking_criteria.ranking_system_id = ranking_system.id
criteria_name [ TEXT ]
university :
id [ INTEGER ] primary_key
country_id [ INTEGER ] university.country_id = country.id
university_name [ TEXT ]
university_ranking_year :
university_id [ INTEGER ] university_ranking_year.university_id = university.id
ranking_criteria_id [ INTEGER ] university_ranking_year.ranking_criteria_id = ranking_criteria.id
year [ INTEGER ]
score [ INTEGER ]
university_year :
university_id [ INTEGER ] university_year.university_id = university.id
year [ INTEGER ]
num_students [ INTEGER ]
student_staff_ratio [ REAL ]
pct_international_students [ INTEGER ]
pct_female_students [ INTEGER ]
Please write me a SQL statement that answers the following question: How many universities scored 0 in Awards between 2005 to 2015? [/INST] | SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Award' AND T2.year BETWEEN 2005 AND 2015 AND T2.score = 0; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.