nl stringlengths 22 185 | sql stringlengths 22 608 | db_id stringclasses 40
values | table_schema stringclasses 305
values |
|---|---|---|---|
What are the ids of the paintings created before all of the paintings in gallery 240? | SELECT paintingID FROM paintings WHERE YEAR < (SELECT min(YEAR) FROM paintings WHERE LOCATION = 'Gallery 240') | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
What is the id of every painting created before the oldest painting in gallery 240? | SELECT paintingID FROM paintings WHERE YEAR < (SELECT min(YEAR) FROM paintings WHERE LOCATION = 'Gallery 240') | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
What are the ids of the paintings whose height is longer than the height of all paintings created after 1900? | SELECT paintingID FROM paintings WHERE height_mm > (SELECT max(height_mm) FROM paintings WHERE YEAR > 1900) | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
List the ids of all paintings that are taller than the longest painting created after 1900. | SELECT paintingID FROM paintings WHERE height_mm > (SELECT max(height_mm) FROM paintings WHERE YEAR > 1900) | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
Find the top 3 artists who have the biggest number of painting works whose medium is oil? | SELECT T1.lname , T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID = T2.painterID WHERE T2.medium = "oil" GROUP BY T2.painterID ORDER BY count(*) DESC LIMIT 3 | art_1 | [{'table_name': 'artists', 'table_schema': [{'col_name': 'artist id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'birth year'}, {'col_name': 'death year'}], 'foreign_key_columns': [], 'primary_keys': ['artist id']}, {'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'co... |
Which artists have the most paintings in oil? | SELECT T1.lname , T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID = T2.painterID WHERE T2.medium = "oil" GROUP BY T2.painterID ORDER BY count(*) DESC LIMIT 3 | art_1 | [{'table_name': 'artists', 'table_schema': [{'col_name': 'artist id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'birth year'}, {'col_name': 'death year'}], 'foreign_key_columns': [], 'primary_keys': ['artist id']}, {'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'co... |
List the painting id, location and title of the medium oil paintings ordered by year. | SELECT paintingID , title , LOCATION FROM paintings WHERE medium = "oil" ORDER BY YEAR | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
Order all of the oil paintings by date of creation and list their ids, locations, and titles. | SELECT paintingID , title , LOCATION FROM paintings WHERE medium = "oil" ORDER BY YEAR | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
List the year, location and title of paintings whose height is longer than 1000 ordered by title. | SELECT title , LOCATION , YEAR FROM paintings WHERE height_mm > 1000 ORDER BY title | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
List the year, location, and name of all paintings that are taller than 1000 in alphabetical order. | SELECT title , LOCATION , YEAR FROM paintings WHERE height_mm > 1000 ORDER BY title | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
Find the first and last name of artists who have painting but no sculpture work. | SELECT T1.lname , T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID = T2.painterID EXCEPT SELECT T3.lname , T3.fname FROM artists AS T3 JOIN sculptures AS T4 ON T3.artistID = T4.sculptorID | art_1 | [{'table_name': 'artists', 'table_schema': [{'col_name': 'artist id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'birth year'}, {'col_name': 'death year'}], 'foreign_key_columns': [], 'primary_keys': ['artist id']}, {'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'co... |
What are the first and last names of the artists who did not sculpt but could paint. | SELECT T1.lname , T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID = T2.painterID EXCEPT SELECT T3.lname , T3.fname FROM artists AS T3 JOIN sculptures AS T4 ON T3.artistID = T4.sculptorID | art_1 | [{'table_name': 'artists', 'table_schema': [{'col_name': 'artist id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'birth year'}, {'col_name': 'death year'}], 'foreign_key_columns': [], 'primary_keys': ['artist id']}, {'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'co... |
Find the locations that have paintings before 1885 and no work with medium on canvas? | SELECT DISTINCT LOCATION FROM paintings WHERE YEAR < 1885 AND mediumOn != "canvas" | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
Where do you have paintings that were created before 1885 that are not on canvas? | SELECT DISTINCT LOCATION FROM paintings WHERE YEAR < 1885 AND mediumOn != "canvas" | art_1 | [{'table_name': 'paintings', 'table_schema': [{'col_name': 'painting id'}, {'col_name': 'title'}, {'col_name': 'year'}, {'col_name': 'height mm'}, {'col_name': 'width mm'}, {'col_name': 'medium'}, {'col_name': 'medium on'}, {'col_name': 'location'}, {'col_name': 'painter id'}], 'foreign_key_columns': ['painter id'], 'p... |
How many races are there? | SELECT count(*) FROM race | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
Count the number of races. | SELECT count(*) FROM race | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
List the winning drivers and winning teams of races in ascending alphabetical order of winning team. | SELECT Winning_driver , Winning_team FROM race ORDER BY Winning_team ASC | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
What are the winning drivers and teams of races, ordered alphabetically by team? | SELECT Winning_driver , Winning_team FROM race ORDER BY Winning_team ASC | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
Which winning drivers of races had pole position that is not "Junior Strous"? | SELECT Winning_driver FROM race WHERE Pole_Position != 'Junior Strous' | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
Return the winning drivers of races who did not have the pole position of Junior Strous. | SELECT Winning_driver FROM race WHERE Pole_Position != 'Junior Strous' | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
Who are the constructors of drivers sorted by drivers' age in ascending order? | SELECT DISTINCT CONSTRUCTOR FROM driver ORDER BY Age ASC | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Return the different constructors of drivers, ordered by age ascending. | SELECT DISTINCT CONSTRUCTOR FROM driver ORDER BY Age ASC | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What are the distinct entrant types of drivers aged 20 or older? | SELECT DISTINCT Entrant FROM driver WHERE Age >= 20 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Give the different entrant types for drivers at least 20 years old. | SELECT DISTINCT Entrant FROM driver WHERE Age >= 20 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What are the maximum and minimum age of driver? | SELECT max(Age) , min(Age) FROM driver | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Return the maximum and minimum age across drivers. | SELECT max(Age) , min(Age) FROM driver | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
How many different engines are used by drivers with age older than 30 or younger than 20? | SELECT count(DISTINCT Engine) FROM driver WHERE Age > 30 OR Age < 20 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Count the number of different engines used by drivers who had an age either over 30 or under 20. | SELECT count(DISTINCT Engine) FROM driver WHERE Age > 30 OR Age < 20 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List all names of drivers in descending alphabetical order. | SELECT Driver_Name FROM driver ORDER BY Driver_Name DESC | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What are the names of drivers, ordered descending alphabetically? | SELECT Driver_Name FROM driver ORDER BY Driver_Name DESC | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Please show the names of drivers and the names of races they participate in. | SELECT T1.Driver_Name , T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
What are the names of drivers and the names of the races they took part in? | SELECT T1.Driver_Name , T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
Please show the names of drivers and the number of races they participate in. | SELECT T1.Driver_Name , COUNT(*) FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID GROUP BY T1.Driver_ID | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
How many races did each driver participate in? | SELECT T1.Driver_Name , COUNT(*) FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID GROUP BY T1.Driver_ID | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
Please show the age of the driver who participated in the most number of races. | SELECT T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID GROUP BY T1.Driver_ID ORDER BY COUNT(*) DESC LIMIT 1 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
What is the age of the driver who raced in the most races? | SELECT T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID GROUP BY T1.Driver_ID ORDER BY COUNT(*) DESC LIMIT 1 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
Please show the names and ages of the drivers who participated in at least two races. | SELECT T1.Driver_Name , T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID GROUP BY T1.Driver_ID HAVING COUNT(*) >= 2 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
What are the names and ages of drivers who raced in two or more races? | SELECT T1.Driver_Name , T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID GROUP BY T1.Driver_ID HAVING COUNT(*) >= 2 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
Please list the names of races with drivers aged 26 or older participating. | SELECT T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE T1.Age >= 26 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
What are the names of races in which drivers 26 or older took part? | SELECT T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE T1.Age >= 26 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
List the names of drivers whose constructor is not "Bugatti". | SELECT Driver_Name FROM driver WHERE CONSTRUCTOR != "Bugatti" | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What are the names od drivers who did not have the constructor Bugatti? | SELECT Driver_Name FROM driver WHERE CONSTRUCTOR != "Bugatti" | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List different constructors and the number of drivers that use each constructor. | SELECT CONSTRUCTOR , COUNT(*) FROM driver GROUP BY CONSTRUCTOR | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
How many drivers use each constructor? | SELECT CONSTRUCTOR , COUNT(*) FROM driver GROUP BY CONSTRUCTOR | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List the most common type of engine used by drivers. | SELECT Engine FROM driver GROUP BY Engine ORDER BY COUNT(*) DESC LIMIT 1 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What is the most common type of engine? | SELECT Engine FROM driver GROUP BY Engine ORDER BY COUNT(*) DESC LIMIT 1 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List the types of engines that are used by at least two drivers. | SELECT Engine FROM driver GROUP BY Engine HAVING COUNT(*) >= 2 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What are the engine types that are used by two or more drivers? | SELECT Engine FROM driver GROUP BY Engine HAVING COUNT(*) >= 2 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List the names of drivers that do not participate in any race. | SELECT Driver_Name FROM driver WHERE Driver_ID NOT IN (SELECT Driver_ID FROM race) | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
What are names of drivers who did not take part in a race? | SELECT Driver_Name FROM driver WHERE Driver_ID NOT IN (SELECT Driver_ID FROM race) | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
Show the constructors that are used both by drivers with age lower than 20 and drivers with age over than 30. | SELECT CONSTRUCTOR FROM driver WHERE Age < 20 INTERSECT SELECT CONSTRUCTOR FROM driver WHERE Age > 30 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What are the constructors who are used by both drivers who are younger than 20 and drivers older than 30? | SELECT CONSTRUCTOR FROM driver WHERE Age < 20 INTERSECT SELECT CONSTRUCTOR FROM driver WHERE Age > 30 | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Find the teams that won more than once. | SELECT Winning_team FROM race GROUP BY Winning_team HAVING count(*) > 1 | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
Which teams won more than 1 race? | SELECT Winning_team FROM race GROUP BY Winning_team HAVING count(*) > 1 | car_road_race | [{'table_name': 'race', 'table_schema': [{'col_name': 'road'}, {'col_name': 'driver id'}, {'col_name': 'race name'}, {'col_name': 'pole position'}, {'col_name': 'fastest lap'}, {'col_name': 'winning driver'}, {'col_name': 'winning team'}, {'col_name': 'report'}], 'foreign_key_columns': ['driver id'], 'primary_keys': ['... |
Find the names of drivers who were in both "James Hinchcliffe" and "Carl Skerlong" pole positions before. | SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE Pole_Position = "Carl Skerlong" INTERSECT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE Pole_Position = "James Hinchcliffe" | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
What are the names of drivers who had both the pole position James Hinchcliffe and the pole position Carl Skerlong? | SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE Pole_Position = "Carl Skerlong" INTERSECT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE Pole_Position = "James Hinchcliffe" | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
find the name of drivers who were never in "James Hinchcliffe" pole position before. | SELECT Driver_Name FROM driver EXCEPT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE Pole_Position = "James Hinchcliffe" | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
What are the names of drivers except for those who had the pole position James Hinchcliffe? | SELECT Driver_Name FROM driver EXCEPT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID WHERE Pole_Position = "James Hinchcliffe" | car_road_race | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver name'}, {'col_name': 'entrant'}, {'col_name': 'constructor'}, {'col_name': 'chassis'}, {'col_name': 'engine'}, {'col_name': 'age'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}, {'table_name': 'race', 'table_schema'... |
How many languages are there? | SELECT count(*) FROM languages | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Count the number of languages. | SELECT count(*) FROM languages | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
List the name of languages in ascending alphabetical order. | SELECT name FROM languages ORDER BY name ASC | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the names of languages, in alphabetical order? | SELECT name FROM languages ORDER BY name ASC | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the names of languages that contain the word "ish"? | SELECT name FROM languages WHERE name LIKE "%ish%" | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Return the names of langauges that contain the substring "ish". | SELECT name FROM languages WHERE name LIKE "%ish%" | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show the names of countries in descending order of overall scores. | SELECT name FROM countries ORDER BY overall_score DESC | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
What are the names of the countries, ordered descending by overall score? | SELECT name FROM countries ORDER BY overall_score DESC | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
What is the average justice scores among countries? | SELECT avg(justice_score) FROM countries | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
Give the average justice scores across all countries. | SELECT avg(justice_score) FROM countries | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
What are the maximum and minimum health scores among countries that are not "Norway". | SELECT max(health_score) , min(health_score) FROM countries WHERE name != "Norway" | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
Return the maximum and minimum health scores across all countries other than Norway. | SELECT max(health_score) , min(health_score) FROM countries WHERE name != "Norway" | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
How many different official languages are there? | SELECT count(DISTINCT language_id) FROM official_languages | country_language | [{'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys': ['language id']}] |
Count the number of different official languages. | SELECT count(DISTINCT language_id) FROM official_languages | country_language | [{'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys': ['language id']}] |
List names of countries in descending order of education_score. | SELECT name FROM countries ORDER BY education_score DESC | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
What are the names of the countries, ordered descending by education score? | SELECT name FROM countries ORDER BY education_score DESC | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
List the name of the country with the biggest score in politics. | SELECT name FROM countries ORDER BY politics_score DESC LIMIT 1 | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
What is the name of the country with the highest politics score? | SELECT name FROM countries ORDER BY politics_score DESC LIMIT 1 | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
Show the names of countries and their official languages. | SELECT T1.name , T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
What are the names of the countries, as well as the names of their official langauges? | SELECT T1.name , T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
Show the official languages and the number of countries speaking each language. | SELECT T2.name , COUNT(*) FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.name | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
What are the names of the different official languages, as well as the number of countries that speak each? | SELECT T2.name , COUNT(*) FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.name | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
Show the official language spoken by the most number of countries. | SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1 | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
What is the official language that is most common? | SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1 | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
Show the official languages spoken by at least two countries. | SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.id HAVING COUNT(*) >= 2 | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
Which official languages are spoken in two or more countries? | SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.id HAVING COUNT(*) >= 2 | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
Show the average overall scores of countries whose official language is "English". | SELECT avg(T1.overall_score) FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id WHERE T3.name = "English" | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
What is the average overall score across countries with English as their official language? | SELECT avg(T1.overall_score) FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id WHERE T3.name = "English" | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
Show the three official languages that are most commonly spoken. | SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 3 | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
What are the names of the three official languages spoken in the most countries? | SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 3 | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
Show the official languages sorted in descending order by the average overall scores among countries speaking them. | SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id GROUP BY T3.id ORDER BY avg(T1.overall_score) DESC | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
What are the names of the official languages, sorted descending by the average overall scores across the countries that correspond to each? | SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id GROUP BY T3.id ORDER BY avg(T1.overall_score) DESC | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
Show the name of the country that has the greatest number of official languages. | SELECT T1.Name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
Which country has the greatest number of official languages? | SELECT T1.Name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
List the names of languages that are not the official language of any countries. | SELECT name FROM languages WHERE id NOT IN (SELECT language_id FROM official_languages) | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
What are the names of languages that are not the official language of any country? | SELECT name FROM languages WHERE id NOT IN (SELECT language_id FROM official_languages) | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'official languages', 'table_schema': [{'col_name': 'language id'}, {'col_name': 'country id'}], 'foreign_key_columns': ['country id', 'language id'], 'primary_keys... |
List the names of countries that do not have any official language. | SELECT name FROM countries WHERE id NOT IN (SELECT country_id FROM official_languages) | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
What are the names of countries that do not have an official language? | SELECT name FROM countries WHERE id NOT IN (SELECT country_id FROM official_languages) | country_language | [{'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, {'col_name': 'education score'}, {'col_name': 'economics score'}, {'col_name': 'politics score'}], 'foreign_key_columns': [], 'primary_keys'... |
Show the names of languages that are the official language for both countries with overall score greater than 95 and countries with overall score less than than 90. | SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id WHERE T1.overall_score > 95 INTERSECT SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3... | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
What are the names of languages that are the official language not only for countries that have an overall score of above 95, but also for countries that have an overall score below 90? | SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3.id WHERE T1.overall_score > 95 INTERSECT SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id = T2.country_id JOIN languages AS T3 ON T2.language_id = T3... | country_language | [{'table_name': 'languages', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'countries', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'overall score'}, {'col_name': 'justice score'}, {'col_name': 'health score'}, ... |
Which countries and cities are included in addresses? | SELECT country , town_city FROM Addresses; | real_estate_rentals | [{'table_name': 'addresses', 'table_schema': [{'col_name': 'address id'}, {'col_name': 'line 1 number building'}, {'col_name': 'line 2 number street'}, {'col_name': 'line 3 area locality'}, {'col_name': 'town city'}, {'col_name': 'zip postcode'}, {'col_name': 'county state province'}, {'col_name': 'country'}, {'col_nam... |
What are the countries and cities for each address? | SELECT country , town_city FROM Addresses; | real_estate_rentals | [{'table_name': 'addresses', 'table_schema': [{'col_name': 'address id'}, {'col_name': 'line 1 number building'}, {'col_name': 'line 2 number street'}, {'col_name': 'line 3 area locality'}, {'col_name': 'town city'}, {'col_name': 'zip postcode'}, {'col_name': 'county state province'}, {'col_name': 'country'}, {'col_nam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.