input
stringlengths
193
2.69k
output
stringlengths
24
744
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What are the top 5 installed free apps? [/INST]
SELECT App FROM playstore WHERE Price = 0 ORDER BY CAST(REPLACE(REPLACE(Installs, ',', ''), '+', '') AS INTEGER) DESC LIMIT 5;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: Name the top 10 most reviewed apps. [/INST]
SELECT DISTINCT App FROM playstore ORDER BY Reviews DESC LIMIT 10;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: How many of the users hold neutral attitude on "10 Best Foods for You" app and what category is this app? [/INST]
SELECT COUNT(T2.App), T1.Category FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = '10 Best Foods for You' AND T2.Sentiment = 'Neutral';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What are the apps that users pretty like this app and how many installs amount of these apps? [/INST]
SELECT DISTINCT T1.App, T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment_Polarity > 0;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List apps whose rating is 3.9 and state the translated review of each app. [/INST]
SELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Rating = 3.9;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Which apps have multiple genres and what is the total sentiment subjectivity of these apps? [/INST]
SELECT SUM(T2.Sentiment_Subjectivity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres > 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Which apps have not been updated since year 2015 and what kind of sentiment users hold on it? [/INST]
SELECT DISTINCT App, Sentiment FROM user_reviews WHERE App IN ( SELECT App FROM playstore WHERE CAST(SUBSTR('Last Updated', -4, 4) AS INTEGER) < 2015 );
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the total installs of apps with content rating of adults only 18+ and what are the translated reviews of it? [/INST]
SELECT SUM(T1.Installs), T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1."Content Rating" = 'Adults only 18+';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Which of the app is the best selling app and what is the sentiments polarity of it? [/INST]
SELECT T1.App, T2.Sentiment_Polarity FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App ORDER BY T1.Price * CAST(REPLACE(REPLACE(Installs, ',', ''), '+', '') AS INTEGER) DESC LIMIT 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the average rating of comic category apps? How many users hold positive attitude towards this app? [/INST]
SELECT AVG(T1.Rating) , COUNT(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE NULL END) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Category = 'COMICS';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What is the rating for "Draw A Stickman"? [/INST]
SELECT Rating FROM playstore WHERE APP = 'Draw A Stickman';
[INST] Here is a database schema: user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: How many of the reviews for the app "Brit + Co" have a comment? [/INST]
SELECT COUNT(App) FROM user_reviews WHERE App = 'Brit + Co' AND Translated_Review IS NOT NULL;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: List the top 5 shopping apps with the most reviews. [/INST]
SELECT DISTINCT App FROM playstore WHERE Genres = 'Shopping' GROUP BY App ORDER BY COUNT(App) DESC LIMIT 5;
[INST] Here is a database schema: user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: How many neutral reviews does the app "Dino War: Rise of Beasts" have? [/INST]
SELECT COUNT(App) FROM user_reviews WHERE App = 'Dino War: Rise of Beasts' AND Sentiment = 'Neutral';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What are the apps with only 5,000+ installs? [/INST]
SELECT DISTINCT App FROM playstore WHERE Installs = '5,000+';
[INST] Here is a database schema: user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List all the negative comments on the "Dog Run - Pet Dog Simulator" app. [/INST]
SELECT Translated_Review FROM user_reviews WHERE App = 'Dog Run - Pet Dog Simulator' AND Sentiment = 'Negative';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Which free app has the most Negative comments? [/INST]
SELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Type = 'Free' AND T2.Sentiment = 'Negative' GROUP BY T1.App ORDER BY COUNT(T2.Sentiment) DESC LIMIT 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: How many negative comments are there in all the apps with 100,000,000+ installs? [/INST]
SELECT COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Installs = '100,000,000+' AND T2.Sentiment = 'Negative';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the total Sentiment polarity score of the most expensive app? [/INST]
SELECT SUM(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Price = ( SELECT MAX(Price) FROM playstore );
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the rating for "Garden Coloring Book"? List all of its reviews. [/INST]
SELECT T1.Rating, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Garden Coloring Book';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Which Photography app has the highest total Sentiment subjectivity score? [/INST]
SELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Photography' GROUP BY T1.App ORDER BY SUM(T2.Sentiment_Subjectivity) DESC LIMIT 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List all the comments on the lowest rated Mature 17+ app. [/INST]
SELECT T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1."Content Rating" = 'Mature 17+' ORDER BY T1.Rating LIMIT 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the number of installments of the app with the highest total Sentiment polarity score? [/INST]
SELECT T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App GROUP BY T1.App ORDER BY SUM(T2.Sentiment_Polarity) DESC LIMIT 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the number of neutral comments from all the weather apps? [/INST]
SELECT COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Weather' AND T2.Sentiment = 'Neutral';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Which 1,000,000,000+ intalls apps has the most no comment reviews? [/INST]
SELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Installs = '1,000,000+' AND T2.Translated_Review = 'nan' GROUP BY T1.App ORDER BY COUNT(T2.Translated_Review) DESC LIMIT 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the rating and the total Sentiment subjectivity score of "Onefootball - Soccer Scores"? [/INST]
SELECT T1.Rating, SUM(T2.Sentiment_Subjectivity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Onefootball - Soccer Scores';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: Which apps have 5 rating? List out then application name. [/INST]
SELECT DISTINCT App FROM playstore WHERE Rating = 5;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: List out genre that have downloads more than 1000000000. [/INST]
SELECT Genres FROM playstore WHERE Installs = '1,000,000,000+' GROUP BY Genres;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What is the average price for a dating application? [/INST]
SELECT AVG(Price) FROM playstore WHERE Genres = 'Dating';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What is the average download for entertainment apps with size no more than 1.0 M? [/INST]
SELECT AVG(CAST(REPLACE(REPLACE(Installs, ',', ''), '+', '') AS INTEGER)) FROM playstore WHERE Category = 'ENTERTAINMENT' AND Size < '1.0M';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What is the average review number for application with 5 rating? [/INST]
SELECT AVG(Reviews) FROM playstore WHERE Rating = 5;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List out the top 3 genre for application with a sentiment review greater than 0.5. [/INST]
SELECT Genres FROM playstore WHERE App IN ( SELECT App FROM user_reviews WHERE Sentiment = 'Positive' AND Sentiment_Polarity > 0.5 ORDER BY Sentiment_Polarity DESC LIMIT 3 );
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the percentage of application with 4.7 rating having more positives sentiment than negative sentiment? [/INST]
SELECT CAST(COUNT(CASE WHEN ( SELECT COUNT(CASE WHEN Sentiment = 'Positive' THEN 1 ELSE NULL END) - COUNT(CASE WHEN Sentiment = 'Negative' THEN 1 ELSE NULL END) FROM user_reviews GROUP BY App ) > 0 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Rating = 4.7;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List down app that does not have negative sentiment and give their average rating? [/INST]
SELECT T1.App, AVG(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment != 'Negative' GROUP BY T1.App;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List down application that have not been updated since 2015. What is the percentage of this application having more negative sentiment than positive sentiment? [/INST]
SELECT CAST((( SELECT COUNT(*) Po FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE SUBSTR(T1."Last Updated", -4, 4) > '2015' AND T2.Sentiment = 'Positive' ) - ( SELECT COUNT(*) Ne FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE SUBSTR(T1."Last Updated", -4, 4) > '2015' AND T2.Sentiment = 'Negative' )) AS REAL) * 100 / ( SELECT COUNT(*) NUM FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE SUBSTR(T1."Last Updated", -4, 4) > '2015' );
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What is the percentage for free application with a rating 4.5 and above have not been updated since 2018? [/INST]
SELECT CAST(SUM(CASE WHEN SUBSTR('Last Updated', -4) > '2018' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(App) PER FROM playstore WHERE Type = 'Free' AND Rating >= 4.5;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What genre does Honkai Impact 3rd belong to? [/INST]
SELECT DISTINCT Genres FROM playstore WHERE App = 'Honkai Impact 3rd';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: List down the rating for the App Learn C++. [/INST]
SELECT DISTINCT Rating FROM playstore WHERE App = 'Learn C++';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] Please write me a SQL statement that answers the following question: What is the average price of games belonging in the arcade genre which has a content rating of Everyone 10+? [/INST]
SELECT AVG(Price) FROM playstore WHERE 'Content Rating' = 'Everyone 10+' AND Genres = 'Arcade';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: How much is the size of Browser 4G and how many users have a pretty positive favorability on it? [/INST]
SELECT T1.Size, COUNT(T1.App) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Browser 4G' AND T2.Sentiment_Polarity >= 0.5;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Name the Apps with a sentiment objectivity of 0.3 and include their number of installs. [/INST]
SELECT DISTINCT T1.App, T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment_Polarity = 0.3;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: How much is the average sentiment polarity score of Golf GPS Rangefinder: Golf Pad and what is it's rating in the Google Play Store? [/INST]
SELECT AVG(T2.Sentiment_Polarity), T1.Rating FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Golf GPS Rangefinder: Golf Pad';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List the top 5 lowest rated puzzle games and count the number of negative sentiments the games received. [/INST]
SELECT T1.App, COUNT(T1.App) COUNTNUMBER FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment = 'Negative' GROUP BY T1.App ORDER BY T1.Rating LIMIT 5;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Indicate the number of installs and include the percentage of positive sentiments of FREEDOME VPN Unlimited anonymous Wifi Security. [/INST]
SELECT T1.Installs , CAST(SUM(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE 0 END) * 100 / SUM(CASE WHEN T2.Sentiment IS NOT NULL THEN 1.0 ELSE 0 END) AS REAL) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'FREEDOME VPN Unlimited anonymous Wifi Security';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: For the Honkai Impact 3rd App, what is the highest sentiment polarity score and what genre does it belong to? [/INST]
SELECT MAX(T2.Sentiment_Polarity), T1.Genres FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Honkai Impact 3rd' AND T2.Sentiment_Polarity > 0.5 GROUP BY T1.Genres;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the rating of Dragon Ball Legends and how many users dislike this App? [/INST]
SELECT T1.Rating, COUNT(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Dragon Ball Legends' AND CAST(Sentiment_Polarity AS INTEGER) < -0.5;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Which education App has the worst rating and state the translated review if available. [/INST]
SELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Category = 'EDUCATION' GROUP BY T1.App, T2.Translated_Review ORDER BY T1.Rating ASC LIMIT 1;
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: List all free sports Apps and their translated review. [/INST]
SELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Type = 'Free' AND T1.Category = 'SPORTS';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: Among the role playing game genre, how many are targeted to teens and what is their average sentiment polarity score? [/INST]
SELECT COUNT(T1.App), AVG(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1."Content Rating" = 'Teen' AND T1.Genres = 'Role Playing';
[INST] Here is a database schema: playstore : App [ TEXT ] Category [ TEXT ] Rating [ REAL ] Reviews [ INTEGER ] Size [ TEXT ] Installs [ TEXT ] Type [ TEXT ] Price [ TEXT ] Content Rating [ TEXT ] Genres [ TEXT ] user_reviews : App [ TEXT ] user_reviews.App = playstore.App Translated_Review [ TEXT ] Sentiment [ TEXT ] Sentiment_Polarity [ TEXT ] Sentiment_Subjectivity [ TEXT ] Please write me a SQL statement that answers the following question: What is the average rating of Apps falling under the racing genre and what is the percentage ratio of positive sentiment reviews? [/INST]
SELECT AVG(T1.Rating), CAST(COUNT(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Racing';
[INST] Here is a database schema: Regions : StateCode [ TEXT ] primary_key State [ TEXT ] Region [ TEXT ] Please write me a SQL statement that answers the following question: State the full name of state code "GA". [/INST]
SELECT T FROM ( SELECT IIF(StateCode = 'GA', State, NULL) AS T FROM Regions ) WHERE T IS NOT NULL;
[INST] Here is a database schema: Regions : StateCode [ TEXT ] primary_key State [ TEXT ] Region [ TEXT ] Please write me a SQL statement that answers the following question: How many states located in the Midwest region? [/INST]
SELECT COUNT(DISTINCT T) FROM ( SELECT CASE WHEN Region = 'Midwest' THEN StateCode ELSE NULL END AS T FROM Regions ) WHERE T IS NOT NULL;
[INST] Here is a database schema: Regions : StateCode [ TEXT ] primary_key State [ TEXT ] Region [ TEXT ] Please write me a SQL statement that answers the following question: How many states are in the Midwest region? [/INST]
SELECT COUNT(DISTINCT T) FROM ( SELECT CASE WHEN Region = 'Midwest' THEN State ELSE NULL END AS T FROM Regions ) WHERE T IS NOT NULL;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What is the most consecutive games tied by Ebbsfleet as an away team in the 2008 season? [/INST]
SELECT COUNT(*) FROM matchs WHERE season = 2008 AND AwayTeam = 'Ebbsfleet' AND FTR = 'D';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] Please write me a SQL statement that answers the following question: Of all the divisions in the world, what percentage of them belong to England? [/INST]
SELECT CAST(COUNT(CASE WHEN country = 'England' THEN division ELSE NULL END) AS REAL) * 100 / COUNT(division) FROM divisions;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What percentage of games won, games lost and games drawn does Cittadella have as a home team in total? [/INST]
SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) / COUNT(HomeTeam) AS REAL) * 100, CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam), CAST(COUNT(CASE WHEN FTR = 'D' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam) FROM matchs WHERE HomeTeam = 'Cittadella';
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Of all the teams that played as a team away against Caen in the 2010 season, which one has the highest winning percentage? [/INST]
SELECT AwayTeam FROM matchs WHERE HomeTeam = 'Caen' AND season = 2010 AND FTR = 'A' GROUP BY AwayTeam ORDER BY COUNT(AwayTeam) DESC LIMIT 1;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What percentage of matches played on 2005/07/30 belong to the F1 division? [/INST]
SELECT CAST(SUM(CASE WHEN Div = 'F1' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Div) FROM matchs WHERE Date = '2005-07-30' ;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What percentage of all tied games did the Sassuolo team play in? [/INST]
SELECT CAST(SUM(CASE WHEN HomeTeam = 'Sassuolo' OR AwayTeam = 'Sassuolo' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(FTR) FROM matchs WHERE FTR = 'D';
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What is the percentage whereby the away team scored 2 goals during the 2017 seasons? [/INST]
SELECT CAST(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END) / COUNT(FTAG) AS REAL) * 100 FROM matchs WHERE season = 2017;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What is the name of all the teams that played in the EFL League One division? [/INST]
SELECT T1.HomeTeam,T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'EFL League One' and T1.Div = 'E2' ;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many teams playing in divisions in Greece have ever scored 4 or more goals? [/INST]
SELECT COUNT(DISTINCT CASE WHEN T1.FTHG >= 4 THEN HomeTeam ELSE NULL end) + COUNT(DISTINCT CASE WHEN T1.FTAG >= 4 THEN AwayTeam ELSE NULL end) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' ;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many matches played in the 2019 season of Scottish Championship league were ended with an equal result of 2-2? [/INST]
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T2.name = 'Scottish Championship' AND T1.FTAG = 2 AND T1.FTHG = 2;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which 2 Scottish teams scored 10 goals playing as a local team and in which seasons? [/INST]
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Scotland' AND T1.FTHG = 10;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: From the Spanish LaLiga division in the 2017 season, which team won the most times as a local team and by what percentage? [/INST]
SELECT T1.HomeTeam HWHT , CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T2.country = 'Spain' AND T1.season = 2017;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many teams that played in the 2012 season belong to any of the English divisions and what percentage play in each of the divisions? [/INST]
SELECT ( SELECT COUNT(T1.Div) AS total FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS num , CASE WHEN 1 THEN T.result END AS percentage FROM ( SELECT 100.0 * COUNT(T1.Div) / ( SELECT COUNT(T1.Div) FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS result FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 GROUP BY T2.division ) AS T;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What is the highest final-time score across all divisions in the 2021 season? Which team was the team that made up that score? [/INST]
SELECT ( SELECT MAX(MAX(FTAG), MAX(FTHG)) FROM matchs WHERE season = 2021 ) AS T1, AwayTeam FROM matchs WHERE season = 2021 AND FTHG = T1 OR FTAG = T1;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What is the name of the home team in division P1 with the highest final time goal in all seasons? [/INST]
SELECT HomeTeam FROM matchs WHERE Div = 'P1' AND season = 2021 ORDER BY FTHG DESC LIMIT 1;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What was the difference in home team and away team win percentages across all divisions in 2010? [/INST]
SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) - CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) DIFFERENCE FROM matchs WHERE season = 2010;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which division had the most draft matches in the 2008 season? [/INST]
SELECT Div FROM matchs WHERE season = 2008 AND FTR = 'D' GROUP BY Div ORDER BY COUNT(FTR) DESC LIMIT 1;
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which team won the match in the EC division on January 20, 2008 at home? [/INST]
SELECT HomeTeam FROM matchs WHERE Div = 'EC' AND Date = '2008-01-20' AND FTR = 'H';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What is the name of the division in which Club Brugge and Genk competed on September 13, 2009? [/INST]
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2009-09-13' and T1.HomeTeam = 'Club Brugge' AND T1.AwayTeam = 'Genk';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many matches were played in the Scottish Premiership division from 2006 to 2008? [/INST]
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish Premiership' AND (T1.season BETWEEN 2006 AND 2008);
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: In which division was the match between Hibernian, the away team, and Hearts, the home team, played? To which country does this division belong? [/INST]
SELECT DISTINCT T2.division,T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Hearts' AND T1.AwayTeam = 'Hibernian';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which away team in the division of Bundesliga has the highest final time goals? [/INST]
SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'Bundesliga' ORDER BY T1.FTAG DESC LIMIT 1;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Please provide the names of any three away teams that competed in the Italian divisions. [/INST]
SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.country = 'Italy' LIMIT 3;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What is the name of the division that has had the lowest number of draft matches in the 2019 season? [/INST]
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T1.FTR = 'D' GROUP BY T2.division ORDER BY COUNT(FTR) LIMIT 1;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many times did Valencia's home team win in the LaLiga division? [/INST]
SELECT COUNT(T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T1.HomeTeam = 'Valencia' AND T1.FTR = 'H';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: In how many matches in the Seria A division did both teams have equal goals? [/INST]
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Seria A' AND T1.FTR = 'D';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] Please write me a SQL statement that answers the following question: How many football divisions does England have? [/INST]
SELECT COUNT(division) FROM divisions WHERE country = 'England';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] Please write me a SQL statement that answers the following question: What's the name of the football division in the Netherlands? [/INST]
SELECT name FROM divisions WHERE country = 'Netherlands';
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Who is the winner of the game happened on 2009/10/10, between "East Fife" and "Dumbarton"? [/INST]
SELECT CASE WHEN FTR = 'H' THEN 'East Fife' ELSE 'Dumbarton' END WINNER FROM matchs WHERE Date = '2009-10-10' AND HomeTeam = 'East Fife' AND AwayTeam = 'Dumbarton';
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What was the final score for the game Bursaspor vs Denizlispor on 2009/4/26? [/INST]
SELECT FTHG, FTAG FROM matchs WHERE Date = '2009-04-26' AND HomeTeam = 'Bursaspor' AND AwayTeam = 'Denizlispor';
[INST] Here is a database schema: matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: When did the first match that score more than 10 goals happen? [/INST]
SELECT MIN(Date) FROM matchs WHERE FTHG + FTAG > 10;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: For the Ligue 2 game that made the most goals, who is the winner of that game? [/INST]
SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam ELSE T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Ligue 2' ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many Away Victories happened on 2016/3/27 in the LaLiga 2 division? [/INST]
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga 2' AND T1.Date = '2016-03-27' AND T1.FTR = 'A';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many draw games happened on 2018/8/7 for National League? [/INST]
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'National League' AND T1.Date = '2018-08-07' AND T1.FTR = 'D';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which country had the game that Away team made the most goals? [/INST]
SELECT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division GROUP BY T2.country ORDER BY SUM(T1.FTAG) DESC LIMIT 1;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: For a game had a score of 1-8 in the year of 2011, what division was that game in? Give the full name of the division. [/INST]
SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2011 AND T1.FTHG = 1 AND T1.FTAG = 8;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which division had the most games with more than 5 total field goals on 2020/2/22? Give the full name of the division? [/INST]
SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-02-22' AND T1.FTAG + T1.FTHG > 5 ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Give the full name of the divison that had the most 0-0 games. [/INST]
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTAG = 0 AND T1.FTHG = 0 GROUP BY T2.division ORDER BY COUNT(T1.FTAG) DESC LIMIT 1;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many Scottish League One games took place on the day that "Pro Vercelli" and "Pescara"had a 5-2 game? [/INST]
SELECT COUNT(T1.Date) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish League One' AND T1.Date = ( SELECT Date FROM matchs WHERE FTHG = 5 AND FTAG = 2 AND HomeTeam = 'Pro Vercelli' AND AwayTeam = 'Pescara' );
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: List the number of games that ended up with 5-0 in Greece. [/INST]
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' AND T1.FTHG = 5 AND T1.FTAG = 0;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which country did Bradford Team belongs to? [/INST]
SELECT DISTINCT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Bradford' OR T1.AwayTeam = 'Bradford';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many Eredivisie teams have played in 2008? [/INST]
SELECT COUNT(DISTINCT T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Eredivisie' AND T1.season = 2008;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: What's the home win ratio of the Bundesliga division in 2021? [/INST]
SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Bundesliga';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: For all the games ended up with 1-1, what percentage of them are from Liga NOS division? [/INST]
SELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1;
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: How many matches were held during the 2021 season's Premier League? [/INST]
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Premier League';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which team was the home team in the match of the Bundesliga division on 2020/10/2? [/INST]
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga';
[INST] Here is a database schema: divisions : division [ TEXT ] primary_key name [ TEXT ] country [ TEXT ] matchs : Div [ TEXT ] matchs.Div = divisions.division Date [ DATE ] HomeTeam [ TEXT ] AwayTeam [ TEXT ] FTHG [ INTEGER ] FTAG [ INTEGER ] FTR [ TEXT ] season [ INTEGER ] Please write me a SQL statement that answers the following question: Which team won the match of the Bundesliga division on 2020/10/2? [/INST]
SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam WHEN T1.FTR = 'A' THEN T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga';