problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: How many restaurants are on Irving Street?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(id_restaurant) FROM location WHERE street_name = 'irving' |
Write SQL query to solve given problem: Provide a list of restaurants from Marin county.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county' |
Write SQL query to solve given problem: What is the address of the Peking Duck restaurant?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.label = 'peking duck restaurant' |
Write SQL query to solve given problem: List all the streets with more than 10 restaurants in Alameda county.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.county = 'alameda county' GROUP BY T2.street_name HAVING COUNT(T2.id_restaurant) > 10 |
Write SQL query to solve given problem: What are the regions with Greek restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT DISTINCT T1.region FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'greek' |
Write SQL query to solve given problem: List all of the restaurant addresses from an unknown region.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'unknown' |
Write SQL query to solve given problem: What is the review of the restaurant at 8440 Murray Ave?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.review FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'murray ave' AND T1.street_num = 8440 |
Write SQL query to solve given problem: What type of restaurant is most common in Monterey county?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.food_type FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'Monterey' GROUP BY T2.food_type ORDER BY COUNT(T2.food_type) DESC LIMIT 1 |
Write SQL query to solve given problem: Which street in San Francisco has the most burger restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.food_type = 'burgers' GROUP BY T2.street_name ORDER BY COUNT(T2.id_restaurant) DESC LIMIT 1 |
Write SQL query to solve given problem: What is the region of 1149 El Camino Real?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_num = 1149 AND T1.street_name = 'el camino real' |
Write SQL query to solve given problem: What is the county of the Sankee restaurant?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'sankee' |
Write SQL query to solve given problem: How many streets with restaurants are there in the Northern California region?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'northern california' |
Write SQL query to solve given problem: List all of the restaurants on Park St.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'park st' |
Write SQL query to solve given problem: What percentage of restaurants are from the Bay Area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT CAST(SUM(IIF(T1.region = 'bay area', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city |
Write SQL query to solve given problem: List all the average reviews of Chinese restaurants for each county from highest to lowest.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT AVG(T1.review) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'chinese' GROUP BY T1.id_restaurant ORDER BY AVG(T1.review) DESC |
Write SQL query to solve given problem: List street names in San Francisco city.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT street_name FROM location WHERE city = 'San Francisco' |
Write SQL query to solve given problem: List restaurant ids located in Danville city.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT id_restaurant FROM location WHERE city = 'Danville' |
Write SQL query to solve given problem: How many cities are located in the Bay Area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(city) FROM geographic WHERE region = 'bay area' |
Write SQL query to solve given problem: How many labels of the restaurant have an unknown country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(T1.label) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'unknown' |
Write SQL query to solve given problem: Please indicate the street names of restaurants with food type is American.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'American' |
Write SQL query to solve given problem: Please indicate which labels have the city located in Santa Cruz.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'Santa Cruz county' |
Write SQL query to solve given problem: Give the review of the restaurant at 430, Broadway.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T1.review FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'Broadway' AND T2.street_num = 430 |
Write SQL query to solve given problem: Indicate the address of the restaurant with the most popular reviews.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.street_num, T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant ORDER BY T1.review DESC LIMIT 1 |
Write SQL query to solve given problem: Which country has the most restaurants with Italian food?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'Italian' GROUP BY T2.county ORDER BY COUNT(T1.id_restaurant) DESC LIMIT 1 |
Write SQL query to solve given problem: Find the percentage of restaurant in Napa Valley.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT CAST(SUM(IIF(region = 'Napa Valley', 1, 0)) AS REAL) * 100 / COUNT(region) FROM geographic |
Write SQL query to solve given problem: How many of the cities are in a Bay Area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(city) FROM geographic WHERE region = 'bay area' |
Write SQL query to solve given problem: List down the cities with unknown country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT city FROM geographic WHERE county = 'unknown' |
Write SQL query to solve given problem: What is the city located in Bay Area of Santa Clara?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT city FROM geographic WHERE region = 'bay area' AND county = 'santa clara county' |
Write SQL query to solve given problem: List down the restaurant ID of restaurants located in Sunnyvale.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT id_restaurant FROM location WHERE city = 'sunnyvale' |
Write SQL query to solve given problem: Among the restaurants on street number below 1000, how many of them are in Railroad St.?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(city) FROM location WHERE street_name = 'railroad' AND street_num < 1000 |
Write SQL query to solve given problem: What is the name of the 24 hour diner at San Francisco?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT label FROM generalinfo WHERE food_type = '24 hour diner' AND city = 'san francisco' |
Write SQL query to solve given problem: Give the review of the restaurant located in Ocean St., Santa Cruz.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.review FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'santa cruz' AND T1.street_name = 'ocean st' |
Write SQL query to solve given problem: Give the street number of a bar in Oakland with a 2.7 review.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.street_num FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.review = 2.7 AND T2.city = 'oakland' AND T1.food_type = 'bar' |
Write SQL query to solve given problem: Among the bakeries, what is total number of bakery located at University Avenue, Palo Alto?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.food_type = 'bakery' AND T2.city = 'palo alto' AND T1.street_name = 'university ave.' |
Write SQL query to solve given problem: Among the listed winery, what is the street number of the winery named "Tulocay Winery"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: List the review and label of the restaurants in Mission Blvd., Hayward.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: Among all indian restaurants in Castro St., Mountainview, how many of them is about cookhouse in their label?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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%' |
Write SQL query to solve given problem: In restaurants with a review of 2, how many restaurants have a street number below 500?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: Among all asian restaurants in N. Milpitas Blvd., Milpitas, how many of them have restaurant ID greater than 385?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: What is the restaurant's name and ID located at Ocean Avenue, San Francisco?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: What is the full address of the restaurant named "Sanuki Restaurant"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: List the food type of the restaurant located in 22779 6th St., Hayward City.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: How many American restaurants are located in Front, San Francisco?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: List the restaurant's ID that has a review greater than the 70% of average review of all American restaurants with street number greater than 2000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: Among the restaurants located on the street number ranges from 1000 to 2000, what is the percentage of Afghani restaurants are there?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: What is the name of the most popular restaurant serving Asian foods in San Francisco?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' ) |
Write SQL query to solve given problem: How many cities are there in Monterey?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(DISTINCT city) FROM geographic WHERE region = 'monterey' |
Write SQL query to solve given problem: How many deli in Belmont have a review rating of 2 or more?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(id_restaurant) FROM generalinfo WHERE city = 'belmont' AND review > 2 AND food_type = 'deli' |
Write SQL query to solve given problem: Which county in northern California has the highest number of cities?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT county FROM geographic WHERE region = 'northern california' GROUP BY county ORDER BY COUNT(city) DESC LIMIT 1 |
Write SQL query to solve given problem: How many restaurants can you find in Concord?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT COUNT(id_restaurant) FROM location WHERE city = 'concord' |
Write SQL query to solve given problem: In which region can you find the top 4 most popular restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | SELECT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city ORDER BY T1.review DESC LIMIT 4 |
Write SQL query to solve given problem: How many Chinese restaurants are there on 1st st, Livermore?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: How many Indian restaurants are there in the Los Angeles area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: In the Bay Area, what is the most common type of food served by restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: How many restaurants in Broadway, Oakland received a review of no more than 3?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: In which region can you find the highest number of Baskin Robbins restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: List all the streets where pizza-serving restaurants are found in San Jose.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: How many types of restaurants are there in the Yosemite and Mono Lake area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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' |
Write SQL query to solve given problem: What is the full address of the most popular restaurant among the diners?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: In which counties can you find the restaurant with the highest number of branches?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: Which region has the highest number of restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: List the full address of all the American restaurants with a review of 4 or more?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | restaurant | 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 |
Write SQL query to solve given problem: How many players were born after the year 1985?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT COUNT(Player_Id) FROM Player WHERE SUBSTR(DOB, 1, 4) > 1985 |
Write SQL query to solve given problem: How many matches were there in May, 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT COUNT(Match_Id) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008' AND SUBSTR(Match_Date, 7, 1) = '5' |
Write SQL query to solve given problem: For how many times has player no.41 won the "man of the match" award?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT COUNT(Match_Id) FROM `Match` WHERE Man_of_the_Match = 41 |
Write SQL query to solve given problem: Please list the IDs of all the matches in the year 2008.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT Match_Id FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008' |
Write SQL query to solve given problem: Which country is the oldest player from?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: Among the players who use the right hand as their batting hand, how many of them were born after 1985?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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' |
Write SQL query to solve given problem: Please list the names of the players who use the right hand as their batting hand and are from Australia.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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' |
Write SQL query to solve given problem: What is the bowling skill used by most players?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: What is the name of the player who won the "man of the match" award in the match on 2008/4/18?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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' |
Write SQL query to solve given problem: For how many times has SC Ganguly played as team captain in a match?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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' |
Write SQL query to solve given problem: What is the role of SC Ganguly in the match on 2008/4/18?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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' |
Write SQL query to solve given problem: Among all the players born after the year 1985, what is the percentage of the players who use the right hand as their batting hand?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: Give the name of the youngest player.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1 |
Write SQL query to solve given problem: How many times has Sunrisers Hyderabad been the toss winner of a game?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT SUM(CASE WHEN Toss_Winner = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Sunrisers Hyderabad' ) THEN 1 ELSE 0 END) FROM `Match` |
Write SQL query to solve given problem: Give the name of the striker in the match no. 419169, over no.3, ball no.2, inning no.2.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: Give the name of venue for the game with a win margin of 138 points.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Win_Margin = 138 |
Write SQL query to solve given problem: For the game on 2008/5/12, who was the man of the match?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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' |
Write SQL query to solve given problem: State the name of captain keeper of the match no.419117.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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' |
Write SQL query to solve given problem: Who was the man of the series in 2013? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: Give the date of birth of the 2014 Orange Cap winner.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: What is the nationality of the 7th season Purple Cap winner?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: How many Indian cities are there in the database?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: State the name of the city with the most venues.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: In the database, how many times is the number of Indian cities to the South African cities?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: How many times does M Chinnaswamy Stadium host games than Maharashtra Cricket Association Stadium?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT SUM(CASE WHEN T2.Venue_Name = 'M Chinnaswamy Stadium' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.Venue_Name = 'Maharashtra Cricket Association Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id |
Write SQL query to solve given problem: Who is the oldest player?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT Player_Name FROM Player ORDER BY DOB ASC LIMIT 1 |
Write SQL query to solve given problem: How many matches were played on May 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT SUM(CASE WHEN SUBSTR(Match_Date, 7, 1) = '5' THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008' |
Write SQL query to solve given problem: How many players were born in the 90s?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT COUNT(Player_Id) AS cnt FROM Player WHERE DOB BETWEEN '1990-01-01' AND '1999-12-31' |
Write SQL query to solve given problem: How many matches did Team 10 play in 2012?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT SUM(CASE WHEN Team_1 = 10 OR Team_2 = 10 THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2012' |
Write SQL query to solve given problem: List the id of the player who won the Orange Cap for 2 consecutive seasons.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT Orange_Cap FROM Season GROUP BY Orange_Cap HAVING COUNT(Season_Year) > 1 |
Write SQL query to solve given problem: How many matches were played in Season 7?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT COUNT(Match_Id) FROM `Match` WHERE Season_Id = 7 |
Write SQL query to solve given problem: How many umpires are from South Africa?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: What is the name of the player with the highest number of outstanding player awards in a particular match?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: In which country do the majority of the players are from?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: How many Orange Cap awards were won by CH Gayle?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Write SQL query to solve given problem: Which season played the highest number of matches at M Chinnaswamy Stadium?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT T1.Season_Id FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium' GROUP BY T1.Season_Id ORDER BY COUNT(T1.Season_Id) DESC LIMIT 1 |
Write SQL query to solve given problem: What is the name of the team that won the most number of matches in season 1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | SELECT Team_Name FROM Team WHERE Team_Id = ( SELECT Match_Winner FROM `Match` WHERE season_Id = 1 GROUP BY Match_Winner ORDER BY COUNT(Match_Winner) DESC LIMIT 1 ) |
Write SQL query to solve given problem: Which venue did Kolkata Knight Riders play most of their matches as a Team 1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | soccer_2016 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.