input
stringlengths 236
16.9k
| output
stringlengths 19
805
|
---|---|
-- 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 ] | 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 list all of the restaurants that serve European food.
| SELECT label FROM generalinfo WHERE food_type = 'european'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What cities are located in Northern California?
| SELECT city FROM geographic WHERE region = 'northern california'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What does the one and only 24-hour diner's name?
| SELECT label FROM generalinfo WHERE food_type = '24 hour diner'; |
-- 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 ] | 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 list any five cities that have an unidentified county and region.
| SELECT city FROM geographic WHERE county = 'unknown' AND region = 'unknown' LIMIT 5; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the county and region of Davis City?
| SELECT county, region FROM geographic WHERE city = 'Davis'; |
-- 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 ] | 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 list all of the street names in Clayton City.
| SELECT street_name FROM location WHERE city = 'Clayton'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What are the most popular restaurants in San Francisco among diners?
| SELECT id_restaurant, label FROM generalinfo WHERE city = 'San Francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE city = 'San Francisco' ); |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many American food restaurants are unpopular in Carmel?
| SELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' AND review = ( SELECT MIN(review) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' ); |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the percentage of restaurants that serve American food in Dublin city?
| SELECT CAST(SUM(IIF(food_type = 'american food', 1, 0)) AS REAL) * 100 / COUNT(id_restaurant) FROM generalinfo WHERE city = 'dublin'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the full address of Albert's Café?
| SELECT T2.street_num, T2.street_name, T1.city FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.label = 'Albert''s Café'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What are the restaurants that are located at "19th St. Oakland"?
| SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'Oakland' AND T2.street_name = '19th St'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What kind of restaurants can be found at "106 E 25th Ave"?
| SELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_num = 106 AND T2.street_name = 'e 25th ave'; |
-- 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 ] | 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 name any three restaurants that have an unidentified region.
| SELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T3.region = 'unknown' LIMIT 3; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the name of the Chinese restaurant that can be found at 104 San Tomas Aquino Road, Campbell?
| SELECT T1.label FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_num = 104 AND T1.city = 'campbell' AND T2.street_name = 'san tomas aquino road'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many Thai restaurants can be found in San Pablo Ave, Albany?
| SELECT COUNT(T1.id_restaurant) FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.food_type = 'thai' AND T1.city = 'albany' AND T2.street_name = 'san pablo ave'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the county and region of Plearn-Thai Cuisine restaurant?
| SELECT T1.county, T1.region, T2.label FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.label = 'plearn-thai cuisine'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the name of the restaurant that is located in El Dorado County, Lake Tahoe region?
| SELECT T2.label FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'lake tahoe' AND T1.county = 'el dorado county'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which county and region does the street E. El Camino Real belong to?
| SELECT DISTINCT T2.county, T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_name = 'E. El Camino Real'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the name of the least popular Indian restaurant on Shattuck Avenue in Berkeley?
| SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'berkeley' AND T2.street_name = 'shattuck ave' AND T1.food_type = 'Indian restaurant' ORDER BY T1.review LIMIT 1; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the percentage of restaurants in the Bay Area region that scored over 4 for the review rating?
| SELECT CAST(SUM(IIF(T2.review > 4, 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 RIGHT JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List every city in San Mateo County.
| SELECT city FROM geographic WHERE county = 'san mateo county'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many restaurants have more than 4 star reviews?
| SELECT COUNT(id_restaurant) AS cnt FROM generalinfo WHERE review > 4; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which street has the most restaurants?
| SELECT street_name FROM location GROUP BY street_name ORDER BY COUNT(street_name) DESC LIMIT 1; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which chicken restaurant has the highest review?
| SELECT label FROM generalinfo WHERE food_type = 'chicken' ORDER BY review DESC LIMIT 1; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which county is El Cerrito from?
| SELECT county FROM geographic WHERE city = 'el cerrito'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many restaurants are on Irving Street?
| SELECT COUNT(id_restaurant) FROM location WHERE street_name = 'irving'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Provide a list of restaurants from Marin county.
| SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the address of the Peking Duck 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List all the streets with more than 10 restaurants in Alameda county.
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What are the regions with Greek restaurants?
| SELECT DISTINCT T1.region FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'greek'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List all of the restaurant addresses from an unknown region.
| SELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'unknown'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the review of the restaurant at 8440 Murray Ave?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What type of restaurant is most common in Monterey county?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which street in San Francisco has the most burger restaurants?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the region of 1149 El Camino Real?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the county of the Sankee restaurant?
| SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'sankee'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many streets with restaurants are there in the Northern California region?
| SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'northern california'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List all of the restaurants on Park St.
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What percentage of restaurants are from the Bay Area?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List all the average reviews of Chinese restaurants for each county from highest to lowest.
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List street names in San Francisco city.
| SELECT street_name FROM location WHERE city = 'San Francisco'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List restaurant ids located in Danville city.
| SELECT id_restaurant FROM location WHERE city = 'Danville'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many cities are located in the Bay Area?
| SELECT COUNT(city) FROM geographic WHERE region = 'bay area'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many labels of the restaurant have an unknown country?
| SELECT COUNT(T1.label) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'unknown'; |
-- 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 ] | 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 indicate the street names of restaurants with food type is American.
| SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'American'; |
-- 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 ] | 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 indicate which labels have the city located in Santa Cruz.
| SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'Santa Cruz county'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Give the review of the restaurant at 430, Broadway.
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Indicate the address of the restaurant with the most popular reviews.
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which country has the most restaurants with Italian food?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Find the percentage of restaurant in Napa Valley.
| SELECT CAST(SUM(IIF(region = 'Napa Valley', 1, 0)) AS REAL) * 100 / COUNT(region) FROM geographic; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many of the cities are in a Bay Area?
| SELECT COUNT(city) FROM geographic WHERE region = 'bay area'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List down the cities with unknown country.
| SELECT city FROM geographic WHERE county = 'unknown'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the city located in Bay Area of Santa Clara?
| SELECT city FROM geographic WHERE region = 'bay area' AND county = 'santa clara county'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List down the restaurant ID of restaurants located in Sunnyvale.
| SELECT id_restaurant FROM location WHERE city = 'sunnyvale'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Among the restaurants on street number below 1000, how many of them are in Railroad St.?
| SELECT COUNT(city) FROM location WHERE street_name = 'railroad' AND street_num < 1000; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the name of the 24 hour diner at San Francisco?
| SELECT label FROM generalinfo WHERE food_type = '24 hour diner' AND city = 'san francisco'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Give the review of the restaurant located in Ocean St., Santa Cruz.
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Give the street number of a bar in Oakland with a 2.7 review.
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Among the bakeries, what is total number of bakery located at University Avenue, Palo Alto?
| 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.'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Among the listed winery, what is the street number of the winery named "Tulocay Winery"?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List the review and label of the restaurants in Mission Blvd., Hayward.
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Among all indian restaurants in Castro St., Mountainview, how many of them is about cookhouse in their label?
| 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%'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- In restaurants with a review of 2, how many restaurants have a street number below 500?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Among all asian restaurants in N. Milpitas Blvd., Milpitas, how many of them have restaurant ID greater than 385?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the restaurant's name and ID located at Ocean Avenue, San Francisco?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the full address of the restaurant named "Sanuki 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List the food type of the restaurant located in 22779 6th St., Hayward City.
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many American restaurants are located in Front, San Francisco?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- 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.
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Among the restaurants located on the street number ranges from 1000 to 2000, what is the percentage of Afghani restaurants are there?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the name of the most popular restaurant serving Asian foods in San Francisco?
| 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' ); |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many cities are there in Monterey?
| SELECT COUNT(DISTINCT city) FROM geographic WHERE region = 'monterey'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many deli in Belmont have a review rating of 2 or more?
| SELECT COUNT(id_restaurant) FROM generalinfo WHERE city = 'belmont' AND review > 2 AND food_type = 'deli'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which county in northern California has the highest number of cities?
| SELECT county FROM geographic WHERE region = 'northern california' GROUP BY county ORDER BY COUNT(city) DESC LIMIT 1; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many restaurants can you find in Concord?
| SELECT COUNT(id_restaurant) FROM location WHERE city = 'concord'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- In which region can you find the top 4 most popular restaurants?
| SELECT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city ORDER BY T1.review DESC LIMIT 4; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many Chinese restaurants are there on 1st st, Livermore?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many Indian restaurants are there in the Los Angeles area?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- In the Bay Area, what is the most common type of food served by restaurants?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many restaurants in Broadway, Oakland received a review of no more than 3?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- In which region can you find the highest number of Baskin Robbins restaurants?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List all the streets where pizza-serving restaurants are found in San Jose.
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- How many types of restaurants are there in the Yosemite and Mono Lake area?
| 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'; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- What is the full address of the most popular restaurant among the diners?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- In which counties can you find the restaurant with the highest number of branches?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- Which region has the highest number of restaurants?
| 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; |
-- 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 ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- List the full address of all the American restaurants with a review of 4 or more?
| 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; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- How many players were born after the year 1985?
| SELECT COUNT(Player_Id) FROM Player WHERE SUBSTR(DOB, 1, 4) > 1985; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- How many matches were there in May, 2008?
| SELECT COUNT(Match_Id) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008' AND SUBSTR(Match_Date, 7, 1) = '5'; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- For how many times has player no.41 won the "man of the match" award?
| SELECT COUNT(Match_Id) FROM `Match` WHERE Man_of_the_Match = 41; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- Please list the IDs of all the matches in the year 2008.
| SELECT Match_Id FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008'; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- How many players are from Australia?
| 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; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- Which country is the oldest player from?
| 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; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- What is the bowling skill of SC Ganguly?
| 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'; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- Among the players who use the right hand as their batting hand, how many of them were born after 1985?
| 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'; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- Please list the names of the players who use the right hand as their batting hand and are from Australia.
| 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'; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- Please list the bowling skills of all the players from Australia.
| 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; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- Among the players whose bowling skill is "Legbreak", when was the oldest one of them born?
| 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'; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- What is the bowling skill used by most players?
| 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; |
-- Database schema
| Batting_Style : Batting_Id [ INTEGER ] primary_key , Batting_hand [ TEXT ] | Bowling_Style : Bowling_Id [ INTEGER ] primary_key , Bowling_skill [ TEXT ] | City : City_Id [ INTEGER ] primary_key , City_Name [ TEXT ] , Country_id [ INTEGER ] | Country : Country_Id [ INTEGER ] primary_key , Country_Name [ TEXT ] | Extra_Type : Extra_Id [ INTEGER ] primary_key , Extra_Name [ TEXT ] | Extra_Runs : Match_Id [ INTEGER ] , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id , Extra_Runs [ INTEGER ] , Innings_No [ INTEGER ] | Out_Type : Out_Id [ INTEGER ] primary_key , Out_Name [ TEXT ] | Outcome : Outcome_Id [ INTEGER ] primary_key , Outcome_Type [ 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_Id , Country_Name [ INTEGER ] Player.Country_Name = Country.Country_Id | Rolee : Role_Id [ INTEGER ] primary_key , Role_Desc [ TEXT ] | Season : Season_Id [ INTEGER ] primary_key , Man_of_the_Series [ INTEGER ] , Orange_Cap [ INTEGER ] , Purple_Cap [ INTEGER ] , Season_Year [ INTEGER ] | Team : Team_Id [ INTEGER ] primary_key , Team_Name [ TEXT ] | Toss_Decision : Toss_Id [ INTEGER ] primary_key , Toss_Name [ TEXT ] | Umpire : Umpire_Id [ INTEGER ] primary_key , Umpire_Name [ TEXT ] , Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id | Venue : Venue_Id [ INTEGER ] primary_key , Venue_Name [ TEXT ] , City_Id [ INTEGER ] Venue.City_Id = City.City_Id | Win_By : Win_Id [ INTEGER ] primary_key , Win_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_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id , Toss_Winner [ INTEGER ] Match.Toss_Winner = Team.Team_Id , Toss_Decide [ INTEGER ] Match.Toss_Decide = Toss_Decision.Toss_Id , Win_Type [ INTEGER ] Match.Win_Type = Win_By.Win_Id , Win_Margin [ INTEGER ] , Outcome_type [ INTEGER ] Match.Outcome_type = Out_Type.Out_Id , Match_Winner [ INTEGER ] Match.Match_Winner = Team.Team_Id , Man_of_the_Match [ INTEGER ] Match.Man_of_the_Match = Player.Player_Id | 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 ] | Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id , Over_Id [ INTEGER ] , Ball_Id [ INTEGER ] , Runs_Scored [ INTEGER ] , Innings_No [ INTEGER ] | 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 | 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 = Player.Player_Id , Innings_No [ INTEGER ] |
-- -- What is the name of the player who won the "man of the match" award in the match on 2008/4/18?
| 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'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.