input stringlengths 193 2.69k | output stringlengths 24 744 |
|---|---|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'Tulocay winery' AND T2.food_type = 'winery'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T2.review, T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'hayward' AND T1.street_name = 'mission blvd'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'castro st' AND T1.city = 'mountain view' AND T2.food_type = 'indian' AND T2.label LIKE '%cookhouse%'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.review = 2 AND T1.street_num < 500; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT COUNT(T1.id_restaurant) AS num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'milpitas' AND T2.food_type = 'asian' AND T1.street_name = 'n milpitas blvd' AND T1.id_restaurant > 385; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T2.label, T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'ocean avenue'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T2.city, T1.street_num, T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'sanuki restaurant'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_num = 22779 AND T1.street_name = '6th St' AND T2.city = 'hayward'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT COUNT(T2.food_type = 'american') FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'front'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.food_type = 'american' AND T1.street_num > 2000 GROUP BY T1.id_restaurant ORDER BY AVG(T2.review) * 0.7 DESC; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT CAST(SUM(IIF(T2.food_type = 'afghani', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE 1000 <= T1.street_num <= 2000; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What is the name of the most popular restaurant serving Asian foo... | SELECT label FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' ); |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: How many cities are there in Monterey? [/INST] | SELECT COUNT(DISTINCT city) FROM geographic WHERE region = 'monterey'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: How many deli in Belmont have a review rating of 2 or more? [/INS... | SELECT COUNT(id_restaurant) FROM generalinfo WHERE city = 'belmont' AND review > 2 AND food_type = 'deli'; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: Which county in northern California has the highest number of cities? [/INST] | SELECT county FROM geographic WHERE region = 'northern california' GROUP BY county ORDER BY COUNT(city) DESC LIMIT 1; |
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: How many restaurants can y... | SELECT COUNT(id_restaurant) FROM location WHERE city = 'concord'; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following ques... | SELECT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city ORDER BY T1.review DESC LIMIT 4; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT COUNT(T1.id_restaurant) FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'livermore' AND T1.food_type = 'chinese' AND T2.street_name = '1st st'; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following ques... | SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'indian' AND T1.region = 'los angeles area'; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following ques... | SELECT T2.food_type FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area' GROUP BY T2.food_type ORDER BY COUNT(T2.food_type) DESC LIMIT 1; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.street_name = 'broadway' AND T2.review < 3 AND T1.city = 'oakland'; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following ques... | SELECT T2.region AS num FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'baskin robbins' GROUP BY T2.region ORDER BY COUNT(T1.city) DESC LIMIT 1; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'pizza' AND T1.city = 'san jose'; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following ques... | SELECT COUNT(T2.food_type) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'yosemite and mono lake area'; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T2.street_name, T2.street_num, T2.city FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant ORDER BY T1.review DESC LIMIT 1; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following ques... | SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city GROUP BY T2.county ORDER BY COUNT(T1.label) DESC LIMIT 1; |
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL st... | SELECT T1.region FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city GROUP BY T1.region ORDER BY COUNT(T2.id_restaurant) DESC LIMIT 1; |
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name ... | SELECT T1.street_num, T1.street_name, T1.city FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.review >= 4; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT COUNT(Player_Id) FROM Player WHERE SUBSTR(DOB, 1, 4) > 1985; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling... | SELECT COUNT(CASE WHEN T2.Country_Name = 'Australia' THEN T1.Player_Id ELSE NULL END) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling... | SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.Country_Name IS NOT NULL ORDER BY T2.DOB LIMIT 1; |
[INST] Here is a database schema:
Bowling_Style :
Bowling_Id [ INTEGER ] primary_key
Bowling_skill [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.... | SELECT T1.Bowling_Skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T2.Bowling_skill = T1.Bowling_Id WHERE T2.Player_Name = 'SC Ganguly'; |
[INST] Here is a database schema:
Batting_Style :
Batting_Id [ INTEGER ] primary_key
Batting_hand [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.B... | SELECT SUM(CASE WHEN SUBSTR(T1.DOB, 1, 4) > 1985 THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_Hand = 'Right-hand bat'; |
[INST] Here is a database schema:
Batting_Style :
Batting_Id [ INTEGER ] primary_key
Batting_hand [ TEXT ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_... | SELECT T2.Player_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_id INNER JOIN Batting_Style AS T3 ON T2.Batting_hand = T3.Batting_Id WHERE T1.Country_Name = 'Australia' AND T3.Batting_Hand = 'Right-hand bat'; |
[INST] Here is a database schema:
Bowling_Style :
Bowling_Id [ INTEGER ] primary_key
Bowling_skill [ TEXT ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting... | SELECT T2.Bowling_Skill FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id INNER JOIN Country AS T3 ON T1.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'Australia' GROUP BY T2.Bowling_Skill; |
[INST] Here is a database schema:
Bowling_Style :
Bowling_Id [ INTEGER ] primary_key
Bowling_skill [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.... | SELECT MIN(T1.DOB) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_Skill = 'Legbreak'; |
[INST] Here is a database schema:
Bowling_Style :
Bowling_Id [ INTEGER ] primary_key
Bowling_skill [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.... | SELECT T1.Bowling_Skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T2.Bowling_skill = T1.Bowling_Id GROUP BY T1.Bowling_Skill ORDER BY COUNT(T1.Bowling_Skill) DESC LIMIT 1; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T2.Player_Name FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match WHERE T1.Match_Date = '2008-04-18'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT SUM(CASE WHEN T3.Role_Desc = 'Captain' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id WHERE T1.Player_Name = 'SC Ganguly'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T2.Role_Id FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Match AS T4 ON T2.Match_Id = T4.Match_Id WHERE T1.Player_Name = 'SC Ganguly' AND T4.Match_Date = '2008-04-18'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT MAX(T3.Win_Margin) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE T1.Player_Name = 'SC Ganguly'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT CAST(SUM(T3.Win_Margin) AS REAL) / COUNT(*) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE T1.Player_Name = 'SC Ganguly'; |
[INST] Here is a database schema:
Batting_Style :
Batting_Id [ INTEGER ] primary_key
Batting_hand [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.B... | SELECT CAST(SUM(CASE WHEN T2.Batting_Hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE SUBSTR(T1.DOB, 1, 4) > 1985; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T2.Player_Name FROM Ball_by_Ball AS T1 INNER JOIN Player AS T2 ON T1.Striker = T2.Player_Id WHERE T1.Match_Id = 419169 AND T1.Over_Id = 3 AND T1.Ball_Id = 2 AND T1.Innings_No = 2; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match WHERE T2.Match_Date = '2008-05-12'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Rolee AS T2 ON T1.Role_Id = T2.Role_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T1.Match_Id = '419117' AND T2.Role_Desc = 'CaptainKeeper'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2013; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T2.DOB FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2014 AND T1.Orange_Cap IS NOT NULL; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling... | SELECT T3.Country_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Season_Id = 7 AND T1.Purple_Cap IS NOT NULL; |
[INST] Here is a database schema:
City :
City_Id [ INTEGER ] primary_key
City_Name [ TEXT ]
Country_id [ INTEGER ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Please write me a SQL statement that answers the following question: Which country does Ranchi city belong to? [/INST] | SELECT T2.Country_Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id WHERE T1.City_Name = 'Ranchi'; |
[INST] Here is a database schema:
City :
City_Id [ INTEGER ] primary_key
City_Name [ TEXT ]
Country_id [ INTEGER ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Please write me a SQL statement that answers the following question: How many Indian cities are there in the database? [/INST] | SELECT SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id; |
[INST] Here is a database schema:
City :
City_Id [ INTEGER ] primary_key
City_Name [ TEXT ]
Country_id [ INTEGER ]
Venue :
Venue_Id [ INTEGER ] primary_key
Venue_Name [ TEXT ]
City_Id [ INTEGER ] Venue.City_Id = City.City_Id
Please write me a SQL statement that answers the following question: State the name of the cit... | SELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T1.City_Id = T2.City_Id GROUP BY T1.City_Id ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1; |
[INST] Here is a database schema:
Batting_Style :
Batting_Id [ INTEGER ] primary_key
Batting_hand [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.B... | SELECT T2.Batting_hand FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T1.Player_Name = 'MK Pandey'; |
[INST] Here is a database schema:
City :
City_Id [ INTEGER ] primary_key
City_Name [ TEXT ]
Country_id [ INTEGER ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Please write me a SQL statement that answers the following question: In the database, how many times is the number of Indian cities to th... | SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT Player_Name FROM Player ORDER BY DOB ASC LIMIT 1; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT COUNT(Player_Id) AS cnt FROM Player WHERE DOB BETWEEN '1990-01-01' AND '1999-12-31'; |
[INST] Here is a database schema:
Season :
Season_Id [ INTEGER ] primary_key
Man_of_the_Series [ INTEGER ]
Orange_Cap [ INTEGER ]
Purple_Cap [ INTEGER ]
Season_Year [ INTEGER ]
Please write me a SQL statement that answers the following question: List the id of the player who won the Orange Cap for 2 consecutive season... | SELECT Orange_Cap FROM Season GROUP BY Orange_Cap HAVING COUNT(Season_Year) > 1; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Umpire :
Umpire_Id [ INTEGER ] primary_key
Umpire_Name [ TEXT ]
Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id
Please write me a SQL statement that answers the following question: How many umpire... | SELECT SUM(CASE WHEN T1.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN Umpire AS T2 ON T1.Country_ID = T2.Umpire_Country; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match GROUP BY T2.Man_of_the_Match ORDER BY COUNT(T2.Man_of_the_Match) DESC LIMIT 1; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling... | SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T1.Country_Id = T2.Country_Name GROUP BY T2.Country_Name ORDER BY COUNT(T2.Country_Name) DESC LIMIT 1; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT SUM(CASE WHEN T1.Player_Name = 'CH Gayle' THEN 1 ELSE 0 END) AS cnt FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Orange_Cap; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Venue :
Venue_Id [ INTEGER ] primary_key
Venue_Name [ TEXT ]
City_Id [ INTEGER ] Venue.City_Id = City.City_Id
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_... | SELECT T3.Venue_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 INNER JOIN Venue AS T3 ON T2.Venue_Id = T3.Venue_Id WHERE T1.Team_Name = 'Kolkata Knight Riders' GROUP BY T3.Venue_Id ORDER BY COUNT(T3.Venue_Id) DESC LIMIT 1; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT T1.Team_Name FROM Team AS T1 INNER JOIN ( SELECT COUNT(Team_1) AS a, Team_1 FROM Match WHERE Team_1 <> Match_Winner GROUP BY Team_1 UNION SELECT COUNT(Team_2) AS a, Team_2 FROM Match WHERE Team_2 <> Match_Winner GROUP BY Team_2 ORDER BY a DESC LIMIT 1 ) AS T2 ON T1.Team_Id = T2.Team_1; |
[INST] Here is a database schema:
Batting_Style :
Batting_Id [ INTEGER ] primary_key
Batting_hand [ TEXT ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_... | SELECT SUM(CASE WHEN T1.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS cnt FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T1.Batting_Id = T2.Batting_hand INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'India'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T4.Player_Name FROM Team AS T1 INNER JOIN Player_Match AS T2 ON T1.Team_id = T2.Team_id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Player AS T4 ON T2.Player_Id = T4.Player_Id WHERE T1.Team_Name = 'Deccan Chargers' AND T1.Team_Id = 8 AND T3.Role_Desc = 'Captain' AND T3.Role_Id = 1 GROUP BY T4.Pl... |
[INST] Here is a database schema:
Batting_Style :
Batting_Id [ INTEGER ] primary_key
Batting_hand [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.B... | SELECT CAST(SUM(CASE WHEN T1.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Player_Id) FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T2.Batting_hand = T1.Batting_Id; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT Player_name FROM Player WHERE DOB = '1981-07-07'; |
[INST] Here is a database schema:
Player_Match :
Match_Id [ INTEGER ] Player_Match.Match_Id = Match.Match_Id
Player_Id [ INTEGER ] Player_Match.Player_Id = Player.Player_Id
Role_Id [ INTEGER ] Player_Match.Role_Id = Rolee.Role_Id
Team_Id [ INTEGER ] Player_Match.Team_Id = Team.Team_Id
Please write me a SQL statement t... | SELECT SUM(CASE WHEN Player_Id = 2 THEN 1 ELSE 0 END) FROM Player_Match; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 ORDER BY T1.Win_Margin DESC LIMIT 1; |
[INST] Here is a database schema:
City :
City_Id [ INTEGER ] primary_key
City_Name [ TEXT ]
Country_id [ INTEGER ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Venue :
Venue_Id [ INTEGER ] primary_key
Venue_Name [ TEXT ]
City_Id [ INTEGER ] Venue.City_Id = City.City_Id
Please write me a SQL state... | SELECT T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T2.City_Id = T1.City_Id INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_id WHERE T1.Venue_Name = 'St George''s Park'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T3.Team_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T2.Match_Id = 335990 AND T3.Team_Name = 'Mumbai Indians' GROUP BY T3.Team_Name; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Match_Date = '2009-05-07' AND T2.Win_Margin = 7; |
[INST] Here is a database schema:
Outcome :
Outcome_Id [ INTEGER ] primary_key
Outcome_Type [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_I... | SELECT SUM(CASE WHEN T2.Outcome_Type = 'Superover' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Outcome AS T2 ON T2.Outcome_Id = T1.Outcome_type; |
[INST] Here is a database schema:
City :
City_Id [ INTEGER ] primary_key
City_Name [ TEXT ]
Country_id [ INTEGER ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Please write me a SQL statement that answers the following question: List the cities located in U.A.E. [/INST] | SELECT T1.City_Name FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Country_id WHERE T2.Country_Name = 'U.A.E'; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT SUM(CASE WHEN T2.Team_Name = 'Pune Warriors' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Date LIKE '2015%' AND T1.Match_Id = 829768; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T3.Role_Desc FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Rolee AS T3 ON T3.Role_Id = T2.Role_Id WHERE T2.Match_Id = 335992 AND T1.Player_Name = 'K Goel'; |
[INST] Here is a database schema:
City :
City_Id [ INTEGER ] primary_key
City_Name [ TEXT ]
Country_id [ INTEGER ]
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Please write me a SQL statement that answers the following question: How many cities are located in South Africa? [/INST] | SELECT SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Country_id; |
[INST] Here is a database schema:
Venue :
Venue_Id [ INTEGER ] primary_key
Venue_Name [ TEXT ]
City_Id [ INTEGER ] Venue.City_Id = City.City_Id
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ]... | SELECT SUM(CASE WHEN T2.Venue_Name = 'Newlands' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT T1.Win_Margin FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE (T2.Team_Name = 'Mumbai Indians' AND T3.Team_Name = 'Royal Challengers Bangalore' AND T1.Match_Date = '2008-05-28') OR (T2.Team_Name = 'Royal Challengers Bangalore' AND T3.Team_Nam... |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT DISTINCT CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T2.Team_Name END, CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T3.Team_Name END FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.T... |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT CAST(SUM(CASE WHEN T1.Role_Desc = 'Captain' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Role_Id) FROM Rolee AS T1 INNER JOIN Player_Match AS T2 ON T2.Role_Id = T1.Role_Id INNER JOIN Player AS T3 ON T3.Player_Id = T2.Player_Id WHERE T3.DOB LIKE '1977%'; |
[INST] Here is a database schema:
Ball_by_Ball :
Match_Id [ INTEGER ] Ball_by_Ball.Match_Id = Match.Match_Id
Over_Id [ INTEGER ]
Ball_Id [ INTEGER ]
Innings_No [ INTEGER ]
Team_Batting [ INTEGER ]
Team_Bowling [ INTEGER ]
Striker_Batting_Position [ INTEGER ]
Striker [ INTEGER ]
Non_Striker [ INTEGER ]
Bowler [ INTEGER ... | SELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1; |
[INST] Here is a database schema:
Batsman_Scored :
Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id
Over_Id [ INTEGER ]
Ball_Id [ INTEGER ]
Runs_Scored [ INTEGER ]
Innings_No [ INTEGER ]
Please write me a SQL statement that answers the following question: List the over IDs, ball IDs, and innings numbers o... | SELECT Over_Id, Ball_Id, Innings_No FROM Batsman_Scored WHERE Match_Id = 336004 ORDER BY Runs_Scored DESC LIMIT 1; |
[INST] Here is a database schema:
Ball_by_Ball :
Match_Id [ INTEGER ] Ball_by_Ball.Match_Id = Match.Match_Id
Over_Id [ INTEGER ]
Ball_Id [ INTEGER ]
Innings_No [ INTEGER ]
Team_Batting [ INTEGER ]
Team_Bowling [ INTEGER ]
Striker_Batting_Position [ INTEGER ]
Striker [ INTEGER ]
Non_Striker [ INTEGER ]
Bowler [ INTEGER ... | SELECT Match_Id FROM Ball_by_Ball WHERE Over_Id = 20 GROUP BY Match_Id LIMIT 5; |
[INST] Here is a database schema:
Wicket_Taken :
Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id
Over_Id [ INTEGER ]
Ball_Id [ INTEGER ]
Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id
Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = Out_Type.Out_Id
Fielders [ INTEGER ] Wicket_Taken.Fielders =... | SELECT SUM(CASE WHEN Match_Id = 548335 THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Innings_No = 1; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT Player_name FROM Player WHERE DOB LIKE '1971%'; |
[INST] Here is a database schema:
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id
Toss_Winner [ INTEGER... | SELECT Match_Id FROM Match WHERE Match_Date LIKE '%2015-04-18%'; |
[INST] Here is a database schema:
Out_Type :
Out_Id [ INTEGER ] primary_key
Out_Name [ TEXT ]
Wicket_Taken :
Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id
Over_Id [ INTEGER ]
Ball_Id [ INTEGER ]
Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id
Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = ... | SELECT T1.Match_Id FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'hit wicket'; |
[INST] Here is a database schema:
Out_Type :
Out_Id [ INTEGER ] primary_key
Out_Name [ TEXT ]
Wicket_Taken :
Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id
Over_Id [ INTEGER ]
Ball_Id [ INTEGER ]
Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id
Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = ... | SELECT SUM(CASE WHEN T1.Innings_No = 2 THEN 1 ELSE 0 END) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'stumped'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT SUM(CASE WHEN T2.Player_Name = 'Yuvraj Singh' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling... | SELECT T2.Player_Name, T2.DOB FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.DOB LIKE '1977%' AND T1.Country_Name = 'England'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T2.Man_of_the_Match = T1.Player_Id INNER JOIN Season AS T3 ON T3.Season_Id = T2.Season_Id WHERE T3.Season_Year = 2010 GROUP BY T1.Player_Name; |
[INST] Here is a database schema:
Team :
Team_Id [ INTEGER ] primary_key
Team_Name [ TEXT ]
Match :
Match_Id [ INTEGER ] primary_key
Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id
Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id
Match_Date [ DATE ]
Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id
Venue_Id [ INTEG... | SELECT CAST(SUM(CASE WHEN T1.Match_Winner = 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE T2.Team_Name = 'Chennai Super Kings' OR T3.Team_Name = 'Chennai Super Kings'; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling... | SELECT T4.Player_Name, T5.Country_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_Id INNER JOIN Match AS T3 ON T3.Match_Id = T1.Match_Id INNER JOIN Player AS T4 ON T4.Player_Id = T1.Player_Id INNER JOIN Country AS T5 ON T5.Country_Id = T4.Country_Name WHERE T2.Team_Name = 'Gujarat Lions' AND ... |
[INST] Here is a database schema:
Bowling_Style :
Bowling_Id [ INTEGER ] primary_key
Bowling_skill [ TEXT ]
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.... | SELECT T1.Player_Name, T1.DOB FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T2.Bowling_Id = T1.Bowling_skill WHERE T2.Bowling_skill = 'Left-arm fast'; |
[INST] Here is a database schema:
Country :
Country_Id [ INTEGER ] primary_key
Country_Name [ TEXT ]
Umpire :
Umpire_Id [ INTEGER ] primary_key
Umpire_Name [ TEXT ]
Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id
Please write me a SQL statement that answers the following question: Where did BR Do... | SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Umpire AS T2 ON T2.Umpire_Country = T1.Country_Id WHERE T2.Umpire_Name = 'BR Doctrove'; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Match AS T2 ON T2.Match_Id = T1.Match_Id INNER JOIN Player AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Rolee AS T4 ON T4.Role_Id = T1.Role_Id WHERE T2.Match_Date = '2008-06-01' AND T4.Role_Desc = 'Captain' AND T2.Match_Winner = T1.Team_Id; |
[INST] Here is a database schema:
Player :
Player_Id [ INTEGER ] primary_key
Player_Name [ TEXT ]
DOB [ DATE ]
Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id
Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id
Country_Name [ INTEGER ] Player.Country_Name = Country.Country_... | SELECT T3.Team_Name, COUNT(T2.Match_Id) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T1.Player_Name = 'CK Kapugedera'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.