db_id
stringclasses
19 values
schema
stringclasses
19 values
schemaComEx
stringclasses
19 values
question_en
stringlengths
29
142
query
stringlengths
27
344
answer
stringlengths
17
111k
hardness
stringclasses
4 values
schema_llm
stringclasses
19 values
query_llm
stringlengths
27
403
selector
stringlengths
25
156
schema_reduzido
stringlengths
64
392
schema_reduzido_only_tables
stringlengths
129
994
course_teach
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") )
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) /* 2 rows from course table: Course_ID Staring_Date Course 1 5 May Language Arts 2 6 May Math */ CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) /* 2 rows from course_arrange table: Course_ID Teacher_ID Grade 2 5 1 2 3 3 */ CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") ) /* 2 rows from teacher table: Teacher_ID Name Age Hometown 1 Joseph Huts 32 Blackrod Urban District 2 Gustaaf Deloor 29 Bolton County Borough */
What are the towns from which at least two teachers come from?
SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*) >= 2
[{'Nenhum': 'Nenhum resultado encontrado'}]
easy
Table course ( course.Course_ID (INT), course.Staring_Date (TEXT), course.Course (TEXT), ) Table course_arrange ( course_arrange.Course_ID (INT), course_arrange.Teacher_ID (INT), course_arrange.Grade (INT), ) Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs: course_arrange.Course_ID = course.Course_ID course_arrange.Teacher_ID = teacher.Teacher_ID
SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*) >= 2
{ 'teacher': ['teacher_id', 'hometown'] }
Table teacher ( teacher.Teacher_ID (INT), teacher.Hometown (TEXT), ) Possible JOINs:
Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs:
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
What are the population, name and leader of the country with the largest area?
SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1
[{'Name': 'Russian Federation', 'Population': 146934000, 'HeadOfState': 'Vladimir Putin'}]
medium
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1
{ 'country': ['code', 'name', 'surfacearea', 'population', 'headofstate'] }
Table country ( country.Code (char(3)), country.Name (char(52)), country.SurfaceArea (float(10,2)), country.Population (INTEGER), country.HeadOfState (char(60)), ) Possible JOINs:
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Possible JOINs:
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
Return the names of the 3 most populated countries.
SELECT Name FROM country ORDER BY Population DESC LIMIT 3
[{'Name': 'China'}, {'Name': 'India'}, {'Name': 'United States'}]
medium
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT Name FROM country ORDER BY Population DESC LIMIT 3
{ 'country': ['code', 'name', 'population'] }
Table country ( country.Code (char(3)), country.Name (char(52)), country.Population (INTEGER), ) Possible JOINs:
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Possible JOINs:
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
What are the id, role, and first name of the professionals who have performed two or more treatments?
SELECT T1.professional_id , T1.role_code , T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2
[{'professional_id': 4, 'role_code': 'Veterenarian', 'first_name': 'Vernice'}, {'professional_id': 6, 'role_code': 'Veterenarian', 'first_name': 'Ruben'}, {'professional_id': 8, 'role_code': 'Employee', 'first_name': 'Karley'}, {'professional_id': 9, 'role_code': 'Veterenarian', 'first_name': 'Monte'}, {'professional_id': 10, 'role_code': 'Employee', 'first_name': 'Domenica'}, {'professional_id': 14, 'role_code': 'Employee', 'first_name': 'Sigurd'}]
medium
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT Professionals.professional_id , Professionals.role_code , Professionals.first_name FROM Professionals JOIN Treatments ON Professionals.professional_id = Treatments.professional_id GROUP BY Professionals.professional_id HAVING count(*) >= 2
{ 'professionals': ['professional_id', 'role_code', 'first_name'], 'treatments': ['treatment_id', 'professional_id'] }
Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.professional_id (INTEGER), ) Possible JOINs: Treatments.professional_id = Professionals.professional_id
Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
tvshow
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) )
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from Cartoon table: id Title Directed_by Written_by Original_air_date Production_code Channel 1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700 2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701 */ CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) /* 2 rows from TV_Channel table: id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option 700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia 701 Sky Music Italy Italian music 4:3 no no Sky Famiglia */ CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from TV_series table: id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel 1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700 2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701 */
What are the countries that have cartoons on TV that were written by Todd Casey?
SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'
[{'Country': 'United Kingdom'}, {'Country': 'Italy'}]
medium
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id TV_series.Channel = TV_Channel.id
SELECT TV_Channel.country FROM TV_Channel JOIN cartoon ON TV_Channel.id = cartoon.Channel WHERE cartoon.written_by = 'Todd Casey'
{ 'tv_channel': ['id', 'country'], 'cartoon': ['id', 'written_by', 'channel'] }
Table Cartoon ( Cartoon.id (REAL), Cartoon.Written_by (TEXT), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.Country (TEXT), )
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id
cre_Doc_Template_Mgt
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") )
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) /* 2 rows from Documents table: Document_ID Template_ID Document_Name Document_Description Other_Details 0 7 Introduction of OS n None 1 25 Understanding DB y None */ CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Paragraphs table: Paragraph_ID Document_ID Paragraph_Text Other_Details 7 2394 Korea None 9 3 Somalia None */ CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) /* 2 rows from Ref_Template_Types table: Template_Type_Code Template_Type_Description PPT Presentation CV CV */ CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") ) /* 2 rows from Templates table: Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details 0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28 1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04 */
What are the ids, names, and descriptions for all documents?
SELECT document_id , document_name , document_description FROM Documents
[{'Document_ID': 0, 'Document_Name': 'Introduction of OS', 'Document_Description': 'n'}, {'Document_ID': 1, 'Document_Name': 'Understanding DB', 'Document_Description': 'y'}, {'Document_ID': 3, 'Document_Name': 'Summer Show', 'Document_Description': 'u'}, {'Document_ID': 76, 'Document_Name': 'Robbin CV', 'Document_Description': 'y'}, {'Document_ID': 80, 'Document_Name': 'Welcome to NY', 'Document_Description': 'h'}, {'Document_ID': 82, 'Document_Name': 'Data base', 'Document_Description': 'w'}, {'Document_ID': 2394, 'Document_Name': 'Customer reviews', 'Document_Description': 'y'}, {'Document_ID': 3830, 'Document_Name': 'Do not panic', 'Document_Description': 'k'}, {'Document_ID': 33930, 'Document_Name': 'How Google people work', 'Document_Description': 'z'}, {'Document_ID': 50123, 'Document_Name': 'Learning French', 'Document_Description': 'r'}, {'Document_ID': 651512, 'Document_Name': 'How to write a CV', 'Document_Description': 'f'}, {'Document_ID': 801801, 'Document_Name': 'How to read a book', 'Document_Description': 'w'}, {'Document_ID': 3540024, 'Document_Name': 'Palm reading', 'Document_Description': 'y'}, {'Document_ID': 16514113, 'Document_Name': 'A history of Arts', 'Document_Description': 'h'}, {'Document_ID': 385906526, 'Document_Name': 'About Korea', 'Document_Description': 'b'}]
medium
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), Paragraphs.Other_Details (VARCHAR(255)), ) Table Ref_Template_Types ( Ref_Template_Types.Template_Type_Code (CHAR(15)), Ref_Template_Types.Template_Type_Description (VARCHAR(255)), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID Paragraphs.Document_ID = Documents.Document_ID Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
SELECT document_id , document_name , document_description FROM Documents
{ 'documents': ['document_id', 'document_name', 'document_description'] }
Table Documents ( Documents.Document_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), )
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID
pets_1
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from Has_Pet table: StuID PetID 1001 2001 1002 2002 */ CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) /* 2 rows from Pets table: PetID PetType pet_age weight 2001 cat 3 12.0 2002 dog 2 13.4 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
Find the number of distinct type of pets.
SELECT count(DISTINCT pettype) FROM pets
[{'count(DISTINCT pettype)': 2}]
easy
Table Has_Pet ( Has_Pet.StuID (INTEGER), Has_Pet.PetID (INTEGER), ) Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Table Student ( Student.StuID (INTEGER), Student.LName (VARCHAR(12)), Student.Fname (VARCHAR(12)), Student.Age (INTEGER), Student.Sex (VARCHAR(1)), Student.Major (INTEGER), Student.Advisor (INTEGER), Student.city_code (VARCHAR(3)), ) Possible JOINs: Has_Pet.StuID = Student.StuID Has_Pet.PetID = Pets.PetID
SELECT count(DISTINCT pettype) FROM pets
{ 'pets': ['petid', 'pettype'] }
Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), ) Possible JOINs:
Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Possible JOINs:
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What are the names and ids of all countries with at least one car maker?
SELECT T1.CountryName , T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.CountryId HAVING count(*) >= 1;
[{'CountryName': 'usa', 'CountryId': 1}, {'CountryName': 'germany', 'CountryId': 2}, {'CountryName': 'france', 'CountryId': 3}, {'CountryName': 'japan', 'CountryId': 4}, {'CountryName': 'italy', 'CountryId': 5}, {'CountryName': 'sweden', 'CountryId': 6}, {'CountryName': 'uk', 'CountryId': 7}, {'CountryName': 'korea', 'CountryId': 8}]
medium
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT COUNTRIES.CountryName , COUNTRIES.CountryId FROM COUNTRIES JOIN CAR_MAKERS ON COUNTRIES.CountryId = CAR_MAKERS.Country GROUP BY COUNTRIES.CountryId HAVING count(*) >= 1;
{ 'countries': ['countryid', 'countryname'], 'car_makers': ['id', 'country'] }
Table car_makers ( car_makers.Id (INTEGER), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), ) Possible JOINs:
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Possible JOINs: car_makers.Country = countries.CountryId countries.Continent = continents.ContId
wta_1
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 0 rows from players table: player_id first_name last_name hand birth_date country_code */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 0 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 0 rows from rankings table: ranking_date ranking player_id ranking_points tours */
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 2 rows from players table: player_id first_name last_name hand birth_date country_code 200001 Martina Hingis R 19800930 SUI 200002 Mirjana Lucic R 19820309 CRO */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 2 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year 3 4 24.626967830300003 R 170 201474 POL Agnieszka Radwanska 4 5890 3 297 82 RR 6-2 6-4 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 3 4 23.6221765914 L 183 201520 CZE Petra Kvitova 6 4370 5 296 72 RR 6-2 6-3 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 2 rows from rankings table: ranking_date ranking player_id ranking_points tours 20000101 3 200748 4378 13 20000101 4 200033 3021 15 */
List the first and last name of all players who are left / L hand in the order of birth date.
SELECT first_name , last_name FROM players WHERE hand = 'L' ORDER BY birth_date
[{'first_name': 'Ann', 'last_name': 'Jones'}, {'first_name': 'Wendy', 'last_name': 'Gilchrist'}, {'first_name': 'Martina', 'last_name': 'Navratilova'}, {'first_name': 'Mary', 'last_name': 'Carillo'}, {'first_name': 'Katerina', 'last_name': 'Bohmova'}, {'first_name': 'Petra', 'last_name': 'Delhees Jauch'}, {'first_name': 'Nancy', 'last_name': 'Loeffler Caro'}, {'first_name': 'Lise', 'last_name': 'Gregory'}, {'first_name': 'Rene', 'last_name': 'Collins'}, {'first_name': 'Nicole', 'last_name': 'Arendt'}, {'first_name': 'Florencia', 'last_name': 'Labat'}, {'first_name': 'Sabine', 'last_name': 'Appelmans'}, {'first_name': 'Andreea', 'last_name': 'Ehritt Vanc'}, {'first_name': 'Monica', 'last_name': 'Seles'}, {'first_name': 'Gala', 'last_name': 'Leon Garcia'}, {'first_name': 'Karen', 'last_name': 'Cross'}, {'first_name': 'Julie', 'last_name': 'Pullin'}, {'first_name': 'Vanessa', 'last_name': 'Webb'}, {'first_name': 'Elena', 'last_name': 'Tatarkova'}, {'first_name': 'Anca', 'last_name': 'Barna'}, {'first_name': 'Francesca', 'last_name': 'Lubiani'}, {'first_name': 'Gaelle', 'last_name': 'Widmer'}, {'first_name': 'Amanda', 'last_name': 'Keen'}, {'first_name': 'Amanda', 'last_name': 'Augustus'}, {'first_name': 'Rita', 'last_name': 'Kuti Kis'}, {'first_name': 'Amelie', 'last_name': 'Cocheteux'}, {'first_name': 'Amelie', 'last_name': 'Castera'}, {'first_name': 'Saori', 'last_name': 'Obata'}, {'first_name': 'Marine', 'last_name': 'Nizri Spiegel'}, {'first_name': 'Patty', 'last_name': 'Schnyder'}, {'first_name': 'Julie', 'last_name': 'Ditty'}, {'first_name': 'Joana', 'last_name': 'Cortez'}, {'first_name': 'Barbara', 'last_name': 'Schwartz'}, {'first_name': 'Ludmilla', 'last_name': 'Varmuza'}, {'first_name': 'Magui', 'last_name': 'Serna'}, {'first_name': 'Amanda', 'last_name': 'Grahame'}, {'first_name': 'Kim', 'last_name': 'Kilsdonk'}, {'first_name': 'Emilie', 'last_name': 'Loit'}, {'first_name': 'Erika', 'last_name': 'Pineider'}, {'first_name': 'Anne Gaelle', 'last_name': 'Sidot'}, {'first_name': 'Erica', 'last_name': 'Biro'}, {'first_name': 'Stephanie', 'last_name': 'Kovacic'}, {'first_name': 'Sybille', 'last_name': 'Bammer'}, {'first_name': 'Lisa', 'last_name': 'Fritz'}, {'first_name': 'Maja', 'last_name': 'Matevzic'}, {'first_name': 'Leanne', 'last_name': 'Baker'}, {'first_name': 'Aurelie', 'last_name': 'Vedy'}, {'first_name': 'Carla', 'last_name': 'Tiene'}, {'first_name': 'Erika', 'last_name': 'Venere'}, {'first_name': 'Jelena', 'last_name': 'Kostanic Tosic'}, {'first_name': 'Clarisa', 'last_name': 'Fernandez'}, {'first_name': 'Ansley', 'last_name': 'Cargill'}, {'first_name': 'Dimana', 'last_name': 'Krastevitch'}, {'first_name': 'Maria Jose', 'last_name': 'Martinez Sanchez'}, {'first_name': 'Zerene', 'last_name': 'Reyes'}, {'first_name': 'Melinda', 'last_name': 'Czink'}, {'first_name': 'Sandra', 'last_name': 'Klemenschits'}, {'first_name': 'Maria Elizabeth', 'last_name': 'Lopez'}, {'first_name': 'Salome', 'last_name': 'Llaguno'}, {'first_name': 'Lindsay', 'last_name': 'Cox'}, {'first_name': 'Iveta', 'last_name': 'Benesova'}, {'first_name': 'Eugenia', 'last_name': 'Chialvo'}, {'first_name': 'Chun Yan', 'last_name': 'He'}, {'first_name': 'Maria Fernanda', 'last_name': 'Alves'}, {'first_name': 'Emily', 'last_name': 'Quin'}, {'first_name': 'Fernanda', 'last_name': 'Oliveira Da Silva'}, {'first_name': 'Annabel', 'last_name': 'Blow'}, {'first_name': 'Julia', 'last_name': 'Smith'}, {'first_name': 'Ana Lucia', 'last_name': 'Migliarini De Leon'}, {'first_name': 'Elizabeth', 'last_name': 'Bondi'}, {'first_name': 'Galina', 'last_name': 'Fokina'}, {'first_name': 'Elise', 'last_name': 'Tamaela'}, {'first_name': 'Bit Na', 'last_name': 'Lee'}, {'first_name': 'Sonia', 'last_name': 'Iacovacci'}, {'first_name': 'Mariana Pires', 'last_name': 'Junqueira'}, {'first_name': 'Natalia', 'last_name': 'Bogdanova'}, {'first_name': 'Irina', 'last_name': 'Smirnova'}, {'first_name': 'Meghha', 'last_name': 'Vakaria'}, {'first_name': 'Angela', 'last_name': 'Haynes'}, {'first_name': 'Karly', 'last_name': 'Olson'}, {'first_name': 'Casey', 'last_name': 'Dellacqua'}, {'first_name': 'Kathrin', 'last_name': 'Hegel'}, {'first_name': 'Beatrix', 'last_name': 'Csordas'}, {'first_name': 'Zsuzsanna', 'last_name': 'Babos'}, {'first_name': 'Emily', 'last_name': 'Applegate'}, {'first_name': 'Olga', 'last_name': 'Pasichnichenko'}, {'first_name': 'Theresa', 'last_name': 'Logar'}, {'first_name': 'Jin A', 'last_name': 'Lee'}, {'first_name': 'Hannah', 'last_name': 'Kuervers'}, {'first_name': 'Andreea', 'last_name': 'Novaceanu'}, {'first_name': 'Valentina', 'last_name': 'Tizzano'}, {'first_name': 'Helen', 'last_name': 'Fritche'}, {'first_name': 'Sandra', 'last_name': 'Sasidharan'}, {'first_name': 'Isha', 'last_name': 'Lakhani'}, {'first_name': 'Krushmi', 'last_name': 'Chheda'}, {'first_name': 'Ljubica', 'last_name': 'Avramovic'}, {'first_name': 'Avel Romaly', 'last_name': 'Coronado'}, {'first_name': 'Shadisha', 'last_name': 'Robinson'}, {'first_name': 'Carla', 'last_name': 'Zabaleta'}, {'first_name': 'Diana', 'last_name': 'Arutyunova'}, {'first_name': 'Cecile', 'last_name': 'Baijot'}, {'first_name': 'Laura', 'last_name': 'Rocchi'}, {'first_name': 'Rie', 'last_name': 'Imai'}, {'first_name': 'Danielle', 'last_name': 'Harmsen'}, {'first_name': 'Alejandra', 'last_name': 'Obregon'}, {'first_name': 'Ariela', 'last_name': 'Perez'}, {'first_name': 'Vasilisa', 'last_name': 'Davydova'}, {'first_name': 'Emilia', 'last_name': 'Yorio'}, {'first_name': 'Lizaan', 'last_name': 'Du Plessis'}, {'first_name': 'Claire', 'last_name': 'Feuerstein'}, {'first_name': 'Alexandria', 'last_name': 'Liles'}, {'first_name': 'Katharine', 'last_name': 'Baker'}, {'first_name': 'Emma', 'last_name': 'Laine'}, {'first_name': 'Geraldine', 'last_name': 'Roma'}, {'first_name': 'Aya', 'last_name': 'El Akkad'}, {'first_name': 'Alexandra', 'last_name': 'Kazanova'}, {'first_name': 'Allison', 'last_name': 'Baker'}, {'first_name': 'Lucy', 'last_name': 'Fletcher'}, {'first_name': 'Monika', 'last_name': 'Musilova'}, {'first_name': 'Jitka', 'last_name': 'Gavdunova'}, {'first_name': 'Elena', 'last_name': 'Petrucciano'}, {'first_name': 'Varvara', 'last_name': 'Lepchenko'}, {'first_name': 'Claire', 'last_name': 'De Gubernatis'}, {'first_name': 'Seheno', 'last_name': 'Razafindramaso'}, {'first_name': 'Karolina', 'last_name': 'Soor'}, {'first_name': 'Melisa', 'last_name': 'Cabrera Handt'}, {'first_name': 'Shraddha', 'last_name': 'Lodha'}, {'first_name': 'Sylvia', 'last_name': 'Krywacz'}, {'first_name': 'Amina', 'last_name': 'El Sahn'}, {'first_name': 'Hendrike Lea', 'last_name': 'Heitmann'}, {'first_name': 'Dunja', 'last_name': 'Antunovic'}, {'first_name': 'Micaela', 'last_name': 'Acosta'}, {'first_name': 'Katerina', 'last_name': 'Bohmova'}, {'first_name': 'Catherine', 'last_name': 'Grotz'}, {'first_name': 'Yurika', 'last_name': 'Sema'}, {'first_name': 'Sheng Nan', 'last_name': 'Sun'}, {'first_name': 'Lucie', 'last_name': 'Safarova'}, {'first_name': 'Jitka', 'last_name': 'Kleisnerova'}, {'first_name': 'Carolina', 'last_name': 'Escamilla'}, {'first_name': 'Tapiwa', 'last_name': 'Marobela'}, {'first_name': 'Punam', 'last_name': 'Reddy'}, {'first_name': 'Katia', 'last_name': 'Sabate Orera'}, {'first_name': 'Shana', 'last_name': 'Claes'}, {'first_name': 'Chrissie', 'last_name': 'Seredni'}, {'first_name': 'Yui', 'last_name': 'Nagasawa'}, {'first_name': 'Marcela', 'last_name': 'Vojtiskova'}, {'first_name': 'Seul Ki', 'last_name': 'Chin'}, {'first_name': 'Nina', 'last_name': 'Munch Soegaard'}, {'first_name': 'Hannah', 'last_name': 'Grady'}, {'first_name': 'Karen', 'last_name': 'Castiblanco'}, {'first_name': 'Angelique', 'last_name': 'Kerber'}, {'first_name': 'Lauren', 'last_name': 'Lui'}, {'first_name': 'Rana', 'last_name': 'Tharwat Hafez'}, {'first_name': 'Nicole', 'last_name': 'Grunwald'}, {'first_name': 'Ana', 'last_name': 'Veselinovic'}, {'first_name': 'Sanaa', 'last_name': 'Bhambri'}, {'first_name': 'Diana Andreea', 'last_name': 'Gae'}, {'first_name': 'Ana', 'last_name': 'Beltran Trigueros'}, {'first_name': 'Barbora', 'last_name': 'Bozkova'}, {'first_name': 'Camila', 'last_name': 'Belassi'}, {'first_name': 'Violette', 'last_name': 'Huck'}, {'first_name': 'Megumi', 'last_name': 'Fukui'}, {'first_name': 'Rita', 'last_name': 'Gouveia'}, {'first_name': 'Mihaela', 'last_name': 'Buzarnescu'}, {'first_name': 'Liset', 'last_name': 'Brito Herrera'}, {'first_name': 'Paulina', 'last_name': 'Jorquera'}, {'first_name': 'Ekaterina', 'last_name': 'Makarova'}, {'first_name': 'Dessislava', 'last_name': 'Mladenova'}, {'first_name': 'Sanaz', 'last_name': 'Marand'}, {'first_name': 'Cristina', 'last_name': 'Greco Naccarato'}, {'first_name': 'Cagla', 'last_name': 'Urcu'}, {'first_name': 'Liege', 'last_name': 'Vieira'}, {'first_name': 'Chang', 'last_name': 'Xu'}, {'first_name': 'Jessica', 'last_name': 'Sweeting'}, {'first_name': 'Yi Fan', 'last_name': 'Xu'}, {'first_name': 'Eloisa Maria', 'last_name': 'Compostizo De Andres'}, {'first_name': 'Karina', 'last_name': 'Porushkevich'}, {'first_name': 'Ornella', 'last_name': 'Gentile'}, {'first_name': 'Valeria', 'last_name': 'Casillo'}, {'first_name': 'Bianca Ioana', 'last_name': 'Bonifate'}, {'first_name': 'Michelle', 'last_name': 'Russ'}, {'first_name': 'Monika', 'last_name': 'Lalewicz'}, {'first_name': 'Amandine', 'last_name': 'Cazeaux'}, {'first_name': 'Fatima', 'last_name': 'El Allami'}, {'first_name': 'Simonetta', 'last_name': 'Miori'}, {'first_name': 'Gabriela', 'last_name': 'Roux'}, {'first_name': 'Sherazad', 'last_name': 'Benamar'}, {'first_name': 'Sherazad', 'last_name': 'Reix'}, {'first_name': 'Zora', 'last_name': 'Vlckova'}, {'first_name': 'Naomi', 'last_name': 'Cavaday'}, {'first_name': 'Nathalia', 'last_name': 'Rossi'}, {'first_name': 'Maria Eugenia', 'last_name': 'Roca Recarey'}, {'first_name': 'Lauren', 'last_name': 'Jones'}, {'first_name': 'Roxane', 'last_name': 'Vaisemberg'}, {'first_name': 'Ivana', 'last_name': 'Belejova'}, {'first_name': 'Petra', 'last_name': 'Vogel'}, {'first_name': 'Majdouline', 'last_name': 'Akrate'}, {'first_name': 'Laura', 'last_name': 'Sadria'}, {'first_name': 'Ia', 'last_name': 'Jikia'}, {'first_name': 'Alessandra', 'last_name': 'Caprara'}, {'first_name': 'Guadalupe', 'last_name': 'Moreno'}, {'first_name': 'Lucie', 'last_name': 'Sipkova'}, {'first_name': 'Xenia', 'last_name': 'Samoilova'}, {'first_name': 'Kotomi', 'last_name': 'Takahata'}, {'first_name': 'Stephanie', 'last_name': 'Theiler'}, {'first_name': 'Maria', 'last_name': 'Prishlyak'}, {'first_name': 'Grace', 'last_name': 'Leake'}, {'first_name': 'Ioana Alexandra', 'last_name': 'Oprea'}, {'first_name': 'Sanne', 'last_name': 'Bakker'}, {'first_name': 'Katerina', 'last_name': 'Vankova'}, {'first_name': 'Kristy', 'last_name': 'Frilling'}, {'first_name': 'Tatiana', 'last_name': 'Bua'}, {'first_name': 'Anastasia', 'last_name': 'Kontratevidi'}, {'first_name': 'Chane', 'last_name': 'Hines'}, {'first_name': 'Julia', 'last_name': 'Gavenko'}, {'first_name': 'Yuuki', 'last_name': 'Tanaka'}, {'first_name': 'Petra', 'last_name': 'Kvitova'}, {'first_name': 'Leticia', 'last_name': 'Costas'}, {'first_name': 'Sandra', 'last_name': 'Roma'}, {'first_name': 'Nina', 'last_name': 'Mujezinovic'}, {'first_name': 'Stella', 'last_name': 'Papaspyrou'}, {'first_name': 'Chinami', 'last_name': 'Ogi'}, {'first_name': 'Martina', 'last_name': 'Balogova'}, {'first_name': 'Xinyun', 'last_name': 'Han'}, {'first_name': 'Nicole', 'last_name': 'Riner'}, {'first_name': 'Lara', 'last_name': 'Meccico'}, {'first_name': 'Mai', 'last_name': 'Iwasaki'}, {'first_name': 'Oksana', 'last_name': 'Kalashnikova'}, {'first_name': 'Dipti', 'last_name': 'Srivastava'}, {'first_name': 'Claudia', 'last_name': 'Mercado'}, {'first_name': 'Margarita', 'last_name': 'Lazareva'}, {'first_name': 'Shaozhuo', 'last_name': 'Liu'}, {'first_name': 'Ana Maria', 'last_name': 'Chavez Franco'}, {'first_name': 'Arantxa', 'last_name': 'Rus'}, {'first_name': 'Ekaterina', 'last_name': 'Kamendova'}, {'first_name': 'Monika', 'last_name': 'Tumova'}, {'first_name': 'Gabriella', 'last_name': 'Boboc'}, {'first_name': 'Ganna', 'last_name': 'Lukianchykova'}, {'first_name': 'Sofia', 'last_name': 'Medina'}, {'first_name': 'Ekaterina', 'last_name': 'Abaeva'}, {'first_name': 'Andressa', 'last_name': 'Garcia'}, {'first_name': 'Giulia', 'last_name': 'Bruzzone'}, {'first_name': 'Catia', 'last_name': 'Rodrigues'}, {'first_name': 'Danielle', 'last_name': 'Mills'}, {'first_name': 'Flavia', 'last_name': 'Borges'}, {'first_name': 'Misaki', 'last_name': 'Doi'}, {'first_name': 'Veronika', 'last_name': 'Domagala'}, {'first_name': 'Cindy', 'last_name': 'Chala'}, {'first_name': 'Ksenia', 'last_name': 'Pervak'}, {'first_name': 'Bianca', 'last_name': 'Botto'}, {'first_name': 'Marianna', 'last_name': 'Natali'}, {'first_name': 'Carolina', 'last_name': 'Orsi'}, {'first_name': 'Aleksandra', 'last_name': 'Vukadinovic'}, {'first_name': 'Elixane', 'last_name': 'Lechemia'}, {'first_name': 'Sonya', 'last_name': 'Dayal'}, {'first_name': 'Francesca', 'last_name': 'Campigotto'}, {'first_name': 'Cristina Bianca', 'last_name': 'Danaila'}, {'first_name': 'Tereza', 'last_name': 'Budilova'}, {'first_name': 'Gemma', 'last_name': 'Praditngam'}, {'first_name': 'Ekaterine', 'last_name': 'Gorgodze'}, {'first_name': 'Dejana', 'last_name': 'Raickovic'}, {'first_name': 'Alena', 'last_name': 'Gerasimova'}, {'first_name': 'Quirine', 'last_name': 'Lemoine'}, {'first_name': 'Chieh Yu', 'last_name': 'Hsu'}, {'first_name': 'Anastasiya', 'last_name': 'Vasylyeva'}, {'first_name': 'Alexia', 'last_name': 'Quartetto'}, {'first_name': 'Joanna', 'last_name': 'Bougon'}, {'first_name': 'Kristyna', 'last_name': 'Pliskova'}, {'first_name': 'Elena', 'last_name': 'Bogdan'}, {'first_name': 'Fiorella', 'last_name': 'Jerardino'}, {'first_name': 'Julie', 'last_name': 'Gonzalez Rodriguez'}, {'first_name': 'Alejandra', 'last_name': 'Barragan'}, {'first_name': 'Renata', 'last_name': 'Bakieva'}, {'first_name': 'Ashley', 'last_name': 'Krysiak'}, {'first_name': 'Sarah Rebecca', 'last_name': 'Sekulic'}, {'first_name': 'Na Lae', 'last_name': 'Han'}, {'first_name': 'Natali', 'last_name': 'Coronel'}, {'first_name': 'Kristyna', 'last_name': 'Hancarova'}, {'first_name': 'Doroteja', 'last_name': 'Eric'}, {'first_name': 'Chanel', 'last_name': 'Simmonds'}, {'first_name': 'Kobkanok', 'last_name': 'Upapong'}, {'first_name': 'Annie', 'last_name': 'Sullivan'}, {'first_name': 'Jenny Thuy', 'last_name': 'Le'}, {'first_name': 'Xenia', 'last_name': 'Knoll'}, {'first_name': 'Francisca', 'last_name': 'Matos'}, {'first_name': 'Christina', 'last_name': 'Madenoglou'}, {'first_name': 'Alexandra', 'last_name': 'Avirvarei'}, {'first_name': 'Georgina', 'last_name': 'Fedosenkova'}, {'first_name': 'Alicia', 'last_name': 'Doms Golobart'}, {'first_name': 'Amy', 'last_name': 'Hoburn'}, {'first_name': 'Monica', 'last_name': 'Turewicz'}, {'first_name': 'Martina', 'last_name': 'Zerbola'}, {'first_name': 'Mashaal', 'last_name': 'Hameed'}, {'first_name': 'Sabrina', 'last_name': 'Dos Reis'}, {'first_name': 'Maria Sol', 'last_name': 'Carrasco'}, {'first_name': 'Ruxandra', 'last_name': 'Ababii'}, {'first_name': 'Daniella', 'last_name': 'Patton'}, {'first_name': 'Veronika', 'last_name': 'Zavodska'}, {'first_name': 'Briar', 'last_name': 'Preston'}, {'first_name': 'Gabriela', 'last_name': 'Ce'}, {'first_name': 'Amanda', 'last_name': 'Rodgers'}, {'first_name': 'Constanze', 'last_name': 'Lotz'}, {'first_name': 'Paula', 'last_name': 'Mocete Talamantes'}, {'first_name': 'Verena', 'last_name': 'Gantschnig'}, {'first_name': 'Ainhoa', 'last_name': 'Atucha Gomez'}, {'first_name': 'Katarzyna', 'last_name': 'Kossowska'}, {'first_name': 'Julia', 'last_name': 'Stamatova'}, {'first_name': 'Vorranavaporn', 'last_name': 'Vorrarattanamongkol'}, {'first_name': 'Michaela', 'last_name': 'Jasenakova'}, {'first_name': 'Agustina Sol', 'last_name': 'Eskenazi'}, {'first_name': 'Maja', 'last_name': 'Mladenovic'}, {'first_name': 'Sandra', 'last_name': 'Garriga Catala'}, {'first_name': 'Rita', 'last_name': 'Vilaca'}, {'first_name': 'Zanmarie', 'last_name': 'Pienaar'}, {'first_name': 'Julia', 'last_name': 'Kimmelmann'}, {'first_name': 'Martina', 'last_name': 'Trevisan'}, {'first_name': 'Charitomeni', 'last_name': 'Matoula'}, {'first_name': 'Andreea', 'last_name': 'Istrate'}, {'first_name': 'Sowjanya', 'last_name': 'Bavisetti'}, {'first_name': 'Gabrielle', 'last_name': 'Moxey'}, {'first_name': 'Viktoryia', 'last_name': 'Kisialeva'}, {'first_name': 'Sarahi', 'last_name': 'Garcia Carrera'}, {'first_name': 'Rachel', 'last_name': 'Girard'}, {'first_name': 'Laura', 'last_name': 'Robson'}, {'first_name': 'Kate', 'last_name': 'Vialle'}, {'first_name': 'Anna', 'last_name': 'Montserrat Sanchez'}, {'first_name': 'Elena Teodora', 'last_name': 'Cadar'}, {'first_name': 'Carol', 'last_name': 'Augustine Benito'}, {'first_name': 'Kamila', 'last_name': 'Pavelkova'}, {'first_name': 'Arantxa', 'last_name': 'Sanchez'}, {'first_name': 'Ana Sofia', 'last_name': 'Sanchez'}, {'first_name': 'Julia', 'last_name': 'Wachaczyk'}, {'first_name': 'Ecaterina', 'last_name': 'Oproiu'}, {'first_name': 'Snigdha', 'last_name': 'Padamata'}, {'first_name': 'Rona', 'last_name': 'Berisha'}, {'first_name': 'Olga', 'last_name': 'Doroshina'}, {'first_name': 'So Ra', 'last_name': 'Lee'}, {'first_name': 'Brandy', 'last_name': 'Mina'}, {'first_name': 'Natalie', 'last_name': 'Novakova'}, {'first_name': 'Storm', 'last_name': 'Sanders'}, {'first_name': 'Alexandra', 'last_name': 'Martinez'}, {'first_name': 'Ysaline', 'last_name': 'Bonaventure'}, {'first_name': 'Barbora', 'last_name': 'Trestikova'}, {'first_name': 'Stefania', 'last_name': 'Hristov'}, {'first_name': 'Ana Maria', 'last_name': 'Crisan'}, {'first_name': 'Elpida', 'last_name': 'Papanelopoulou'}, {'first_name': 'Tereza', 'last_name': 'Jankovska'}, {'first_name': 'Rebecca', 'last_name': 'Andrade'}, {'first_name': 'Kelly', 'last_name': 'Williford'}, {'first_name': 'Tina', 'last_name': 'Rupert'}, {'first_name': 'Mia Nicole', 'last_name': 'Eklund'}, {'first_name': 'Bernarda', 'last_name': 'Pera'}, {'first_name': 'Montserrat', 'last_name': 'Alonso'}, {'first_name': 'Rosalie', 'last_name': 'Van Der Hoek'}, {'first_name': 'Hedda', 'last_name': 'Odegaard'}, {'first_name': 'Samira', 'last_name': 'Radjaa'}, {'first_name': 'Zuzanna', 'last_name': 'Maciejewska'}, {'first_name': 'Saumya', 'last_name': 'Vig'}, {'first_name': 'Marie', 'last_name': 'Benoit'}, {'first_name': 'Iga', 'last_name': 'Odrzywolek'}, {'first_name': 'Shakhlo', 'last_name': 'Saidova'}, {'first_name': 'Irina', 'last_name': 'Khromacheva'}, {'first_name': 'Yuliya', 'last_name': 'Lysa'}, {'first_name': 'Sophie', 'last_name': 'Blom'}, {'first_name': 'Jennifer', 'last_name': 'Zerbone'}, {'first_name': 'Kristina', 'last_name': 'Chasovskikh'}, {'first_name': 'Maria Camila', 'last_name': 'Trujillo Hoyos'}, {'first_name': 'Karina', 'last_name': 'Rovira'}, {'first_name': 'Teodora Adina', 'last_name': 'Ardeleanu'}, {'first_name': 'Yasmine', 'last_name': 'Rashad'}, {'first_name': 'Judit', 'last_name': 'Vives Joan'}, {'first_name': 'Sarah Beth', 'last_name': 'Askew'}, {'first_name': 'Yasmine', 'last_name': 'Xantos'}, {'first_name': 'Lea', 'last_name': 'Tholey'}, {'first_name': 'Hikari', 'last_name': 'Yamamoto'}, {'first_name': 'Ines Miren', 'last_name': 'De Pablo'}, {'first_name': 'Stuti', 'last_name': 'Singh Tomar'}, {'first_name': 'Naomi', 'last_name': 'Totka'}, {'first_name': 'Polina', 'last_name': 'Bezsmertnaya'}, {'first_name': 'Hannah', 'last_name': 'King'}, {'first_name': 'Gabriele', 'last_name': 'Bertasiute'}, {'first_name': 'Rebecca', 'last_name': 'Smaller'}, {'first_name': 'Busra', 'last_name': 'Kayrun'}, {'first_name': 'Stephani', 'last_name': 'Rodriguez'}, {'first_name': 'Raquel', 'last_name': 'Montalvo'}, {'first_name': 'Oana', 'last_name': 'Irimescu'}, {'first_name': 'Taylor', 'last_name': 'Townsend'}, {'first_name': 'Carmen', 'last_name': 'Blasco Robaina'}, {'first_name': 'Giulia', 'last_name': 'Della Cioppa'}, {'first_name': 'Nadege', 'last_name': 'Jorda'}, {'first_name': 'Beatriz', 'last_name': 'Haddad Maia'}, {'first_name': 'Nelise', 'last_name': 'Verster'}, {'first_name': 'Eleonore', 'last_name': 'Barrere'}, {'first_name': 'Anastasia', 'last_name': 'Prokopenko'}, {'first_name': 'Dzina', 'last_name': 'Milovanovic'}, {'first_name': 'Isabelle', 'last_name': 'Wallace'}, {'first_name': 'Katelyn', 'last_name': 'Jackson'}, {'first_name': 'Polina', 'last_name': 'Novoselova'}, {'first_name': 'Maite', 'last_name': 'Cano'}, {'first_name': 'Ria', 'last_name': 'Vaidya'}, {'first_name': 'Ana Lorena', 'last_name': 'Garcia Navas'}, {'first_name': 'Aayushi', 'last_name': 'Chouhan'}, {'first_name': 'Ivona', 'last_name': 'Cudina'}, {'first_name': 'Karina', 'last_name': 'Gurgenyan'}, {'first_name': 'Maria', 'last_name': 'Patrascu'}, {'first_name': 'Denisa', 'last_name': 'Chereches'}, {'first_name': 'Mirabelle', 'last_name': 'Njoze'}, {'first_name': 'Vasanti', 'last_name': 'Shinde'}, {'first_name': 'Amanda', 'last_name': 'Schneider'}, {'first_name': 'Katharina', 'last_name': 'Herpertz'}, {'first_name': 'Tayisiya', 'last_name': 'Morderger'}, {'first_name': 'Tamara', 'last_name': 'Tomic'}, {'first_name': 'Maria Fernanda', 'last_name': 'Herazo Gonzalez'}, {'first_name': 'Andra Maria', 'last_name': 'Nitescu'}, {'first_name': 'Micheline', 'last_name': 'Aubuchon'}, {'first_name': 'Ilayda', 'last_name': 'Yondem'}, {'first_name': 'Birgit', 'last_name': 'Burk'}, {'first_name': 'Kanako', 'last_name': 'Osafune'}, {'first_name': 'Anastasiya', 'last_name': 'Komardina'}, {'first_name': 'Nina', 'last_name': 'Holanova'}, {'first_name': 'Jil Belen', 'last_name': 'Teichmann'}, {'first_name': 'Francesca', 'last_name': 'Di Lorenzo'}, {'first_name': 'Natsuho', 'last_name': 'Arakawa'}, {'first_name': 'Emerald', 'last_name': 'Able'}, {'first_name': 'Manca', 'last_name': 'Pislak'}, {'first_name': 'Irys', 'last_name': 'Ekani'}, {'first_name': 'Veronica', 'last_name': 'Miroshnichenko'}, {'first_name': 'Martina', 'last_name': 'Capurro Taborda'}, {'first_name': 'Mariam', 'last_name': 'Bolkvadze'}, {'first_name': 'Diana', 'last_name': 'Valverde'}, {'first_name': 'Do Hee', 'last_name': 'Bae'}, {'first_name': 'Daniela', 'last_name': 'Morales Beckmann'}, {'first_name': 'Ioana Diana', 'last_name': 'Pietroiu'}, {'first_name': 'Luisa Fernanda', 'last_name': 'Echeverry Rodriguez'}, {'first_name': 'Mayuka', 'last_name': 'Aikawa'}, {'first_name': 'Nicole', 'last_name': 'Frenkel'}, {'first_name': 'Daria', 'last_name': 'Kruzhkova'}, {'first_name': 'Alejandra', 'last_name': 'Tamayo Gomez'}, {'first_name': 'Tereza', 'last_name': 'Koplova'}, {'first_name': 'Chiara', 'last_name': 'Lommer'}, {'first_name': 'Laura', 'last_name': 'Illanes'}, {'first_name': 'Olga', 'last_name': 'Fridman'}, {'first_name': 'Ana Paula', 'last_name': 'Leal'}, {'first_name': 'Shiraz', 'last_name': 'Bronstein'}, {'first_name': 'Nicole', 'last_name': 'Bunea'}, {'first_name': 'Charlotte', 'last_name': 'Robillard Millette'}, {'first_name': 'Ashley', 'last_name': 'Kratzer'}, {'first_name': 'Momoka', 'last_name': 'Chimura'}, {'first_name': 'Anna', 'last_name': 'Slovakova'}, {'first_name': 'Ai Qi', 'last_name': 'Chen'}, {'first_name': 'Jiaying', 'last_name': 'He'}, {'first_name': 'Ysabel', 'last_name': 'Gonzalez Rico'}, {'first_name': 'Andreea', 'last_name': 'Stanescu'}, {'first_name': 'Marketa', 'last_name': 'Vondrousova'}, {'first_name': 'Ecaterina', 'last_name': 'Ivasco'}, {'first_name': 'Ivon', 'last_name': 'Mihaleva'}, {'first_name': 'Jasmine', 'last_name': 'Boyd'}, {'first_name': 'Andrea', 'last_name': 'Arratia Fernandez'}, {'first_name': 'Kayla', 'last_name': 'Day'}, {'first_name': 'Ekaterina', 'last_name': 'Davletova'}, {'first_name': 'Irina', 'last_name': 'Cantos Siemers'}, {'first_name': 'Oceane', 'last_name': 'Mialon'}, {'first_name': 'Watsachol', 'last_name': 'Sawasdee'}, {'first_name': 'Ellen', 'last_name': 'Ashley'}, {'first_name': 'Mila', 'last_name': 'Mejic'}, {'first_name': 'Natalia', 'last_name': 'Nikolopoulou'}, {'first_name': 'Marta', 'last_name': 'Del Pino Maturano'}, {'first_name': 'Jayci', 'last_name': 'Goldsmith'}, {'first_name': 'Yang', 'last_name': 'Lee'}, {'first_name': 'Isabella', 'last_name': 'Tcherkes Zade'}, {'first_name': 'Mara', 'last_name': 'Vidal'}, {'first_name': 'Taylor', 'last_name': 'Johnson'}, {'first_name': 'Julia', 'last_name': 'Vulpio'}, {'first_name': 'Dagmar', 'last_name': 'Zdrubecka'}, {'first_name': 'Olga', 'last_name': 'Danilovic'}, {'first_name': 'Xiyu', 'last_name': 'Wang'}, {'first_name': 'Lina', 'last_name': 'Shokry'}, {'first_name': 'Ya Hsin', 'last_name': 'Lee'}, {'first_name': 'Ruxandra', 'last_name': 'Schech'}, {'first_name': 'Yasmina', 'last_name': 'Karimjanova'}, {'first_name': 'Lara', 'last_name': 'Biter'}, {'first_name': 'Najah', 'last_name': 'Dawson'}, {'first_name': 'Giulia', 'last_name': 'Morlet'}, {'first_name': 'Matilde', 'last_name': 'Mariani'}, {'first_name': 'Isabella', 'last_name': 'Nunez'}, {'first_name': 'Betina', 'last_name': 'Tokac'}, {'first_name': 'Noa', 'last_name': 'Krznaric'}]
medium
Table matches ( matches.best_of (INT), matches.draw_size (INT), matches.loser_age (FLOAT), matches.loser_entry (TEXT), matches.loser_hand (TEXT), matches.loser_ht (INT), matches.loser_id (INT), matches.loser_ioc (TEXT), matches.loser_name (TEXT), matches.loser_rank (INT), matches.loser_rank_points (INT), matches.loser_seed (INT), matches.match_num (INT), matches.minutes (INT), matches.round (TEXT), matches.score (TEXT), matches.surface (TEXT), matches.tourney_date (DATE), matches.tourney_id (TEXT), matches.tourney_level (TEXT), matches.tourney_name (TEXT), matches.winner_age (FLOAT), matches.winner_entry (TEXT), matches.winner_hand (TEXT), matches.winner_ht (INT), matches.winner_id (INT), matches.winner_ioc (TEXT), matches.winner_name (TEXT), matches.winner_rank (INT), matches.winner_rank_points (INT), matches.winner_seed (INT), matches.year (INT), ) Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Table rankings ( rankings.ranking_date (DATE), rankings.ranking (INT), rankings.player_id (INT), rankings.ranking_points (INT), rankings.tours (INT), ) Possible JOINs: matches.loser_id = players.player_id matches.winner_id = players.player_id rankings.player_id = players.player_id
SELECT first_name , last_name FROM players WHERE hand = 'L' ORDER BY birth_date
{ 'players': ['player_id', 'first_name', 'last_name', 'hand', 'birth_date'] }
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), ) Possible JOINs:
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Possible JOINs:
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What are the different models for the cards produced after 1980?
SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980;
[{'Model': 'plymouth'}, {'Model': 'buick'}, {'Model': 'dodge'}, {'Model': 'chevrolet'}, {'Model': 'toyota'}, {'Model': 'honda'}, {'Model': 'subaru'}, {'Model': 'datsun'}, {'Model': 'mazda'}, {'Model': 'ford'}, {'Model': 'volkswagen'}, {'Model': 'renault'}, {'Model': 'peugeot'}, {'Model': 'saab'}, {'Model': 'volvo'}, {'Model': 'oldsmobile'}, {'Model': 'chrysler'}, {'Model': 'pontiac'}, {'Model': 'amc'}, {'Model': 'mercury'}, {'Model': 'nissan'}]
hard
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT DISTINCT MODEL_LIST.model FROM MODEL_LIST JOIN CAR_NAMES ON MODEL_LIST.model = CAR_NAMES.model JOIN CARS_DATA ON CAR_NAMES.MakeId = CARS_DATA.id WHERE CARS_DATA.year > 1980;
{ 'model_list': ['modelid', 'model'], 'car_names': ['makeid', 'model'], 'cars_data': ['id', 'year'] }
Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.Year (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Model (TEXT), ) Possible JOINs:
Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_names.Model = model_list.Model cars_data.Id = car_names.MakeId model_list.Maker = car_makers.Id
orchestra
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") )
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) /* 2 rows from conductor table: Conductor_ID Name Age Nationality Year_of_Work 1 Antal Doráti 40 USA 10 2 Igor Stravinsky 41 UK 11 */ CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) /* 2 rows from orchestra table: Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format 1 London Symphony Orchestra 1 Mercury Records 2003.0 CD 2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP */ CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) /* 2 rows from performance table: Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share 1 1 Auditions 1 9 June 5.2 12 22.7% 2 2 Auditions 2 10 June 6.73 8 28.0% */ CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") ) /* 2 rows from show table: Show_ID Performance_ID If_first_show Result Attendance 1 1 True T 1026.0 2 2 True T 695.0 */
What are the names of conductors who have conducted orchestras founded after the year 2008?
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008
[{'Name': 'Igor Stravinsky'}]
medium
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Table show ( show.Show_ID (INT), show.Performance_ID (INT), show.If_first_show (bool), show.Result (TEXT), show.Attendance (REAL), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID show.Performance_ID = performance.Performance_ID
SELECT conductor.Name FROM conductor JOIN orchestra ON conductor.Conductor_ID = orchestra.Conductor_ID WHERE Year_of_Founded > 2008
{ 'conductor': ['conductor_id', 'name'], 'orchestra': ['orchestra_id', 'orchestra', 'conductor_id', 'year_of_founded'] }
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Year_of_Founded (REAL), )
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID
poker_player
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") )
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Nationality Name Birth_Date Height 1 Russia Aleksey Ostapenko May 26, 1986 207.0 2 Bulgaria Teodor Salparov August 16, 1982 182.0 */ CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from poker_player table: Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings 1 1 42.0 1.0 68.0 476090.0 2 2 10.0 2.0 141.0 189233.0 */
How many poker players are there?
SELECT count(*) FROM poker_player
[{'count(*)': 5}]
easy
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
SELECT count(*) FROM poker_player
{ 'poker_player': ['poker_player_id'] }
Table poker_player ( poker_player.Poker_Player_ID (INT), )
Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
tvshow
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) )
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from Cartoon table: id Title Directed_by Written_by Original_air_date Production_code Channel 1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700 2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701 */ CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) /* 2 rows from TV_Channel table: id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option 700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia 701 Sky Music Italy Italian music 4:3 no no Sky Famiglia */ CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from TV_series table: id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel 1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700 2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701 */
List the title of all Cartoons showed on TV Channel with series name "Sky Radio".
SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio";
[{'Title': 'The Rise of the Blue Beetle!'}, {'Title': 'Return of the Fearsome Fangs!'}]
medium
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id TV_series.Channel = TV_Channel.id
SELECT Cartoon.Title FROM TV_Channel JOIN Cartoon ON TV_Channel.id = Cartoon.Channel WHERE TV_Channel.series_name = "Sky Radio";
{ 'tv_channel': ['id', 'series_name'], 'cartoon': ['id', 'title', 'channel'] }
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), )
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id
flight_2
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") )
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) /* 2 rows from airlines table: uid Airline Abbreviation Country 1 United Airlines UAL USA 2 US Airways USAir USA */ CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) /* 2 rows from airports table: City AirportCode AirportName Country CountryAbbrev Aberdeen APG Phillips AAF United States US Aberdeen ABR Municipal United States US */ CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") ) /* 2 rows from flights table: Airline FlightNo SourceAirport DestAirport 1 28 APG ASY 1 29 ASY APG */
What are flight numbers of flights departing from City "Aberdeen "?
SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
[{'Nenhum': 'Nenhum resultado encontrado'}]
medium
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
SELECT FLIGHTS.FlightNo FROM FLIGHTS JOIN AIRPORTS ON FLIGHTS.SourceAirport = AIRPORTS.AirportCode WHERE AIRPORTS.City = "Aberdeen"
{ 'flights': ['airline', 'flightno', 'sourceairport'], 'airports': ['city', 'airportcode'] }
Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), )
Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
wta_1
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 0 rows from players table: player_id first_name last_name hand birth_date country_code */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 0 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 0 rows from rankings table: ranking_date ranking player_id ranking_points tours */
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 2 rows from players table: player_id first_name last_name hand birth_date country_code 200001 Martina Hingis R 19800930 SUI 200002 Mirjana Lucic R 19820309 CRO */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 2 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year 3 4 24.626967830300003 R 170 201474 POL Agnieszka Radwanska 4 5890 3 297 82 RR 6-2 6-4 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 3 4 23.6221765914 L 183 201520 CZE Petra Kvitova 6 4370 5 296 72 RR 6-2 6-3 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 2 rows from rankings table: ranking_date ranking player_id ranking_points tours 20000101 3 200748 4378 13 20000101 4 200033 3021 15 */
Find the first name and country code of the oldest player.
SELECT first_name , country_code FROM players ORDER BY birth_date LIMIT 1
[{'first_name': 'Thelma', 'country_code': 'AUS'}]
medium
Table matches ( matches.best_of (INT), matches.draw_size (INT), matches.loser_age (FLOAT), matches.loser_entry (TEXT), matches.loser_hand (TEXT), matches.loser_ht (INT), matches.loser_id (INT), matches.loser_ioc (TEXT), matches.loser_name (TEXT), matches.loser_rank (INT), matches.loser_rank_points (INT), matches.loser_seed (INT), matches.match_num (INT), matches.minutes (INT), matches.round (TEXT), matches.score (TEXT), matches.surface (TEXT), matches.tourney_date (DATE), matches.tourney_id (TEXT), matches.tourney_level (TEXT), matches.tourney_name (TEXT), matches.winner_age (FLOAT), matches.winner_entry (TEXT), matches.winner_hand (TEXT), matches.winner_ht (INT), matches.winner_id (INT), matches.winner_ioc (TEXT), matches.winner_name (TEXT), matches.winner_rank (INT), matches.winner_rank_points (INT), matches.winner_seed (INT), matches.year (INT), ) Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Table rankings ( rankings.ranking_date (DATE), rankings.ranking (INT), rankings.player_id (INT), rankings.ranking_points (INT), rankings.tours (INT), ) Possible JOINs: matches.loser_id = players.player_id matches.winner_id = players.player_id rankings.player_id = players.player_id
SELECT first_name , country_code FROM players ORDER BY birth_date LIMIT 1
{ 'players': ['player_id', 'first_name', 'birth_date', 'country_code'] }
Table players ( players.player_id (INT), players.first_name (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Possible JOINs:
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Possible JOINs:
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
How many professionals did not operate any treatment on dogs?
SELECT count(*) FROM Professionals WHERE professional_id NOT IN ( SELECT professional_id FROM Treatments )
[{'count(*)': 7}]
extra
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT count(*) FROM Professionals WHERE professional_id NOT IN ( SELECT professional_id FROM Treatments )
{ 'professionals': ['professional_id'], 'treatments': ['treatment_id', 'professional_id'] }
Table Professionals ( Professionals.professional_id (INTEGER), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.professional_id (INTEGER), ) Possible JOINs: Treatments.professional_id = Professionals.professional_id
Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
flight_2
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") )
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) /* 2 rows from airlines table: uid Airline Abbreviation Country 1 United Airlines UAL USA 2 US Airways USAir USA */ CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) /* 2 rows from airports table: City AirportCode AirportName Country CountryAbbrev Aberdeen APG Phillips AAF United States US Aberdeen ABR Municipal United States US */ CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") ) /* 2 rows from flights table: Airline FlightNo SourceAirport DestAirport 1 28 APG ASY 1 29 ASY APG */
What is the airport name for airport 'AKO'?
SELECT AirportName FROM AIRPORTS WHERE AirportCode = "AKO"
[{'AirportName': 'Colorado Plains Regional Airport '}]
easy
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
SELECT AirportName FROM AIRPORTS WHERE AirportCode = "AKO"
{ 'airports': ['airportcode', 'airportname'] }
Table airports ( airports.AirportCode (TEXT), airports.AirportName (TEXT), ) Possible JOINs:
Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Possible JOINs:
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
Which continent is Anguilla in?
SELECT Continent FROM country WHERE Name = "Anguilla"
[{'Continent': 'North America'}]
easy
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT Continent FROM country WHERE Name = "Anguilla"
{ 'country': ['code', 'name', 'continent'] }
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), ) Possible JOINs:
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Possible JOINs:
cre_Doc_Template_Mgt
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") )
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) /* 2 rows from Documents table: Document_ID Template_ID Document_Name Document_Description Other_Details 0 7 Introduction of OS n None 1 25 Understanding DB y None */ CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Paragraphs table: Paragraph_ID Document_ID Paragraph_Text Other_Details 7 2394 Korea None 9 3 Somalia None */ CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) /* 2 rows from Ref_Template_Types table: Template_Type_Code Template_Type_Description PPT Presentation CV CV */ CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") ) /* 2 rows from Templates table: Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details 0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28 1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04 */
Show ids for all templates that are used by more than one document.
SELECT template_id FROM Documents GROUP BY template_id HAVING count(*) > 1
[{'Template_ID': 11}, {'Template_ID': 14}, {'Template_ID': 25}]
easy
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), Paragraphs.Other_Details (VARCHAR(255)), ) Table Ref_Template_Types ( Ref_Template_Types.Template_Type_Code (CHAR(15)), Ref_Template_Types.Template_Type_Description (VARCHAR(255)), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID Paragraphs.Document_ID = Documents.Document_ID Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
SELECT template_id FROM Documents GROUP BY template_id HAVING count(*) > 1
{ 'documents': ['document_id', 'template_id'] }
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), )
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
Which breed do the most dogs have? Give me the breed name.
SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY count(*) DESC LIMIT 1
[{'breed_name': 'Bulldog'}]
extra
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT Breeds.breed_name FROM Breeds JOIN Dogs ON Breeds.breed_code = Dogs.breed_code GROUP BY Breeds.breed_name ORDER BY count(*) DESC LIMIT 1
{ 'breeds': ['breed_code', 'breed_name'], 'dogs': ['dog_id', 'breed_code'] }
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.breed_code (VARCHAR(10)), ) Possible JOINs: Dogs.breed_code = Breeds.breed_code
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What is the number of cars with more than 4 cylinders?
SELECT count(*) FROM CARS_DATA WHERE Cylinders > 4;
[{'count(*)': 195}]
easy
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT count(*) FROM CARS_DATA WHERE Cylinders > 4;
{ 'cars_data': ['id', 'cylinders'] }
Table cars_data ( cars_data.Id (INTEGER), cars_data.Cylinders (INTEGER), )
Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Possible JOINs: cars_data.Id = car_names.MakeId
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What is the model of the car with the smallest amount of horsepower?
SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC LIMIT 1;
[{'Model': 'amc'}]
hard
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT CAR_NAMES.Model FROM CAR_NAMES JOIN CARS_DATA ON CAR_NAMES.MakeId = CARS_DATA.Id ORDER BY CARS_DATA.horsepower ASC LIMIT 1;
{ 'car_names': ['makeid', 'model'], 'cars_data': ['id', 'horsepower'] }
Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.Horsepower (TEXT), ) Possible JOINs:
Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Possible JOINs: car_names.Model = model_list.Model cars_data.Id = car_names.MakeId
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
Find the distinct breed type and size type combinations for dogs.
SELECT DISTINCT breed_code , size_code FROM dogs
[{'breed_code': 'ESK', 'size_code': 'LGE'}, {'breed_code': 'BUL', 'size_code': 'LGE'}, {'breed_code': 'BUL', 'size_code': 'MED'}, {'breed_code': 'HUS', 'size_code': 'MED'}, {'breed_code': 'ESK', 'size_code': 'SML'}, {'breed_code': 'HUS', 'size_code': 'SML'}, {'breed_code': 'ESK', 'size_code': 'MED'}]
medium
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT DISTINCT breed_code , size_code FROM dogs
{ 'dogs': ['dog_id', 'breed_code', 'size_code'] }
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), )
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code
employee_hire_evaluation
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") )
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) /* 2 rows from employee table: Employee_ID Name Age City 1 George Chuter 23 Bristol 2 Lee Mears 29 Bath */ CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) /* 2 rows from evaluation table: Employee_ID Year_awarded Bonus 1 2011 3000.0 2 2015 3200.0 */ CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) /* 2 rows from hiring table: Shop_ID Employee_ID Start_from Is_full_time 1 1 2009 True 1 2 2003 True */ CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") ) /* 2 rows from shop table: Shop_ID Name Location District Number_products Manager_name 1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen 2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen */
What is total bonus given in all evaluations?
SELECT sum(bonus) FROM evaluation
[{'sum(bonus)': 19500.0}]
easy
Table employee ( employee.Employee_ID (INT), employee.Name (TEXT), employee.Age (INT), employee.City (TEXT), ) Table evaluation ( evaluation.Employee_ID (TEXT), evaluation.Year_awarded (TEXT), evaluation.Bonus (REAL), ) Table hiring ( hiring.Shop_ID (INT), hiring.Employee_ID (INT), hiring.Start_from (TEXT), hiring.Is_full_time (bool), ) Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs: evaluation.Employee_ID = employee.Employee_ID hiring.Shop_ID = shop.Shop_ID hiring.Employee_ID = employee.Employee_ID
SELECT sum(bonus) FROM evaluation
{ 'evaluation': ['employee_id', 'bonus'] }
Table evaluation ( evaluation.Employee_ID (TEXT), evaluation.Bonus (REAL), )
Table evaluation ( evaluation.Employee_ID (TEXT), evaluation.Year_awarded (TEXT), evaluation.Bonus (REAL), ) Possible JOINs: evaluation.Employee_ID = employee.Employee_ID
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
Find the id, last name and cell phone of the professionals who live in the state of Indiana or have performed more than two treatments.
SELECT professional_id , last_name , cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id , T1.last_name , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) > 2
[{'professional_id': 1, 'last_name': 'Braun', 'cell_number': '(275)939-2435x80863'}, {'professional_id': 8, 'last_name': 'Hyatt', 'cell_number': '328.842.3792'}, {'professional_id': 9, 'last_name': 'Kshlerin', 'cell_number': '962-983-8109x3509'}]
extra
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT professional_id , last_name , cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT Professionals.professional_id , Professionals.last_name , Professionals.cell_number FROM Professionals JOIN Treatments ON Professionals.professional_id = Treatments.professional_id GROUP BY Professionals.professional_id HAVING count(*) > 2
{ 'professionals': ['professional_id', 'state', 'last_name', 'cell_number'], 'treatments': ['treatment_id', 'professional_id'] }
Table Professionals ( Professionals.professional_id (INTEGER), Professionals.state (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.cell_number (VARCHAR(20)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.professional_id (INTEGER), ) Possible JOINs: Treatments.professional_id = Professionals.professional_id
Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
poker_player
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") )
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Nationality Name Birth_Date Height 1 Russia Aleksey Ostapenko May 26, 1986 207.0 2 Bulgaria Teodor Salparov August 16, 1982 182.0 */ CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from poker_player table: Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings 1 1 42.0 1.0 68.0 476090.0 2 2 10.0 2.0 141.0 189233.0 */
Return the names of poker players sorted by their earnings descending.
SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC
[{'Name': 'Maksim Botin'}, {'Name': 'Aleksey Ostapenko'}, {'Name': 'Teodor Salparov'}, {'Name': 'Semen Poltavskiy'}, {'Name': 'Yevgeni Sivozhelez'}]
medium
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
SELECT people.Name FROM people JOIN poker_player ON people.People_ID = poker_player.People_ID ORDER BY poker_player.Earnings DESC
{ 'people': ['people_id', 'name'], 'poker_player': ['poker_player_id', 'people_id', 'earnings'] }
Table people ( people.People_ID (INT), people.Name (TEXT), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Earnings (REAL), )
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
network_1
CREATE TABLE "Friend" ( student_id INTEGER, friend_id INTEGER, PRIMARY KEY (student_id, friend_id), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID") ) CREATE TABLE "Highschooler" ( "ID" INTEGER, name TEXT, grade INTEGER, PRIMARY KEY ("ID") ) CREATE TABLE "Likes" ( student_id INTEGER, liked_id INTEGER, PRIMARY KEY (student_id, liked_id), FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID") )
CREATE TABLE "Friend" ( student_id INTEGER, friend_id INTEGER, PRIMARY KEY (student_id, friend_id), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID") ) /* 2 rows from Friend table: student_id friend_id 1510 1381 1510 1689 */ CREATE TABLE "Highschooler" ( "ID" INTEGER, name TEXT, grade INTEGER, PRIMARY KEY ("ID") ) /* 2 rows from Highschooler table: ID name grade 1510 Jordan 9 1689 Gabriel 9 */ CREATE TABLE "Likes" ( student_id INTEGER, liked_id INTEGER, PRIMARY KEY (student_id, liked_id), FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID") ) /* 2 rows from Likes table: student_id liked_id 1689 1709 1709 1689 */
Show the names of students who have at least 2 likes.
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 2
[{'Nenhum': 'Nenhum resultado encontrado'}]
medium
Table Friend ( Friend.student_id (INT), Friend.friend_id (INT), ) Table Highschooler ( Highschooler.ID (INT), Highschooler.name (TEXT), Highschooler.grade (INT), ) Table Likes ( Likes.student_id (INT), Likes.liked_id (INT), ) Possible JOINs: Friend.student_id = Highschooler.ID Friend.friend_id = Highschooler.ID Likes.student_id = Highschooler.ID Likes.liked_id = Highschooler.ID
SELECT Highschooler.name FROM Likes JOIN Highschooler ON Likes.student_id = Highschooler.id GROUP BY Likes.student_id HAVING count(*) >= 2
{ 'likes': ['student_id'], 'highschooler': ['id', 'name'] }
Table Highschooler ( Highschooler.ID (INT), Highschooler.name (TEXT), ) Table Likes ( Likes.student_id (INT), ) Possible JOINs: Likes.student_id = Highschooler.ID
Table Highschooler ( Highschooler.ID (INT), Highschooler.name (TEXT), Highschooler.grade (INT), ) Table Likes ( Likes.student_id (INT), Likes.liked_id (INT), ) Possible JOINs: Likes.student_id = Highschooler.ID Likes.liked_id = Highschooler.ID
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
How many car makers are there in each continents? List the continent name and the count.
SELECT T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.continent JOIN car_makers AS T3 ON T2.CountryId = T3.Country GROUP BY T1.Continent;
[{'Continent': 'america', 'count(*)': 4}, {'Continent': 'asia', 'count(*)': 7}, {'Continent': 'europe', 'count(*)': 11}]
hard
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT CONTINENTS.Continent , count(*) FROM CONTINENTS JOIN COUNTRIES ON CONTINENTS.ContId = COUNTRIES.continent JOIN car_makers ON COUNTRIES.CountryId = car_makers.Country GROUP BY CONTINENTS.Continent;
{ 'continents': ['contid', 'continent'], 'countries': ['countryid', 'continent'], 'car_makers': ['id', 'country'] }
Table car_makers ( car_makers.Id (INTEGER), car_makers.Country (TEXT), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.Continent (INTEGER), ) Possible JOINs:
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Possible JOINs: car_makers.Country = countries.CountryId countries.Continent = continents.ContId
voter_1
CREATE TABLE "AREA_CODE_STATE" ( area_code INTEGER NOT NULL, state VARCHAR(2) NOT NULL, PRIMARY KEY (area_code) ) CREATE TABLE "CONTESTANTS" ( contestant_number INTEGER, contestant_name VARCHAR(50) NOT NULL, PRIMARY KEY (contestant_number) ) CREATE TABLE "VOTES" ( vote_id INTEGER NOT NULL, phone_number INTEGER NOT NULL, state VARCHAR(2) NOT NULL, contestant_number INTEGER NOT NULL, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (vote_id), FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number), FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state) )
CREATE TABLE "AREA_CODE_STATE" ( area_code INTEGER NOT NULL, state VARCHAR(2) NOT NULL, PRIMARY KEY (area_code) ) /* 2 rows from AREA_CODE_STATE table: area_code state 201 NJ 202 DC */ CREATE TABLE "CONTESTANTS" ( contestant_number INTEGER, contestant_name VARCHAR(50) NOT NULL, PRIMARY KEY (contestant_number) ) /* 2 rows from CONTESTANTS table: contestant_number contestant_name 1 Edwina Burnam 2 Tabatha Gehling */ CREATE TABLE "VOTES" ( vote_id INTEGER NOT NULL, phone_number INTEGER NOT NULL, state VARCHAR(2) NOT NULL, contestant_number INTEGER NOT NULL, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (vote_id), FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number), FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state) ) /* 2 rows from VOTES table: vote_id phone_number state contestant_number created 1 7182887233 NY 2 2018-03-09 19:03:21 2 7148407040 NY 3 2018-03-09 19:03:36 */
Of all the contestants who got voted, what is the contestant number and name of the contestant who got least votes?
SELECT T1.contestant_number , T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number ORDER BY count(*) ASC LIMIT 1
[{'contestant_number': 2, 'contestant_name': 'Tabatha Gehling'}]
extra
Table AREA_CODE_STATE ( AREA_CODE_STATE.area_code (INTEGER), AREA_CODE_STATE.state (varchar(2)), ) Table CONTESTANTS ( CONTESTANTS.contestant_number (INTEGER), CONTESTANTS.contestant_name (varchar(50)), ) Table VOTES ( VOTES.vote_id (INTEGER), VOTES.phone_number (INTEGER), VOTES.state (varchar(2)), VOTES.contestant_number (INTEGER), VOTES.created (timestamp), ) Possible JOINs: VOTES.state = AREA_CODE_STATE.state VOTES.contestant_number = CONTESTANTS.contestant_number
SELECT contestants.contestant_number , contestants.contestant_name FROM contestants JOIN votes ON contestants.contestant_number = votes.contestant_number GROUP BY contestants.contestant_number ORDER BY count(*) ASC LIMIT 1
{ 'contestants': ['contestant_number', 'contestant_name'], 'votes': ['vote_id', 'contestant_number'] }
Table CONTESTANTS ( CONTESTANTS.contestant_number (INTEGER), CONTESTANTS.contestant_name (varchar(50)), ) Table VOTES ( VOTES.vote_id (INTEGER), VOTES.contestant_number (INTEGER), ) Possible JOINs: VOTES.contestant_number = CONTESTANTS.contestant_number
Table CONTESTANTS ( CONTESTANTS.contestant_number (INTEGER), CONTESTANTS.contestant_name (varchar(50)), ) Table VOTES ( VOTES.vote_id (INTEGER), VOTES.phone_number (INTEGER), VOTES.state (varchar(2)), VOTES.contestant_number (INTEGER), VOTES.created (timestamp), ) Possible JOINs: VOTES.state = AREA_CODE_STATE.state VOTES.contestant_number = CONTESTANTS.contestant_number
flight_2
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") )
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) /* 2 rows from airlines table: uid Airline Abbreviation Country 1 United Airlines UAL USA 2 US Airways USAir USA */ CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) /* 2 rows from airports table: City AirportCode AirportName Country CountryAbbrev Aberdeen APG Phillips AAF United States US Aberdeen ABR Municipal United States US */ CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") ) /* 2 rows from flights table: Airline FlightNo SourceAirport DestAirport 1 28 APG ASY 1 29 ASY APG */
What is the abbreviation of the airilne has the fewest flights and what country is it in?
SELECT T1.Abbreviation , T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY count(*) LIMIT 1
[{'Abbreviation': 'AirTran', 'Country': 'USA'}]
extra
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
SELECT AIRLINES.Abbreviation , AIRLINES.Country FROM AIRLINES JOIN FLIGHTS ON AIRLINES.uid = FLIGHTS.Airline GROUP BY AIRLINES.Airline ORDER BY count(*) LIMIT 1
{ 'airlines': ['uid', 'airline', 'abbreviation', 'country'], 'flights': ['airline'] }
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table flights ( flights.Airline (INTEGER), )
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
poker_player
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") )
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Nationality Name Birth_Date Height 1 Russia Aleksey Ostapenko May 26, 1986 207.0 2 Bulgaria Teodor Salparov August 16, 1982 182.0 */ CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from poker_player table: Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings 1 1 42.0 1.0 68.0 476090.0 2 2 10.0 2.0 141.0 189233.0 */
Return the nationalities for which there are two or more people.
SELECT Nationality FROM people GROUP BY Nationality HAVING COUNT(*) >= 2
[{'Nationality': 'Russia'}]
easy
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
SELECT Nationality FROM people GROUP BY Nationality HAVING COUNT(*) >= 2
{ 'people': ['people_id', 'nationality'] }
Table people ( people.People_ID (INT), people.Nationality (TEXT), ) Possible JOINs:
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Possible JOINs:
tvshow
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) )
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from Cartoon table: id Title Directed_by Written_by Original_air_date Production_code Channel 1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700 2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701 */ CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) /* 2 rows from TV_Channel table: id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option 700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia 701 Sky Music Italy Italian music 4:3 no no Sky Famiglia */ CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from TV_series table: id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel 1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700 2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701 */
What are all of the episodes ordered by ratings?
SELECT Episode FROM TV_series ORDER BY rating
[{'Episode': 'The Hanged Man'}, {'Episode': 'Double Down'}, {'Episode': 'Home By Another Way'}, {'Episode': 'Keepers'}, {'Episode': 'Emily'}, {'Episode': 'Blowback'}, {'Episode': 'The Legend of Dylan McCleen'}, {'Episode': 'Winterland'}, {'Episode': 'The Year of the Rabbit'}, {'Episode': 'Game Three'}, {'Episode': 'Friendly Skies'}, {'Episode': 'A Love of a Lifetime'}]
easy
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id TV_series.Channel = TV_Channel.id
SELECT Episode FROM TV_series ORDER BY rating
{ 'tv_series': ['id', 'episode', 'rating'] }
Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Rating (TEXT), )
Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: TV_series.Channel = TV_Channel.id
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What is the name of each continent and how many car makers are there in each one?
SELECT T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.continent JOIN car_makers AS T3 ON T2.CountryId = T3.Country GROUP BY T1.Continent;
[{'Continent': 'america', 'count(*)': 4}, {'Continent': 'asia', 'count(*)': 7}, {'Continent': 'europe', 'count(*)': 11}]
hard
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT CONTINENTS.Continent , count(*) FROM CONTINENTS JOIN COUNTRIES ON CONTINENTS.ContId = COUNTRIES.continent JOIN car_makers ON COUNTRIES.CountryId = car_makers.Country GROUP BY CONTINENTS.Continent;
{ 'continents': ['contid', 'continent'], 'countries': ['countryid', 'continent'], 'car_makers': ['id', 'country'] }
Table car_makers ( car_makers.Id (INTEGER), car_makers.Country (TEXT), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.Continent (INTEGER), ) Possible JOINs:
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Possible JOINs: car_makers.Country = countries.CountryId countries.Continent = continents.ContId
network_1
CREATE TABLE "Friend" ( student_id INTEGER, friend_id INTEGER, PRIMARY KEY (student_id, friend_id), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID") ) CREATE TABLE "Highschooler" ( "ID" INTEGER, name TEXT, grade INTEGER, PRIMARY KEY ("ID") ) CREATE TABLE "Likes" ( student_id INTEGER, liked_id INTEGER, PRIMARY KEY (student_id, liked_id), FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID") )
CREATE TABLE "Friend" ( student_id INTEGER, friend_id INTEGER, PRIMARY KEY (student_id, friend_id), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID") ) /* 2 rows from Friend table: student_id friend_id 1510 1381 1510 1689 */ CREATE TABLE "Highschooler" ( "ID" INTEGER, name TEXT, grade INTEGER, PRIMARY KEY ("ID") ) /* 2 rows from Highschooler table: ID name grade 1510 Jordan 9 1689 Gabriel 9 */ CREATE TABLE "Likes" ( student_id INTEGER, liked_id INTEGER, PRIMARY KEY (student_id, liked_id), FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"), FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID") ) /* 2 rows from Likes table: student_id liked_id 1689 1709 1709 1689 */
Show all the grades of the high schoolers.
SELECT grade FROM Highschooler
[{'grade': 9}, {'grade': 9}, {'grade': 9}, {'grade': 9}, {'grade': 10}, {'grade': 10}, {'grade': 10}, {'grade': 10}, {'grade': 11}, {'grade': 11}, {'grade': 11}, {'grade': 11}, {'grade': 12}, {'grade': 12}, {'grade': 12}, {'grade': 12}]
easy
Table Friend ( Friend.student_id (INT), Friend.friend_id (INT), ) Table Highschooler ( Highschooler.ID (INT), Highschooler.name (TEXT), Highschooler.grade (INT), ) Table Likes ( Likes.student_id (INT), Likes.liked_id (INT), ) Possible JOINs: Friend.student_id = Highschooler.ID Friend.friend_id = Highschooler.ID Likes.student_id = Highschooler.ID Likes.liked_id = Highschooler.ID
SELECT grade FROM Highschooler
{ 'highschooler': ['id', 'grade'] }
Table Highschooler ( Highschooler.ID (INT), Highschooler.grade (INT), ) Possible JOINs:
Table Highschooler ( Highschooler.ID (INT), Highschooler.name (TEXT), Highschooler.grade (INT), ) Possible JOINs:
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What is the number of makers of care in France?
SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france';
[{'count(*)': 3}]
medium
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT count(*) FROM CAR_MAKERS JOIN COUNTRIES ON CAR_MAKERS.Country = COUNTRIES.CountryId WHERE COUNTRIES.CountryName = 'france';
{ 'car_makers': ['id', 'country'], 'countries': ['countryid', 'countryname'] }
Table car_makers ( car_makers.Id (INTEGER), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), ) Possible JOINs:
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Possible JOINs: car_makers.Country = countries.CountryId countries.Continent = continents.ContId
wta_1
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 0 rows from players table: player_id first_name last_name hand birth_date country_code */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 0 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 0 rows from rankings table: ranking_date ranking player_id ranking_points tours */
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 2 rows from players table: player_id first_name last_name hand birth_date country_code 200001 Martina Hingis R 19800930 SUI 200002 Mirjana Lucic R 19820309 CRO */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 2 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year 3 4 24.626967830300003 R 170 201474 POL Agnieszka Radwanska 4 5890 3 297 82 RR 6-2 6-4 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 3 4 23.6221765914 L 183 201520 CZE Petra Kvitova 6 4370 5 296 72 RR 6-2 6-3 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 2 rows from rankings table: ranking_date ranking player_id ranking_points tours 20000101 3 200748 4378 13 20000101 4 200033 3021 15 */
What are the first names and birth dates of players from the USA?
SELECT first_name , birth_date FROM players WHERE country_code = 'USA'
[{'first_name': 'Jolene', 'birth_date': 19680831}, {'first_name': 'Lisa', 'birth_date': 19730810}, {'first_name': 'Meilen', 'birth_date': 19780117}, {'first_name': 'Serena', 'birth_date': 19810926}, {'first_name': 'Chanda', 'birth_date': 19760218}, {'first_name': 'Amy', 'birth_date': 19720919}, {'first_name': 'Tara', 'birth_date': 19770526}, {'first_name': 'Meghann', 'birth_date': 19790413}, {'first_name': 'Erika', 'birth_date': 19721014}, {'first_name': 'Lilia', 'birth_date': 19780407}, {'first_name': 'Jane', 'birth_date': 19740621}, {'first_name': 'Jennifer', 'birth_date': 19760329}, {'first_name': 'Alexandra', 'birth_date': 19801215}, {'first_name': 'Linda', 'birth_date': 19710211}, {'first_name': 'Brie', 'birth_date': 19800121}, {'first_name': 'Corina', 'birth_date': 19780126}, {'first_name': 'Marissa', 'birth_date': 19800623}, {'first_name': 'Lindsay', 'birth_date': 19760608}, {'first_name': 'Kathleen', 'birth_date': 19461027}, {'first_name': 'Geri', 'birth_date': ''}, {'first_name': 'Rosie', 'birth_date': 19480916}, {'first_name': 'Joan', 'birth_date': ''}, {'first_name': 'Mary Ann', 'birth_date': 19461125}, {'first_name': 'Billie Jean', 'birth_date': 19431122}, {'first_name': 'Patti', 'birth_date': 19491221}, {'first_name': 'Sharon', 'birth_date': 19520224}, {'first_name': 'Mona', 'birth_date': 19481128}, {'first_name': 'Ann', 'birth_date': 19510504}, {'first_name': 'Chris', 'birth_date': 19541221}, {'first_name': 'Janet', 'birth_date': 19530806}, {'first_name': 'Jill', 'birth_date': 19540519}, {'first_name': 'Julie', 'birth_date': 19451208}, {'first_name': 'Ann', 'birth_date': 19550822}, {'first_name': 'Joy', 'birth_date': 19540519}, {'first_name': 'Pam', 'birth_date': 19510417}, {'first_name': 'Peggy', 'birth_date': 19490202}, {'first_name': 'Martina', 'birth_date': 19561018}, {'first_name': 'Laura', 'birth_date': 19490504}, {'first_name': 'Sally', 'birth_date': 19550325}, {'first_name': 'Cecilia', 'birth_date': 19470524}, {'first_name': 'Rene', 'birth_date': 19570512}, {'first_name': 'Beth', 'birth_date': 19570613}, {'first_name': 'Patricia', 'birth_date': 19511125}, {'first_name': 'Kim', 'birth_date': 19561011}, {'first_name': 'Betsy', 'birth_date': 19561023}, {'first_name': 'Barbara', 'birth_date': 19570402}, {'first_name': 'Dianne', 'birth_date': 19580811}, {'first_name': 'Felicia', 'birth_date': 19570720}, {'first_name': 'Lindsay', 'birth_date': 19550124}, {'first_name': 'Lele', 'birth_date': 19560910}, {'first_name': 'Diane', 'birth_date': 19550615}, {'first_name': 'Rosalyn', 'birth_date': 19601102}, {'first_name': 'Marcie', 'birth_date': 19530910}, {'first_name': 'Pam', 'birth_date': 19620704}, {'first_name': 'Barbara', 'birth_date': 19570501}, {'first_name': 'Candy', 'birth_date': 19550324}, {'first_name': 'Bonnie', 'birth_date': 19630911}, {'first_name': 'Barbara', 'birth_date': 19611022}, {'first_name': 'Anne', 'birth_date': 19590701}, {'first_name': 'Paula', 'birth_date': 19570110}, {'first_name': 'Nancy', 'birth_date': 19550522}, {'first_name': 'Andrea', 'birth_date': 19650604}, {'first_name': 'Anne', 'birth_date': 19610928}, {'first_name': 'Leslie', 'birth_date': 19570312}, {'first_name': 'Kathy', 'birth_date': 19591203}, {'first_name': 'Mary Lou', 'birth_date': 19610806}, {'first_name': 'Sherry', 'birth_date': 19590606}, {'first_name': 'Lea', 'birth_date': 19590120}, {'first_name': 'Kim', 'birth_date': 19571222}, {'first_name': 'Tracy', 'birth_date': 19621212}, {'first_name': 'Kate', 'birth_date': 19521025}, {'first_name': 'Wendy', 'birth_date': 19600929}, {'first_name': 'Andrea', 'birth_date': 19640118}, {'first_name': 'Zina', 'birth_date': 19631116}, {'first_name': 'Susan', 'birth_date': 19640628}, {'first_name': 'Camille', 'birth_date': 19660602}, {'first_name': 'Alycia', 'birth_date': 19610218}, {'first_name': 'Jane', 'birth_date': 19531206}, {'first_name': 'Vicki', 'birth_date': 19620925}, {'first_name': 'Heather', 'birth_date': 19610611}, {'first_name': 'Robin', 'birth_date': 19631210}, {'first_name': 'Gigi', 'birth_date': 19640222}, {'first_name': 'Kathy', 'birth_date': 19670324}, {'first_name': 'Anna Maria', 'birth_date': 19601022}, {'first_name': 'Beth', 'birth_date': 19640528}, {'first_name': 'Lori', 'birth_date': 19631218}, {'first_name': 'Laura', 'birth_date': 19630317}, {'first_name': 'Kim', 'birth_date': 19570928}, {'first_name': 'Shelley', 'birth_date': 19630619}, {'first_name': 'Barbara', 'birth_date': 19640703}, {'first_name': 'Michaela', 'birth_date': 19660227}, {'first_name': 'Shawn', 'birth_date': 19671221}, {'first_name': 'Elise', 'birth_date': 19620305}, {'first_name': 'Sandy', 'birth_date': 19581013}, {'first_name': 'Linda', 'birth_date': 19691224}, {'first_name': 'Lisa', 'birth_date': 19620714}, {'first_name': 'Terry', 'birth_date': 19551128}, {'first_name': 'Ann', 'birth_date': 19591031}, {'first_name': 'Lisa', 'birth_date': 19651016}, {'first_name': 'Molly', 'birth_date': 19650312}, {'first_name': 'Hu', 'birth_date': 19630416}, {'first_name': 'Dee Ann', 'birth_date': 19620611}, {'first_name': 'Jamie', 'birth_date': 19620121}, {'first_name': 'Beverly', 'birth_date': 19650909}, {'first_name': 'Louise', 'birth_date': 19620107}, {'first_name': 'Cammy', 'birth_date': 19681011}, {'first_name': 'Susan', 'birth_date': 19590415}, {'first_name': 'Caryn', 'birth_date': 19610314}, {'first_name': 'Tina', 'birth_date': 19521124}, {'first_name': 'Terry', 'birth_date': 19661218}, {'first_name': 'Marianne', 'birth_date': 19671017}, {'first_name': 'Gretchen', 'birth_date': 19640207}, {'first_name': 'Kathrin', 'birth_date': 19621128}, {'first_name': 'Pamela', 'birth_date': 19630703}, {'first_name': 'Lindsay', 'birth_date': 19620731}, {'first_name': 'Jennifer', 'birth_date': 19670702}, {'first_name': 'Jennifer', 'birth_date': 19620426}, {'first_name': 'Carol', 'birth_date': 19621009}, {'first_name': 'Jill', 'birth_date': 19640904}, {'first_name': 'Elizabeth', 'birth_date': 19680826}, {'first_name': 'Pam', 'birth_date': 19631220}, {'first_name': 'Melissa', 'birth_date': 19680411}, {'first_name': 'Cynthia', 'birth_date': 19640326}, {'first_name': 'Amy', 'birth_date': 19690902}, {'first_name': 'Sherri', 'birth_date': 19640202}, {'first_name': 'Stephanie', 'birth_date': 19650206}, {'first_name': 'Patty', 'birth_date': 19650331}, {'first_name': 'Penny', 'birth_date': 19640411}, {'first_name': 'Wendy', 'birth_date': 19640420}, {'first_name': 'Katrina', 'birth_date': 19680805}, {'first_name': 'Leigh Anne', 'birth_date': 19641214}, {'first_name': 'Donna', 'birth_date': 19710705}, {'first_name': 'Jennifer', 'birth_date': 19690226}, {'first_name': 'Andrea', 'birth_date': 19710930}, {'first_name': 'Anna', 'birth_date': 19660117}, {'first_name': 'Kimberly', 'birth_date': 19730327}, {'first_name': 'Laxmi', 'birth_date': 19721109}, {'first_name': 'Kathy', 'birth_date': 19650825}, {'first_name': 'Halle', 'birth_date': 19690805}, {'first_name': 'Ronni', 'birth_date': 19660510}, {'first_name': 'Ann', 'birth_date': 19701013}, {'first_name': 'Mary Joe', 'birth_date': 19710819}, {'first_name': 'Jeri', 'birth_date': 19701211}, {'first_name': 'Carrie', 'birth_date': 19720428}, {'first_name': 'Shaun', 'birth_date': 19681213}, {'first_name': 'Audra', 'birth_date': 19711117}, {'first_name': 'Stacey', 'birth_date': 19701113}, {'first_name': 'Tami', 'birth_date': 19681113}, {'first_name': 'Stacey', 'birth_date': 19680319}, {'first_name': 'Ginger', 'birth_date': 19680914}, {'first_name': 'Monica', 'birth_date': 19731202}, {'first_name': 'Patty', 'birth_date': 19680118}, {'first_name': 'Nicole', 'birth_date': 19690826}, {'first_name': 'Jessica', 'birth_date': 19700913}, {'first_name': 'Kimberly', 'birth_date': 19711020}, {'first_name': 'Stephanie', 'birth_date': 19691105}, {'first_name': 'Debbie', 'birth_date': 19700825}, {'first_name': 'Susan', 'birth_date': 19701205}, {'first_name': 'Caroline', 'birth_date': 19660825}, {'first_name': 'Elly', 'birth_date': 19690825}, {'first_name': 'Meredith', 'birth_date': 19710428}, {'first_name': 'Sandra', 'birth_date': 19740910}, {'first_name': 'Anne', 'birth_date': 19770119}, {'first_name': 'Lindsay', 'birth_date': 19770628}, {'first_name': 'Venus', 'birth_date': 19800617}, {'first_name': 'Samantha', 'birth_date': 19790117}, {'first_name': 'Karin', 'birth_date': 19771210}, {'first_name': 'Jill', 'birth_date': 19740704}, {'first_name': 'Bunny', 'birth_date': 19570905}, {'first_name': 'Rayni', 'birth_date': 19560524}, {'first_name': 'Jennifer', 'birth_date': 19810210}, {'first_name': 'Holly', 'birth_date': 19790210}, {'first_name': 'Nancy', 'birth_date': 19420823}, {'first_name': 'Dorothy', 'birth_date': 19250703}, {'first_name': 'Kristy', 'birth_date': 19500815}, {'first_name': 'Valerie', 'birth_date': 19490629}, {'first_name': 'Linda', 'birth_date': 19501021}, {'first_name': 'Peaches', 'birth_date': 19490416}, {'first_name': 'Tory Ann', 'birth_date': 19420808}, {'first_name': 'Pamela', 'birth_date': 19500312}, {'first_name': 'Denise', 'birth_date': 19500731}, {'first_name': 'Wendy', 'birth_date': 19470331}, {'first_name': 'Becky', 'birth_date': ''}, {'first_name': 'Nancy', 'birth_date': 19520731}, {'first_name': 'Barbara', 'birth_date': 19540304}, {'first_name': 'Kristien', 'birth_date': 19520725}, {'first_name': 'Janet', 'birth_date': 19530628}, {'first_name': 'Daryl', 'birth_date': 19540507}, {'first_name': 'Ching Ling', 'birth_date': 19481008}, {'first_name': 'Robin', 'birth_date': 19580513}, {'first_name': 'Patricia', 'birth_date': 19410811}, {'first_name': 'Laurie', 'birth_date': 19551104}, {'first_name': 'Donna', 'birth_date': 19541109}, {'first_name': 'Linda', 'birth_date': 19521114}, {'first_name': 'Julie', 'birth_date': 19480113}, {'first_name': 'Jeanne', 'birth_date': 19571005}, {'first_name': 'Laurie', 'birth_date': 19550614}, {'first_name': 'Kathy', 'birth_date': 19560618}, {'first_name': 'Janice', 'birth_date': 19520710}, {'first_name': 'Kathy', 'birth_date': 19561123}, {'first_name': 'Jane', 'birth_date': 19530810}, {'first_name': 'Marita', 'birth_date': 19560219}, {'first_name': 'Susie', 'birth_date': 19570916}, {'first_name': 'Mary', 'birth_date': 19500721}, {'first_name': 'Mary', 'birth_date': 19540907}, {'first_name': 'Mary', 'birth_date': 19570312}, {'first_name': 'Carrie', 'birth_date': 19550822}, {'first_name': 'Ruta', 'birth_date': 19551118}, {'first_name': 'Mareen', 'birth_date': 19600815}, {'first_name': 'Robin', 'birth_date': 19560413}, {'first_name': 'Caroline', 'birth_date': 19601104}, {'first_name': 'Emilse', 'birth_date': 19571219}, {'first_name': 'Kay', 'birth_date': 19570925}, {'first_name': 'Zenda', 'birth_date': 19591212}, {'first_name': 'Betty Ann', 'birth_date': 19500226}, {'first_name': 'Jeanne', 'birth_date': 19591207}, {'first_name': 'Linda', 'birth_date': 19610605}, {'first_name': 'Julie', 'birth_date': 19620205}, {'first_name': 'Stacy', 'birth_date': 19590405}, {'first_name': 'Dana', 'birth_date': 19591126}, {'first_name': 'Roberta', 'birth_date': 19581103}, {'first_name': 'Joyce', 'birth_date': 19580503}, {'first_name': 'Andrea', 'birth_date': 19550406}, {'first_name': 'Trey', 'birth_date': 19591127}, {'first_name': 'Jenny', 'birth_date': 19650419}, {'first_name': 'Leigh Anne', 'birth_date': 19640108}, {'first_name': 'Joanne', 'birth_date': 19541030}, {'first_name': 'Michelle', 'birth_date': 19670627}, {'first_name': 'Nancy', 'birth_date': 19580418}, {'first_name': 'Felicia', 'birth_date': 19611231}, {'first_name': 'Jean', 'birth_date': 19581025}, {'first_name': 'Barbi', 'birth_date': 19640914}, {'first_name': 'Amy', 'birth_date': 19650405}, {'first_name': 'Jill', 'birth_date': 19600623}, {'first_name': 'Ginny', 'birth_date': 19661115}, {'first_name': 'Grace', 'birth_date': 19680416}, {'first_name': 'Melissa', 'birth_date': 19690624}, {'first_name': 'Debbie', 'birth_date': 19670809}, {'first_name': 'Eileen', 'birth_date': 19661201}, {'first_name': 'Maeve', 'birth_date': 19641116}, {'first_name': 'Kathleen', 'birth_date': 19610905}, {'first_name': 'Niurka', 'birth_date': 19690419}, {'first_name': 'Cecilia', 'birth_date': 19630628}, {'first_name': 'Kristin', 'birth_date': 19590827}, {'first_name': 'Kate', 'birth_date': 19630111}, {'first_name': 'Liezel', 'birth_date': 19760821}, {'first_name': 'Mashona', 'birth_date': 19760531}, {'first_name': 'Stephanie', 'birth_date': 19460308}, {'first_name': 'Marilyn', 'birth_date': 19480308}, {'first_name': 'Mimi', 'birth_date': ''}, {'first_name': 'Alice', 'birth_date': 19421122}, {'first_name': 'Pixie', 'birth_date': ''}, {'first_name': 'Betty', 'birth_date': 19250415}, {'first_name': 'Nadine', 'birth_date': 19441026}, {'first_name': 'Victoria', 'birth_date': ''}, {'first_name': 'Stephanie', 'birth_date': 19500703}, {'first_name': 'Carole', 'birth_date': 19430624}, {'first_name': 'Gail', 'birth_date': 19510421}, {'first_name': 'Patricia', 'birth_date': 19400101}, {'first_name': 'Eliza', 'birth_date': 19530102}, {'first_name': 'Patricia', 'birth_date': 19450828}, {'first_name': 'Sandy', 'birth_date': 19560501}, {'first_name': 'Tam', 'birth_date': 19520127}, {'first_name': 'Wendy', 'birth_date': 19520430}, {'first_name': 'Kathy', 'birth_date': 19461218}, {'first_name': 'Lisa', 'birth_date': ''}, {'first_name': 'Judy', 'birth_date': 19490816}, {'first_name': 'Roberta', 'birth_date': 19560702}, {'first_name': 'Mary', 'birth_date': 19450925}, {'first_name': 'Aleida', 'birth_date': 19550616}, {'first_name': 'Erin', 'birth_date': 19550720}, {'first_name': 'Stephanie', 'birth_date': 19560325}, {'first_name': 'Karen', 'birth_date': 19421211}, {'first_name': 'Sheila', 'birth_date': 19580222}, {'first_name': 'Susie', 'birth_date': 19620329}, {'first_name': 'Micki', 'birth_date': 19601129}, {'first_name': 'Heather', 'birth_date': 19610712}, {'first_name': 'Jane', 'birth_date': 19620121}, {'first_name': 'Diane', 'birth_date': 19611105}, {'first_name': 'Shawna', 'birth_date': ''}, {'first_name': 'Tammy', 'birth_date': 19651012}, {'first_name': 'Tracy', 'birth_date': 19791006}, {'first_name': 'Allison', 'birth_date': 19801114}, {'first_name': 'Ansley', 'birth_date': 19820105}, {'first_name': 'Dawn', 'birth_date': 19760529}, {'first_name': 'Kristen', 'birth_date': 19840628}, {'first_name': 'Vija', 'birth_date': ''}, {'first_name': 'Farel', 'birth_date': ''}, {'first_name': 'Connie', 'birth_date': 19510521}, {'first_name': 'Marjorie', 'birth_date': 19510503}, {'first_name': 'Peggy', 'birth_date': ''}, {'first_name': 'Tish', 'birth_date': ''}, {'first_name': 'Jade', 'birth_date': ''}, {'first_name': 'Carole', 'birth_date': ''}, {'first_name': 'Emilie', 'birth_date': ''}, {'first_name': 'Diane', 'birth_date': ''}, {'first_name': 'Mary', 'birth_date': ''}, {'first_name': 'Ann', 'birth_date': ''}, {'first_name': 'Tina', 'birth_date': ''}, {'first_name': 'Maricaye', 'birth_date': ''}, {'first_name': 'Roylee', 'birth_date': 19490526}, {'first_name': 'Nancy', 'birth_date': 19330421}, {'first_name': 'Louise', 'birth_date': 19470321}, {'first_name': 'Mimi', 'birth_date': 19390818}, {'first_name': 'Raymonde', 'birth_date': ''}, {'first_name': 'Carol', 'birth_date': ''}, {'first_name': 'Joyce', 'birth_date': 19420223}, {'first_name': 'Pat', 'birth_date': 19340819}, {'first_name': 'Jane', 'birth_date': 19510220}, {'first_name': 'Darlene', 'birth_date': 19360106}, {'first_name': 'Pam', 'birth_date': 19501025}, {'first_name': 'Carol', 'birth_date': ''}, {'first_name': 'Emilie', 'birth_date': ''}, {'first_name': 'Margaret', 'birth_date': 19500413}, {'first_name': 'Pam', 'birth_date': ''}, {'first_name': 'Susan', 'birth_date': 19531113}, {'first_name': 'Shari', 'birth_date': ''}, {'first_name': 'Sue', 'birth_date': 19540603}, {'first_name': 'Jeanne', 'birth_date': 19350721}, {'first_name': 'Kathy', 'birth_date': 19521219}, {'first_name': 'Gertrude', 'birth_date': 19230908}, {'first_name': 'Judy', 'birth_date': 19430402}, {'first_name': 'Brenda', 'birth_date': 19540211}, {'first_name': 'Patricia', 'birth_date': 19580516}, {'first_name': 'Marcy', 'birth_date': ''}, {'first_name': 'Sally', 'birth_date': ''}, {'first_name': 'Lynne', 'birth_date': 19580328}, {'first_name': 'Margaret', 'birth_date': 19530105}, {'first_name': 'Renee', 'birth_date': 19340819}, {'first_name': 'Carol', 'birth_date': 19501022}, {'first_name': 'Chris', 'birth_date': 19561026}, {'first_name': 'Kelly', 'birth_date': 19620418}, {'first_name': 'Lisa', 'birth_date': 19590305}, {'first_name': 'Lucy', 'birth_date': ''}, {'first_name': 'Jody', 'birth_date': 19560704}, {'first_name': 'Phyllis', 'birth_date': 19570326}, {'first_name': 'Linda', 'birth_date': 19631106}, {'first_name': 'Karen', 'birth_date': 19640323}, {'first_name': 'Eleni', 'birth_date': 19671023}, {'first_name': 'Lisa', 'birth_date': 19680718}, {'first_name': 'Sandra', 'birth_date': 19690903}, {'first_name': 'Shannan', 'birth_date': 19700519}, {'first_name': 'Julie', 'birth_date': 19760424}, {'first_name': 'Nicole', 'birth_date': 19760203}, {'first_name': 'Angela', 'birth_date': 19720404}, {'first_name': 'Keri', 'birth_date': 19740501}, {'first_name': 'Jacqueline', 'birth_date': 19801126}, {'first_name': 'Laura', 'birth_date': 19810512}, {'first_name': 'Jean', 'birth_date': 19740607}, {'first_name': 'Melissa', 'birth_date': 19820606}, {'first_name': 'Amber', 'birth_date': 19840706}, {'first_name': 'Sarah', 'birth_date': 19811106}, {'first_name': 'Ashley', 'birth_date': 19850502}, {'first_name': 'Bethanie', 'birth_date': 19850323}, {'first_name': 'Allison', 'birth_date': 19860410}, {'first_name': 'Bea', 'birth_date': 19801128}, {'first_name': 'Alexandra', 'birth_date': 19850902}, {'first_name': 'Carly', 'birth_date': 19861126}, {'first_name': 'Theresa', 'birth_date': 19850310}, {'first_name': 'Gabriela', 'birth_date': 19800607}, {'first_name': 'Shenay', 'birth_date': 19840706}, {'first_name': 'Angela', 'birth_date': 19840927}, {'first_name': 'Kelly', 'birth_date': 19830318}, {'first_name': 'Teryn', 'birth_date': 19781212}, {'first_name': 'Abigail', 'birth_date': 19810712}, {'first_name': 'Jessica', 'birth_date': 19871110}, {'first_name': 'Jamea', 'birth_date': 19860907}, {'first_name': 'Mary', 'birth_date': 19881218}, {'first_name': 'Tiffany', 'birth_date': 19800314}, {'first_name': 'Alexa', 'birth_date': 19890910}, {'first_name': 'Vania', 'birth_date': 19890303}, {'first_name': 'Ahsha', 'birth_date': 19850321}, {'first_name': 'Lauren', 'birth_date': 19891001}, {'first_name': 'Varvara', 'birth_date': 19860521}, {'first_name': 'Madison', 'birth_date': 19900403}, {'first_name': 'Audra', 'birth_date': 19860421}, {'first_name': 'Ashley', 'birth_date': 19890620}, {'first_name': 'Julie', 'birth_date': 19790104}, {'first_name': 'Melanie', 'birth_date': 19910923}, {'first_name': 'Kristie', 'birth_date': 19920615}, {'first_name': 'Gail', 'birth_date': 19910605}, {'first_name': 'Asia', 'birth_date': 19910404}, {'first_name': 'Coco', 'birth_date': 19911206}, {'first_name': 'Christina', 'birth_date': 19920511}, {'first_name': 'Mallory', 'birth_date': 19900718}, {'first_name': 'Lauren', 'birth_date': 19910110}, {'first_name': 'Hilary', 'birth_date': 19881117}, {'first_name': 'Sloane', 'birth_date': 19930320}, {'first_name': 'Alison', 'birth_date': 19900703}, {'first_name': 'Jamie', 'birth_date': 19900108}, {'first_name': 'Chelsey', 'birth_date': 19900829}, {'first_name': 'Beatrice', 'birth_date': 19920406}, {'first_name': 'Shelby', 'birth_date': 19921013}, {'first_name': 'Irina', 'birth_date': 19900504}, {'first_name': 'Lauren', 'birth_date': 19931009}, {'first_name': 'Madison', 'birth_date': 19950217}, {'first_name': 'Nicole', 'birth_date': 19740801}, {'first_name': 'Michelle', 'birth_date': 19731228}, {'first_name': 'Akiko', 'birth_date': 19720214}, {'first_name': 'Joy', 'birth_date': 19621006}, {'first_name': 'Caryn', 'birth_date': 19711005}, {'first_name': 'Luanne', 'birth_date': 19721228}, {'first_name': 'Julie', 'birth_date': 19720510}, {'first_name': 'Rachel Ann', 'birth_date': 19721119}, {'first_name': 'Judy', 'birth_date': 19620511}, {'first_name': 'Noelle', 'birth_date': 19701218}, {'first_name': 'Alysia', 'birth_date': 19710131}, {'first_name': 'Laura', 'birth_date': 19670517}, {'first_name': 'Amanda', 'birth_date': 19780620}, {'first_name': 'Julie', 'birth_date': 19721007}, {'first_name': 'Ann', 'birth_date': 19670822}, {'first_name': 'Melissa', 'birth_date': 19720621}, {'first_name': 'Jan', 'birth_date': 19531223}, {'first_name': 'Mary', 'birth_date': 19620121}, {'first_name': 'Sylvia', 'birth_date': 19640127}, {'first_name': 'Gail', 'birth_date': 19470116}, {'first_name': 'Diedre', 'birth_date': 19711011}, {'first_name': 'Caroline', 'birth_date': 19651129}, {'first_name': 'Kerry', 'birth_date': 19501002}, {'first_name': 'Kathy', 'birth_date': 19670904}, {'first_name': 'Stella', 'birth_date': 19690309}, {'first_name': 'Karen', 'birth_date': 19680705}, {'first_name': 'Cynthia', 'birth_date': 19580614}, {'first_name': 'Marlie', 'birth_date': 19501120}, {'first_name': 'Rona', 'birth_date': 19690708}, {'first_name': 'Kylie', 'birth_date': 19610519}, {'first_name': 'Helena', 'birth_date': 19610201}, {'first_name': 'Cheryl', 'birth_date': 19640503}, {'first_name': 'Jennifer', 'birth_date': 19690715}, {'first_name': 'Elizabeth', 'birth_date': 19660406}, {'first_name': 'Anne', 'birth_date': 19660205}, {'first_name': 'Alix', 'birth_date': 19721022}, {'first_name': 'Erica', 'birth_date': 19690716}, {'first_name': 'Stephanie', 'birth_date': 19700424}, {'first_name': 'Jill', 'birth_date': 19671011}, {'first_name': 'Jane', 'birth_date': 19630123}, {'first_name': 'Kathy', 'birth_date': ''}, {'first_name': 'Jean', 'birth_date': 19700510}, {'first_name': 'Ann', 'birth_date': 19651028}, {'first_name': 'Kirsten', 'birth_date': 19690327}, {'first_name': 'Wendy', 'birth_date': 19600327}, {'first_name': 'Nicole', 'birth_date': 19610906}, {'first_name': 'Vicki', 'birth_date': 19570325}, {'first_name': 'Mary Ann', 'birth_date': 19560424}, {'first_name': 'Christine', 'birth_date': 19680118}, {'first_name': 'Jennifer', 'birth_date': 19600326}, {'first_name': 'Julie', 'birth_date': 19570621}, {'first_name': 'Penny', 'birth_date': 19550826}, {'first_name': 'Cathy', 'birth_date': 19580310}, {'first_name': 'June', 'birth_date': 19630619}, {'first_name': 'Pam', 'birth_date': 19750701}, {'first_name': 'Stephanie', 'birth_date': 19791023}, {'first_name': 'Jane', 'birth_date': ''}, {'first_name': 'Gretchen', 'birth_date': 19650626}, {'first_name': 'Jane', 'birth_date': 19660324}, {'first_name': 'Holyn', 'birth_date': 19731012}, {'first_name': 'Kristi', 'birth_date': 19690910}, {'first_name': 'Linley', 'birth_date': 19620501}, {'first_name': 'Shelby', 'birth_date': 19500626}, {'first_name': 'Andrea', 'birth_date': 19700128}, {'first_name': 'Kathy', 'birth_date': 19591224}, {'first_name': 'Danielle', 'birth_date': 19700322}, {'first_name': 'Carol', 'birth_date': 19610705}, {'first_name': 'Jean', 'birth_date': 19550606}, {'first_name': 'Lori', 'birth_date': 19650330}, {'first_name': 'Edie', 'birth_date': ''}, {'first_name': 'Robin', 'birth_date': ''}, {'first_name': 'Kerri', 'birth_date': 19681001}, {'first_name': 'Lisa', 'birth_date': 19700324}, {'first_name': 'Mary', 'birth_date': 19660508}, {'first_name': 'Carol', 'birth_date': 19591113}, {'first_name': 'Katie', 'birth_date': 19750429}, {'first_name': 'Michele', 'birth_date': 19660606}, {'first_name': 'Shannon', 'birth_date': 19670527}, {'first_name': 'Gina', 'birth_date': 19490515}, {'first_name': 'Clare', 'birth_date': ''}, {'first_name': 'Cathleen', 'birth_date': 19570316}, {'first_name': 'Janice', 'birth_date': 19510522}, {'first_name': 'Betsy', 'birth_date': 19540503}, {'first_name': 'Lucia', 'birth_date': 19601022}, {'first_name': 'Wendy', 'birth_date': 19680715}, {'first_name': 'Allyson', 'birth_date': 19631007}, {'first_name': 'Debbie', 'birth_date': 19620722}, {'first_name': 'Marsha', 'birth_date': ''}, {'first_name': 'Linda', 'birth_date': 19690503}, {'first_name': 'Page', 'birth_date': 19740622}, {'first_name': 'Heather', 'birth_date': 19711011}, {'first_name': 'Gigi', 'birth_date': 19701007}, {'first_name': 'Marilda', 'birth_date': 19650222}, {'first_name': 'Christine', 'birth_date': 19720714}, {'first_name': 'Cynthia Ann', 'birth_date': 19521114}, {'first_name': 'Jenny', 'birth_date': 19710226}, {'first_name': 'Shelley', 'birth_date': 19650421}, {'first_name': 'Jackie', 'birth_date': 19640104}, {'first_name': 'Stephanie', 'birth_date': ''}, {'first_name': 'Michelle', 'birth_date': 19610116}, {'first_name': 'Genevieve', 'birth_date': 19630819}, {'first_name': 'Glynis', 'birth_date': ''}, {'first_name': 'Ann', 'birth_date': 19520526}, {'first_name': 'Allegra', 'birth_date': ''}, {'first_name': 'Cricket', 'birth_date': 19610507}, {'first_name': 'Bunny', 'birth_date': 19460729}, {'first_name': 'Holly Ann', 'birth_date': 19701218}, {'first_name': 'Amy', 'birth_date': 19721112}, {'first_name': 'Kathy', 'birth_date': 19631005}, {'first_name': 'Monique', 'birth_date': 19841006}, {'first_name': 'Erica', 'birth_date': 19721128}, {'first_name': 'Susan', 'birth_date': 19651125}, {'first_name': 'Rita', 'birth_date': 19601018}, {'first_name': 'Nina', 'birth_date': 19610207}, {'first_name': 'Donna', 'birth_date': 19591005}, {'first_name': 'Cissie', 'birth_date': 19600108}, {'first_name': 'Nancy', 'birth_date': 19640804}, {'first_name': 'Erika', 'birth_date': 19631007}, {'first_name': 'Cristina', 'birth_date': 19770210}, {'first_name': 'Terri', 'birth_date': 19680118}, {'first_name': 'Patty', 'birth_date': 19730928}, {'first_name': 'Katrina', 'birth_date': 19681104}, {'first_name': 'Katrina', 'birth_date': 19800530}, {'first_name': 'Anne', 'birth_date': 19810420}, {'first_name': 'Cory Ann', 'birth_date': 19850122}, {'first_name': 'Nicole', 'birth_date': 19861103}, {'first_name': 'Diana', 'birth_date': 19790704}, {'first_name': 'Tanner', 'birth_date': 19840803}, {'first_name': 'Shadisha', 'birth_date': 19850712}, {'first_name': 'Leslie', 'birth_date': 19870525}, {'first_name': 'Neha', 'birth_date': 19860206}, {'first_name': 'Megan', 'birth_date': 19850719}, {'first_name': 'Elizabeth', 'birth_date': 19880603}, {'first_name': 'Jewel', 'birth_date': 19810910}, {'first_name': 'Lindsey', 'birth_date': 19851118}, {'first_name': 'Raquel', 'birth_date': 19821208}, {'first_name': 'Brittany', 'birth_date': 19910919}, {'first_name': 'Kirsten', 'birth_date': 19880814}, {'first_name': 'Chieh Yu', 'birth_date': 19920114}, {'first_name': 'Alexis', 'birth_date': 19830331}, {'first_name': 'Amanda', 'birth_date': 19861204}, {'first_name': 'Catherine', 'birth_date': 19940409}, {'first_name': 'Tetiana', 'birth_date': 19840904}, {'first_name': 'Julia', 'birth_date': 19910909}, {'first_name': 'Alexandra', 'birth_date': 19880214}, {'first_name': 'Zoe Gwen', 'birth_date': 19930921}, {'first_name': 'Julia', 'birth_date': 19890323}, {'first_name': 'Jessica', 'birth_date': 19940224}, {'first_name': 'Grace', 'birth_date': 19940506}, {'first_name': 'Chi Chi', 'birth_date': 19920705}, {'first_name': 'Nicole', 'birth_date': 19930303}, {'first_name': 'Mallory', 'birth_date': 19910128}, {'first_name': 'Jennifer', 'birth_date': 19860922}, {'first_name': 'Samantha', 'birth_date': 19950218}, {'first_name': 'Victoria', 'birth_date': 19951130}, {'first_name': 'Maria', 'birth_date': 19891126}, {'first_name': 'Anne', 'birth_date': 19850828}, {'first_name': 'Megan', 'birth_date': 19850311}, {'first_name': 'Lena', 'birth_date': 19881115}, {'first_name': 'Katie', 'birth_date': 19830503}, {'first_name': 'Courtney B', 'birth_date': 19920325}, {'first_name': 'Kimberly', 'birth_date': 19890509}, {'first_name': 'Jacqueline', 'birth_date': 19910830}, {'first_name': 'Ester', 'birth_date': 19930704}, {'first_name': 'Eleanor', 'birth_date': 19880626}, {'first_name': 'Yasmin', 'birth_date': 19880504}, {'first_name': 'Anne Liz', 'birth_date': 19960526}, {'first_name': 'Alessondra', 'birth_date': 19900906}, {'first_name': 'Ryann', 'birth_date': 19960723}, {'first_name': 'Lucie', 'birth_date': 19720406}, {'first_name': 'Kelly S', 'birth_date': 19730905}, {'first_name': 'Kristina', 'birth_date': 19790811}, {'first_name': 'Wendy', 'birth_date': 19750131}, {'first_name': 'Julie', 'birth_date': 19751016}, {'first_name': 'Aurandrea', 'birth_date': 19791121}, {'first_name': 'Brandis', 'birth_date': 19800213}, {'first_name': 'Megan', 'birth_date': 19781224}, {'first_name': 'Alyssa', 'birth_date': 19821119}, {'first_name': 'Jennifer', 'birth_date': 19780807}, {'first_name': 'Jennifer', 'birth_date': 19840217}, {'first_name': 'Candice', 'birth_date': 19820331}, {'first_name': 'Michelle', 'birth_date': 19780119}, {'first_name': 'Kristy', 'birth_date': 19790517}, {'first_name': 'Andrea', 'birth_date': 19881006}, {'first_name': 'Lauren', 'birth_date': 19800829}, {'first_name': 'Iris', 'birth_date': 19850613}, {'first_name': 'Jennifer', 'birth_date': 19810718}, {'first_name': 'Ali', 'birth_date': 19870923}, {'first_name': 'Nicole', 'birth_date': 19851124}, {'first_name': 'Kaysie', 'birth_date': 19800411}, {'first_name': 'Krystina', 'birth_date': 19880510}, {'first_name': 'Riza', 'birth_date': 19860210}, {'first_name': 'Sarah', 'birth_date': 19810627}, {'first_name': 'Megan', 'birth_date': 19830326}, {'first_name': 'Story', 'birth_date': 19830502}, {'first_name': 'Christina', 'birth_date': 19801127}, {'first_name': 'Stacia', 'birth_date': 19850921}, {'first_name': 'Kaitlyn', 'birth_date': 19920113}, {'first_name': 'Chloe', 'birth_date': 19900201}, {'first_name': 'Amanda', 'birth_date': 19870902}, {'first_name': 'Kelcy', 'birth_date': 19890411}, {'first_name': 'June', 'birth_date': 19950619}, {'first_name': 'Krista', 'birth_date': 19940914}, {'first_name': 'Adria', 'birth_date': 19791221}, {'first_name': 'Susie', 'birth_date': 19721210}, {'first_name': 'Kori', 'birth_date': 19731101}, {'first_name': 'Elizabeth', 'birth_date': 19770823}, {'first_name': 'Agnes', 'birth_date': 19800801}, {'first_name': 'Courtenay', 'birth_date': 19770227}, {'first_name': 'Dee Dee', 'birth_date': 19790211}, {'first_name': 'Aurora', 'birth_date': 19741107}, {'first_name': 'Keirsten', 'birth_date': 19730917}, {'first_name': 'Ingrid', 'birth_date': 19730602}, {'first_name': 'Stephanie', 'birth_date': 19761207}, {'first_name': 'Sara', 'birth_date': 19770113}, {'first_name': 'Lori', 'birth_date': 19810731}, {'first_name': 'Milangela', 'birth_date': 19811209}, {'first_name': 'Brooke', 'birth_date': 19790101}, {'first_name': 'Lauren', 'birth_date': 19820521}, {'first_name': 'Amanda', 'birth_date': 19780119}, {'first_name': 'Kelley', 'birth_date': 19850922}, {'first_name': 'Meredith', 'birth_date': 19720604}, {'first_name': 'Jackie', 'birth_date': 19840111}, {'first_name': 'Megan', 'birth_date': 19780427}, {'first_name': 'Amanda', 'birth_date': 19811126}, {'first_name': 'Cammy', 'birth_date': 19701225}, {'first_name': 'Ditta', 'birth_date': 19751226}, {'first_name': 'Jennifer', 'birth_date': 19731228}, {'first_name': 'Krissy', 'birth_date': 19791211}, {'first_name': 'Annica', 'birth_date': 19780902}, {'first_name': 'Tory', 'birth_date': 19850618}, {'first_name': 'Whitney', 'birth_date': 19860123}, {'first_name': 'Sarah', 'birth_date': 19801121}, {'first_name': 'Jessyca', 'birth_date': 19800826}, {'first_name': 'Beau', 'birth_date': 19800626}, {'first_name': 'Katrina', 'birth_date': 19880707}, {'first_name': 'Stephanie', 'birth_date': 19790129}, {'first_name': 'Jennifer', 'birth_date': 19881123}, {'first_name': 'Jessica', 'birth_date': 19871124}, {'first_name': 'Sarah', 'birth_date': 19880209}, {'first_name': 'Kim Anh', 'birth_date': 19831004}, {'first_name': 'Ellah', 'birth_date': 19881122}, {'first_name': 'Lauren', 'birth_date': 19820914}, {'first_name': 'Link', 'birth_date': 19861125}, {'first_name': 'Aleke', 'birth_date': 19820427}, {'first_name': 'Kendra', 'birth_date': 19831118}, {'first_name': 'Arpi', 'birth_date': 19830612}, {'first_name': 'Erin', 'birth_date': 19900328}, {'first_name': 'Tiffany', 'birth_date': 19820909}, {'first_name': 'Robin', 'birth_date': 19830621}, {'first_name': 'Kristi', 'birth_date': 19851222}, {'first_name': 'Jennifer Lee', 'birth_date': 19870227}, {'first_name': 'Veronica Ruo Qi', 'birth_date': 19891110}, {'first_name': 'Danielle', 'birth_date': 19910328}, {'first_name': 'Shilpa', 'birth_date': 19840412}, {'first_name': 'Elizabeth', 'birth_date': 19880526}, {'first_name': 'Megan', 'birth_date': 19870701}, {'first_name': 'Melissa', 'birth_date': 19880408}, {'first_name': 'Lauren', 'birth_date': 19890522}, {'first_name': 'Alana', 'birth_date': 19851031}, {'first_name': 'Riley', 'birth_date': 19901114}, {'first_name': 'Kristen', 'birth_date': 19880323}, {'first_name': 'Mami', 'birth_date': 19790715}, {'first_name': 'Kit', 'birth_date': 19810726}, {'first_name': 'Stacey', 'birth_date': 19910718}, {'first_name': 'Elizabeth', 'birth_date': 19810315}, {'first_name': 'Nina', 'birth_date': 19890707}, {'first_name': 'Nadja', 'birth_date': 19900607}, {'first_name': 'Erica', 'birth_date': 19901127}, {'first_name': 'Jenna', 'birth_date': 19851126}, {'first_name': 'Tiya', 'birth_date': 19860611}, {'first_name': 'Natalie', 'birth_date': 19850322}, {'first_name': 'Courtney', 'birth_date': 19820929}, {'first_name': 'Kristy', 'birth_date': 19900108}, {'first_name': 'Susanna', 'birth_date': 19831103}, {'first_name': 'Alexa', 'birth_date': 19901117}, {'first_name': 'Aeriel', 'birth_date': 19900928}, {'first_name': 'Maureen', 'birth_date': 19820528}, {'first_name': 'Allie', 'birth_date': 19910420}, {'first_name': 'Sanaz', 'birth_date': 19880621}, {'first_name': 'Lauren', 'birth_date': 19760912}, {'first_name': 'Alexis', 'birth_date': 19840927}, {'first_name': 'Libby', 'birth_date': 19940124}, {'first_name': 'Lauren', 'birth_date': 19930723}, {'first_name': 'Michaela', 'birth_date': 19880722}, {'first_name': 'Tori', 'birth_date': 19871124}, {'first_name': 'Gabrielle', 'birth_date': 19930227}, {'first_name': 'Danielle Rose', 'birth_date': 19931213}, {'first_name': 'Tarakaa', 'birth_date': 19860811}, {'first_name': 'Danielle', 'birth_date': 19910528}, {'first_name': 'Ellen', 'birth_date': 19931008}, {'first_name': 'Brooke', 'birth_date': 19920408}, {'first_name': 'Mccall', 'birth_date': 19900315}, {'first_name': 'Macall', 'birth_date': 19860205}, {'first_name': 'Megan', 'birth_date': 19880705}, {'first_name': 'Nicole', 'birth_date': 19930729}, {'first_name': 'Alexandra', 'birth_date': 19911130}, {'first_name': 'Elizabeth', 'birth_date': 19860524}, {'first_name': 'Jade', 'birth_date': 19921028}, {'first_name': 'Brie', 'birth_date': 19890507}, {'first_name': 'Jan', 'birth_date': 19950301}, {'first_name': 'Simone', 'birth_date': 19891230}, {'first_name': 'Elizabeth', 'birth_date': 19860731}, {'first_name': 'Gabrielle Faith', 'birth_date': 19961223}, {'first_name': 'Sachia', 'birth_date': 19950511}, {'first_name': 'Taylor', 'birth_date': 19960416}, {'first_name': 'Lindsey', 'birth_date': 19900104}, {'first_name': 'Alexandra', 'birth_date': 19950630}, {'first_name': 'Alexandra', 'birth_date': 19910213}, {'first_name': 'Robin', 'birth_date': 19930412}, {'first_name': 'Brianna', 'birth_date': 19940219}, {'first_name': 'Olivia', 'birth_date': 19960122}, {'first_name': 'Whitney', 'birth_date': 19860811}, {'first_name': 'Emily J', 'birth_date': 19910615}, {'first_name': 'Caroline B', 'birth_date': 19941031}, {'first_name': 'Chalena', 'birth_date': 19950818}, {'first_name': 'Elizabeth Anita Alexandria', 'birth_date': 19960806}, {'first_name': 'Breanna Alexa Bachini', 'birth_date': 19930521}, {'first_name': 'Mary', 'birth_date': 19950817}, {'first_name': 'Betsy', 'birth_date': 19600427}, {'first_name': 'Eve', 'birth_date': 19621028}, {'first_name': 'Janet', 'birth_date': 19670405}, {'first_name': 'Jaime', 'birth_date': 19611001}, {'first_name': 'Angel', 'birth_date': 19610830}, {'first_name': 'Donna', 'birth_date': 19550626}, {'first_name': 'Valerie', 'birth_date': 19540813}, {'first_name': 'Lucinda', 'birth_date': 19520717}, {'first_name': 'J', 'birth_date': ''}, {'first_name': 'J', 'birth_date': ''}, {'first_name': 'D', 'birth_date': ''}, {'first_name': 'K', 'birth_date': ''}, {'first_name': 'B', 'birth_date': ''}, {'first_name': 'J', 'birth_date': ''}, {'first_name': 'R', 'birth_date': ''}, {'first_name': 'N', 'birth_date': ''}, {'first_name': 'E', 'birth_date': ''}, {'first_name': 'F', 'birth_date': ''}, {'first_name': 'Caroline', 'birth_date': 19560622}, {'first_name': 'D', 'birth_date': ''}, {'first_name': 'Wendy', 'birth_date': ''}, {'first_name': 'Nancy', 'birth_date': 19530830}, {'first_name': 'Susan', 'birth_date': 19570107}, {'first_name': 'Gretchen', 'birth_date': 19560201}, {'first_name': 'Anne', 'birth_date': ''}, {'first_name': 'Holly', 'birth_date': 19690811}, {'first_name': 'Margaret', 'birth_date': 19601012}, {'first_name': 'Clare', 'birth_date': 19671008}, {'first_name': 'Kathy', 'birth_date': 19641104}, {'first_name': 'Rita', 'birth_date': 19660512}, {'first_name': 'Marlene', 'birth_date': 19810731}, {'first_name': 'Linda', 'birth_date': 19570701}, {'first_name': 'Beverly', 'birth_date': 19530124}, {'first_name': 'Ann', 'birth_date': 19551013}, {'first_name': 'Robin', 'birth_date': 19540923}, {'first_name': 'A', 'birth_date': ''}, {'first_name': 'Maria', 'birth_date': ''}, {'first_name': 'Karen', 'birth_date': ''}, {'first_name': 'Karen', 'birth_date': ''}, {'first_name': 'Jenny', 'birth_date': ''}, {'first_name': 'Lisa', 'birth_date': ''}, {'first_name': 'Kathy', 'birth_date': ''}, {'first_name': 'Maria', 'birth_date': 19600424}, {'first_name': 'Judith', 'birth_date': ''}, {'first_name': 'Becky', 'birth_date': ''}, {'first_name': 'Connie', 'birth_date': ''}, {'first_name': 'Lori', 'birth_date': ''}, {'first_name': 'Joni', 'birth_date': 19651125}, {'first_name': 'Lisa', 'birth_date': ''}, {'first_name': 'Suzanne', 'birth_date': ''}, {'first_name': 'Shandra', 'birth_date': 19680519}, {'first_name': 'Merrilee', 'birth_date': ''}, {'first_name': 'Jennifer', 'birth_date': 19660615}, {'first_name': 'Chris', 'birth_date': ''}, {'first_name': 'Trisha', 'birth_date': 19690203}, {'first_name': 'Stephanie', 'birth_date': 19690818}, {'first_name': 'Sonya', 'birth_date': 19670825}, {'first_name': 'Susan', 'birth_date': 19710412}, {'first_name': 'Tanya', 'birth_date': 19690302}, {'first_name': 'Tonya', 'birth_date': 19690821}, {'first_name': 'Kara', 'birth_date': 19730105}, {'first_name': 'Melissa', 'birth_date': 19740402}, {'first_name': 'Victoria', 'birth_date': 19761230}, {'first_name': 'Trina', 'birth_date': 19821230}, {'first_name': 'Kristine', 'birth_date': 19720623}, {'first_name': 'Martha', 'birth_date': 19691215}, {'first_name': 'Candice', 'birth_date': 19800207}, {'first_name': 'Cindy', 'birth_date': 19790422}, {'first_name': 'Elizabeth', 'birth_date': 19740824}, {'first_name': 'Valerie', 'birth_date': 19731228}, {'first_name': 'Tracey', 'birth_date': 19710129}, {'first_name': 'Diana', 'birth_date': 19680410}, {'first_name': 'Alice', 'birth_date': 19770830}, {'first_name': 'Allison', 'birth_date': 19660804}, {'first_name': 'Vickie', 'birth_date': 19710827}, {'first_name': 'Stacey', 'birth_date': 19750105}, {'first_name': 'Marissa', 'birth_date': 19780613}, {'first_name': 'Susanna', 'birth_date': 19720303}, {'first_name': 'Rebecca', 'birth_date': 19721119}, {'first_name': 'Ashley', 'birth_date': 19720408}, {'first_name': 'Varalee', 'birth_date': 19760502}, {'first_name': 'Stephanie', 'birth_date': 19770408}, {'first_name': 'Elizabeth', 'birth_date': 19631112}, {'first_name': 'Bridget', 'birth_date': 19740207}, {'first_name': 'Leslie', 'birth_date': 19720209}, {'first_name': 'Traci', 'birth_date': 19780805}, {'first_name': 'Alison', 'birth_date': 19741125}, {'first_name': 'Amy', 'birth_date': 19681007}, {'first_name': 'Vanessa', 'birth_date': 19760513}, {'first_name': 'Laura', 'birth_date': 19720426}, {'first_name': 'Anna', 'birth_date': 19761021}, {'first_name': 'Betsy', 'birth_date': 19751127}, {'first_name': 'Kristen', 'birth_date': 19781002}, {'first_name': 'Mugette', 'birth_date': 19810424}, {'first_name': 'Tu', 'birth_date': 19780208}, {'first_name': 'Irene', 'birth_date': 19790612}, {'first_name': 'Jennifer', 'birth_date': 19720416}, {'first_name': 'Diana', 'birth_date': 19751029}, {'first_name': 'Jody', 'birth_date': 19711122}, {'first_name': 'Samantha', 'birth_date': 19890509}, {'first_name': 'Tristen Z', 'birth_date': 19940501}, {'first_name': 'Rachel', 'birth_date': 19920719}, {'first_name': 'Ashley', 'birth_date': 19871106}, {'first_name': 'Alexandra', 'birth_date': 19920223}, {'first_name': 'Natalie', 'birth_date': 19910801}, {'first_name': 'Lindsay', 'birth_date': 19880226}, {'first_name': 'Amelia', 'birth_date': 19920802}, {'first_name': 'Caroline', 'birth_date': 19930313}, {'first_name': 'Camila', 'birth_date': 19950929}, {'first_name': 'Josie', 'birth_date': 19951105}, {'first_name': 'Skylar Alexandra', 'birth_date': 19940424}, {'first_name': 'Brooke', 'birth_date': 19960212}, {'first_name': 'Alexandra', 'birth_date': 19910413}, {'first_name': 'Daniella', 'birth_date': 19971105}, {'first_name': 'Hayley', 'birth_date': 19950517}, {'first_name': 'Jody', 'birth_date': 19780930}, {'first_name': 'Ella', 'birth_date': 19760917}, {'first_name': 'Emily Ann', 'birth_date': 19820328}, {'first_name': 'Jacquelyn', 'birth_date': 19801117}, {'first_name': 'Lesley', 'birth_date': 19781011}, {'first_name': 'Kristen', 'birth_date': 19770518}, {'first_name': 'Cara', 'birth_date': 19720421}, {'first_name': 'Zuzanna', 'birth_date': 19800403}, {'first_name': 'Katie', 'birth_date': 19800911}, {'first_name': 'Marilyn', 'birth_date': 19740114}, {'first_name': 'Lena', 'birth_date': 19830510}, {'first_name': 'Brandi', 'birth_date': 19770612}, {'first_name': 'Andrea', 'birth_date': 19780204}, {'first_name': 'Sara', 'birth_date': 19801022}, {'first_name': 'Hillary', 'birth_date': 19820417}, {'first_name': 'Mariel', 'birth_date': 19800220}, {'first_name': 'Whitney', 'birth_date': 19800508}, {'first_name': 'Darian', 'birth_date': 19790615}, {'first_name': 'Alexandra', 'birth_date': 19820310}, {'first_name': 'Prim', 'birth_date': 19810115}, {'first_name': 'Janet', 'birth_date': 19800628}, {'first_name': 'Rachel', 'birth_date': 19690211}, {'first_name': 'Lindsay', 'birth_date': 19821207}, {'first_name': 'Kirsty', 'birth_date': 19780517}, {'first_name': 'Raluca Daniela', 'birth_date': 19830717}, {'first_name': 'Mindy', 'birth_date': 19720322}, {'first_name': 'Erin', 'birth_date': 19830419}, {'first_name': 'Mary Carlisle', 'birth_date': 19780716}, {'first_name': 'Erin', 'birth_date': 19800116}, {'first_name': 'Keiko', 'birth_date': 19800429}, {'first_name': 'Maiko', 'birth_date': 19820623}, {'first_name': 'Paige', 'birth_date': 19740714}, {'first_name': 'Janet', 'birth_date': 19790529}, {'first_name': 'Briana', 'birth_date': 19781221}, {'first_name': 'Stacey', 'birth_date': 19721219}, {'first_name': 'Kristin', 'birth_date': 19720204}, {'first_name': 'Julia', 'birth_date': 19810518}, {'first_name': 'Rochelle', 'birth_date': 19800430}, {'first_name': 'Selin', 'birth_date': 19780706}, {'first_name': 'Jennifer', 'birth_date': 19730117}, {'first_name': 'Luana', 'birth_date': 19821205}, {'first_name': 'Whitney', 'birth_date': 19850811}, {'first_name': 'Paloma', 'birth_date': 19720823}, {'first_name': 'Tumeka', 'birth_date': 19761226}, {'first_name': 'Maria', 'birth_date': 19830319}, {'first_name': 'Hyacinth', 'birth_date': 19610809}, {'first_name': 'Eva', 'birth_date': 19840706}, {'first_name': 'Kara', 'birth_date': 19790920}, {'first_name': 'Katie', 'birth_date': 19841110}, {'first_name': 'Melissa', 'birth_date': 19840613}, {'first_name': 'Emmy', 'birth_date': 19870722}, {'first_name': 'Alexandria', 'birth_date': 19860310}, {'first_name': 'Shari', 'birth_date': 19641103}, {'first_name': 'Michelle', 'birth_date': 19791212}, {'first_name': 'Alexandra', 'birth_date': 19841228}, {'first_name': 'Nicole', 'birth_date': 19860203}, {'first_name': 'Monica', 'birth_date': 19851212}, {'first_name': 'Caitlin', 'birth_date': 19850517}, {'first_name': 'Lia', 'birth_date': 19800922}, {'first_name': 'Michelle', 'birth_date': 19870304}, {'first_name': 'Sybil', 'birth_date': 19770106}, {'first_name': 'Jodi', 'birth_date': 19810822}, {'first_name': 'Liberty', 'birth_date': 19870409}, {'first_name': 'Mimi', 'birth_date': 19841030}, {'first_name': 'Melissa', 'birth_date': 19861211}, {'first_name': 'Jessi', 'birth_date': 19870221}, {'first_name': 'Courtney', 'birth_date': 19880501}, {'first_name': 'Chrissie', 'birth_date': 19870902}, {'first_name': 'Yvette', 'birth_date': 19880612}, {'first_name': 'Audra', 'birth_date': 19830331}, {'first_name': 'Leila', 'birth_date': 19860206}, {'first_name': 'Tamara', 'birth_date': 19790924}, {'first_name': 'Rebekah', 'birth_date': 19791012}, {'first_name': 'Sabita', 'birth_date': 19840927}, {'first_name': 'Shannon', 'birth_date': 19870109}, {'first_name': 'Courtney', 'birth_date': 19851011}, {'first_name': 'Polina', 'birth_date': 19860408}, {'first_name': 'Anamika', 'birth_date': 19890413}, {'first_name': 'Jie', 'birth_date': 19871101}, {'first_name': 'Georgette', 'birth_date': 19840709}, {'first_name': 'Christy', 'birth_date': 19871212}, {'first_name': 'Suzanne', 'birth_date': 19880117}, {'first_name': 'Courtney', 'birth_date': 19900327}, {'first_name': 'Cammie', 'birth_date': 19871122}, {'first_name': 'Nelly', 'birth_date': 19901113}, {'first_name': 'Veronica', 'birth_date': 19870514}, {'first_name': 'Keilly', 'birth_date': 19900505}, {'first_name': 'Kate', 'birth_date': 19831111}, {'first_name': 'Reka', 'birth_date': 19890708}, {'first_name': 'Bianca', 'birth_date': 19890514}, {'first_name': 'Thien Trang', 'birth_date': 19910918}, {'first_name': 'Pamela', 'birth_date': 19910101}, {'first_name': 'Morgan', 'birth_date': 19920220}, {'first_name': 'Julianna', 'birth_date': 19850107}, {'first_name': 'Subbadharmi', 'birth_date': 19890708}, {'first_name': 'Stephanie', 'birth_date': 19930216}, {'first_name': 'Kelsey', 'birth_date': 19910408}, {'first_name': 'Alexandra', 'birth_date': 19870719}, {'first_name': 'Amanda', 'birth_date': 19880314}, {'first_name': 'Chelsea', 'birth_date': 19891211}, {'first_name': 'Anna', 'birth_date': 19840821}, {'first_name': 'Jill M', 'birth_date': 19910313}, {'first_name': 'Kady', 'birth_date': 19860317}, {'first_name': 'Phoebe', 'birth_date': 19880520}, {'first_name': 'Emily', 'birth_date': 19921201}, {'first_name': 'Christian', 'birth_date': 19840913}, {'first_name': 'Keri', 'birth_date': 19891225}, {'first_name': 'Sabrina', 'birth_date': 19860112}, {'first_name': 'Nataly', 'birth_date': 19900913}, {'first_name': 'Maria', 'birth_date': 19920619}, {'first_name': 'Noel', 'birth_date': 19930203}, {'first_name': 'April', 'birth_date': 19920508}, {'first_name': 'Ellie', 'birth_date': 19930808}, {'first_name': 'Stephanie', 'birth_date': 19901027}, {'first_name': 'Nicole', 'birth_date': 19911031}, {'first_name': 'Anna', 'birth_date': 19940308}, {'first_name': 'Veronika', 'birth_date': 19900920}, {'first_name': 'Annie', 'birth_date': 19930330}, {'first_name': 'Kyle', 'birth_date': 19940405}, {'first_name': 'Chanelle', 'birth_date': 19940119}, {'first_name': 'Yawna', 'birth_date': 19860801}, {'first_name': 'Hilary', 'birth_date': 19910513}, {'first_name': 'Ivana', 'birth_date': 19861108}, {'first_name': 'Gira', 'birth_date': 19860829}, {'first_name': 'Claire', 'birth_date': 19891129}, {'first_name': 'Erin', 'birth_date': 19880609}, {'first_name': 'Caitlin', 'birth_date': 19880219}, {'first_name': 'Alexandra', 'birth_date': 19850703}, {'first_name': 'Jennifer', 'birth_date': 19950412}, {'first_name': 'Kimberly', 'birth_date': 19961015}, {'first_name': 'Natalie', 'birth_date': 19891102}, {'first_name': 'Elizaveta Anna', 'birth_date': 19930831}, {'first_name': 'Veronica M', 'birth_date': 19911207}, {'first_name': 'Karina', 'birth_date': 19950706}, {'first_name': 'Sylvia', 'birth_date': 19860904}, {'first_name': 'Sherry', 'birth_date': 19950208}, {'first_name': 'Katrine Isabel', 'birth_date': 19960315}, {'first_name': 'Denise', 'birth_date': 19950417}, {'first_name': 'Courtney', 'birth_date': 19940325}, {'first_name': 'Christina', 'birth_date': 19960529}, {'first_name': 'Noelle', 'birth_date': 19881205}, {'first_name': 'Lauren', 'birth_date': 19950517}, {'first_name': 'Breaunna', 'birth_date': 19941222}, {'first_name': 'Nicole', 'birth_date': 19941230}, {'first_name': 'Meredith', 'birth_date': 19970521}, {'first_name': 'Nadia', 'birth_date': 19950114}, {'first_name': 'Jackie', 'birth_date': 19710922}, {'first_name': 'Antoinette', 'birth_date': 19850107}, {'first_name': 'Kathleen', 'birth_date': 19740511}, {'first_name': 'Kylene', 'birth_date': 19790725}, {'first_name': 'Dana', 'birth_date': 19730725}, {'first_name': 'Audra', 'birth_date': 19720605}, {'first_name': 'Tracee', 'birth_date': 19731009}, {'first_name': 'Amie', 'birth_date': 19800517}, {'first_name': 'Jennifer', 'birth_date': 19811128}, {'first_name': 'Lashawnn', 'birth_date': 19740602}, {'first_name': 'Jacqueline', 'birth_date': 19820209}, {'first_name': 'Jennifer', 'birth_date': 19770119}, {'first_name': 'Kristy', 'birth_date': 19741230}, {'first_name': 'Susan', 'birth_date': 19741201}, {'first_name': 'Bridget', 'birth_date': 19761018}, {'first_name': 'Amy', 'birth_date': 19690628}, {'first_name': 'Sandra', 'birth_date': 19750116}, {'first_name': 'Khristen', 'birth_date': 19750803}, {'first_name': 'Stefanie', 'birth_date': 19810322}, {'first_name': 'Barrie', 'birth_date': 19730724}, {'first_name': 'Kate', 'birth_date': 19820415}, {'first_name': 'Amy', 'birth_date': 19731107}, {'first_name': 'Anne', 'birth_date': 19780520}, {'first_name': 'Lauren', 'birth_date': 19740830}, {'first_name': 'Dewonder', 'birth_date': 19590127}, {'first_name': 'Kendra', 'birth_date': 19790828}, {'first_name': 'Jamie', 'birth_date': 19801106}, {'first_name': 'Jennifer', 'birth_date': 19750823}, {'first_name': 'Audrey', 'birth_date': 19850430}, {'first_name': 'Marjorie', 'birth_date': 19750503}, {'first_name': 'Katie', 'birth_date': 19770527}, {'first_name': 'Aimee', 'birth_date': 19820110}, {'first_name': 'Megan', 'birth_date': 19810519}, {'first_name': 'April', 'birth_date': 19781129}, {'first_name': 'Maren', 'birth_date': 19791106}, {'first_name': 'Sarah', 'birth_date': 19780514}, {'first_name': 'Marie Ange', 'birth_date': 19780114}, {'first_name': 'Dina', 'birth_date': 19680406}, {'first_name': 'Margaret', 'birth_date': 19760707}, {'first_name': 'Mary Beth', 'birth_date': 19760329}, {'first_name': 'Patricia', 'birth_date': 19841020}, {'first_name': 'Ashley', 'birth_date': 19821229}, {'first_name': 'Kathryn', 'birth_date': 19790225}, {'first_name': 'Leslie', 'birth_date': 19810718}, {'first_name': 'Becky', 'birth_date': 19640801}, {'first_name': 'Julie', 'birth_date': 19811223}, {'first_name': 'Danielle', 'birth_date': 19781110}, {'first_name': 'Terri', 'birth_date': 19650402}, {'first_name': 'Amy', 'birth_date': 19681215}, {'first_name': 'Douglas', 'birth_date': 19840522}, {'first_name': 'Sara', 'birth_date': 19850621}, {'first_name': 'Karla', 'birth_date': 19770318}, {'first_name': 'Kristin', 'birth_date': 19841130}, {'first_name': 'Kristin', 'birth_date': 19810705}, {'first_name': 'Bonnie', 'birth_date': 19850503}, {'first_name': 'Natalie', 'birth_date': 19830401}, {'first_name': 'Jennifer', 'birth_date': 19830702}, {'first_name': 'Claire', 'birth_date': 19700527}, {'first_name': 'Lauren', 'birth_date': 19780316}, {'first_name': 'Alison', 'birth_date': 19791129}, {'first_name': 'Laura', 'birth_date': 19710624}, {'first_name': 'Katia', 'birth_date': 19810816}, {'first_name': 'Kara', 'birth_date': 19771202}, {'first_name': 'Violette', 'birth_date': 19790927}, {'first_name': 'Lisa', 'birth_date': 19740221}, {'first_name': 'Evonne', 'birth_date': 19740923}, {'first_name': 'Mandy', 'birth_date': 19790312}, {'first_name': 'Jessica', 'birth_date': 19800415}, {'first_name': 'Emily', 'birth_date': 19811119}, {'first_name': 'Callie', 'birth_date': 19770711}, {'first_name': 'Maggie', 'birth_date': 19750529}, {'first_name': 'Elina', 'birth_date': 19820521}, {'first_name': 'Terry Ann', 'birth_date': 19740428}, {'first_name': 'Kimberly', 'birth_date': 19790725}, {'first_name': 'Bettina', 'birth_date': 19820718}, {'first_name': 'Lindsay', 'birth_date': 19800519}, {'first_name': 'Johanna', 'birth_date': 19750518}, {'first_name': 'Amy', 'birth_date': 19790124}, {'first_name': 'Meiling', 'birth_date': 19791112}, {'first_name': 'Jennifer', 'birth_date': 19781020}, {'first_name': 'Vania', 'birth_date': 19810428}, {'first_name': 'Megan', 'birth_date': 19831014}, {'first_name': 'Lindsey', 'birth_date': 19800201}, {'first_name': 'Megan', 'birth_date': 19820411}, {'first_name': 'Angela', 'birth_date': 19840329}, {'first_name': 'Megan', 'birth_date': 19840920}, {'first_name': 'Nicolette', 'birth_date': 19831108}, {'first_name': 'Anita', 'birth_date': 19860219}, {'first_name': 'Alessandra', 'birth_date': 19870112}, {'first_name': 'Aradhana', 'birth_date': 19820709}, {'first_name': 'Tiffany', 'birth_date': 19831228}, {'first_name': 'Macey', 'birth_date': 19830224}, {'first_name': 'Kelcy', 'birth_date': 19861225}, {'first_name': 'Caylan', 'birth_date': 19820701}, {'first_name': 'Stephanie', 'birth_date': 19820923}, {'first_name': 'Jan', 'birth_date': 19580317}, {'first_name': 'Kate', 'birth_date': 19830530}, {'first_name': 'Karen', 'birth_date': 19671205}, {'first_name': 'Sarah Jane', 'birth_date': 19820802}, {'first_name': 'Catrina', 'birth_date': 19840913}, {'first_name': 'Bethany', 'birth_date': 19821129}, {'first_name': 'Lindsay', 'birth_date': 19820811}, {'first_name': 'Kathleen', 'birth_date': 19820917}, {'first_name': 'Amy', 'birth_date': 19810415}, {'first_name': 'Emilia', 'birth_date': 19820204}, {'first_name': 'Colleen', 'birth_date': 19790212}, {'first_name': 'Ashlee', 'birth_date': 19850522}, {'first_name': 'Saras', 'birth_date': 19830726}, {'first_name': 'Brittany', 'birth_date': 19850420}, {'first_name': 'Laila', 'birth_date': 19810805}, {'first_name': 'Natalie', 'birth_date': 19851103}, {'first_name': 'Celena', 'birth_date': 19790130}, {'first_name': 'Marine', 'birth_date': 19780929}, {'first_name': 'Cara', 'birth_date': 19730424}, {'first_name': 'Loni', 'birth_date': 19810928}, {'first_name': 'Christyn', 'birth_date': 19850210}, {'first_name': 'Cassy', 'birth_date': 19850802}, {'first_name': 'Manisha', 'birth_date': 19770513}, {'first_name': 'Jennifer', 'birth_date': 19811121}, {'first_name': 'Michelle', 'birth_date': 19801002}, {'first_name': 'Brook', 'birth_date': 19851231}, {'first_name': 'Samantha', 'birth_date': 19840807}, {'first_name': 'Stephanie', 'birth_date': 19870411}, {'first_name': 'Courtney', 'birth_date': 19820502}, {'first_name': 'Melissa', 'birth_date': 19840112}, {'first_name': 'Kristin', 'birth_date': 19790227}, {'first_name': 'Adriana', 'birth_date': 19780902}, {'first_name': 'Christine', 'birth_date': 19831216}, {'first_name': 'Julie', 'birth_date': 19840521}, {'first_name': 'Cristina', 'birth_date': 19860826}, {'first_name': 'Nadia', 'birth_date': 19850209}, {'first_name': 'Amanda', 'birth_date': 19821020}, {'first_name': 'Camelia', 'birth_date': 19860406}, {'first_name': 'Emily', 'birth_date': 19850201}, {'first_name': 'Danielle', 'birth_date': 19840717}, {'first_name': 'Rochelle', 'birth_date': 19800627}, {'first_name': 'Brianna', 'birth_date': 19851215}, {'first_name': 'Zena', 'birth_date': 19880717}, {'first_name': 'Adina', 'birth_date': 19870619}, {'first_name': 'Lauren', 'birth_date': 19880204}, {'first_name': 'Lauren', 'birth_date': 19870928}, {'first_name': 'Meg', 'birth_date': 19870811}, {'first_name': 'Ristine', 'birth_date': 19850116}, {'first_name': 'Jennifer', 'birth_date': 19841115}, {'first_name': 'Lindsey', 'birth_date': 19860101}, {'first_name': 'Lindsay', 'birth_date': 19880524}, {'first_name': 'Gloriann', 'birth_date': 19840228}, {'first_name': 'Patricia', 'birth_date': 19740119}, {'first_name': 'Kelly', 'birth_date': 19820223}, {'first_name': 'Amanda', 'birth_date': 19870813}, {'first_name': 'Elizabeth', 'birth_date': 19860128}, {'first_name': 'Whitney', 'birth_date': 19851225}, {'first_name': 'Laura', 'birth_date': 19850506}, {'first_name': 'Masha', 'birth_date': 19840211}, {'first_name': 'Karina', 'birth_date': 19880811}, {'first_name': 'Erin', 'birth_date': 19850113}, {'first_name': 'Randi', 'birth_date': 19870211}, {'first_name': 'Kewa', 'birth_date': 19860701}, {'first_name': 'Hala', 'birth_date': 19850809}, {'first_name': 'Dasha', 'birth_date': 19870606}, {'first_name': 'Suzanna', 'birth_date': 19861013}, {'first_name': 'Colleen', 'birth_date': 19880209}, {'first_name': 'Blair', 'birth_date': 19830904}, {'first_name': 'Simone', 'birth_date': 19881010}, {'first_name': 'Jessica', 'birth_date': 19870304}, {'first_name': 'Austin', 'birth_date': 19860601}, {'first_name': 'Preethi', 'birth_date': 19850629}, {'first_name': 'Christala', 'birth_date': 19890709}, {'first_name': 'Krista', 'birth_date': 19900423}, {'first_name': 'Marie', 'birth_date': 19830721}, {'first_name': 'Ashley', 'birth_date': 19861113}, {'first_name': 'Latrell', 'birth_date': 19891212}, {'first_name': 'Sheryl', 'birth_date': 19850920}, {'first_name': 'Amanda', 'birth_date': 19850319}, {'first_name': 'Blakeley', 'birth_date': 19841114}, {'first_name': 'Ashley', 'birth_date': 19870917}, {'first_name': 'Whitney', 'birth_date': 19890109}, {'first_name': 'Marlene', 'birth_date': 19880329}, {'first_name': 'Melissa', 'birth_date': 19860801}, {'first_name': 'Alex', 'birth_date': 19870117}, {'first_name': 'Jessica', 'birth_date': 19811223}, {'first_name': 'Megan', 'birth_date': 19890204}, {'first_name': 'Jacqueline', 'birth_date': 19830608}, {'first_name': 'Melody', 'birth_date': 19830708}, {'first_name': 'Sarah', 'birth_date': 19910314}, {'first_name': 'Marie', 'birth_date': 19910614}, {'first_name': 'Daron', 'birth_date': 19851128}, {'first_name': 'Amy', 'birth_date': 19790324}, {'first_name': 'Dina', 'birth_date': 19871014}, {'first_name': 'Mia', 'birth_date': 19910312}, {'first_name': 'Valerie', 'birth_date': 19851231}, {'first_name': 'Amanda', 'birth_date': 19880523}, {'first_name': 'Connor', 'birth_date': 19870922}, {'first_name': 'Elizabeth', 'birth_date': 19920114}, {'first_name': 'Brittany', 'birth_date': 19870208}, {'first_name': 'Kristen A', 'birth_date': 19880325}, {'first_name': 'Julie', 'birth_date': 19880331}, {'first_name': 'Sarah', 'birth_date': 19880129}, {'first_name': 'Emily', 'birth_date': 19890724}, {'first_name': 'Christine', 'birth_date': 19871225}, {'first_name': 'Amanda', 'birth_date': 19850511}, {'first_name': 'Nicole', 'birth_date': 19880620}, {'first_name': 'Laurianne', 'birth_date': 19881018}, {'first_name': 'Pamela', 'birth_date': 19901124}, {'first_name': 'Miya', 'birth_date': 19871114}, {'first_name': 'Rachel', 'birth_date': 19830708}, {'first_name': 'Joanna', 'birth_date': 19891009}, {'first_name': 'Lynn', 'birth_date': 19791216}, {'first_name': 'Claire', 'birth_date': 19871108}, {'first_name': 'Paola', 'birth_date': 19920827}, {'first_name': 'Lauren', 'birth_date': 19890512}, {'first_name': 'Erin Carol', 'birth_date': 19930506}, {'first_name': 'Cameron', 'birth_date': 19881224}, {'first_name': 'Julie', 'birth_date': 19870627}, {'first_name': 'Stefanie', 'birth_date': 19890130}, {'first_name': 'Hannah', 'birth_date': 19910812}, {'first_name': 'Katherine', 'birth_date': 19860305}, {'first_name': 'Olivia', 'birth_date': 19880423}, {'first_name': 'Christina', 'birth_date': 19880426}, {'first_name': 'Christina', 'birth_date': 19881212}, {'first_name': 'Cierra', 'birth_date': 19910927}, {'first_name': 'Milena', 'birth_date': 19850506}, {'first_name': 'Christin J', 'birth_date': 19870731}, {'first_name': 'Stephanie', 'birth_date': 19900327}, {'first_name': 'Kaysara', 'birth_date': 19910623}, {'first_name': 'Nina', 'birth_date': 19900115}, {'first_name': 'Deirdre', 'birth_date': 19901205}, {'first_name': 'Kristin', 'birth_date': 19841024}, {'first_name': 'Jacqueline', 'birth_date': 19900913}, {'first_name': 'Stephany', 'birth_date': 19900609}, {'first_name': 'Erica', 'birth_date': 19900702}, {'first_name': 'Julia', 'birth_date': 19910916}, {'first_name': 'Grace', 'birth_date': 19891211}, {'first_name': 'C C', 'birth_date': 19911009}, {'first_name': 'Sarah', 'birth_date': 19910422}, {'first_name': 'Marianne', 'birth_date': 19850906}, {'first_name': 'Monica', 'birth_date': 19920622}, {'first_name': 'Kate', 'birth_date': 19920109}, {'first_name': 'Amanda Marie', 'birth_date': 19860106}, {'first_name': 'Alexa', 'birth_date': 19900824}, {'first_name': 'Denise', 'birth_date': 19890731}, {'first_name': 'Molly', 'birth_date': 19890525}, {'first_name': 'Nelo', 'birth_date': 19920705}, {'first_name': 'Farwa', 'birth_date': 19891101}, {'first_name': 'Millie', 'birth_date': 19641005}, {'first_name': 'Brooke Lindsey', 'birth_date': 19940622}, {'first_name': 'Lilly F', 'birth_date': 19911101}, {'first_name': 'Brynn', 'birth_date': 19910801}, {'first_name': 'Karina', 'birth_date': 19831112}, {'first_name': 'Tracy', 'birth_date': 19740827}, {'first_name': 'Desiree', 'birth_date': 19931110}, {'first_name': 'Rachael', 'birth_date': 19910427}, {'first_name': 'Alrissa', 'birth_date': 19920724}, {'first_name': 'Amanda', 'birth_date': 19870317}, {'first_name': 'Olivia', 'birth_date': 19910711}, {'first_name': 'Caryssa L', 'birth_date': 19920413}, {'first_name': 'Monica', 'birth_date': 19930108}, {'first_name': 'Joelle', 'birth_date': 19910606}, {'first_name': 'Malika', 'birth_date': 19910709}, {'first_name': 'Theresa', 'birth_date': 19930607}, {'first_name': 'Mary Anne', 'birth_date': 19920215}, {'first_name': 'Morocco', 'birth_date': 19921107}, {'first_name': 'Mara', 'birth_date': 19920222}, {'first_name': 'Alejandra Maria', 'birth_date': 19950228}, {'first_name': 'Catherine', 'birth_date': 19880430}, {'first_name': 'Kate', 'birth_date': 19901106}, {'first_name': 'Abigail', 'birth_date': 19900209}, {'first_name': 'Sabrina', 'birth_date': 19930224}, {'first_name': 'Heatherm', 'birth_date': 19890925}, {'first_name': 'Stephanie', 'birth_date': 19940511}, {'first_name': 'Leighann', 'birth_date': 19931204}, {'first_name': 'Lauren', 'birth_date': 19880816}, {'first_name': 'Kayla', 'birth_date': 19920921}, {'first_name': 'Kir', 'birth_date': 19891031}, {'first_name': 'Skylar', 'birth_date': 19930914}, {'first_name': 'Julia', 'birth_date': 19931207}, {'first_name': 'Meghan', 'birth_date': 19930621}, {'first_name': 'Nida', 'birth_date': 19911029}, {'first_name': 'Lauren', 'birth_date': 19880905}, {'first_name': 'Kelly K', 'birth_date': 19910531}, {'first_name': 'Alyssa Grace', 'birth_date': 19950215}, {'first_name': 'Mary', 'birth_date': 19911122}, {'first_name': 'Madeleine', 'birth_date': 19920319}, {'first_name': 'Rachel', 'birth_date': 19840302}, {'first_name': 'Alex', 'birth_date': 19911229}, {'first_name': 'Kyra', 'birth_date': 19960510}, {'first_name': 'Suzy', 'birth_date': 19940830}, {'first_name': 'Remeice', 'birth_date': 19891112}, {'first_name': 'Kate', 'birth_date': 19940201}, {'first_name': 'Courtney', 'birth_date': 19891015}, {'first_name': 'Molly', 'birth_date': 19930810}, {'first_name': 'Stephanie', 'birth_date': 19940131}, {'first_name': 'Alexandra M', 'birth_date': 19870719}, {'first_name': 'Aleksandra', 'birth_date': 19960409}, {'first_name': 'Erin', 'birth_date': 19880709}, {'first_name': 'Jessica', 'birth_date': 19930428}, {'first_name': 'Spencer', 'birth_date': 19950125}, {'first_name': 'Anik', 'birth_date': 19910405}, {'first_name': 'Simone', 'birth_date': 19920717}, {'first_name': 'Emma', 'birth_date': 19930623}, {'first_name': 'Melissa', 'birth_date': 19921004}, {'first_name': 'Tina', 'birth_date': 19950427}, {'first_name': 'Julia', 'birth_date': 19940613}, {'first_name': 'Rachael', 'birth_date': 19931209}, {'first_name': 'Shelby', 'birth_date': 19930114}, {'first_name': 'Epiphany B', 'birth_date': 19921217}, {'first_name': 'Kaitlin', 'birth_date': 19921215}, {'first_name': 'Mariana', 'birth_date': 19950927}, {'first_name': 'Hannah', 'birth_date': 19951103}, {'first_name': 'Casey', 'birth_date': 19910613}, {'first_name': 'Deborah', 'birth_date': 19940514}, {'first_name': 'Jessica', 'birth_date': 19931117}, {'first_name': 'Kelsey', 'birth_date': 19940821}, {'first_name': 'Samantha', 'birth_date': 19930126}, {'first_name': 'Blair', 'birth_date': 19940814}, {'first_name': 'Martha V', 'birth_date': 19900628}, {'first_name': 'Amanda', 'birth_date': 19930322}, {'first_name': 'Sarah', 'birth_date': 19920729}, {'first_name': 'Emily', 'birth_date': 19931112}, {'first_name': 'Jamie', 'birth_date': 19950308}, {'first_name': 'Kelly', 'birth_date': 19770505}, {'first_name': 'Quinn', 'birth_date': 19941110}, {'first_name': 'Sophia', 'birth_date': 19930330}, {'first_name': 'Sierra A', 'birth_date': 19900816}, {'first_name': 'Mckenzie', 'birth_date': 19940107}, {'first_name': 'Stacey', 'birth_date': 19900117}, {'first_name': 'Courtney', 'birth_date': 19910226}, {'first_name': 'Rosalia', 'birth_date': 19900208}, {'first_name': 'Sydney', 'birth_date': 19950207}, {'first_name': 'Mia', 'birth_date': 19950406}, {'first_name': 'Erin Kane', 'birth_date': 19960512}, {'first_name': 'Laura', 'birth_date': 19841119}, {'first_name': 'Eva', 'birth_date': 19921222}, {'first_name': 'Elizabeth', 'birth_date': 19940706}, {'first_name': 'Sarah', 'birth_date': 19930713}, {'first_name': 'Elyse', 'birth_date': 19870910}, {'first_name': 'Sabrina', 'birth_date': 19920912}, {'first_name': 'Julia', 'birth_date': 19890114}, {'first_name': 'Gabriella', 'birth_date': 19951208}, {'first_name': 'Tanya', 'birth_date': 19930914}, {'first_name': 'Nyla', 'birth_date': 19960730}, {'first_name': 'Louisa', 'birth_date': 19960516}, {'first_name': 'Zina', 'birth_date': 19980402}, {'first_name': 'Tornado Alicia', 'birth_date': 19980512}, {'first_name': 'Madison', 'birth_date': 19970919}, {'first_name': 'Rima', 'birth_date': 19951116}, {'first_name': 'Kourtney J', 'birth_date': 19940907}, {'first_name': 'Natasha', 'birth_date': 19940823}, {'first_name': 'Erin', 'birth_date': 19901230}, {'first_name': 'Rachel May', 'birth_date': 19941113}, {'first_name': 'Jillian', 'birth_date': 19941210}, {'first_name': 'Caroline', 'birth_date': 19960315}, {'first_name': 'Dominique', 'birth_date': 19870203}, {'first_name': 'Trelsie', 'birth_date': 19890707}, {'first_name': 'Angela', 'birth_date': 19950604}, {'first_name': 'Nicole', 'birth_date': 19980429}, {'first_name': 'Kim', 'birth_date': 19951027}, {'first_name': 'Emina', 'birth_date': 19930330}, {'first_name': 'Lynda', 'birth_date': 19921123}, {'first_name': 'Joanna Mary', 'birth_date': 19930201}, {'first_name': 'Caroline', 'birth_date': 19960103}, {'first_name': 'Julia', 'birth_date': 19940403}, {'first_name': 'Callie', 'birth_date': 19910904}, {'first_name': 'Maxine', 'birth_date': 19910710}, {'first_name': 'Katie', 'birth_date': 19921211}, {'first_name': 'Emma Christine', 'birth_date': 19980201}, {'first_name': 'Johnnise', 'birth_date': 19960510}, {'first_name': 'Katerina', 'birth_date': 19970717}, {'first_name': 'Jessica', 'birth_date': 19970105}, {'first_name': 'Marjorie', 'birth_date': 19880420}, {'first_name': 'Maci', 'birth_date': 19931007}, {'first_name': 'Kaitlyn', 'birth_date': 19971204}, {'first_name': 'Jacqueline', 'birth_date': 19941203}, {'first_name': 'Charity', 'birth_date': 19870711}, {'first_name': 'Parris', 'birth_date': 19980708}, {'first_name': 'Jamie', 'birth_date': 19930819}, {'first_name': 'Miriam Ruth', 'birth_date': 19940724}, {'first_name': 'Elizabeth', 'birth_date': 19910118}, {'first_name': 'Amanda', 'birth_date': 19860130}, {'first_name': 'Lindsay', 'birth_date': 19780708}, {'first_name': 'Erica', 'birth_date': 19860327}, {'first_name': 'Dina', 'birth_date': 19711211}, {'first_name': 'Robyn', 'birth_date': 19850111}, {'first_name': 'Anita', 'birth_date': 19810402}, {'first_name': 'Casey', 'birth_date': 19840501}, {'first_name': 'Emily', 'birth_date': 19850224}, {'first_name': 'Jamie', 'birth_date': 19880415}, {'first_name': 'Brittany', 'birth_date': 19880627}, {'first_name': 'Elizabeth', 'birth_date': 19550921}, {'first_name': 'Carolyn', 'birth_date': 19900415}, {'first_name': 'Cassandra', 'birth_date': 19891211}, {'first_name': 'Prissy', 'birth_date': 19910807}, {'first_name': 'Kristin', 'birth_date': 19830420}, {'first_name': 'Diamond', 'birth_date': 19901226}, {'first_name': 'Celia', 'birth_date': 19860527}, {'first_name': 'Tiffany', 'birth_date': 19891126}, {'first_name': 'Jennifer', 'birth_date': 19890531}, {'first_name': 'Komal', 'birth_date': 19930108}, {'first_name': 'Roxanne', 'birth_date': 19890826}, {'first_name': 'Mandy', 'birth_date': 19810914}, {'first_name': 'Amanda', 'birth_date': 19800324}, {'first_name': 'Alissa', 'birth_date': 19671209}, {'first_name': 'Kay', 'birth_date': 19570927}, {'first_name': 'Jane', 'birth_date': 19661222}, {'first_name': 'Tracie', 'birth_date': 19610116}, {'first_name': 'Elizabeth', 'birth_date': 19630811}, {'first_name': 'Cinda', 'birth_date': 19710410}, {'first_name': 'Tracy', 'birth_date': 19611021}, {'first_name': 'Dena', 'birth_date': 19650928}, {'first_name': 'Hemel', 'birth_date': 19660108}, {'first_name': 'Karen', 'birth_date': 19630803}, {'first_name': 'Reka', 'birth_date': 19670612}, {'first_name': 'Vincenza', 'birth_date': 19660820}, {'first_name': 'Lisa', 'birth_date': 19640803}, {'first_name': 'Lynn', 'birth_date': 19661018}, {'first_name': 'Jill', 'birth_date': 19731226}, {'first_name': 'Julie', 'birth_date': 19710609}, {'first_name': 'Kilmeny', 'birth_date': 19660218}, {'first_name': 'Kay', 'birth_date': 19690131}, {'first_name': 'Debbie', 'birth_date': 19651129}, {'first_name': 'Anne Marie', 'birth_date': 19660720}, {'first_name': 'Leslie', 'birth_date': 19660908}, {'first_name': 'Lisa', 'birth_date': 19630604}, {'first_name': 'Lisa', 'birth_date': 19611106}, {'first_name': 'Tory', 'birth_date': 19660712}, {'first_name': 'Kylie', 'birth_date': 19700509}, {'first_name': 'Anya', 'birth_date': 19690220}, {'first_name': 'Jennifer', 'birth_date': 19670106}, {'first_name': 'Diana', 'birth_date': 19721007}, {'first_name': 'Betsy', 'birth_date': 19671127}, {'first_name': 'Katrina', 'birth_date': 19671129}, {'first_name': 'Karen', 'birth_date': 19701102}, {'first_name': 'Susan', 'birth_date': 19710206}, {'first_name': 'Sherri', 'birth_date': 19730118}, {'first_name': 'Tonya', 'birth_date': 19691110}, {'first_name': 'Julie', 'birth_date': 19680817}, {'first_name': 'Susan', 'birth_date': 19710206}, {'first_name': 'Jamie', 'birth_date': 19691029}, {'first_name': 'Alita', 'birth_date': 19630112}, {'first_name': 'Tara', 'birth_date': 19681223}, {'first_name': 'Erika', 'birth_date': 19720516}, {'first_name': 'Kellie', 'birth_date': 19670601}, {'first_name': 'Happy', 'birth_date': 19680605}, {'first_name': 'Angie', 'birth_date': 19710323}, {'first_name': 'Bonnie', 'birth_date': 19770412}, {'first_name': 'Farley', 'birth_date': 19741212}, {'first_name': 'Tunecia', 'birth_date': 19701023}, {'first_name': 'Roseann', 'birth_date': 19710227}, {'first_name': 'Allison', 'birth_date': 19710927}, {'first_name': 'Hillery', 'birth_date': 19610619}, {'first_name': 'La Shawnn', 'birth_date': 19740206}, {'first_name': 'Sylvia', 'birth_date': 19610419}, {'first_name': 'Kathy', 'birth_date': 19741105}, {'first_name': 'Zuzanna', 'birth_date': 19790726}, {'first_name': 'Cassi', 'birth_date': 19850902}, {'first_name': 'Lejla', 'birth_date': 19870206}, {'first_name': 'Danielle', 'birth_date': 19820120}, {'first_name': 'Geneva', 'birth_date': 19871225}, {'first_name': 'Katie', 'birth_date': 19891023}, {'first_name': 'Katie', 'birth_date': 19881216}, {'first_name': 'Brittany', 'birth_date': 19940406}, {'first_name': 'Allie', 'birth_date': 19950630}, {'first_name': 'Sofia', 'birth_date': 19981114}, {'first_name': 'Mia', 'birth_date': 19970723}, {'first_name': 'Ty Ana', 'birth_date': 19970313}, {'first_name': 'Karina Kristina', 'birth_date': 19981021}, {'first_name': 'Jessica', 'birth_date': 19890916}, {'first_name': 'Trisha', 'birth_date': 19981027}, {'first_name': 'Ashley', 'birth_date': 19881017}, {'first_name': 'Tina', 'birth_date': 19920831}, {'first_name': 'Tatijana', 'birth_date': 19971116}, {'first_name': 'Taylor L', 'birth_date': 19950117}, {'first_name': 'Alexa', 'birth_date': 19980707}, {'first_name': 'Emerald', 'birth_date': 19970905}, {'first_name': 'Marie', 'birth_date': 19970611}, {'first_name': 'Alexandra', 'birth_date': 19950224}, {'first_name': 'Aleah', 'birth_date': 19910923}, {'first_name': 'Sarah', 'birth_date': 19941219}, {'first_name': 'Usue Maitane', 'birth_date': 19981028}, {'first_name': 'Ellie', 'birth_date': 19970710}, {'first_name': 'Maia A', 'birth_date': 19960921}, {'first_name': 'Raquel', 'birth_date': 19980128}, {'first_name': 'Peggy', 'birth_date': 19951110}, {'first_name': 'Rebecca', 'birth_date': 19971004}, {'first_name': 'Camila', 'birth_date': 19961125}, {'first_name': 'Karyn', 'birth_date': 19940912}, {'first_name': 'Ayla', 'birth_date': 19960715}, {'first_name': 'Rasheeda', 'birth_date': 19950630}, {'first_name': 'Amy', 'birth_date': 19941028}, {'first_name': 'Ariana', 'birth_date': 19960126}, {'first_name': 'Luisa', 'birth_date': 19951005}, {'first_name': 'Mary', 'birth_date': 19910802}, {'first_name': 'Kristi', 'birth_date': 19900427}, {'first_name': 'Ronit', 'birth_date': 19931203}, {'first_name': 'Julia Christine', 'birth_date': 19921027}, {'first_name': 'Kristina N', 'birth_date': 19910125}, {'first_name': 'Macie', 'birth_date': 19941023}, {'first_name': 'Jessica', 'birth_date': 19950102}, {'first_name': 'Rhiann', 'birth_date': 19940622}, {'first_name': 'Frances', 'birth_date': 19940222}, {'first_name': 'Kelly', 'birth_date': 19960221}, {'first_name': 'Hanna', 'birth_date': 19980225}, {'first_name': 'Natalie', 'birth_date': 19960508}, {'first_name': 'Dasha', 'birth_date': 19961011}, {'first_name': 'Elizabeth', 'birth_date': 19910218}, {'first_name': 'Brianna', 'birth_date': 19951012}, {'first_name': 'Kristin', 'birth_date': 19951122}, {'first_name': 'Kristina', 'birth_date': 19951204}, {'first_name': 'Maddie', 'birth_date': 19971117}, {'first_name': 'Raveena', 'birth_date': 19980723}, {'first_name': 'Daniella', 'birth_date': 19971027}, {'first_name': 'Laura', 'birth_date': 19970305}, {'first_name': 'Idia', 'birth_date': 19930922}, {'first_name': 'Chloe Michele', 'birth_date': 19970905}, {'first_name': 'Morgan', 'birth_date': 19941219}, {'first_name': 'Nikki', 'birth_date': 19960418}, {'first_name': 'Sianna', 'birth_date': 19900804}, {'first_name': 'Nicole', 'birth_date': 19990508}, {'first_name': 'Mercedes', 'birth_date': 19970525}, {'first_name': 'Lourdes', 'birth_date': 19990531}, {'first_name': 'Adi', 'birth_date': 19951213}, {'first_name': 'Anna', 'birth_date': 19971103}, {'first_name': 'Alexandra', 'birth_date': 19980719}, {'first_name': 'Katarina', 'birth_date': 19960704}, {'first_name': 'Michaela', 'birth_date': 19990726}, {'first_name': 'Ena', 'birth_date': 19980212}, {'first_name': 'Catherine Cartan', 'birth_date': 19990408}, {'first_name': 'Hadley', 'birth_date': 19960311}, {'first_name': 'Madison', 'birth_date': 19960402}, {'first_name': 'Jaeda', 'birth_date': 19990728}, {'first_name': 'Jeannez', 'birth_date': 19960707}, {'first_name': 'Erica', 'birth_date': 19980316}, {'first_name': 'Jessie', 'birth_date': 19980419}, {'first_name': 'Andie K', 'birth_date': 19970107}, {'first_name': 'Alexandria', 'birth_date': 19960511}, {'first_name': 'Gabriella', 'birth_date': 19960709}, {'first_name': 'Kelly', 'birth_date': 19990509}, {'first_name': 'Terri', 'birth_date': 19960723}, {'first_name': 'Angel', 'birth_date': 19850125}, {'first_name': 'Maria', 'birth_date': 19970506}, {'first_name': 'Alexis', 'birth_date': 19980809}, {'first_name': 'Rianna', 'birth_date': 19960903}, {'first_name': 'Megen', 'birth_date': 19960709}, {'first_name': 'Caroline', 'birth_date': 19980905}, {'first_name': 'Sophie', 'birth_date': 19970528}, {'first_name': 'Nicole', 'birth_date': 19960504}, {'first_name': 'Jacqueline', 'birth_date': 19970531}, {'first_name': 'Jessica', 'birth_date': 19970709}, {'first_name': 'Adriana', 'birth_date': 19890308}, {'first_name': 'Kylie', 'birth_date': 19970606}, {'first_name': 'Yuki Kristina', 'birth_date': 19950819}, {'first_name': 'Lexi', 'birth_date': 19950525}, {'first_name': 'Caroline', 'birth_date': 19970726}, {'first_name': 'Ingrid', 'birth_date': 19980616}, {'first_name': 'Alexandra', 'birth_date': 19970301}, {'first_name': 'Nada', 'birth_date': 20000308}, {'first_name': 'Alexis', 'birth_date': 19950606}, {'first_name': 'Felicity', 'birth_date': 19970313}, {'first_name': 'Tory', 'birth_date': 19930105}, {'first_name': 'Aimee', 'birth_date': 19940907}, {'first_name': 'Alli', 'birth_date': 19961203}, {'first_name': 'Claudia', 'birth_date': 19961206}, {'first_name': 'Brooke', 'birth_date': 19951010}, {'first_name': 'Marina', 'birth_date': 19981123}, {'first_name': 'Zoe Adeline', 'birth_date': 19941217}, {'first_name': 'Jessica', 'birth_date': 19970605}, {'first_name': 'Ashley', 'birth_date': 19920829}, {'first_name': 'Valerie', 'birth_date': 19971122}, {'first_name': 'Ashley', 'birth_date': 19990208}, {'first_name': 'Brittany', 'birth_date': 19920303}, {'first_name': 'Olivia', 'birth_date': 19940623}, {'first_name': 'Taylor', 'birth_date': 19950731}, {'first_name': 'Alexis', 'birth_date': 19950724}, {'first_name': 'Sara', 'birth_date': 19971217}, {'first_name': 'Lindsay', 'birth_date': 19930107}, {'first_name': 'Liza', 'birth_date': 19950317}, {'first_name': 'Jayci', 'birth_date': 20000517}, {'first_name': 'Marina', 'birth_date': 19920314}, {'first_name': 'Sydney', 'birth_date': 19990430}, {'first_name': 'Alyza', 'birth_date': 19951122}, {'first_name': 'Sophia', 'birth_date': 19920113}, {'first_name': 'Riley', 'birth_date': 19990615}, {'first_name': 'Delaney', 'birth_date': 19981028}, {'first_name': 'Jane', 'birth_date': 19961112}, {'first_name': 'Valerie Ann', 'birth_date': 19980801}, {'first_name': 'Carolyn', 'birth_date': 19970524}, {'first_name': 'Maegan', 'birth_date': 19950416}, {'first_name': 'Tamara', 'birth_date': 19971129}, {'first_name': 'Mary', 'birth_date': 19981025}, {'first_name': 'Victoria', 'birth_date': 19990401}, {'first_name': 'Kennedy', 'birth_date': 19970521}, {'first_name': 'Amy', 'birth_date': 19970120}, {'first_name': 'Makenna', 'birth_date': 19980226}, {'first_name': 'Stephanie', 'birth_date': 19980415}, {'first_name': 'Nicole Taylor', 'birth_date': 19990426}, {'first_name': 'Claire', 'birth_date': 20000525}, {'first_name': 'Jada', 'birth_date': 19990129}, {'first_name': 'Sara', 'birth_date': 19970723}, {'first_name': 'Hannah', 'birth_date': 19960923}, {'first_name': 'Sophia', 'birth_date': 19971005}, {'first_name': 'Akiko', 'birth_date': 19930913}, {'first_name': 'Karina', 'birth_date': 19970808}, {'first_name': 'Haley', 'birth_date': 19910403}, {'first_name': 'Paige', 'birth_date': 19970222}, {'first_name': 'Kayla', 'birth_date': 19990928}, {'first_name': 'Carson', 'birth_date': 20000909}, {'first_name': 'Amanda', 'birth_date': 19940813}, {'first_name': 'Maria', 'birth_date': 19990721}, {'first_name': 'Kylie', 'birth_date': 19990321}, {'first_name': 'Luciana', 'birth_date': 19981001}, {'first_name': 'Zoe', 'birth_date': 20010308}, {'first_name': 'Sachi', 'birth_date': 19981129}, {'first_name': 'Audrey', 'birth_date': 19951029}, {'first_name': 'Anna', 'birth_date': 19970319}, {'first_name': 'Abigail', 'birth_date': 20010122}, {'first_name': 'Cameron', 'birth_date': 19990920}, {'first_name': 'Katelyn', 'birth_date': 19921211}, {'first_name': 'Katharine', 'birth_date': 19961019}, {'first_name': 'Elyse', 'birth_date': 19981014}, {'first_name': 'Mimi', 'birth_date': 19930430}, {'first_name': 'Bess', 'birth_date': 19971029}, {'first_name': 'Ines Karmen', 'birth_date': 19970615}, {'first_name': 'Taylor', 'birth_date': 19990615}, {'first_name': 'Kristen', 'birth_date': 19970407}, {'first_name': 'Sabrina', 'birth_date': 19971003}, {'first_name': 'Desirae', 'birth_date': 19940111}, {'first_name': 'Sarah', 'birth_date': 19960418}, {'first_name': 'Rachel', 'birth_date': 19961108}, {'first_name': 'Victoria', 'birth_date': 19990807}, {'first_name': 'Nini', 'birth_date': 19950909}, {'first_name': 'Francesca', 'birth_date': 19970722}, {'first_name': 'Makenzie', 'birth_date': 19990610}, {'first_name': 'Chiara', 'birth_date': 19980826}, {'first_name': 'Melissa', 'birth_date': 19930602}, {'first_name': 'Morgan', 'birth_date': 19990416}, {'first_name': 'Jerricka', 'birth_date': 19950116}, {'first_name': 'Eva', 'birth_date': 19961102}, {'first_name': 'Miranda', 'birth_date': 19990307}, {'first_name': 'Teresia', 'birth_date': 19990529}, {'first_name': 'Julia', 'birth_date': 19971217}, {'first_name': 'Malkia', 'birth_date': 20000808}, {'first_name': 'Lorraine M', 'birth_date': 19930615}, {'first_name': 'Carol', 'birth_date': 19960218}, {'first_name': 'Jocelyn', 'birth_date': 19900526}, {'first_name': 'Roosh', 'birth_date': 19920321}, {'first_name': 'Alexa', 'birth_date': 19980703}, {'first_name': 'Alyvia', 'birth_date': 20000503}, {'first_name': 'Katie', 'birth_date': 19990929}, {'first_name': 'Meible', 'birth_date': 19990519}, {'first_name': 'Elizabeth', 'birth_date': 20010712}, {'first_name': 'Emma', 'birth_date': 20010518}, {'first_name': 'Arianna', 'birth_date': 19950206}, {'first_name': 'Kiah', 'birth_date': 19950117}, {'first_name': 'Alyssa', 'birth_date': 20000210}, {'first_name': 'Stephanie', 'birth_date': 19880402}, {'first_name': 'Sofia', 'birth_date': 19990722}, {'first_name': 'Sarah', 'birth_date': 19930814}, {'first_name': 'Melan', 'birth_date': 19970406}, {'first_name': 'Alexandra', 'birth_date': 19990105}, {'first_name': 'Dilara', 'birth_date': 19990911}, {'first_name': 'Hurricane Tyra', 'birth_date': 20010302}, {'first_name': 'Taylor', 'birth_date': 19980222}, {'first_name': 'Nami', 'birth_date': 19980827}, {'first_name': 'Marcella', 'birth_date': 20001012}, {'first_name': 'Sophia', 'birth_date': 20010630}, {'first_name': 'Delisha', 'birth_date': ''}, {'first_name': 'Haley', 'birth_date': ''}, {'first_name': 'Jenna', 'birth_date': ''}, {'first_name': 'Nikita', 'birth_date': 19931021}, {'first_name': 'Hoda', 'birth_date': ''}, {'first_name': 'Meredith', 'birth_date': 19990310}, {'first_name': 'Morgan', 'birth_date': 19950317}, {'first_name': 'Kirsten', 'birth_date': 19940508}, {'first_name': 'Maya', 'birth_date': 19940527}, {'first_name': 'Kat', 'birth_date': 19930215}, {'first_name': 'Alexandra', 'birth_date': 19930215}, {'first_name': 'Meghan', 'birth_date': 19971028}, {'first_name': 'Salma', 'birth_date': 20000828}, {'first_name': 'Madeline', 'birth_date': 19990307}, {'first_name': 'Lindsay', 'birth_date': 19981217}, {'first_name': 'Alexa', 'birth_date': 20010908}, {'first_name': 'Mary Catherine', 'birth_date': 19971104}, {'first_name': 'Cheyenne', 'birth_date': 19960326}, {'first_name': 'Neri', 'birth_date': 19990902}, {'first_name': 'Jesse', 'birth_date': 20011004}, {'first_name': 'Ann', 'birth_date': 20000626}, {'first_name': 'Natalia', 'birth_date': 19930929}, {'first_name': 'Whitney', 'birth_date': 20020417}, {'first_name': 'Christina', 'birth_date': 19970725}, {'first_name': 'Sofia', 'birth_date': 19980703}, {'first_name': 'Nicole', 'birth_date': 20000805}, {'first_name': 'Kenadi', 'birth_date': 19970313}, {'first_name': 'Paiton', 'birth_date': 19980808}, {'first_name': 'Shannon', 'birth_date': 19950915}, {'first_name': 'Elysia', 'birth_date': 20000324}, {'first_name': 'Ashley', 'birth_date': 19991026}, {'first_name': 'Alexis', 'birth_date': 19970314}, {'first_name': 'Caty', 'birth_date': 20011120}, {'first_name': 'Isabella', 'birth_date': 20010706}, {'first_name': 'Elizabeth', 'birth_date': 20010519}, {'first_name': 'Anna', 'birth_date': 20020306}, {'first_name': 'Dakota', 'birth_date': 20020508}, {'first_name': 'Janice', 'birth_date': 19990105}, {'first_name': 'Amanda', 'birth_date': 20010831}, {'first_name': 'Jada', 'birth_date': 19980319}, {'first_name': 'Hind', 'birth_date': 19990228}, {'first_name': 'Mikaela', 'birth_date': 19890801}, {'first_name': 'Micheline', 'birth_date': 19970428}, {'first_name': 'Kendal', 'birth_date': 19940106}, {'first_name': 'Anna', 'birth_date': 19991008}, {'first_name': 'Mia', 'birth_date': 19981021}, {'first_name': 'Chloe', 'birth_date': 20010830}, {'first_name': 'Abigail', 'birth_date': 20010310}, {'first_name': 'Ryan', 'birth_date': 19990510}, {'first_name': 'Maia', 'birth_date': ''}, {'first_name': 'Jana', 'birth_date': 19941110}, {'first_name': 'Shale', 'birth_date': 20011015}, {'first_name': 'Helen Abigail', 'birth_date': 19980520}, {'first_name': 'Kariann', 'birth_date': 19990116}, {'first_name': 'Kennedy', 'birth_date': 19980903}, {'first_name': 'Caroline', 'birth_date': 19980929}, {'first_name': 'Allison', 'birth_date': 19981031}, {'first_name': 'Melissa', 'birth_date': 19970624}, {'first_name': 'Ellyse', 'birth_date': 19961109}, {'first_name': 'Charleen', 'birth_date': 19410918}, {'first_name': 'Doris', 'birth_date': 19250620}, {'first_name': 'Patricia', 'birth_date': 19370601}, {'first_name': 'Pauline', 'birth_date': 19190806}, {'first_name': 'Helen', 'birth_date': 19290507}, {'first_name': 'Mary', 'birth_date': ''}, {'first_name': 'Althea', 'birth_date': 19270825}, {'first_name': 'Carrie', 'birth_date': 19571026}, {'first_name': 'Cathy', 'birth_date': 19510822}, {'first_name': 'Karen', 'birth_date': 19570408}, {'first_name': '', 'birth_date': ''}, {'first_name': 'Barbara', 'birth_date': ''}, {'first_name': 'Susan', 'birth_date': 19611219}, {'first_name': 'Jan', 'birth_date': 19630609}, {'first_name': 'Diane', 'birth_date': 19650626}, {'first_name': 'Carol', 'birth_date': 19620605}, {'first_name': 'Leanne', 'birth_date': ''}, {'first_name': 'Shelley', 'birth_date': 19631120}, {'first_name': 'Maureen', 'birth_date': ''}, {'first_name': 'Lorrie', 'birth_date': 19601015}, {'first_name': 'Tiffany', 'birth_date': 19600417}, {'first_name': 'Sarah', 'birth_date': 19741010}, {'first_name': 'Meg', 'birth_date': ''}, {'first_name': 'Wendy', 'birth_date': ''}, {'first_name': 'Lynn', 'birth_date': 19660819}, {'first_name': 'Heidi', 'birth_date': 19640507}, {'first_name': 'Jacqueline', 'birth_date': 19620329}, {'first_name': 'Sheri', 'birth_date': 19690629}, {'first_name': 'Diane', 'birth_date': 19710121}, {'first_name': 'Angela', 'birth_date': 19641211}, {'first_name': 'Nancy', 'birth_date': ''}, {'first_name': 'Liz', 'birth_date': 19640423}, {'first_name': 'Jamie', 'birth_date': 19630530}, {'first_name': '', 'birth_date': ''}, {'first_name': 'Laura', 'birth_date': 19681210}, {'first_name': 'Jill', 'birth_date': ''}, {'first_name': 'Courtney', 'birth_date': 19560622}, {'first_name': 'Tiffany', 'birth_date': 19810121}, {'first_name': 'Kristen', 'birth_date': 19810501}, {'first_name': 'Wendy', 'birth_date': 19681001}, {'first_name': 'Sheila', 'birth_date': ''}, {'first_name': 'Heidi', 'birth_date': 19601007}, {'first_name': 'Julie', 'birth_date': 19610523}, {'first_name': 'Deborah', 'birth_date': 19701129}, {'first_name': 'Jennifer', 'birth_date': ''}, {'first_name': 'Cindy', 'birth_date': 19591207}, {'first_name': 'Lynn', 'birth_date': ''}, {'first_name': 'I', 'birth_date': ''}, {'first_name': 'Lisa', 'birth_date': 19600808}, {'first_name': 'Jill', 'birth_date': 19540907}, {'first_name': 'Aschara', 'birth_date': ''}, {'first_name': 'Heidi', 'birth_date': 19720713}, {'first_name': 'Julie', 'birth_date': 19710609}, {'first_name': '', 'birth_date': ''}, {'first_name': 'G', 'birth_date': ''}, {'first_name': 'Stephanie', 'birth_date': 19661010}, {'first_name': 'Lucy', 'birth_date': 19540402}, {'first_name': 'Cathy', 'birth_date': ''}, {'first_name': '', 'birth_date': ''}, {'first_name': 'Emmy', 'birth_date': ''}, {'first_name': '', 'birth_date': ''}, {'first_name': 'Claudette', 'birth_date': ''}, {'first_name': 'Lisa', 'birth_date': ''}, {'first_name': 'Lynn', 'birth_date': 19631114}, {'first_name': 'Lindsay', 'birth_date': ''}, {'first_name': 'Lisa', 'birth_date': 19630218}, {'first_name': 'Virginia', 'birth_date': ''}, {'first_name': 'Lloyd', 'birth_date': 19451208}, {'first_name': 'Suzanne', 'birth_date': 19750612}, {'first_name': 'Caren', 'birth_date': 19611110}, {'first_name': 'Allegra', 'birth_date': 19720113}, {'first_name': 'Molly', 'birth_date': 19630215}, {'first_name': 'Lori', 'birth_date': 19600112}, {'first_name': 'Lindsay', 'birth_date': 19780417}, {'first_name': 'Adrienne', 'birth_date': 19680903}, {'first_name': 'Quynh', 'birth_date': 19710627}, {'first_name': 'Kari', 'birth_date': 19810120}, {'first_name': 'Lisa', 'birth_date': 19590212}, {'first_name': 'Christa', 'birth_date': 19790115}, {'first_name': 'Kelly', 'birth_date': 19770505}, {'first_name': 'Massoumeh', 'birth_date': 19770803}, {'first_name': 'Louise', 'birth_date': 19500119}, {'first_name': 'Jayne', 'birth_date': 19741006}, {'first_name': 'Christine', 'birth_date': ''}, {'first_name': 'Kim', 'birth_date': 19780329}, {'first_name': 'Lani', 'birth_date': 19600808}, {'first_name': 'Julie', 'birth_date': 19690425}, {'first_name': 'Ruth Ann', 'birth_date': 19700506}, {'first_name': 'Lauren', 'birth_date': 19830423}, {'first_name': 'Tasha', 'birth_date': 19760223}, {'first_name': 'Kealy', 'birth_date': 19801030}, {'first_name': 'Courtney', 'birth_date': 19721230}, {'first_name': 'Julie Ann', 'birth_date': 19750618}, {'first_name': 'Nicole', 'birth_date': 19741001}, {'first_name': 'Ashlee', 'birth_date': 19801005}, {'first_name': 'Kelly', 'birth_date': 19751106}, {'first_name': 'Alexandra', 'birth_date': 19790210}, {'first_name': 'Mary', 'birth_date': 19730912}, {'first_name': 'Lisa', 'birth_date': 19660204}, {'first_name': 'Monty', 'birth_date': 19650506}, {'first_name': 'Julie Anne', 'birth_date': 19800911}, {'first_name': 'Lorrie', 'birth_date': 19651203}, {'first_name': 'Kendra', 'birth_date': 19760621}, {'first_name': 'Chris', 'birth_date': 19610706}, {'first_name': 'Christine', 'birth_date': 19850303}, {'first_name': 'Rankin', 'birth_date': 19840126}, {'first_name': 'Julia', 'birth_date': 19850721}, {'first_name': 'Sabaea', 'birth_date': 19811125}, {'first_name': 'Nicole', 'birth_date': 19750602}, {'first_name': 'Joyce', 'birth_date': 19800628}, {'first_name': 'Sarah', 'birth_date': 19820410}, {'first_name': 'Jean Marie', 'birth_date': 19651109}, {'first_name': 'Stacey', 'birth_date': 19720110}, {'first_name': 'Varita', 'birth_date': 19820702}, {'first_name': 'Shera', 'birth_date': 19780910}, {'first_name': 'Trisha', 'birth_date': 19710617}, {'first_name': 'Suzanne', 'birth_date': 19680921}, {'first_name': 'Lisa', 'birth_date': 19801119}, {'first_name': 'Martha', 'birth_date': 19551005}, {'first_name': 'Kandiss', 'birth_date': 19770221}, {'first_name': 'Brooke', 'birth_date': 19780413}, {'first_name': 'Cristina', 'birth_date': 19750825}, {'first_name': 'Jasmine', 'birth_date': 19810102}, {'first_name': 'Kathleen', 'birth_date': 19830125}, {'first_name': 'Melissa', 'birth_date': 19770524}, {'first_name': 'Michelle', 'birth_date': 19731114}, {'first_name': 'April', 'birth_date': 19831011}, {'first_name': 'Olivia', 'birth_date': 19810310}, {'first_name': 'Melissa', 'birth_date': 19650221}, {'first_name': 'Cami', 'birth_date': 19720314}, {'first_name': 'Marissa', 'birth_date': 19780318}, {'first_name': 'Kristin', 'birth_date': 19720204}, {'first_name': 'Christi', 'birth_date': 19610509}, {'first_name': 'Cindy', 'birth_date': ''}, {'first_name': 'Ashley', 'birth_date': 19830506}, {'first_name': 'Leigh', 'birth_date': 19831014}, {'first_name': 'Natalia', 'birth_date': 19831110}, {'first_name': 'Nikhila', 'birth_date': 19850208}, {'first_name': 'Rachel', 'birth_date': 19820916}, {'first_name': 'Alison', 'birth_date': 19850118}, {'first_name': 'Cameron', 'birth_date': 19830328}, {'first_name': 'Gretchen', 'birth_date': 19820304}, {'first_name': 'Cackie', 'birth_date': 19661107}, {'first_name': 'Stephanie', 'birth_date': 19650104}, {'first_name': 'Miriam', 'birth_date': 19850925}, {'first_name': 'Nicole', 'birth_date': 19880219}, {'first_name': 'Lilivette', 'birth_date': 19800225}, {'first_name': 'Jonni', 'birth_date': 19791203}, {'first_name': 'Amanda', 'birth_date': 19850102}, {'first_name': 'Weyli', 'birth_date': 19800722}, {'first_name': 'Helene', 'birth_date': 19841215}, {'first_name': 'Amanda', 'birth_date': 19841101}, {'first_name': 'Nicole', 'birth_date': 19870615}, {'first_name': 'Stefani', 'birth_date': 19841215}, {'first_name': 'Laura', 'birth_date': 19860217}, {'first_name': 'Tifanie', 'birth_date': 19880920}, {'first_name': 'Mary', 'birth_date': 19651124}, {'first_name': 'Katherine', 'birth_date': 19730414}, {'first_name': 'Monica', 'birth_date': 19800204}, {'first_name': 'Nicole', 'birth_date': 19850105}, {'first_name': 'Shanna', 'birth_date': 19750428}, {'first_name': 'Jane', 'birth_date': 19890926}, {'first_name': 'Estelle', 'birth_date': 19890503}, {'first_name': 'Maria', 'birth_date': 19820204}, {'first_name': 'Jessica', 'birth_date': 19860812}, {'first_name': 'Renata', 'birth_date': 19650224}, {'first_name': 'Laura', 'birth_date': 19830408}, {'first_name': 'Lindsey', 'birth_date': 19840313}, {'first_name': 'Christy', 'birth_date': 19850925}, {'first_name': 'Timberly', 'birth_date': 19831209}, {'first_name': 'Brooke', 'birth_date': 19850423}, {'first_name': 'Kelli Elizabeth', 'birth_date': 19940409}, {'first_name': 'Melanie', 'birth_date': ''}, {'first_name': 'Whitney P', 'birth_date': 19930625}, {'first_name': 'Sydni', 'birth_date': 19880612}, {'first_name': 'Jasmine Nicole', 'birth_date': 19930826}, {'first_name': 'Alexandra', 'birth_date': 19920812}, {'first_name': 'Amber', 'birth_date': 19870605}, {'first_name': 'Kelsey', 'birth_date': 19920610}, {'first_name': 'Alex', 'birth_date': 19920225}, {'first_name': 'Ashley M', 'birth_date': 19940304}, {'first_name': 'Lauren', 'birth_date': 19940828}, {'first_name': 'Stacia', 'birth_date': 19930914}, {'first_name': 'Alexandria', 'birth_date': 19900111}, {'first_name': 'Rozel Asuncion', 'birth_date': 19950616}, {'first_name': 'Bolan', 'birth_date': 19890908}, {'first_name': 'Annie', 'birth_date': 19920829}, {'first_name': 'Eva', 'birth_date': 19941007}, {'first_name': 'Whitney', 'birth_date': 19900909}, {'first_name': 'Hanna', 'birth_date': 19911107}, {'first_name': 'Mandy', 'birth_date': 19910501}, {'first_name': 'Gia', 'birth_date': 19900614}, {'first_name': 'Brooke', 'birth_date': 19951105}, {'first_name': 'Lisa', 'birth_date': 19680519}, {'first_name': 'Alexandra M', 'birth_date': 19930120}, {'first_name': 'Sonya Sheeran', 'birth_date': 19940816}, {'first_name': 'Shinann', 'birth_date': 19900608}, {'first_name': 'Nicolette', 'birth_date': 19950824}, {'first_name': 'Rebecca', 'birth_date': 19921125}, {'first_name': 'Ashley', 'birth_date': 19960430}, {'first_name': 'Savannah', 'birth_date': 19950115}, {'first_name': 'Margaret', 'birth_date': 19570423}, {'first_name': 'Carlee', 'birth_date': 19950724}, {'first_name': 'Sarah', 'birth_date': 19850718}, {'first_name': 'Caroline', 'birth_date': 19840926}, {'first_name': 'Alexia', 'birth_date': 19940421}, {'first_name': 'Micaela', 'birth_date': 19890311}, {'first_name': 'Tina', 'birth_date': 19810116}, {'first_name': 'Manon Cristina', 'birth_date': 19941224}, {'first_name': 'Hailey M', 'birth_date': 19930127}, {'first_name': 'Tiffany', 'birth_date': 19911216}, {'first_name': 'Devan', 'birth_date': 19940528}, {'first_name': 'Courtenay', 'birth_date': 19770227}, {'first_name': 'Christine', 'birth_date': 19931110}, {'first_name': 'Emily', 'birth_date': 19900517}, {'first_name': 'Leyla', 'birth_date': 19930423}, {'first_name': 'Alexis', 'birth_date': 19880722}, {'first_name': 'Di Andrea', 'birth_date': 19950730}, {'first_name': 'Jandayia', 'birth_date': 19960303}, {'first_name': 'Margarita', 'birth_date': 19950317}, {'first_name': 'Olivia', 'birth_date': 19941211}, {'first_name': 'Caitlin', 'birth_date': 19910905}, {'first_name': 'Kara', 'birth_date': 19910629}, {'first_name': 'Paloma', 'birth_date': 19890313}, {'first_name': 'Susie', 'birth_date': 19491114}, {'first_name': 'Emily', 'birth_date': 19861118}, {'first_name': 'Abbie', 'birth_date': 19951121}, {'first_name': 'Alanna', 'birth_date': 19950107}, {'first_name': 'Siobhan', 'birth_date': 19871110}, {'first_name': 'Kayla Symone', 'birth_date': 19960110}, {'first_name': 'Margie', 'birth_date': 19901106}, {'first_name': 'Jamie', 'birth_date': 19820521}, {'first_name': 'Adria', 'birth_date': 19791221}, {'first_name': 'Lynn', 'birth_date': 19941106}, {'first_name': 'Nadege', 'birth_date': 19960527}, {'first_name': 'Lauren', 'birth_date': 19941203}, {'first_name': 'Tiffany', 'birth_date': 19881204}, {'first_name': 'Sarah', 'birth_date': 19880907}, {'first_name': 'Victoria', 'birth_date': 19941214}, {'first_name': 'Natalia', 'birth_date': 19950325}, {'first_name': 'Alexandra', 'birth_date': 19931013}, {'first_name': 'Montana', 'birth_date': 19970219}, {'first_name': 'Samantha Rose', 'birth_date': 19940410}, {'first_name': 'Angela', 'birth_date': 19980331}, {'first_name': 'Samantha', 'birth_date': 19950527}, {'first_name': 'Elizabeth', 'birth_date': 19890419}, {'first_name': 'Sarah', 'birth_date': 19941121}, {'first_name': 'Gabriela', 'birth_date': 19950418}, {'first_name': 'Tina', 'birth_date': 19911222}, {'first_name': 'Mia', 'birth_date': 19920116}, {'first_name': 'Stephanie', 'birth_date': 19920831}, {'first_name': 'Kennan', 'birth_date': 19960317}, {'first_name': 'Madison', 'birth_date': 19930602}, {'first_name': 'Whitney', 'birth_date': 19910815}, {'first_name': 'Sarah', 'birth_date': 19960925}, {'first_name': 'Brooke', 'birth_date': 19980614}, {'first_name': 'Jessie Lynn', 'birth_date': 19951228}, {'first_name': 'Brittany', 'birth_date': 19941212}, {'first_name': 'Kylie', 'birth_date': 19870826}, {'first_name': 'Erin', 'birth_date': 19861102}, {'first_name': 'Lindsay', 'birth_date': 19821118}, {'first_name': 'Jessica', 'birth_date': 19801107}, {'first_name': 'Yuliya', 'birth_date': 19860609}, {'first_name': 'Kathryn', 'birth_date': 19831129}, {'first_name': 'Lyndsey', 'birth_date': 19820509}, {'first_name': 'Tiana', 'birth_date': 19841014}, {'first_name': 'Keri', 'birth_date': 19870310}, {'first_name': 'Sarah', 'birth_date': 19871201}, {'first_name': 'Alyssa', 'birth_date': 19841006}, {'first_name': 'Rachel', 'birth_date': 19870205}, {'first_name': 'Angelina', 'birth_date': 19521229}, {'first_name': 'Amy', 'birth_date': 19540720}, {'first_name': 'Bernadette', 'birth_date': 19821015}, {'first_name': 'Tarrin', 'birth_date': 19820423}, {'first_name': 'Christine', 'birth_date': 19670817}, {'first_name': 'Christian', 'birth_date': 19870108}, {'first_name': 'Emily', 'birth_date': 19820728}, {'first_name': 'Kelly', 'birth_date': 19700330}, {'first_name': 'Courtney', 'birth_date': 19900729}, {'first_name': 'Taylor', 'birth_date': 19900818}, {'first_name': 'Carissa', 'birth_date': 19900507}, {'first_name': 'Heather', 'birth_date': 19810210}, {'first_name': 'Georgiana', 'birth_date': 19880624}, {'first_name': 'Michelle', 'birth_date': 19910127}, {'first_name': 'Brintney', 'birth_date': 19871008}, {'first_name': 'Chisako', 'birth_date': 19870720}, {'first_name': 'Kristen', 'birth_date': 19890819}, {'first_name': 'Jessica', 'birth_date': 19910223}, {'first_name': 'Susie', 'birth_date': 19700212}, {'first_name': 'Ashley', 'birth_date': 19830410}, {'first_name': 'Megan', 'birth_date': 19890818}, {'first_name': 'Larraine', 'birth_date': 19910713}, {'first_name': 'Courtney', 'birth_date': 19920503}, {'first_name': 'Tiffany', 'birth_date': 19860519}, {'first_name': 'Olga', 'birth_date': 19880819}, {'first_name': 'Shauna', 'birth_date': 19900424}, {'first_name': 'Canna', 'birth_date': 19860515}, {'first_name': 'Jennifer', 'birth_date': 19890525}, {'first_name': 'Keri', 'birth_date': ''}, {'first_name': 'Lauren', 'birth_date': 19890922}, {'first_name': 'Whitney', 'birth_date': 19880108}, {'first_name': 'Caitlyn', 'birth_date': 19891220}, {'first_name': 'Stephanie', 'birth_date': 19890627}, {'first_name': 'Jacqueline', 'birth_date': 19910905}, {'first_name': 'Natalia Maria', 'birth_date': 19880414}, {'first_name': 'Katie', 'birth_date': 19921222}, {'first_name': 'Stephanie', 'birth_date': 19880527}, {'first_name': 'Kirsten', 'birth_date': 19810703}, {'first_name': 'Taylor', 'birth_date': 19881121}, {'first_name': 'Rebecca', 'birth_date': 19880627}, {'first_name': 'Maggie', 'birth_date': 19881230}, {'first_name': 'Arianna', 'birth_date': 19910421}, {'first_name': 'Katrina', 'birth_date': 19860415}, {'first_name': 'Jennifer', 'birth_date': 19851029}, {'first_name': 'Amber', 'birth_date': 19920313}, {'first_name': 'Kali A', 'birth_date': 19880211}, {'first_name': 'Merritt', 'birth_date': 19890702}, {'first_name': 'Whitney', 'birth_date': 19860409}, {'first_name': 'Jovana', 'birth_date': 19900831}, {'first_name': 'Daisy', 'birth_date': 19841010}, {'first_name': 'Danice', 'birth_date': 19801001}, {'first_name': 'Dana', 'birth_date': 19870713}, {'first_name': 'Kellie', 'birth_date': 19871004}, {'first_name': 'Magdalena', 'birth_date': 19880701}, {'first_name': 'Alison', 'birth_date': 19900425}, {'first_name': 'Myke', 'birth_date': 19610608}, {'first_name': 'Isadora', 'birth_date': 19920421}, {'first_name': 'Kelly', 'birth_date': 19900622}, {'first_name': 'Kristina', 'birth_date': 19890516}, {'first_name': 'Lindsey', 'birth_date': 19930106}, {'first_name': 'Emily Theresa', 'birth_date': 19901123}, {'first_name': 'Lauren', 'birth_date': 19900423}, {'first_name': 'Jenna', 'birth_date': 19931127}, {'first_name': 'Elizabeth', 'birth_date': 19831216}, {'first_name': 'Kelly', 'birth_date': 19891215}, {'first_name': 'Chelsea', 'birth_date': 19880701}, {'first_name': 'Sabrina', 'birth_date': 19930104}, {'first_name': 'Jamila', 'birth_date': 19920114}, {'first_name': 'Tracy', 'birth_date': 19860926}, {'first_name': 'Whitney', 'birth_date': 19870831}, {'first_name': 'Margaret', 'birth_date': 19910927}, {'first_name': 'Alexandra', 'birth_date': 19920422}, {'first_name': 'Mikayla', 'birth_date': 19880525}, {'first_name': 'Hailee', 'birth_date': 19880530}, {'first_name': 'Maureen', 'birth_date': 19900314}, {'first_name': 'Catherine R', 'birth_date': 19910609}, {'first_name': 'Erin', 'birth_date': 19900530}, {'first_name': 'Maryam', 'birth_date': 19930203}, {'first_name': 'Shabnam', 'birth_date': 19910726}, {'first_name': 'Caitlyn', 'birth_date': 19931013}, {'first_name': 'Chelsea', 'birth_date': 19850919}, {'first_name': 'Ashley', 'birth_date': 19820703}, {'first_name': 'Christina', 'birth_date': 19890331}, {'first_name': 'Chanel', 'birth_date': 19930618}, {'first_name': 'Amanda', 'birth_date': 19890125}, {'first_name': 'Alexandra', 'birth_date': 19891129}, {'first_name': 'Monica', 'birth_date': 19901123}, {'first_name': 'Lauren', 'birth_date': 19890811}, {'first_name': 'Jacquelyn', 'birth_date': 19870304}, {'first_name': 'Jacquelynn', 'birth_date': 19890111}, {'first_name': 'Courtney M', 'birth_date': 19880916}, {'first_name': 'Courtney', 'birth_date': 19820114}, {'first_name': 'Kristen', 'birth_date': 19820114}, {'first_name': 'Cameron', 'birth_date': 19881217}, {'first_name': 'Caroline', 'birth_date': 19900110}, {'first_name': 'Susanne', 'birth_date': 19750213}, {'first_name': 'Sarah', 'birth_date': 19920801}, {'first_name': 'Niltooli', 'birth_date': 19900411}, {'first_name': 'Victoria', 'birth_date': 19891231}, {'first_name': 'Hiromi', 'birth_date': 19900510}, {'first_name': 'Rachel', 'birth_date': 19900209}, {'first_name': 'Sena', 'birth_date': 19970605}, {'first_name': 'Christi', 'birth_date': 19960204}, {'first_name': 'Tatum', 'birth_date': 19970428}, {'first_name': 'Madeline', 'birth_date': 19940911}, {'first_name': 'Julia', 'birth_date': 19890628}, {'first_name': 'Kelly', 'birth_date': 19941021}, {'first_name': 'Jasmine Janelle', 'birth_date': 19920519}, {'first_name': 'Maria', 'birth_date': 19950924}, {'first_name': 'Monet', 'birth_date': 19960106}, {'first_name': 'Cordelia Currey', 'birth_date': 19930607}, {'first_name': 'Millie', 'birth_date': 19911004}, {'first_name': 'Madison', 'birth_date': 19941227}, {'first_name': 'Zaina', 'birth_date': 19970519}, {'first_name': 'Katelyn', 'birth_date': 19870608}, {'first_name': 'Amanda', 'birth_date': 19961028}, {'first_name': 'Anna Kate', 'birth_date': 19941011}, {'first_name': 'Tamijean', 'birth_date': 19980616}, {'first_name': 'Victoria', 'birth_date': 19961202}, {'first_name': 'Christiana', 'birth_date': 19951116}, {'first_name': 'Angie', 'birth_date': 19750716}, {'first_name': 'Kerry', 'birth_date': 19680528}, {'first_name': 'Anna', 'birth_date': 19960128}, {'first_name': 'Sabrina', 'birth_date': 19920113}, {'first_name': 'Brienne', 'birth_date': 19971125}, {'first_name': 'Sarah', 'birth_date': 19960513}, {'first_name': 'Stephanie J', 'birth_date': 19960305}, {'first_name': 'Alexus', 'birth_date': 19970206}, {'first_name': 'Alexandra', 'birth_date': 19990630}, {'first_name': 'Chloe', 'birth_date': 19900921}, {'first_name': 'Megan', 'birth_date': 19960122}, {'first_name': 'Erin', 'birth_date': 19941226}, {'first_name': 'Sydney', 'birth_date': 19950909}, {'first_name': 'Katherine', 'birth_date': ''}, {'first_name': 'Lauren', 'birth_date': 19990905}, {'first_name': 'Teresa', 'birth_date': 19941010}, {'first_name': 'Alix', 'birth_date': 19950718}, {'first_name': 'Alaina', 'birth_date': 19980809}, {'first_name': 'Cassie', 'birth_date': 19950201}, {'first_name': 'Morgan', 'birth_date': 19940208}, {'first_name': 'Kenna', 'birth_date': 19930918}, {'first_name': 'Kelli', 'birth_date': 19931202}, {'first_name': 'Lauren', 'birth_date': 19940618}, {'first_name': 'Katrina', 'birth_date': 19920314}, {'first_name': 'Taylor', 'birth_date': 19921208}, {'first_name': 'Sara Catherine', 'birth_date': 19970130}, {'first_name': 'Tamara', 'birth_date': 19850418}, {'first_name': 'Mckenna Alexandra', 'birth_date': 19970303}, {'first_name': 'Caroline', 'birth_date': 19990809}, {'first_name': 'Hada', 'birth_date': 19980710}, {'first_name': 'Lauren', 'birth_date': 19970108}, {'first_name': 'Jacara', 'birth_date': 19980704}, {'first_name': 'Ndindi Inziani', 'birth_date': 19971224}, {'first_name': 'Susanne', 'birth_date': 19980505}, {'first_name': 'Bianca', 'birth_date': 19960804}, {'first_name': 'Caitlin', 'birth_date': 19960406}, {'first_name': 'Iesha', 'birth_date': 19911109}, {'first_name': 'Chelsie Marie', 'birth_date': 19920321}, {'first_name': 'Aurora', 'birth_date': 19921204}, {'first_name': 'Alexandra', 'birth_date': 19950811}, {'first_name': 'Karolina', 'birth_date': 19990305}, {'first_name': 'Skylar', 'birth_date': 19950616}, {'first_name': 'Jillian', 'birth_date': 20010513}, {'first_name': 'Gabrielle', 'birth_date': 19960114}, {'first_name': 'Gabriella', 'birth_date': 19971216}, {'first_name': 'Allison', 'birth_date': 19980324}, {'first_name': 'Madeline', 'birth_date': 19970403}, {'first_name': 'Darya', 'birth_date': 19981019}, {'first_name': 'Seriana', 'birth_date': 19980227}, {'first_name': 'Erin', 'birth_date': 19960312}, {'first_name': 'Katherine', 'birth_date': 20001206}, {'first_name': 'Vivian', 'birth_date': 20000111}, {'first_name': 'Stephanie M', 'birth_date': 19931110}, {'first_name': 'Sabrina', 'birth_date': 19971216}, {'first_name': 'Kate', 'birth_date': 19971013}, {'first_name': 'Emma', 'birth_date': 20000212}, {'first_name': 'Lauren', 'birth_date': 20010728}, {'first_name': 'Kayla', 'birth_date': 19930220}, {'first_name': 'Khume', 'birth_date': 19961023}, {'first_name': 'Christiana', 'birth_date': 19970614}, {'first_name': 'Candace Olivia', 'birth_date': 19800101}, {'first_name': 'Alycia', 'birth_date': 20001231}, {'first_name': 'Mikayla', 'birth_date': 19990722}, {'first_name': 'Tiffany', 'birth_date': 19971009}, {'first_name': 'Sanyukta', 'birth_date': 20010928}, {'first_name': 'Karly', 'birth_date': 19850115}, {'first_name': 'Emma', 'birth_date': 19940624}, {'first_name': 'Arielle', 'birth_date': 20000910}, {'first_name': 'Marjorie', 'birth_date': 19980202}, {'first_name': 'Anastasiya', 'birth_date': 19990324}, {'first_name': 'Natasha', 'birth_date': ''}, {'first_name': 'Addison', 'birth_date': ''}, {'first_name': 'Mbalia', 'birth_date': 19980107}, {'first_name': 'Safiya', 'birth_date': ''}, {'first_name': 'Taylor', 'birth_date': 20010406}, {'first_name': 'Natasha', 'birth_date': 19920609}, {'first_name': 'Katherine', 'birth_date': 20010213}, {'first_name': 'Madison', 'birth_date': 19961215}, {'first_name': 'Omolola', 'birth_date': 19840818}, {'first_name': 'Reagan', 'birth_date': 19980505}, {'first_name': 'Katelyn', 'birth_date': 19960909}, {'first_name': 'Sophie', 'birth_date': 20021031}, {'first_name': 'Gabrielle', 'birth_date': 19920202}, {'first_name': 'Taylor', 'birth_date': 19981203}, {'first_name': 'Andrea', 'birth_date': 19940728}, {'first_name': 'Annie', 'birth_date': 19870905}, {'first_name': 'Olivia', 'birth_date': 19990308}, {'first_name': 'Imani', 'birth_date': 20011220}, {'first_name': 'Lauren', 'birth_date': 20020523}, {'first_name': 'Taylor', 'birth_date': 20000807}, {'first_name': 'Nicole', 'birth_date': 20000304}, {'first_name': 'Jane', 'birth_date': 19881118}, {'first_name': 'Chelsea', 'birth_date': 20000819}, {'first_name': 'Peyton', 'birth_date': 19990915}, {'first_name': 'Ellie', 'birth_date': 20000523}, {'first_name': 'Jane', 'birth_date': 19931227}, {'first_name': 'Anna', 'birth_date': 20010815}, {'first_name': 'Rosalyn', 'birth_date': 19930622}, {'first_name': 'Madison', 'birth_date': 19990419}, {'first_name': 'Sophia', 'birth_date': 20010718}, {'first_name': 'Jasmine', 'birth_date': 19990813}, {'first_name': 'Theresa', 'birth_date': 19701102}, {'first_name': 'Spirit', 'birth_date': 19941027}, {'first_name': 'Najah', 'birth_date': 20010909}, {'first_name': 'Sharmada', 'birth_date': 19990810}, {'first_name': 'Nicole', 'birth_date': 20000812}, {'first_name': 'Nina', 'birth_date': 20020117}, {'first_name': 'Alexa', 'birth_date': 20020906}, {'first_name': 'Naomi', 'birth_date': 20020516}, {'first_name': 'Sabina', 'birth_date': 20010406}, {'first_name': 'Katie', 'birth_date': 20011231}, {'first_name': 'Nikki', 'birth_date': 20011019}, {'first_name': 'Mccartney', 'birth_date': 19990708}, {'first_name': 'Tricia', 'birth_date': 19920706}, {'first_name': 'Peyton', 'birth_date': 20011008}, {'first_name': 'Anika', 'birth_date': 20010807}, {'first_name': 'Dalayna', 'birth_date': 20001216}, {'first_name': 'Kolie', 'birth_date': 20000317}, {'first_name': 'Cassie', 'birth_date': 19960225}, {'first_name': 'Anna', 'birth_date': 20020102}, {'first_name': 'Monica', 'birth_date': 19950419}, {'first_name': 'Taysia', 'birth_date': 20000708}, {'first_name': 'Kathleen', 'birth_date': 19940728}, {'first_name': 'Amanda', 'birth_date': 19990718}, {'first_name': 'Jimena', 'birth_date': 20000707}, {'first_name': 'Cassidy', 'birth_date': 19950510}, {'first_name': 'Brittany', 'birth_date': 19950405}]
medium
Table matches ( matches.best_of (INT), matches.draw_size (INT), matches.loser_age (FLOAT), matches.loser_entry (TEXT), matches.loser_hand (TEXT), matches.loser_ht (INT), matches.loser_id (INT), matches.loser_ioc (TEXT), matches.loser_name (TEXT), matches.loser_rank (INT), matches.loser_rank_points (INT), matches.loser_seed (INT), matches.match_num (INT), matches.minutes (INT), matches.round (TEXT), matches.score (TEXT), matches.surface (TEXT), matches.tourney_date (DATE), matches.tourney_id (TEXT), matches.tourney_level (TEXT), matches.tourney_name (TEXT), matches.winner_age (FLOAT), matches.winner_entry (TEXT), matches.winner_hand (TEXT), matches.winner_ht (INT), matches.winner_id (INT), matches.winner_ioc (TEXT), matches.winner_name (TEXT), matches.winner_rank (INT), matches.winner_rank_points (INT), matches.winner_seed (INT), matches.year (INT), ) Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Table rankings ( rankings.ranking_date (DATE), rankings.ranking (INT), rankings.player_id (INT), rankings.ranking_points (INT), rankings.tours (INT), ) Possible JOINs: matches.loser_id = players.player_id matches.winner_id = players.player_id rankings.player_id = players.player_id
SELECT first_name , birth_date FROM players WHERE country_code = 'USA'
{ 'players': ['player_id', 'first_name', 'birth_date', 'country_code'] }
Table players ( players.player_id (INT), players.first_name (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Possible JOINs:
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Possible JOINs:
tvshow
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) )
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from Cartoon table: id Title Directed_by Written_by Original_air_date Production_code Channel 1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700 2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701 */ CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) /* 2 rows from TV_Channel table: id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option 700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia 701 Sky Music Italy Italian music 4:3 no no Sky Famiglia */ CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from TV_series table: id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel 1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700 2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701 */
What is the content of TV Channel with serial name "Sky Radio"?
SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio";
[{'Content': 'music'}]
easy
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id TV_series.Channel = TV_Channel.id
SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio";
{ 'tv_channel': ['id', 'series_name', 'content'] }
Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Content (TEXT), ) Possible JOINs:
Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Possible JOINs:
course_teach
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") )
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) /* 2 rows from course table: Course_ID Staring_Date Course 1 5 May Language Arts 2 6 May Math */ CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) /* 2 rows from course_arrange table: Course_ID Teacher_ID Grade 2 5 1 2 3 3 */ CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") ) /* 2 rows from teacher table: Teacher_ID Name Age Hometown 1 Joseph Huts 32 Blackrod Urban District 2 Gustaaf Deloor 29 Bolton County Borough */
Show different hometown of teachers and the number of teachers from each hometown.
SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown
[{'Hometown': 'Blackrod Urban District', 'COUNT(*)': 1}, {'Hometown': 'Bolton County Borough', 'COUNT(*)': 1}, {'Hometown': 'Farnworth Municipal Borough', 'COUNT(*)': 1}, {'Hometown': 'Horwich Urban District', 'COUNT(*)': 1}, {'Hometown': 'Kearsley Urban District', 'COUNT(*)': 1}, {'Hometown': 'Little Lever Urban District', 'COUNT(*)': 1}, {'Hometown': 'Turton Urban District', 'COUNT(*)': 1}]
medium
Table course ( course.Course_ID (INT), course.Staring_Date (TEXT), course.Course (TEXT), ) Table course_arrange ( course_arrange.Course_ID (INT), course_arrange.Teacher_ID (INT), course_arrange.Grade (INT), ) Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs: course_arrange.Course_ID = course.Course_ID course_arrange.Teacher_ID = teacher.Teacher_ID
SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown
{ 'teacher': ['teacher_id', 'hometown'] }
Table teacher ( teacher.Teacher_ID (INT), teacher.Hometown (TEXT), ) Possible JOINs:
Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs:
orchestra
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") )
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) /* 2 rows from conductor table: Conductor_ID Name Age Nationality Year_of_Work 1 Antal Doráti 40 USA 10 2 Igor Stravinsky 41 UK 11 */ CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) /* 2 rows from orchestra table: Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format 1 London Symphony Orchestra 1 Mercury Records 2003.0 CD 2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP */ CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) /* 2 rows from performance table: Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share 1 1 Auditions 1 9 June 5.2 12 22.7% 2 2 Auditions 2 10 June 6.73 8 28.0% */ CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") ) /* 2 rows from show table: Show_ID Performance_ID If_first_show Result Attendance 1 1 True T 1026.0 2 2 True T 695.0 */
What are the maximum and minimum share of performances whose type is not "Live final".
SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != "Live final"
[{'max(SHARE)': '44.7%', 'min(SHARE)': '22.7%'}]
medium
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Table show ( show.Show_ID (INT), show.Performance_ID (INT), show.If_first_show (bool), show.Result (TEXT), show.Attendance (REAL), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID show.Performance_ID = performance.Performance_ID
SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != "Live final"
{ 'performance': ['performance_id', 'type', 'share'] }
Table performance ( performance.Performance_ID (INT), performance.Type (TEXT), performance.Share (TEXT), )
Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Possible JOINs: performance.Orchestra_ID = orchestra.Orchestra_ID
tvshow
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) )
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from Cartoon table: id Title Directed_by Written_by Original_air_date Production_code Channel 1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700 2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701 */ CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) /* 2 rows from TV_Channel table: id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option 700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia 701 Sky Music Italy Italian music 4:3 no no Sky Famiglia */ CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from TV_series table: id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel 1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700 2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701 */
What is the pixel aspect ratio and country of origin for all TV channels that do not use English?
SELECT Pixel_aspect_ratio_PAR , country FROM tv_channel WHERE LANGUAGE != 'English'
[{'Pixel_aspect_ratio_PAR': '4:3', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3 / 16:9', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '16:9', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '16:9', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '16:9', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3 / 16:9', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3 / 16:9', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3', 'Country': 'Italy'}, {'Pixel_aspect_ratio_PAR': '4:3', 'Country': 'Italy'}]
medium
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id TV_series.Channel = TV_Channel.id
SELECT Pixel_aspect_ratio_PAR , country FROM tv_channel WHERE LANGUAGE != 'English'
{ 'tv_channel': ['id', 'country', 'language', 'pixel_aspect_ratio_par'] }
Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), ) Possible JOINs:
Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Possible JOINs:
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
List the date of each treatment, together with the first name of the professional who operated it.
SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id
[{'date_of_treatment': '2018-03-19 04:39:54', 'first_name': 'Monte'}, {'date_of_treatment': '2018-03-15 20:25:34', 'first_name': 'Domenica'}, {'date_of_treatment': '2018-03-08 05:26:23', 'first_name': 'Vernice'}, {'date_of_treatment': '2018-03-01 04:14:46', 'first_name': 'Karley'}, {'date_of_treatment': '2018-03-23 13:52:10', 'first_name': 'Sigurd'}, {'date_of_treatment': '2018-03-11 04:23:15', 'first_name': 'Vernice'}, {'date_of_treatment': '2018-03-10 11:45:58', 'first_name': 'Sigurd'}, {'date_of_treatment': '2018-03-24 22:25:58', 'first_name': 'Ruben'}, {'date_of_treatment': '2018-03-14 19:10:40', 'first_name': 'Domenica'}, {'date_of_treatment': '2018-02-28 17:09:43', 'first_name': 'Velva'}, {'date_of_treatment': '2018-03-13 12:22:58', 'first_name': 'Danny'}, {'date_of_treatment': '2018-03-16 10:27:36', 'first_name': 'Monte'}, {'date_of_treatment': '2018-02-26 09:08:53', 'first_name': 'Karley'}, {'date_of_treatment': '2018-03-04 20:33:43', 'first_name': 'Monte'}, {'date_of_treatment': '2018-03-15 19:10:02', 'first_name': 'Ruben'}]
medium
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT Treatments.date_of_treatment , Professionals.first_name FROM Treatments JOIN Professionals ON Treatments.professional_id = Professionals.professional_id
{ 'treatments': ['treatment_id', 'professional_id', 'date_of_treatment'], 'professionals': ['professional_id', 'first_name'] }
Table Professionals ( Professionals.professional_id (INTEGER), Professionals.first_name (VARCHAR(50)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.date_of_treatment (DATETIME), ) Possible JOINs: Treatments.professional_id = Professionals.professional_id
Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
course_teach
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") )
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) /* 2 rows from course table: Course_ID Staring_Date Course 1 5 May Language Arts 2 6 May Math */ CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) /* 2 rows from course_arrange table: Course_ID Teacher_ID Grade 2 5 1 2 3 3 */ CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") ) /* 2 rows from teacher table: Teacher_ID Name Age Hometown 1 Joseph Huts 32 Blackrod Urban District 2 Gustaaf Deloor 29 Bolton County Borough */
What are the names of the teachers who are aged either 32 or 33?
SELECT Name FROM teacher WHERE Age = 32 OR Age = 33
[{'Name': 'Joseph Huts'}, {'Name': 'John Deloor'}]
medium
Table course ( course.Course_ID (INT), course.Staring_Date (TEXT), course.Course (TEXT), ) Table course_arrange ( course_arrange.Course_ID (INT), course_arrange.Teacher_ID (INT), course_arrange.Grade (INT), ) Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs: course_arrange.Course_ID = course.Course_ID course_arrange.Teacher_ID = teacher.Teacher_ID
SELECT Name FROM teacher WHERE Age = 32 OR Age = 33
{ 'teacher': ['teacher_id', 'name', 'age'] }
Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), ) Possible JOINs:
Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs:
employee_hire_evaluation
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") )
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) /* 2 rows from employee table: Employee_ID Name Age City 1 George Chuter 23 Bristol 2 Lee Mears 29 Bath */ CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) /* 2 rows from evaluation table: Employee_ID Year_awarded Bonus 1 2011 3000.0 2 2015 3200.0 */ CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) /* 2 rows from hiring table: Shop_ID Employee_ID Start_from Is_full_time 1 1 2009 True 1 2 2003 True */ CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") ) /* 2 rows from shop table: Shop_ID Name Location District Number_products Manager_name 1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen 2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen */
Find the name of the shops that do not hire any employee.
SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring)
[{'Name': 'FC Honka'}, {'Name': 'KuPS'}, {'Name': 'IFK Mariehamn'}]
hard
Table employee ( employee.Employee_ID (INT), employee.Name (TEXT), employee.Age (INT), employee.City (TEXT), ) Table evaluation ( evaluation.Employee_ID (TEXT), evaluation.Year_awarded (TEXT), evaluation.Bonus (REAL), ) Table hiring ( hiring.Shop_ID (INT), hiring.Employee_ID (INT), hiring.Start_from (TEXT), hiring.Is_full_time (bool), ) Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs: evaluation.Employee_ID = employee.Employee_ID hiring.Shop_ID = shop.Shop_ID hiring.Employee_ID = employee.Employee_ID
SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring)
{ 'shop': ['shop_id', 'name'], 'hiring': ['shop_id', 'employee_id'] }
Table hiring ( hiring.Shop_ID (INT), hiring.Employee_ID (INT), ) Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), )
Table hiring ( hiring.Shop_ID (INT), hiring.Employee_ID (INT), hiring.Start_from (TEXT), hiring.Is_full_time (bool), ) Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs: hiring.Shop_ID = shop.Shop_ID hiring.Employee_ID = employee.Employee_ID
concert_singer
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") )
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) /* 2 rows from concert table: concert_ID concert_Name Theme Stadium_ID Year 1 Auditions Free choice 1 2014 2 Super bootcamp Free choice 2 2 2014 */ CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Country Song_Name Song_release_year Age Is_male 1 Joe Sharp Netherlands You 1992 52 True 2 Timbaland United States Dangerous 2008 32 True */ CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from singer_in_concert table: concert_ID Singer_ID 1 2 1 3 */ CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") ) /* 2 rows from stadium table: Stadium_ID Location Name Capacity Highest Lowest Average 1 Raith Rovers Stark's Park 10104 4812 1294 2106 2 Ayr United Somerset Park 11998 2363 1057 1477 */
What are the names of the singers and number of concerts for each person?
SELECT T2.name , count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id
[{'Name': 'Timbaland', 'count(*)': 2}, {'Name': 'Justin Brown', 'count(*)': 3}, {'Name': 'Rose White', 'count(*)': 1}, {'Name': 'John Nizinik', 'count(*)': 2}, {'Name': 'Tribal King', 'count(*)': 2}]
medium
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), singer.Song_release_year (TEXT), singer.Age (INT), singer.Is_male (bool), ) Table singer_in_concert ( singer_in_concert.concert_ID (INT), singer_in_concert.Singer_ID (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Location (TEXT), stadium.Name (TEXT), stadium.Capacity (INT), stadium.Highest (INT), stadium.Lowest (INT), stadium.Average (INT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID singer_in_concert.concert_ID = concert.concert_ID singer_in_concert.Singer_ID = singer.Singer_ID
SELECT singer.name , count(*) FROM singer_in_concert JOIN singer ON singer_in_concert.singer_id = singer.singer_id GROUP BY singer.singer_id
{ 'singer_in_concert': ['concert_id', 'singer_id'], 'singer': ['singer_id', 'name'] }
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), ) Table singer_in_concert ( singer_in_concert.concert_ID (INT), singer_in_concert.Singer_ID (TEXT), )
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), singer.Song_release_year (TEXT), singer.Age (INT), singer.Is_male (bool), ) Table singer_in_concert ( singer_in_concert.concert_ID (INT), singer_in_concert.Singer_ID (TEXT), ) Possible JOINs: singer_in_concert.concert_ID = concert.concert_ID singer_in_concert.Singer_ID = singer.Singer_ID
pets_1
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from Has_Pet table: StuID PetID 1001 2001 1002 2002 */ CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) /* 2 rows from Pets table: PetID PetType pet_age weight 2001 cat 3 12.0 2002 dog 2 13.4 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
Find the number of pets whose weight is heavier than 10.
SELECT count(*) FROM pets WHERE weight > 10
[{'count(*)': 2}]
easy
Table Has_Pet ( Has_Pet.StuID (INTEGER), Has_Pet.PetID (INTEGER), ) Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Table Student ( Student.StuID (INTEGER), Student.LName (VARCHAR(12)), Student.Fname (VARCHAR(12)), Student.Age (INTEGER), Student.Sex (VARCHAR(1)), Student.Major (INTEGER), Student.Advisor (INTEGER), Student.city_code (VARCHAR(3)), ) Possible JOINs: Has_Pet.StuID = Student.StuID Has_Pet.PetID = Pets.PetID
SELECT count(*) FROM pets WHERE weight > 10
{ 'pets': ['petid', 'weight'] }
Table Pets ( Pets.PetID (INTEGER), Pets.weight (REAL), ) Possible JOINs:
Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Possible JOINs:
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
For the countries founded before 1930, what is the total number of distinct official languages?
SELECT count(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = "T"
[{'count(DISTINCT T2.Language)': 40}]
medium
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT count(DISTINCT countrylanguage.Language) FROM country JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE IndepYear < 1930 AND countrylanguage.IsOfficial = "T"
{ 'country': ['code', 'indepyear'], 'countrylanguage': ['countrycode', 'language', 'isofficial'] }
Table country ( country.Code (char(3)), country.IndepYear (INTEGER), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), )
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: countrylanguage.CountryCode = country.Code
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
Find the arriving date and the departing date of the dogs that received a treatment.
SELECT DISTINCT T1.date_arrived , T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id
[{'date_arrived': '2017-06-18 19:45:38', 'date_departed': '2018-03-24 23:48:59'}, {'date_arrived': '2017-04-20 00:58:55', 'date_departed': '2018-03-24 19:12:22'}, {'date_arrived': '2017-12-22 05:02:02', 'date_departed': '2018-03-25 02:11:32'}, {'date_arrived': '2017-10-24 04:45:13', 'date_departed': '2018-03-25 14:15:41'}, {'date_arrived': '2017-12-29 06:08:26', 'date_departed': '2018-03-25 04:42:14'}, {'date_arrived': '2017-12-29 23:24:13', 'date_departed': '2018-03-24 19:36:59'}, {'date_arrived': '2018-01-02 03:15:29', 'date_departed': '2018-03-25 05:07:47'}, {'date_arrived': '2017-05-06 08:03:52', 'date_departed': '2018-03-25 06:29:10'}, {'date_arrived': '2017-09-08 20:10:13', 'date_departed': '2018-03-25 06:58:44'}]
medium
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT DISTINCT Dogs.date_arrived , Dogs.date_departed FROM Dogs JOIN Treatments ON Dogs.dog_id = Treatments.dog_id
{ 'dogs': ['dog_id', 'date_arrived', 'date_departed'], 'treatments': ['treatment_id', 'dog_id'] }
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.date_arrived (DATETIME), Dogs.date_departed (DATETIME), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), ) Possible JOINs: Treatments.dog_id = Dogs.dog_id
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
What are each owner's first name and their dogs's name?
SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id
[{'first_name': 'Jaclyn', 'name': 'Kacey'}, {'first_name': 'Gay', 'name': 'Hipolito'}, {'first_name': 'Nora', 'name': 'Mavis'}, {'first_name': 'Rachelle', 'name': 'Houston'}, {'first_name': 'Emelie', 'name': 'Jeffrey'}, {'first_name': 'Johann', 'name': 'Merritt'}, {'first_name': 'Jaclyn', 'name': 'Narciso'}, {'first_name': 'Rachelle', 'name': 'George'}, {'first_name': 'Melisa', 'name': 'Bessie'}, {'first_name': 'Kade', 'name': 'Troy'}, {'first_name': 'Cindy', 'name': 'Betty'}, {'first_name': 'Orlando', 'name': 'Holden'}, {'first_name': 'Rolando', 'name': 'Jesus'}, {'first_name': 'Rachelle', 'name': 'Lyric'}, {'first_name': 'Lorenz', 'name': 'Evangeline'}]
medium
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT Owners.first_name , Dogs.name FROM Owners JOIN Dogs ON Owners.owner_id = Dogs.owner_id
{ 'owners': ['owner_id', 'first_name'], 'dogs': ['dog_id', 'owner_id', 'name'] }
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.name (VARCHAR(50)), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code
wta_1
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 0 rows from players table: player_id first_name last_name hand birth_date country_code */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 0 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 0 rows from rankings table: ranking_date ranking player_id ranking_points tours */
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 2 rows from players table: player_id first_name last_name hand birth_date country_code 200001 Martina Hingis R 19800930 SUI 200002 Mirjana Lucic R 19820309 CRO */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 2 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year 3 4 24.626967830300003 R 170 201474 POL Agnieszka Radwanska 4 5890 3 297 82 RR 6-2 6-4 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 3 4 23.6221765914 L 183 201520 CZE Petra Kvitova 6 4370 5 296 72 RR 6-2 6-3 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 2 rows from rankings table: ranking_date ranking player_id ranking_points tours 20000101 3 200748 4378 13 20000101 4 200033 3021 15 */
find the code of the country where has the greatest number of players.
SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) DESC LIMIT 1
[{'country_code': 'USA'}]
hard
Table matches ( matches.best_of (INT), matches.draw_size (INT), matches.loser_age (FLOAT), matches.loser_entry (TEXT), matches.loser_hand (TEXT), matches.loser_ht (INT), matches.loser_id (INT), matches.loser_ioc (TEXT), matches.loser_name (TEXT), matches.loser_rank (INT), matches.loser_rank_points (INT), matches.loser_seed (INT), matches.match_num (INT), matches.minutes (INT), matches.round (TEXT), matches.score (TEXT), matches.surface (TEXT), matches.tourney_date (DATE), matches.tourney_id (TEXT), matches.tourney_level (TEXT), matches.tourney_name (TEXT), matches.winner_age (FLOAT), matches.winner_entry (TEXT), matches.winner_hand (TEXT), matches.winner_ht (INT), matches.winner_id (INT), matches.winner_ioc (TEXT), matches.winner_name (TEXT), matches.winner_rank (INT), matches.winner_rank_points (INT), matches.winner_seed (INT), matches.year (INT), ) Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Table rankings ( rankings.ranking_date (DATE), rankings.ranking (INT), rankings.player_id (INT), rankings.ranking_points (INT), rankings.tours (INT), ) Possible JOINs: matches.loser_id = players.player_id matches.winner_id = players.player_id rankings.player_id = players.player_id
SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) DESC LIMIT 1
{ 'players': ['player_id', 'country_code'] }
Table players ( players.player_id (INT), players.country_code (TEXT), ) Possible JOINs:
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Possible JOINs:
orchestra
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") )
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) /* 2 rows from conductor table: Conductor_ID Name Age Nationality Year_of_Work 1 Antal Doráti 40 USA 10 2 Igor Stravinsky 41 UK 11 */ CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) /* 2 rows from orchestra table: Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format 1 London Symphony Orchestra 1 Mercury Records 2003.0 CD 2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP */ CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) /* 2 rows from performance table: Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share 1 1 Auditions 1 9 June 5.2 12 22.7% 2 2 Auditions 2 10 June 6.73 8 28.0% */ CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") ) /* 2 rows from show table: Show_ID Performance_ID If_first_show Result Attendance 1 1 True T 1026.0 2 2 True T 695.0 */
List the names of orchestras that have no performance.
SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
[{'Orchestra': 'San Francisco Symphony Orchestra'}]
hard
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Table show ( show.Show_ID (INT), show.Performance_ID (INT), show.If_first_show (bool), show.Result (TEXT), show.Attendance (REAL), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID show.Performance_ID = performance.Performance_ID
SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
{ 'orchestra': ['orchestra_id', 'orchestra'], 'performance': ['performance_id', 'orchestra_id'] }
Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), ) Possible JOINs:
Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID
pets_1
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from Has_Pet table: StuID PetID 1001 2001 1002 2002 */ CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) /* 2 rows from Pets table: PetID PetType pet_age weight 2001 cat 3 12.0 2002 dog 2 13.4 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
What are the students' first names who have both cats and dogs as pets?
SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog'
[{'Nenhum': 'Nenhum resultado encontrado'}]
extra
Table Has_Pet ( Has_Pet.StuID (INTEGER), Has_Pet.PetID (INTEGER), ) Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Table Student ( Student.StuID (INTEGER), Student.LName (VARCHAR(12)), Student.Fname (VARCHAR(12)), Student.Age (INTEGER), Student.Sex (VARCHAR(1)), Student.Major (INTEGER), Student.Advisor (INTEGER), Student.city_code (VARCHAR(3)), ) Possible JOINs: Has_Pet.StuID = Student.StuID Has_Pet.PetID = Pets.PetID
SELECT student.Fname FROM student JOIN has_pet ON student.stuid = has_pet.stuid JOIN pets ON pets.petid = has_pet.petid WHERE pets.pettype = 'cat' INTERSECT SELECT student.Fname FROM student JOIN has_pet ON student.stuid = has_pet.stuid JOIN pets ON pets.petid = has_pet.petid WHERE pets.pettype = 'dog'
{ 'student': ['stuid', 'fname'], 'has_pet': ['stuid', 'petid'], 'pets': ['petid', 'pettype'] }
Table Has_Pet ( Has_Pet.StuID (INTEGER), Has_Pet.PetID (INTEGER), ) Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), ) Table Student ( Student.StuID (INTEGER), Student.Fname (VARCHAR(12)), )
Table Has_Pet ( Has_Pet.StuID (INTEGER), Has_Pet.PetID (INTEGER), ) Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Table Student ( Student.StuID (INTEGER), Student.LName (VARCHAR(12)), Student.Fname (VARCHAR(12)), Student.Age (INTEGER), Student.Sex (VARCHAR(1)), Student.Major (INTEGER), Student.Advisor (INTEGER), Student.city_code (VARCHAR(3)), ) Possible JOINs: Has_Pet.StuID = Student.StuID Has_Pet.PetID = Pets.PetID
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
Give the total population and average surface area corresponding to countries in North America that have a surface area greater than 3000 .
SELECT sum(population) , avg(surfacearea) FROM country WHERE continent = "north america" AND surfacearea > 3000
[{'sum(population)': None, 'avg(surfacearea)': None}]
hard
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT sum(population) , avg(surfacearea) FROM country WHERE continent = "north america" AND surfacearea > 3000
{ 'country': ['code', 'continent', 'surfacearea', 'population'] }
Table country ( country.Code (char(3)), country.Continent (TEXT), country.SurfaceArea (float(10,2)), country.Population (INTEGER), ) Possible JOINs:
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Possible JOINs:
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
Give me the description of the treatment type whose total cost is the lowest.
SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1
[{'treatment_type_description': 'Take for a Walk'}]
extra
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT Treatment_types.treatment_type_description FROM Treatment_types JOIN Treatments ON Treatment_types.treatment_type_code = Treatments.treatment_type_code GROUP BY Treatment_types.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1
{ 'treatment_types': ['treatment_type_code', 'treatment_type_description'], 'treatments': ['treatment_id', 'treatment_type_code', 'cost_of_treatment'] }
Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Treatments.treatment_type_code = Treatment_Types.treatment_type_code
Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
tvshow
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) )
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from Cartoon table: id Title Directed_by Written_by Original_air_date Production_code Channel 1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700 2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701 */ CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) /* 2 rows from TV_Channel table: id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option 700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia 701 Sky Music Italy Italian music 4:3 no no Sky Famiglia */ CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from TV_series table: id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel 1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700 2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701 */
Find the production code and channel of the most recently aired cartoon .
SELECT production_code , channel FROM cartoon ORDER BY original_air_date DESC LIMIT 1
[{'Production_code': 102.0, 'Channel': '701'}]
medium
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id TV_series.Channel = TV_Channel.id
SELECT production_code , channel FROM cartoon ORDER BY original_air_date DESC LIMIT 1
{ 'cartoon': ['id', 'original_air_date', 'production_code', 'channel'] }
Table Cartoon ( Cartoon.id (REAL), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), )
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
What languages are only used by a single country with a republic government?
SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = "Republic" GROUP BY T2.Language HAVING COUNT(*) = 1
[{'Language': 'Abhyasi'}, {'Language': 'Acholi'}, {'Language': 'Adja'}, {'Language': 'Aizo'}, {'Language': 'Ambo'}, {'Language': 'Amhara'}, {'Language': 'Ami'}, {'Language': 'Ane'}, {'Language': 'Arabic-French'}, {'Language': 'Arabic-French-English'}, {'Language': 'Araucan'}, {'Language': 'Assyrian'}, {'Language': 'Atayal'}, {'Language': 'Bajad'}, {'Language': 'Balante'}, {'Language': 'Bali'}, {'Language': 'Balochi'}, {'Language': 'Bambara'}, {'Language': 'Bamileke-bamum'}, {'Language': 'Banda'}, {'Language': 'Banja'}, {'Language': 'Bariba'}, {'Language': 'Bassa'}, {'Language': 'Batakki'}, {'Language': 'Bemba'}, {'Language': 'Bengali'}, {'Language': 'Berberi'}, {'Language': 'Bhojpuri'}, {'Language': 'Bicol'}, {'Language': 'Bilin'}, {'Language': 'Bislama'}, {'Language': 'Boa'}, {'Language': 'Brahui'}, {'Language': 'Bubi'}, {'Language': 'Bugi'}, {'Language': 'Bullom-sherbro'}, {'Language': 'Burmese'}, {'Language': 'Buryat'}, {'Language': 'Busansi'}, {'Language': 'Cakchiquel'}, {'Language': 'Caprivi'}, {'Language': 'Cebuano'}, {'Language': 'Chaga and Pare'}, {'Language': 'Chakma'}, {'Language': 'Chewa'}, {'Language': 'Chichewa'}, {'Language': 'Chin'}, {'Language': 'Chuabo'}, {'Language': 'Comorian'}, {'Language': 'Comorian-Arabic'}, {'Language': 'Comorian-French'}, {'Language': 'Comorian-Swahili'}, {'Language': 'Comorian-madagassi'}, {'Language': 'Cuna'}, {'Language': 'Czech'}, {'Language': 'Czech and Moravian'}, {'Language': 'Dagara'}, {'Language': 'Dariganga'}, {'Language': 'Dhivehi'}, {'Language': 'Dorbet'}, {'Language': 'Duala'}, {'Language': 'Dyula'}, {'Language': 'Embera'}, {'Language': 'Fijian'}, {'Language': 'Fon'}, {'Language': 'Friuli'}, {'Language': 'Ga-adangme'}, {'Language': 'Gagauzi'}, {'Language': 'Ganda'}, {'Language': 'Garifuna'}, {'Language': 'Garo'}, {'Language': 'Gbaya'}, {'Language': 'Georgiana'}, {'Language': 'Gio'}, {'Language': 'Gisu'}, {'Language': 'Gogo'}, {'Language': 'Gorane'}, {'Language': 'Grebo'}, {'Language': 'Guaymí'}, {'Language': 'Gur'}, {'Language': 'Gurage'}, {'Language': 'Gusii'}, {'Language': 'Ha'}, {'Language': 'Hadareb'}, {'Language': 'Hadjarai'}, {'Language': 'Haiti Creole'}, {'Language': 'Hakka'}, {'Language': 'Hassaniya'}, {'Language': 'Hausa'}, {'Language': 'Haya'}, {'Language': 'Hebrew'}, {'Language': 'Hehet'}, {'Language': 'Herero'}, {'Language': 'Hiligaynon'}, {'Language': 'Hindko'}, {'Language': 'Icelandic'}, {'Language': 'Ilocano'}, {'Language': 'Irish'}, {'Language': 'Javanese'}, {'Language': 'Kabyé'}, {'Language': 'Kachin'}, {'Language': 'Kalenjin'}, {'Language': 'Kamba'}, {'Language': 'Kanem-bornu'}, {'Language': 'Kanuri'}, {'Language': 'Karakalpak'}, {'Language': 'Karen'}, {'Language': 'Kavango'}, {'Language': 'Kayah'}, {'Language': 'Kekchí'}, {'Language': 'Khasi'}, {'Language': 'Khoekhoe'}, {'Language': 'Kiga'}, {'Language': 'Kikuyu'}, {'Language': 'Kirgiz'}, {'Language': 'Kirundi'}, {'Language': 'Kissi'}, {'Language': 'Kono-vai'}, {'Language': 'Korean'}, {'Language': 'Kotokoli'}, {'Language': 'Kuranko'}, {'Language': 'Lango'}, {'Language': 'Lao'}, {'Language': 'Lao-Soung'}, {'Language': 'Latvian'}, {'Language': 'Limba'}, {'Language': 'Lozi'}, {'Language': 'Luba'}, {'Language': 'Luchazi'}, {'Language': 'Lugbara'}, {'Language': 'Luguru'}, {'Language': 'Luhya'}, {'Language': 'Luimbe-nganguela'}, {'Language': 'Luo'}, {'Language': 'Luvale'}, {'Language': 'Madura'}, {'Language': 'Maguindanao'}, {'Language': 'Maka'}, {'Language': 'Makonde'}, {'Language': 'Makua'}, {'Language': 'Maltese'}, {'Language': 'Mam'}, {'Language': 'Mandara'}, {'Language': 'Mandarin Chinese'}, {'Language': 'Mandjia'}, {'Language': 'Mandyako'}, {'Language': 'Mano'}, {'Language': 'Maranao'}, {'Language': 'Marathi'}, {'Language': 'Marendje'}, {'Language': 'Marma'}, {'Language': 'Marshallese'}, {'Language': 'Masai'}, {'Language': 'Masana'}, {'Language': 'Mayo-kebbi'}, {'Language': 'Mboshi'}, {'Language': 'Mbum'}, {'Language': 'Mbundu'}, {'Language': 'Mende'}, {'Language': 'Meru'}, {'Language': 'Min'}, {'Language': 'Minangkabau'}, {'Language': 'Mixed Languages'}, {'Language': 'Moba'}, {'Language': 'Mon'}, {'Language': 'Mon-khmer'}, {'Language': 'Mongo'}, {'Language': 'Mongolian'}, {'Language': 'Moravian'}, {'Language': 'Mpongwe'}, {'Language': 'Nahua'}, {'Language': 'Nama'}, {'Language': 'Naudemba'}, {'Language': 'Nauru'}, {'Language': 'Ngala and Bangi'}, {'Language': 'Ngbaka'}, {'Language': 'Ngoni'}, {'Language': 'Nkole'}, {'Language': 'Northsotho'}, {'Language': 'Nsenga'}, {'Language': 'Nyakusa'}, {'Language': 'Nyamwesi'}, {'Language': 'Nyaneka-nkhumbi'}, {'Language': 'Nyika'}, {'Language': 'Oromo'}, {'Language': 'Osseetti'}, {'Language': 'Ouaddai'}, {'Language': 'Ovambo'}, {'Language': 'Ovimbundu'}, {'Language': 'Paiwan'}, {'Language': 'Palau'}, {'Language': 'Pampango'}, {'Language': 'Pangasinan'}, {'Language': 'Pashto'}, {'Language': 'Persian'}, {'Language': 'Philippene Languages'}, {'Language': 'Pilipino'}, {'Language': 'Punjabi'}, {'Language': 'Punu'}, {'Language': 'Punu-sira-nzebi'}, {'Language': 'Quiché'}, {'Language': 'Rakhine'}, {'Language': 'Rapa nui'}, {'Language': 'Ronga'}, {'Language': 'Rundi'}, {'Language': 'Saame'}, {'Language': 'Saho'}, {'Language': 'Sango'}, {'Language': 'Santhali'}, {'Language': 'Saraiki'}, {'Language': 'Sardinian'}, {'Language': 'Sena'}, {'Language': 'Senufo and Minianka'}, {'Language': 'Serer'}, {'Language': 'Seselwa'}, {'Language': 'Shambala'}, {'Language': 'Shan'}, {'Language': 'Sidamo'}, {'Language': 'Silesiana'}, {'Language': 'Sinaberberi'}, {'Language': 'Sindhi'}, {'Language': 'Singali'}, {'Language': 'Soga'}, {'Language': 'Somba'}, {'Language': 'Songhai'}, {'Language': 'Songhai-zerma'}, {'Language': 'Soqutri'}, {'Language': 'Southsotho'}, {'Language': 'Sranantonga'}, {'Language': 'Sumo'}, {'Language': 'Sunda'}, {'Language': 'Susu'}, {'Language': 'Swazi'}, {'Language': 'Swedish'}, {'Language': 'Tandjile'}, {'Language': 'Temne'}, {'Language': 'Teso'}, {'Language': 'Thai'}, {'Language': 'Tigre'}, {'Language': 'Tikar'}, {'Language': 'Tongan'}, {'Language': 'Tripuri'}, {'Language': 'Tswa'}, {'Language': 'Tukulor'}, {'Language': 'Turkana'}, {'Language': 'Turkmenian'}, {'Language': 'Ukrainian and Russian'}, {'Language': 'Urdu'}, {'Language': 'Venda'}, {'Language': 'Walaita'}, {'Language': 'Waray-waray'}, {'Language': 'Watyi'}, {'Language': 'Xhosa'}, {'Language': 'Yao'}, {'Language': 'Zande'}, {'Language': 'Zenaga'}, {'Language': 'Zulu'}, {'Language': '[South]Mande'}]
hard
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT countrylanguage.Language FROM country JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE country.GovernmentForm = "Republic" GROUP BY countrylanguage.Language HAVING COUNT(*) = 1
{ 'country': ['code', 'governmentform'], 'countrylanguage': ['countrycode', 'language'] }
Table country ( country.Code (char(3)), country.GovernmentForm (char(45)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), )
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: countrylanguage.CountryCode = country.Code
course_teach
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") )
CREATE TABLE course ( "Course_ID" INTEGER, "Staring_Date" TEXT, "Course" TEXT, PRIMARY KEY ("Course_ID") ) /* 2 rows from course table: Course_ID Staring_Date Course 1 5 May Language Arts 2 6 May Math */ CREATE TABLE course_arrange ( "Course_ID" INTEGER, "Teacher_ID" INTEGER, "Grade" INTEGER, PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID") ) /* 2 rows from course_arrange table: Course_ID Teacher_ID Grade 2 5 1 2 3 3 */ CREATE TABLE teacher ( "Teacher_ID" INTEGER, "Name" TEXT, "Age" TEXT, "Hometown" TEXT, PRIMARY KEY ("Teacher_ID") ) /* 2 rows from teacher table: Teacher_ID Name Age Hometown 1 Joseph Huts 32 Blackrod Urban District 2 Gustaaf Deloor 29 Bolton County Borough */
What is the most commmon hometowns for teachers?
SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1
[{'Hometown': 'Turton Urban District'}]
hard
Table course ( course.Course_ID (INT), course.Staring_Date (TEXT), course.Course (TEXT), ) Table course_arrange ( course_arrange.Course_ID (INT), course_arrange.Teacher_ID (INT), course_arrange.Grade (INT), ) Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs: course_arrange.Course_ID = course.Course_ID course_arrange.Teacher_ID = teacher.Teacher_ID
SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1
{ 'teacher': ['teacher_id', 'hometown'] }
Table teacher ( teacher.Teacher_ID (INT), teacher.Hometown (TEXT), ) Possible JOINs:
Table teacher ( teacher.Teacher_ID (INT), teacher.Name (TEXT), teacher.Age (TEXT), teacher.Hometown (TEXT), ) Possible JOINs:
student_transcripts_tracking
CREATE TABLE "Addresses" ( address_id INTEGER, line_1 VARCHAR(255), line_2 VARCHAR(255), line_3 VARCHAR(255), city VARCHAR(255), zip_postcode VARCHAR(20), state_province_county VARCHAR(255), country VARCHAR(255), other_address_details VARCHAR(255), PRIMARY KEY (address_id) ) CREATE TABLE "Courses" ( course_id INTEGER, course_name VARCHAR(255), course_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (course_id) ) CREATE TABLE "Degree_Programs" ( degree_program_id INTEGER, department_id INTEGER NOT NULL, degree_summary_name VARCHAR(255), degree_summary_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (degree_program_id), FOREIGN KEY(department_id) REFERENCES "Departments" (department_id) ) CREATE TABLE "Departments" ( department_id INTEGER, department_name VARCHAR(255), department_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (department_id) ) CREATE TABLE "Sections" ( section_id INTEGER, course_id INTEGER NOT NULL, section_name VARCHAR(255), section_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (section_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) CREATE TABLE "Semesters" ( semester_id INTEGER, semester_name VARCHAR(255), semester_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (semester_id) ) CREATE TABLE "Student_Enrolment" ( student_enrolment_id INTEGER, degree_program_id INTEGER NOT NULL, semester_id INTEGER NOT NULL, student_id INTEGER NOT NULL, other_details VARCHAR(255), PRIMARY KEY (student_enrolment_id), FOREIGN KEY(student_id) REFERENCES "Students" (student_id), FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id), FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id) ) CREATE TABLE "Student_Enrolment_Courses" ( student_course_id INTEGER, course_id INTEGER NOT NULL, student_enrolment_id INTEGER NOT NULL, PRIMARY KEY (student_course_id), FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) CREATE TABLE "Students" ( student_id INTEGER, current_address_id INTEGER NOT NULL, permanent_address_id INTEGER NOT NULL, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), ssn VARCHAR(40), date_first_registered DATETIME, date_left DATETIME, other_student_details VARCHAR(255), PRIMARY KEY (student_id), FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id), FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id) ) CREATE TABLE "Transcript_Contents" ( student_course_id INTEGER NOT NULL, transcript_id INTEGER NOT NULL, FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id), FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id) ) CREATE TABLE "Transcripts" ( transcript_id INTEGER, transcript_date DATETIME, other_details VARCHAR(255), PRIMARY KEY (transcript_id) )
CREATE TABLE "Addresses" ( address_id INTEGER, line_1 VARCHAR(255), line_2 VARCHAR(255), line_3 VARCHAR(255), city VARCHAR(255), zip_postcode VARCHAR(20), state_province_county VARCHAR(255), country VARCHAR(255), other_address_details VARCHAR(255), PRIMARY KEY (address_id) ) /* 2 rows from Addresses table: address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details 1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None 2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None */ CREATE TABLE "Courses" ( course_id INTEGER, course_name VARCHAR(255), course_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (course_id) ) /* 2 rows from Courses table: course_id course_name course_description other_details 1 ds p None 2 math q None */ CREATE TABLE "Degree_Programs" ( degree_program_id INTEGER, department_id INTEGER NOT NULL, degree_summary_name VARCHAR(255), degree_summary_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (degree_program_id), FOREIGN KEY(department_id) REFERENCES "Departments" (department_id) ) /* 2 rows from Degree_Programs table: degree_program_id department_id degree_summary_name degree_summary_description other_details 1 13 Master architecto None 2 2 Master cumque None */ CREATE TABLE "Departments" ( department_id INTEGER, department_name VARCHAR(255), department_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (department_id) ) /* 2 rows from Departments table: department_id department_name department_description other_details 1 computer science error None 2 history nostrum None */ CREATE TABLE "Sections" ( section_id INTEGER, course_id INTEGER NOT NULL, section_name VARCHAR(255), section_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (section_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) /* 2 rows from Sections table: section_id course_id section_name section_description other_details 1 9 a non None 2 2 b voluptatem None */ CREATE TABLE "Semesters" ( semester_id INTEGER, semester_name VARCHAR(255), semester_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (semester_id) ) /* 2 rows from Semesters table: semester_id semester_name semester_description other_details 1 spring 2010 x None 2 summer 2010 g None */ CREATE TABLE "Student_Enrolment" ( student_enrolment_id INTEGER, degree_program_id INTEGER NOT NULL, semester_id INTEGER NOT NULL, student_id INTEGER NOT NULL, other_details VARCHAR(255), PRIMARY KEY (student_enrolment_id), FOREIGN KEY(student_id) REFERENCES "Students" (student_id), FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id), FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id) ) /* 2 rows from Student_Enrolment table: student_enrolment_id degree_program_id semester_id student_id other_details 1 12 13 14 None 2 4 2 9 None */ CREATE TABLE "Student_Enrolment_Courses" ( student_course_id INTEGER, course_id INTEGER NOT NULL, student_enrolment_id INTEGER NOT NULL, PRIMARY KEY (student_course_id), FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) /* 2 rows from Student_Enrolment_Courses table: student_course_id course_id student_enrolment_id 0 6 2 1 6 8 */ CREATE TABLE "Students" ( student_id INTEGER, current_address_id INTEGER NOT NULL, permanent_address_id INTEGER NOT NULL, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), ssn VARCHAR(40), date_first_registered DATETIME, date_left DATETIME, other_student_details VARCHAR(255), PRIMARY KEY (student_id), FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id), FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id) ) /* 2 rows from Students table: student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details 1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia 2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem */ CREATE TABLE "Transcript_Contents" ( student_course_id INTEGER NOT NULL, transcript_id INTEGER NOT NULL, FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id), FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id) ) /* 2 rows from Transcript_Contents table: student_course_id transcript_id 0 2 96 8 */ CREATE TABLE "Transcripts" ( transcript_id INTEGER, transcript_date DATETIME, other_details VARCHAR(255), PRIMARY KEY (transcript_id) ) /* 2 rows from Transcripts table: transcript_id transcript_date other_details 1 1988-04-30 01:19:47 None 2 1975-10-28 15:16:51 None */
How many degrees does the engineering department offer?
SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer'
[{'count(*)': 0}]
medium
Table Addresses ( Addresses.address_id (INTEGER), Addresses.line_1 (VARCHAR(255)), Addresses.line_2 (VARCHAR(255)), Addresses.line_3 (VARCHAR(255)), Addresses.city (VARCHAR(255)), Addresses.zip_postcode (VARCHAR(20)), Addresses.state_province_county (VARCHAR(255)), Addresses.country (VARCHAR(255)), Addresses.other_address_details (VARCHAR(255)), ) Table Courses ( Courses.course_id (INTEGER), Courses.course_name (VARCHAR(255)), Courses.course_description (VARCHAR(255)), Courses.other_details (VARCHAR(255)), ) Table Degree_Programs ( Degree_Programs.degree_program_id (INTEGER), Degree_Programs.department_id (INTEGER), Degree_Programs.degree_summary_name (VARCHAR(255)), Degree_Programs.degree_summary_description (VARCHAR(255)), Degree_Programs.other_details (VARCHAR(255)), ) Table Departments ( Departments.department_id (INTEGER), Departments.department_name (VARCHAR(255)), Departments.department_description (VARCHAR(255)), Departments.other_details (VARCHAR(255)), ) Table Sections ( Sections.section_id (INTEGER), Sections.course_id (INTEGER), Sections.section_name (VARCHAR(255)), Sections.section_description (VARCHAR(255)), Sections.other_details (VARCHAR(255)), ) Table Semesters ( Semesters.semester_id (INTEGER), Semesters.semester_name (VARCHAR(255)), Semesters.semester_description (VARCHAR(255)), Semesters.other_details (VARCHAR(255)), ) Table Student_Enrolment ( Student_Enrolment.student_enrolment_id (INTEGER), Student_Enrolment.degree_program_id (INTEGER), Student_Enrolment.semester_id (INTEGER), Student_Enrolment.student_id (INTEGER), Student_Enrolment.other_details (VARCHAR(255)), ) Table Student_Enrolment_Courses ( Student_Enrolment_Courses.student_course_id (INTEGER), Student_Enrolment_Courses.course_id (INTEGER), Student_Enrolment_Courses.student_enrolment_id (INTEGER), ) Table Students ( Students.student_id (INTEGER), Students.current_address_id (INTEGER), Students.permanent_address_id (INTEGER), Students.first_name (VARCHAR(80)), Students.middle_name (VARCHAR(40)), Students.last_name (VARCHAR(40)), Students.cell_mobile_number (VARCHAR(40)), Students.email_address (VARCHAR(40)), Students.ssn (VARCHAR(40)), Students.date_first_registered (DATETIME), Students.date_left (DATETIME), Students.other_student_details (VARCHAR(255)), ) Table Transcript_Contents ( Transcript_Contents.student_course_id (INTEGER), Transcript_Contents.transcript_id (INTEGER), ) Table Transcripts ( Transcripts.transcript_id (INTEGER), Transcripts.transcript_date (DATETIME), Transcripts.other_details (VARCHAR(255)), ) Possible JOINs: Degree_Programs.department_id = Departments.department_id Sections.course_id = Courses.course_id Student_Enrolment.degree_program_id = Degree_Programs.degree_program_id Student_Enrolment.semester_id = Semesters.semester_id Student_Enrolment.student_id = Students.student_id Student_Enrolment_Courses.course_id = Courses.course_id Student_Enrolment_Courses.student_enrolment_id = Student_Enrolment.student_enrolment_id Students.current_address_id = Addresses.address_id Students.permanent_address_id = Addresses.address_id Transcript_Contents.student_course_id = Student_Enrolment_Courses.student_course_id Transcript_Contents.transcript_id = Transcripts.transcript_id
SELECT count(*) FROM Departments JOIN Degree_Programs ON Departments.department_id = Degree_Programs.department_id WHERE Departments.department_name = 'engineer'
{ 'departments': ['department_id', 'department_name'], 'degree_programs': ['degree_program_id', 'department_id'] }
Table Degree_Programs ( Degree_Programs.degree_program_id (INTEGER), Degree_Programs.department_id (INTEGER), ) Table Departments ( Departments.department_id (INTEGER), Departments.department_name (VARCHAR(255)), ) Possible JOINs: Degree_Programs.department_id = Departments.department_id
Table Degree_Programs ( Degree_Programs.degree_program_id (INTEGER), Degree_Programs.department_id (INTEGER), Degree_Programs.degree_summary_name (VARCHAR(255)), Degree_Programs.degree_summary_description (VARCHAR(255)), Degree_Programs.other_details (VARCHAR(255)), ) Table Departments ( Departments.department_id (INTEGER), Departments.department_name (VARCHAR(255)), Departments.department_description (VARCHAR(255)), Departments.other_details (VARCHAR(255)), ) Possible JOINs: Degree_Programs.department_id = Departments.department_id
flight_2
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") )
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) /* 2 rows from airlines table: uid Airline Abbreviation Country 1 United Airlines UAL USA 2 US Airways USAir USA */ CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) /* 2 rows from airports table: City AirportCode AirportName Country CountryAbbrev Aberdeen APG Phillips AAF United States US Aberdeen ABR Municipal United States US */ CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") ) /* 2 rows from flights table: Airline FlightNo SourceAirport DestAirport 1 28 APG ASY 1 29 ASY APG */
How many airlines do we have?
SELECT count(*) FROM AIRLINES
[{'count(*)': 12}]
easy
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
SELECT count(*) FROM AIRLINES
{ 'airlines': ['uid'] }
Table airlines ( airlines.uid (INTEGER), ) Possible JOINs:
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Possible JOINs:
concert_singer
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") )
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) /* 2 rows from concert table: concert_ID concert_Name Theme Stadium_ID Year 1 Auditions Free choice 1 2014 2 Super bootcamp Free choice 2 2 2014 */ CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Country Song_Name Song_release_year Age Is_male 1 Joe Sharp Netherlands You 1992 52 True 2 Timbaland United States Dangerous 2008 32 True */ CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from singer_in_concert table: concert_ID Singer_ID 1 2 1 3 */ CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") ) /* 2 rows from stadium table: Stadium_ID Location Name Capacity Highest Lowest Average 1 Raith Rovers Stark's Park 10104 4812 1294 2106 2 Ayr United Somerset Park 11998 2363 1057 1477 */
Show the stadium name and the number of concerts in each stadium.
SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id
[{'Name': "Stark's Park", 'count(*)': 1}, {'Name': 'Glebe Park', 'count(*)': 1}, {'Name': 'Somerset Park', 'count(*)': 2}, {'Name': 'Recreation Park', 'count(*)': 1}, {'Name': 'Balmoor', 'count(*)': 1}]
medium
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), singer.Song_release_year (TEXT), singer.Age (INT), singer.Is_male (bool), ) Table singer_in_concert ( singer_in_concert.concert_ID (INT), singer_in_concert.Singer_ID (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Location (TEXT), stadium.Name (TEXT), stadium.Capacity (INT), stadium.Highest (INT), stadium.Lowest (INT), stadium.Average (INT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID singer_in_concert.concert_ID = concert.concert_ID singer_in_concert.Singer_ID = singer.Singer_ID
SELECT stadium.name , count(*) FROM concert JOIN stadium ON concert.stadium_id = stadium.stadium_id GROUP BY concert.stadium_id
{ 'concert': ['concert_id', 'stadium_id'], 'stadium': ['stadium_id', 'name'] }
Table concert ( concert.concert_ID (INT), concert.Stadium_ID (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Name (TEXT), )
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Location (TEXT), stadium.Name (TEXT), stadium.Capacity (INT), stadium.Highest (INT), stadium.Lowest (INT), stadium.Average (INT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID
poker_player
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") )
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Nationality Name Birth_Date Height 1 Russia Aleksey Ostapenko May 26, 1986 207.0 2 Bulgaria Teodor Salparov August 16, 1982 182.0 */ CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from poker_player table: Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings 1 1 42.0 1.0 68.0 476090.0 2 2 10.0 2.0 141.0 189233.0 */
What is the birth date of the poker player with the lowest earnings?
SELECT T1.Birth_Date FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings ASC LIMIT 1
[{'Birth_Date': 'August 8, 1986'}]
hard
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
SELECT people.Birth_Date FROM people JOIN poker_player ON people.People_ID = poker_player.People_ID ORDER BY poker_player.Earnings ASC LIMIT 1
{ 'people': ['people_id', 'birth_date'], 'poker_player': ['poker_player_id', 'people_id', 'earnings'] }
Table people ( people.People_ID (INT), people.Birth_Date (TEXT), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Earnings (REAL), )
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What are the names of all European countries with at least 3 manufacturers?
SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent = T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId = T3.Country WHERE T2.Continent = 'europe' GROUP BY T1.CountryName HAVING count(*) >= 3;
[{'CountryName': 'france'}, {'CountryName': 'germany'}]
extra
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT COUNTRIES.CountryName FROM COUNTRIES JOIN CONTINENTS ON COUNTRIES.Continent = CONTINENTS.ContId JOIN CAR_MAKERS ON COUNTRIES.CountryId = CAR_MAKERS.Country WHERE CONTINENTS.Continent = 'europe' GROUP BY COUNTRIES.CountryName HAVING count(*) >= 3;
{ 'countries': ['countryid', 'countryname', 'continent'], 'continents': ['contid', 'continent'], 'car_makers': ['id', 'country'] }
Table car_makers ( car_makers.Id (INTEGER), car_makers.Country (TEXT), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Possible JOINs:
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Possible JOINs: car_makers.Country = countries.CountryId countries.Continent = continents.ContId
cre_Doc_Template_Mgt
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") )
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) /* 2 rows from Documents table: Document_ID Template_ID Document_Name Document_Description Other_Details 0 7 Introduction of OS n None 1 25 Understanding DB y None */ CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Paragraphs table: Paragraph_ID Document_ID Paragraph_Text Other_Details 7 2394 Korea None 9 3 Somalia None */ CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) /* 2 rows from Ref_Template_Types table: Template_Type_Code Template_Type_Description PPT Presentation CV CV */ CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") ) /* 2 rows from Templates table: Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details 0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28 1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04 */
Show all distinct template type codes for all templates.
SELECT DISTINCT template_type_code FROM Templates
[{'Template_Type_Code': 'PP'}, {'Template_Type_Code': 'BK'}, {'Template_Type_Code': 'PPT'}, {'Template_Type_Code': 'AD'}, {'Template_Type_Code': 'CV'}]
easy
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), Paragraphs.Other_Details (VARCHAR(255)), ) Table Ref_Template_Types ( Ref_Template_Types.Template_Type_Code (CHAR(15)), Ref_Template_Types.Template_Type_Description (VARCHAR(255)), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID Paragraphs.Document_ID = Documents.Document_ID Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
SELECT DISTINCT template_type_code FROM Templates
{ 'templates': ['template_id', 'template_type_code'] }
Table Templates ( Templates.Template_ID (INTEGER), Templates.Template_Type_Code (CHAR(15)), )
Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
orchestra
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") )
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) /* 2 rows from conductor table: Conductor_ID Name Age Nationality Year_of_Work 1 Antal Doráti 40 USA 10 2 Igor Stravinsky 41 UK 11 */ CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) /* 2 rows from orchestra table: Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format 1 London Symphony Orchestra 1 Mercury Records 2003.0 CD 2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP */ CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) /* 2 rows from performance table: Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share 1 1 Auditions 1 9 June 5.2 12 22.7% 2 2 Auditions 2 10 June 6.73 8 28.0% */ CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") ) /* 2 rows from show table: Show_ID Performance_ID If_first_show Result Attendance 1 1 True T 1026.0 2 2 True T 695.0 */
What are the names of conductors whose nationalities are not "USA"?
SELECT Name FROM conductor WHERE Nationality != 'USA'
[{'Name': 'Igor Stravinsky'}, {'Name': 'Paul Jorgensen'}, {'Name': 'Charles Dutoit'}, {'Name': 'Pierre Boulez'}, {'Name': 'Robert Craft'}, {'Name': 'Michael Tilson Thomas'}]
easy
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Table show ( show.Show_ID (INT), show.Performance_ID (INT), show.If_first_show (bool), show.Result (TEXT), show.Attendance (REAL), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID show.Performance_ID = performance.Performance_ID
SELECT Name FROM conductor WHERE Nationality != 'USA'
{ 'conductor': ['conductor_id', 'name', 'nationality'] }
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Nationality (TEXT), ) Possible JOINs:
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Possible JOINs:
orchestra
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") )
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) /* 2 rows from conductor table: Conductor_ID Name Age Nationality Year_of_Work 1 Antal Doráti 40 USA 10 2 Igor Stravinsky 41 UK 11 */ CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) /* 2 rows from orchestra table: Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format 1 London Symphony Orchestra 1 Mercury Records 2003.0 CD 2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP */ CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) /* 2 rows from performance table: Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share 1 1 Auditions 1 9 June 5.2 12 22.7% 2 2 Auditions 2 10 June 6.73 8 28.0% */ CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") ) /* 2 rows from show table: Show_ID Performance_ID If_first_show Result Attendance 1 1 True T 1026.0 2 2 True T 695.0 */
Return the names of conductors that do not have the nationality "USA".
SELECT Name FROM conductor WHERE Nationality != 'USA'
[{'Name': 'Igor Stravinsky'}, {'Name': 'Paul Jorgensen'}, {'Name': 'Charles Dutoit'}, {'Name': 'Pierre Boulez'}, {'Name': 'Robert Craft'}, {'Name': 'Michael Tilson Thomas'}]
easy
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Table show ( show.Show_ID (INT), show.Performance_ID (INT), show.If_first_show (bool), show.Result (TEXT), show.Attendance (REAL), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID show.Performance_ID = performance.Performance_ID
SELECT Name FROM conductor WHERE Nationality != 'USA'
{ 'conductor': ['conductor_id', 'name', 'nationality'] }
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Nationality (TEXT), ) Possible JOINs:
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Possible JOINs:
singer
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") )
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Birth_Year Net_Worth_Millions Citizenship 1 Liliane Bettencourt 1944.0 30.0 France 2 Christy Walton 1948.0 28.8 United States */ CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from song table: Song_ID Title Singer_ID Sales Highest_Position 1 Do They Know It's Christmas 1 1094000.0 1.0 2 F**k It (I Don't Want You Back) 1 552407.0 1.0 */
What is the sname of every sing that does not have any song?
SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song)
[{'Name': 'Alice Walton'}, {'Name': 'Abigail Johnson'}]
hard
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Table song ( song.Song_ID (INT), song.Title (TEXT), song.Singer_ID (INT), song.Sales (REAL), song.Highest_Position (REAL), ) Possible JOINs: song.Singer_ID = singer.Singer_ID
SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song)
{ 'singer': ['singer_id', 'name'], 'song': ['song_id', 'singer_id'] }
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), ) Table song ( song.Song_ID (INT), song.Singer_ID (INT), )
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Table song ( song.Song_ID (INT), song.Title (TEXT), song.Singer_ID (INT), song.Sales (REAL), song.Highest_Position (REAL), ) Possible JOINs: song.Singer_ID = singer.Singer_ID
museum_visit
CREATE TABLE museum ( "Museum_ID" INTEGER, "Name" TEXT, "Num_of_Staff" INTEGER, "Open_Year" TEXT, PRIMARY KEY ("Museum_ID") ) CREATE TABLE visit ( "Museum_ID" INTEGER, "visitor_ID" TEXT, "Num_of_Ticket" INTEGER, "Total_spent" REAL, PRIMARY KEY ("Museum_ID", "visitor_ID"), FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"), FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID") ) CREATE TABLE visitor ( "ID" INTEGER, "Name" TEXT, "Level_of_membership" INTEGER, "Age" INTEGER, PRIMARY KEY ("ID") )
CREATE TABLE museum ( "Museum_ID" INTEGER, "Name" TEXT, "Num_of_Staff" INTEGER, "Open_Year" TEXT, PRIMARY KEY ("Museum_ID") ) /* 2 rows from museum table: Museum_ID Name Num_of_Staff Open_Year 1 Plaza Museum 62 2000 2 Capital Plaza Museum 25 2012 */ CREATE TABLE visit ( "Museum_ID" INTEGER, "visitor_ID" TEXT, "Num_of_Ticket" INTEGER, "Total_spent" REAL, PRIMARY KEY ("Museum_ID", "visitor_ID"), FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"), FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID") ) /* 2 rows from visit table: Museum_ID visitor_ID Num_of_Ticket Total_spent 1 5 20 320.14 2 5 4 89.98 */ CREATE TABLE visitor ( "ID" INTEGER, "Name" TEXT, "Level_of_membership" INTEGER, "Age" INTEGER, PRIMARY KEY ("ID") ) /* 2 rows from visitor table: ID Name Level_of_membership Age 1 Gonzalo Higuaín 8 35 2 Guti Midfielder 5 28 */
What are the opening year and staff number of the museum named Plaza Museum?
SELECT Num_of_Staff , Open_Year FROM museum WHERE name = 'Plaza Museum'
[{'Num_of_Staff': 62, 'Open_Year': '2000'}]
medium
Table museum ( museum.Museum_ID (INT), museum.Name (TEXT), museum.Num_of_Staff (INT), museum.Open_Year (TEXT), ) Table visit ( visit.Museum_ID (INT), visit.visitor_ID (TEXT), visit.Num_of_Ticket (INT), visit.Total_spent (REAL), ) Table visitor ( visitor.ID (INT), visitor.Name (TEXT), visitor.Level_of_membership (INT), visitor.Age (INT), ) Possible JOINs: visit.Museum_ID = museum.Museum_ID visit.visitor_ID = visitor.ID
SELECT Num_of_Staff , Open_Year FROM museum WHERE name = 'Plaza Museum'
{ 'museum': ['museum_id', 'name', 'num_of_staff', 'open_year'] }
Table museum ( museum.Museum_ID (INT), museum.Name (TEXT), museum.Num_of_Staff (INT), museum.Open_Year (TEXT), ) Possible JOINs:
Table museum ( museum.Museum_ID (INT), museum.Name (TEXT), museum.Num_of_Staff (INT), museum.Open_Year (TEXT), ) Possible JOINs:
employee_hire_evaluation
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") )
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) /* 2 rows from employee table: Employee_ID Name Age City 1 George Chuter 23 Bristol 2 Lee Mears 29 Bath */ CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) /* 2 rows from evaluation table: Employee_ID Year_awarded Bonus 1 2011 3000.0 2 2015 3200.0 */ CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) /* 2 rows from hiring table: Shop_ID Employee_ID Start_from Is_full_time 1 1 2009 True 1 2 2003 True */ CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") ) /* 2 rows from shop table: Shop_ID Name Location District Number_products Manager_name 1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen 2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen */
How many shops are there in each location?
SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION
[{'count(*)': 1, 'Location': 'Espoo'}, {'count(*)': 1, 'Location': 'Helsinki'}, {'count(*)': 1, 'Location': 'Jakobstad'}, {'count(*)': 1, 'Location': 'Kotka'}, {'count(*)': 1, 'Location': 'Kuopio'}, {'count(*)': 1, 'Location': 'Lahti'}, {'count(*)': 1, 'Location': 'Mariehamn'}, {'count(*)': 1, 'Location': 'Turku'}, {'count(*)': 1, 'Location': 'Valkeakoski'}]
medium
Table employee ( employee.Employee_ID (INT), employee.Name (TEXT), employee.Age (INT), employee.City (TEXT), ) Table evaluation ( evaluation.Employee_ID (TEXT), evaluation.Year_awarded (TEXT), evaluation.Bonus (REAL), ) Table hiring ( hiring.Shop_ID (INT), hiring.Employee_ID (INT), hiring.Start_from (TEXT), hiring.Is_full_time (bool), ) Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs: evaluation.Employee_ID = employee.Employee_ID hiring.Shop_ID = shop.Shop_ID hiring.Employee_ID = employee.Employee_ID
SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION
{ 'shop': ['shop_id', 'location'] }
Table shop ( shop.Shop_ID (INT), shop.Location (TEXT), ) Possible JOINs:
Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs:
cre_Doc_Template_Mgt
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") )
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) /* 2 rows from Documents table: Document_ID Template_ID Document_Name Document_Description Other_Details 0 7 Introduction of OS n None 1 25 Understanding DB y None */ CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Paragraphs table: Paragraph_ID Document_ID Paragraph_Text Other_Details 7 2394 Korea None 9 3 Somalia None */ CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) /* 2 rows from Ref_Template_Types table: Template_Type_Code Template_Type_Description PPT Presentation CV CV */ CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") ) /* 2 rows from Templates table: Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details 0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28 1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04 */
What is the id and type code for the template used by the most documents?
SELECT T1.template_id , T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY count(*) DESC LIMIT 1
[{'Template_ID': 25, 'Template_Type_Code': 'PP'}]
extra
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), Paragraphs.Other_Details (VARCHAR(255)), ) Table Ref_Template_Types ( Ref_Template_Types.Template_Type_Code (CHAR(15)), Ref_Template_Types.Template_Type_Description (VARCHAR(255)), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID Paragraphs.Document_ID = Documents.Document_ID Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
SELECT Documents.template_id , Templates.Template_Type_Code FROM Documents JOIN Templates ON Documents.template_id = Templates.template_id GROUP BY Documents.template_id ORDER BY count(*) DESC LIMIT 1
{ 'documents': ['document_id', 'template_id'], 'templates': ['template_id', 'template_type_code'] }
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Template_Type_Code (CHAR(15)), ) Possible JOINs:
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
How much does the most recent treatment cost?
SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1
[{'cost_of_treatment': 407}]
medium
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1
{ 'treatments': ['treatment_id', 'date_of_treatment', 'cost_of_treatment'] }
Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), )
Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
flight_2
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") )
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) /* 2 rows from airlines table: uid Airline Abbreviation Country 1 United Airlines UAL USA 2 US Airways USAir USA */ CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) /* 2 rows from airports table: City AirportCode AirportName Country CountryAbbrev Aberdeen APG Phillips AAF United States US Aberdeen ABR Municipal United States US */ CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") ) /* 2 rows from flights table: Airline FlightNo SourceAirport DestAirport 1 28 APG ASY 1 29 ASY APG */
Find the number of flights landing in the city of Aberdeen or Abilene.
SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene"
[{'count(*)': 0}]
hard
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
SELECT count(*) FROM Flights JOIN Airports ON Flights.DestAirport = Airports.AirportCode WHERE Airports.city = "Aberdeen" OR Airports.city = "Abilene"
{ 'flights': ['airline', 'destairport'], 'airports': ['city', 'airportcode'] }
Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.DestAirport (TEXT), )
Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
student_transcripts_tracking
CREATE TABLE "Addresses" ( address_id INTEGER, line_1 VARCHAR(255), line_2 VARCHAR(255), line_3 VARCHAR(255), city VARCHAR(255), zip_postcode VARCHAR(20), state_province_county VARCHAR(255), country VARCHAR(255), other_address_details VARCHAR(255), PRIMARY KEY (address_id) ) CREATE TABLE "Courses" ( course_id INTEGER, course_name VARCHAR(255), course_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (course_id) ) CREATE TABLE "Degree_Programs" ( degree_program_id INTEGER, department_id INTEGER NOT NULL, degree_summary_name VARCHAR(255), degree_summary_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (degree_program_id), FOREIGN KEY(department_id) REFERENCES "Departments" (department_id) ) CREATE TABLE "Departments" ( department_id INTEGER, department_name VARCHAR(255), department_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (department_id) ) CREATE TABLE "Sections" ( section_id INTEGER, course_id INTEGER NOT NULL, section_name VARCHAR(255), section_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (section_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) CREATE TABLE "Semesters" ( semester_id INTEGER, semester_name VARCHAR(255), semester_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (semester_id) ) CREATE TABLE "Student_Enrolment" ( student_enrolment_id INTEGER, degree_program_id INTEGER NOT NULL, semester_id INTEGER NOT NULL, student_id INTEGER NOT NULL, other_details VARCHAR(255), PRIMARY KEY (student_enrolment_id), FOREIGN KEY(student_id) REFERENCES "Students" (student_id), FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id), FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id) ) CREATE TABLE "Student_Enrolment_Courses" ( student_course_id INTEGER, course_id INTEGER NOT NULL, student_enrolment_id INTEGER NOT NULL, PRIMARY KEY (student_course_id), FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) CREATE TABLE "Students" ( student_id INTEGER, current_address_id INTEGER NOT NULL, permanent_address_id INTEGER NOT NULL, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), ssn VARCHAR(40), date_first_registered DATETIME, date_left DATETIME, other_student_details VARCHAR(255), PRIMARY KEY (student_id), FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id), FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id) ) CREATE TABLE "Transcript_Contents" ( student_course_id INTEGER NOT NULL, transcript_id INTEGER NOT NULL, FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id), FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id) ) CREATE TABLE "Transcripts" ( transcript_id INTEGER, transcript_date DATETIME, other_details VARCHAR(255), PRIMARY KEY (transcript_id) )
CREATE TABLE "Addresses" ( address_id INTEGER, line_1 VARCHAR(255), line_2 VARCHAR(255), line_3 VARCHAR(255), city VARCHAR(255), zip_postcode VARCHAR(20), state_province_county VARCHAR(255), country VARCHAR(255), other_address_details VARCHAR(255), PRIMARY KEY (address_id) ) /* 2 rows from Addresses table: address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details 1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None 2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None */ CREATE TABLE "Courses" ( course_id INTEGER, course_name VARCHAR(255), course_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (course_id) ) /* 2 rows from Courses table: course_id course_name course_description other_details 1 ds p None 2 math q None */ CREATE TABLE "Degree_Programs" ( degree_program_id INTEGER, department_id INTEGER NOT NULL, degree_summary_name VARCHAR(255), degree_summary_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (degree_program_id), FOREIGN KEY(department_id) REFERENCES "Departments" (department_id) ) /* 2 rows from Degree_Programs table: degree_program_id department_id degree_summary_name degree_summary_description other_details 1 13 Master architecto None 2 2 Master cumque None */ CREATE TABLE "Departments" ( department_id INTEGER, department_name VARCHAR(255), department_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (department_id) ) /* 2 rows from Departments table: department_id department_name department_description other_details 1 computer science error None 2 history nostrum None */ CREATE TABLE "Sections" ( section_id INTEGER, course_id INTEGER NOT NULL, section_name VARCHAR(255), section_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (section_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) /* 2 rows from Sections table: section_id course_id section_name section_description other_details 1 9 a non None 2 2 b voluptatem None */ CREATE TABLE "Semesters" ( semester_id INTEGER, semester_name VARCHAR(255), semester_description VARCHAR(255), other_details VARCHAR(255), PRIMARY KEY (semester_id) ) /* 2 rows from Semesters table: semester_id semester_name semester_description other_details 1 spring 2010 x None 2 summer 2010 g None */ CREATE TABLE "Student_Enrolment" ( student_enrolment_id INTEGER, degree_program_id INTEGER NOT NULL, semester_id INTEGER NOT NULL, student_id INTEGER NOT NULL, other_details VARCHAR(255), PRIMARY KEY (student_enrolment_id), FOREIGN KEY(student_id) REFERENCES "Students" (student_id), FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id), FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id) ) /* 2 rows from Student_Enrolment table: student_enrolment_id degree_program_id semester_id student_id other_details 1 12 13 14 None 2 4 2 9 None */ CREATE TABLE "Student_Enrolment_Courses" ( student_course_id INTEGER, course_id INTEGER NOT NULL, student_enrolment_id INTEGER NOT NULL, PRIMARY KEY (student_course_id), FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id), FOREIGN KEY(course_id) REFERENCES "Courses" (course_id) ) /* 2 rows from Student_Enrolment_Courses table: student_course_id course_id student_enrolment_id 0 6 2 1 6 8 */ CREATE TABLE "Students" ( student_id INTEGER, current_address_id INTEGER NOT NULL, permanent_address_id INTEGER NOT NULL, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), ssn VARCHAR(40), date_first_registered DATETIME, date_left DATETIME, other_student_details VARCHAR(255), PRIMARY KEY (student_id), FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id), FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id) ) /* 2 rows from Students table: student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details 1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia 2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem */ CREATE TABLE "Transcript_Contents" ( student_course_id INTEGER NOT NULL, transcript_id INTEGER NOT NULL, FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id), FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id) ) /* 2 rows from Transcript_Contents table: student_course_id transcript_id 0 2 96 8 */ CREATE TABLE "Transcripts" ( transcript_id INTEGER, transcript_date DATETIME, other_details VARCHAR(255), PRIMARY KEY (transcript_id) ) /* 2 rows from Transcripts table: transcript_id transcript_date other_details 1 1988-04-30 01:19:47 None 2 1975-10-28 15:16:51 None */
Which semesters do not have any student enrolled? List the semester name.
SELECT semester_name FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
[{'semester_name': 'fall 2010'}, {'semester_name': 'spring 2013'}, {'semester_name': 'spring 2014'}, {'semester_name': 'spring 2016'}, {'semester_name': 'spring 2017'}, {'semester_name': 'winter 2018'}]
hard
Table Addresses ( Addresses.address_id (INTEGER), Addresses.line_1 (VARCHAR(255)), Addresses.line_2 (VARCHAR(255)), Addresses.line_3 (VARCHAR(255)), Addresses.city (VARCHAR(255)), Addresses.zip_postcode (VARCHAR(20)), Addresses.state_province_county (VARCHAR(255)), Addresses.country (VARCHAR(255)), Addresses.other_address_details (VARCHAR(255)), ) Table Courses ( Courses.course_id (INTEGER), Courses.course_name (VARCHAR(255)), Courses.course_description (VARCHAR(255)), Courses.other_details (VARCHAR(255)), ) Table Degree_Programs ( Degree_Programs.degree_program_id (INTEGER), Degree_Programs.department_id (INTEGER), Degree_Programs.degree_summary_name (VARCHAR(255)), Degree_Programs.degree_summary_description (VARCHAR(255)), Degree_Programs.other_details (VARCHAR(255)), ) Table Departments ( Departments.department_id (INTEGER), Departments.department_name (VARCHAR(255)), Departments.department_description (VARCHAR(255)), Departments.other_details (VARCHAR(255)), ) Table Sections ( Sections.section_id (INTEGER), Sections.course_id (INTEGER), Sections.section_name (VARCHAR(255)), Sections.section_description (VARCHAR(255)), Sections.other_details (VARCHAR(255)), ) Table Semesters ( Semesters.semester_id (INTEGER), Semesters.semester_name (VARCHAR(255)), Semesters.semester_description (VARCHAR(255)), Semesters.other_details (VARCHAR(255)), ) Table Student_Enrolment ( Student_Enrolment.student_enrolment_id (INTEGER), Student_Enrolment.degree_program_id (INTEGER), Student_Enrolment.semester_id (INTEGER), Student_Enrolment.student_id (INTEGER), Student_Enrolment.other_details (VARCHAR(255)), ) Table Student_Enrolment_Courses ( Student_Enrolment_Courses.student_course_id (INTEGER), Student_Enrolment_Courses.course_id (INTEGER), Student_Enrolment_Courses.student_enrolment_id (INTEGER), ) Table Students ( Students.student_id (INTEGER), Students.current_address_id (INTEGER), Students.permanent_address_id (INTEGER), Students.first_name (VARCHAR(80)), Students.middle_name (VARCHAR(40)), Students.last_name (VARCHAR(40)), Students.cell_mobile_number (VARCHAR(40)), Students.email_address (VARCHAR(40)), Students.ssn (VARCHAR(40)), Students.date_first_registered (DATETIME), Students.date_left (DATETIME), Students.other_student_details (VARCHAR(255)), ) Table Transcript_Contents ( Transcript_Contents.student_course_id (INTEGER), Transcript_Contents.transcript_id (INTEGER), ) Table Transcripts ( Transcripts.transcript_id (INTEGER), Transcripts.transcript_date (DATETIME), Transcripts.other_details (VARCHAR(255)), ) Possible JOINs: Degree_Programs.department_id = Departments.department_id Sections.course_id = Courses.course_id Student_Enrolment.degree_program_id = Degree_Programs.degree_program_id Student_Enrolment.semester_id = Semesters.semester_id Student_Enrolment.student_id = Students.student_id Student_Enrolment_Courses.course_id = Courses.course_id Student_Enrolment_Courses.student_enrolment_id = Student_Enrolment.student_enrolment_id Students.current_address_id = Addresses.address_id Students.permanent_address_id = Addresses.address_id Transcript_Contents.student_course_id = Student_Enrolment_Courses.student_course_id Transcript_Contents.transcript_id = Transcripts.transcript_id
SELECT semester_name FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
{ 'semesters': ['semester_id', 'semester_name'], 'student_enrolment': ['student_enrolment_id', 'semester_id'] }
Table Semesters ( Semesters.semester_id (INTEGER), Semesters.semester_name (VARCHAR(255)), ) Table Student_Enrolment ( Student_Enrolment.student_enrolment_id (INTEGER), Student_Enrolment.semester_id (INTEGER), ) Possible JOINs: Student_Enrolment.semester_id = Semesters.semester_id
Table Semesters ( Semesters.semester_id (INTEGER), Semesters.semester_name (VARCHAR(255)), Semesters.semester_description (VARCHAR(255)), Semesters.other_details (VARCHAR(255)), ) Table Student_Enrolment ( Student_Enrolment.student_enrolment_id (INTEGER), Student_Enrolment.degree_program_id (INTEGER), Student_Enrolment.semester_id (INTEGER), Student_Enrolment.student_id (INTEGER), Student_Enrolment.other_details (VARCHAR(255)), ) Possible JOINs: Student_Enrolment.degree_program_id = Degree_Programs.degree_program_id Student_Enrolment.semester_id = Semesters.semester_id Student_Enrolment.student_id = Students.student_id
museum_visit
CREATE TABLE museum ( "Museum_ID" INTEGER, "Name" TEXT, "Num_of_Staff" INTEGER, "Open_Year" TEXT, PRIMARY KEY ("Museum_ID") ) CREATE TABLE visit ( "Museum_ID" INTEGER, "visitor_ID" TEXT, "Num_of_Ticket" INTEGER, "Total_spent" REAL, PRIMARY KEY ("Museum_ID", "visitor_ID"), FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"), FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID") ) CREATE TABLE visitor ( "ID" INTEGER, "Name" TEXT, "Level_of_membership" INTEGER, "Age" INTEGER, PRIMARY KEY ("ID") )
CREATE TABLE museum ( "Museum_ID" INTEGER, "Name" TEXT, "Num_of_Staff" INTEGER, "Open_Year" TEXT, PRIMARY KEY ("Museum_ID") ) /* 2 rows from museum table: Museum_ID Name Num_of_Staff Open_Year 1 Plaza Museum 62 2000 2 Capital Plaza Museum 25 2012 */ CREATE TABLE visit ( "Museum_ID" INTEGER, "visitor_ID" TEXT, "Num_of_Ticket" INTEGER, "Total_spent" REAL, PRIMARY KEY ("Museum_ID", "visitor_ID"), FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"), FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID") ) /* 2 rows from visit table: Museum_ID visitor_ID Num_of_Ticket Total_spent 1 5 20 320.14 2 5 4 89.98 */ CREATE TABLE visitor ( "ID" INTEGER, "Name" TEXT, "Level_of_membership" INTEGER, "Age" INTEGER, PRIMARY KEY ("ID") ) /* 2 rows from visitor table: ID Name Level_of_membership Age 1 Gonzalo Higuaín 8 35 2 Guti Midfielder 5 28 */
What is the name of the visitor who visited both a museum opened before 2009 and a museum opened after 2011?
SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID = t2.Museum_ID WHERE t3.open_year < 2009 INTERSECT SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID = t2.Museum_ID WHERE t3.open_year > 2011
[{'Name': 'Fernando Gago'}]
extra
Table museum ( museum.Museum_ID (INT), museum.Name (TEXT), museum.Num_of_Staff (INT), museum.Open_Year (TEXT), ) Table visit ( visit.Museum_ID (INT), visit.visitor_ID (TEXT), visit.Num_of_Ticket (INT), visit.Total_spent (REAL), ) Table visitor ( visitor.ID (INT), visitor.Name (TEXT), visitor.Level_of_membership (INT), visitor.Age (INT), ) Possible JOINs: visit.Museum_ID = museum.Museum_ID visit.visitor_ID = visitor.ID
SELECT visitor.name FROM visitor JOIN visit ON visitor.id = visit.visitor_id JOIN museum ON museum.Museum_ID = visit.Museum_ID WHERE museum.open_year < 2009 INTERSECT SELECT visitor.name FROM visitor JOIN visit ON visitor.id = visit.visitor_id JOIN museum ON museum.Museum_ID = visit.Museum_ID WHERE museum.open_year > 2011
{ 'visitor': ['id', 'name'], 'visit': ['museum_id', 'visitor_id'], 'museum': ['museum_id', 'open_year'] }
Table museum ( museum.Museum_ID (INT), museum.Open_Year (TEXT), ) Table visit ( visit.Museum_ID (INT), visit.visitor_ID (TEXT), ) Table visitor ( visitor.ID (INT), visitor.Name (TEXT), )
Table museum ( museum.Museum_ID (INT), museum.Name (TEXT), museum.Num_of_Staff (INT), museum.Open_Year (TEXT), ) Table visit ( visit.Museum_ID (INT), visit.visitor_ID (TEXT), visit.Num_of_Ticket (INT), visit.Total_spent (REAL), ) Table visitor ( visitor.ID (INT), visitor.Name (TEXT), visitor.Level_of_membership (INT), visitor.Age (INT), ) Possible JOINs: visit.Museum_ID = museum.Museum_ID visit.visitor_ID = visitor.ID
pets_1
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Has_Pet" ( "StuID" INTEGER, "PetID" INTEGER, FOREIGN KEY("PetID") REFERENCES "Pets" ("PetID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from Has_Pet table: StuID PetID 1001 2001 1002 2002 */ CREATE TABLE "Pets" ( "PetID" INTEGER, "PetType" VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY ("PetID") ) /* 2 rows from Pets table: PetID PetType pet_age weight 2001 cat 3 12.0 2002 dog 2 13.4 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
Find the weight of the youngest dog.
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
[{'weight': 9.3}]
medium
Table Has_Pet ( Has_Pet.StuID (INTEGER), Has_Pet.PetID (INTEGER), ) Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Table Student ( Student.StuID (INTEGER), Student.LName (VARCHAR(12)), Student.Fname (VARCHAR(12)), Student.Age (INTEGER), Student.Sex (VARCHAR(1)), Student.Major (INTEGER), Student.Advisor (INTEGER), Student.city_code (VARCHAR(3)), ) Possible JOINs: Has_Pet.StuID = Student.StuID Has_Pet.PetID = Pets.PetID
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
{ 'pets': ['petid', 'pet_age', 'weight'] }
Table Pets ( Pets.PetID (INTEGER), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Possible JOINs:
Table Pets ( Pets.PetID (INTEGER), Pets.PetType (VARCHAR(20)), Pets.pet_age (INTEGER), Pets.weight (REAL), ) Possible JOINs:
flight_2
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") )
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) /* 2 rows from airlines table: uid Airline Abbreviation Country 1 United Airlines UAL USA 2 US Airways USAir USA */ CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) /* 2 rows from airports table: City AirportCode AirportName Country CountryAbbrev Aberdeen APG Phillips AAF United States US Aberdeen ABR Municipal United States US */ CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") ) /* 2 rows from flights table: Airline FlightNo SourceAirport DestAirport 1 28 APG ASY 1 29 ASY APG */
Which city has most number of departing flights?
SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.SourceAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
[{'Nenhum': 'Nenhum resultado encontrado'}]
extra
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
SELECT AIRPORTS.City FROM AIRPORTS JOIN FLIGHTS ON AIRPORTS.AirportCode = FLIGHTS.SourceAirport GROUP BY AIRPORTS.City ORDER BY count(*) DESC LIMIT 1
{ 'airports': ['city', 'airportcode'], 'flights': ['airline', 'sourceairport'] }
Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.SourceAirport (TEXT), )
Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
How many countries has more than 2 car makers ?
SELECT count(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING count(*) > 2
[{'count(*)': 4}, {'count(*)': 4}, {'count(*)': 3}, {'count(*)': 5}]
medium
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT count(*) FROM countries JOIN car_makers ON countries.countryid = car_makers.country GROUP BY countries.countryid HAVING count(*) > 2
{ 'countries': ['countryid'], 'car_makers': ['id', 'country'] }
Table car_makers ( car_makers.Id (INTEGER), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), ) Possible JOINs:
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Possible JOINs: car_makers.Country = countries.CountryId countries.Continent = continents.ContId
concert_singer
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") )
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) /* 2 rows from concert table: concert_ID concert_Name Theme Stadium_ID Year 1 Auditions Free choice 1 2014 2 Super bootcamp Free choice 2 2 2014 */ CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Country Song_Name Song_release_year Age Is_male 1 Joe Sharp Netherlands You 1992 52 True 2 Timbaland United States Dangerous 2008 32 True */ CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from singer_in_concert table: concert_ID Singer_ID 1 2 1 3 */ CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") ) /* 2 rows from stadium table: Stadium_ID Location Name Capacity Highest Lowest Average 1 Raith Rovers Stark's Park 10104 4812 1294 2106 2 Ayr United Somerset Park 11998 2363 1057 1477 */
For each stadium, how many concerts play there?
SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id
[{'Name': "Stark's Park", 'count(*)': 1}, {'Name': 'Glebe Park', 'count(*)': 1}, {'Name': 'Somerset Park', 'count(*)': 2}, {'Name': 'Recreation Park', 'count(*)': 1}, {'Name': 'Balmoor', 'count(*)': 1}]
medium
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), singer.Song_release_year (TEXT), singer.Age (INT), singer.Is_male (bool), ) Table singer_in_concert ( singer_in_concert.concert_ID (INT), singer_in_concert.Singer_ID (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Location (TEXT), stadium.Name (TEXT), stadium.Capacity (INT), stadium.Highest (INT), stadium.Lowest (INT), stadium.Average (INT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID singer_in_concert.concert_ID = concert.concert_ID singer_in_concert.Singer_ID = singer.Singer_ID
SELECT stadium.name , count(*) FROM concert JOIN stadium ON concert.stadium_id = stadium.stadium_id GROUP BY concert.stadium_id
{ 'concert': ['concert_id', 'stadium_id'], 'stadium': ['stadium_id', 'name'] }
Table concert ( concert.concert_ID (INT), concert.Stadium_ID (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Name (TEXT), )
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Location (TEXT), stadium.Name (TEXT), stadium.Capacity (INT), stadium.Highest (INT), stadium.Lowest (INT), stadium.Average (INT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID
employee_hire_evaluation
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") )
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) /* 2 rows from employee table: Employee_ID Name Age City 1 George Chuter 23 Bristol 2 Lee Mears 29 Bath */ CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) /* 2 rows from evaluation table: Employee_ID Year_awarded Bonus 1 2011 3000.0 2 2015 3200.0 */ CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) /* 2 rows from hiring table: Shop_ID Employee_ID Start_from Is_full_time 1 1 2009 True 1 2 2003 True */ CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") ) /* 2 rows from shop table: Shop_ID Name Location District Number_products Manager_name 1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen 2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen */
Which shops' number products is above the average? Give me the shop names.
SELECT name FROM shop WHERE number_products > (SELECT avg(number_products) FROM shop)
[{'Name': 'HJK'}, {'Name': 'FC Inter'}, {'Name': 'FC Lahti'}]
hard
Table employee ( employee.Employee_ID (INT), employee.Name (TEXT), employee.Age (INT), employee.City (TEXT), ) Table evaluation ( evaluation.Employee_ID (TEXT), evaluation.Year_awarded (TEXT), evaluation.Bonus (REAL), ) Table hiring ( hiring.Shop_ID (INT), hiring.Employee_ID (INT), hiring.Start_from (TEXT), hiring.Is_full_time (bool), ) Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs: evaluation.Employee_ID = employee.Employee_ID hiring.Shop_ID = shop.Shop_ID hiring.Employee_ID = employee.Employee_ID
SELECT name FROM shop WHERE number_products > (SELECT avg(number_products) FROM shop)
{ 'shop': ['shop_id', 'name', 'number_products'] }
Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Number_products (INT), ) Possible JOINs:
Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs:
poker_player
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") )
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Nationality Name Birth_Date Height 1 Russia Aleksey Ostapenko May 26, 1986 207.0 2 Bulgaria Teodor Salparov August 16, 1982 182.0 */ CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from poker_player table: Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings 1 1 42.0 1.0 68.0 476090.0 2 2 10.0 2.0 141.0 189233.0 */
Count the number of poker players.
SELECT count(*) FROM poker_player
[{'count(*)': 5}]
easy
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
SELECT count(*) FROM poker_player
{ 'poker_player': ['poker_player_id'] }
Table poker_player ( poker_player.Poker_Player_ID (INT), )
Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
Give the names of the nations that were founded after 1950.
SELECT Name FROM country WHERE IndepYear > 1950
[{'Name': 'Angola'}, {'Name': 'United Arab Emirates'}, {'Name': 'Armenia'}, {'Name': 'Antigua and Barbuda'}, {'Name': 'Azerbaijan'}, {'Name': 'Burundi'}, {'Name': 'Benin'}, {'Name': 'Burkina Faso'}, {'Name': 'Bangladesh'}, {'Name': 'Bahrain'}, {'Name': 'Bahamas'}, {'Name': 'Bosnia and Herzegovina'}, {'Name': 'Belarus'}, {'Name': 'Belize'}, {'Name': 'Barbados'}, {'Name': 'Brunei'}, {'Name': 'Botswana'}, {'Name': 'Central African Republic'}, {'Name': 'Côte d’Ivoire'}, {'Name': 'Cameroon'}, {'Name': 'Congo, The Democratic Republic of the'}, {'Name': 'Congo'}, {'Name': 'Comoros'}, {'Name': 'Cape Verde'}, {'Name': 'Cyprus'}, {'Name': 'Czech Republic'}, {'Name': 'Germany'}, {'Name': 'Djibouti'}, {'Name': 'Dominica'}, {'Name': 'Algeria'}, {'Name': 'Eritrea'}, {'Name': 'Estonia'}, {'Name': 'Fiji Islands'}, {'Name': 'Micronesia, Federated States of'}, {'Name': 'Gabon'}, {'Name': 'Georgia'}, {'Name': 'Ghana'}, {'Name': 'Guinea'}, {'Name': 'Gambia'}, {'Name': 'Guinea-Bissau'}, {'Name': 'Equatorial Guinea'}, {'Name': 'Grenada'}, {'Name': 'Guyana'}, {'Name': 'Croatia'}, {'Name': 'Jamaica'}, {'Name': 'Kazakstan'}, {'Name': 'Kenya'}, {'Name': 'Kyrgyzstan'}, {'Name': 'Cambodia'}, {'Name': 'Kiribati'}, {'Name': 'Saint Kitts and Nevis'}, {'Name': 'Kuwait'}, {'Name': 'Laos'}, {'Name': 'Libyan Arab Jamahiriya'}, {'Name': 'Saint Lucia'}, {'Name': 'Lesotho'}, {'Name': 'Lithuania'}, {'Name': 'Latvia'}, {'Name': 'Morocco'}, {'Name': 'Moldova'}, {'Name': 'Madagascar'}, {'Name': 'Maldives'}, {'Name': 'Marshall Islands'}, {'Name': 'Macedonia'}, {'Name': 'Mali'}, {'Name': 'Malta'}, {'Name': 'Mozambique'}, {'Name': 'Mauritania'}, {'Name': 'Mauritius'}, {'Name': 'Malawi'}, {'Name': 'Malaysia'}, {'Name': 'Namibia'}, {'Name': 'Niger'}, {'Name': 'Nigeria'}, {'Name': 'Nauru'}, {'Name': 'Oman'}, {'Name': 'Palau'}, {'Name': 'Papua New Guinea'}, {'Name': 'Qatar'}, {'Name': 'Russian Federation'}, {'Name': 'Rwanda'}, {'Name': 'Sudan'}, {'Name': 'Senegal'}, {'Name': 'Singapore'}, {'Name': 'Solomon Islands'}, {'Name': 'Sierra Leone'}, {'Name': 'Somalia'}, {'Name': 'Sao Tome and Principe'}, {'Name': 'Suriname'}, {'Name': 'Slovakia'}, {'Name': 'Slovenia'}, {'Name': 'Swaziland'}, {'Name': 'Seychelles'}, {'Name': 'Chad'}, {'Name': 'Togo'}, {'Name': 'Tajikistan'}, {'Name': 'Turkmenistan'}, {'Name': 'Tonga'}, {'Name': 'Trinidad and Tobago'}, {'Name': 'Tunisia'}, {'Name': 'Tuvalu'}, {'Name': 'Tanzania'}, {'Name': 'Uganda'}, {'Name': 'Ukraine'}, {'Name': 'Uzbekistan'}, {'Name': 'Saint Vincent and the Grenadines'}, {'Name': 'Vanuatu'}, {'Name': 'Samoa'}, {'Name': 'Zambia'}, {'Name': 'Zimbabwe'}]
easy
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT Name FROM country WHERE IndepYear > 1950
{ 'country': ['code', 'name', 'indepyear'] }
Table country ( country.Code (char(3)), country.Name (char(52)), country.IndepYear (INTEGER), ) Possible JOINs:
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Possible JOINs:
cre_Doc_Template_Mgt
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") )
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) /* 2 rows from Documents table: Document_ID Template_ID Document_Name Document_Description Other_Details 0 7 Introduction of OS n None 1 25 Understanding DB y None */ CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Paragraphs table: Paragraph_ID Document_ID Paragraph_Text Other_Details 7 2394 Korea None 9 3 Somalia None */ CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) /* 2 rows from Ref_Template_Types table: Template_Type_Code Template_Type_Description PPT Presentation CV CV */ CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") ) /* 2 rows from Templates table: Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details 0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28 1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04 */
What are the ids of documents that contain the paragraph text 'Brazil' and 'Ireland'?
SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland'
[{'Document_ID': 16514113}]
hard
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), Paragraphs.Other_Details (VARCHAR(255)), ) Table Ref_Template_Types ( Ref_Template_Types.Template_Type_Code (CHAR(15)), Ref_Template_Types.Template_Type_Description (VARCHAR(255)), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID Paragraphs.Document_ID = Documents.Document_ID Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland'
{ 'paragraphs': ['paragraph_id', 'document_id', 'paragraph_text'] }
Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), )
Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), Paragraphs.Other_Details (VARCHAR(255)), ) Possible JOINs: Paragraphs.Document_ID = Documents.Document_ID
flight_2
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") )
CREATE TABLE airlines ( uid INTEGER, "Airline" TEXT, "Abbreviation" TEXT, "Country" TEXT, PRIMARY KEY (uid) ) /* 2 rows from airlines table: uid Airline Abbreviation Country 1 United Airlines UAL USA 2 US Airways USAir USA */ CREATE TABLE airports ( "City" TEXT, "AirportCode" TEXT, "AirportName" TEXT, "Country" TEXT, "CountryAbbrev" TEXT, PRIMARY KEY ("AirportCode") ) /* 2 rows from airports table: City AirportCode AirportName Country CountryAbbrev Aberdeen APG Phillips AAF United States US Aberdeen ABR Municipal United States US */ CREATE TABLE flights ( "Airline" INTEGER, "FlightNo" INTEGER, "SourceAirport" TEXT, "DestAirport" TEXT, PRIMARY KEY ("Airline", "FlightNo"), FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"), FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode") ) /* 2 rows from flights table: Airline FlightNo SourceAirport DestAirport 1 28 APG ASY 1 29 ASY APG */
What are the airline names and abbreviations for airlines in the USA?
SELECT Airline , Abbreviation FROM AIRLINES WHERE Country = "USA"
[{'Airline': 'United Airlines', 'Abbreviation': 'UAL'}, {'Airline': 'US Airways', 'Abbreviation': 'USAir'}, {'Airline': 'Delta Airlines', 'Abbreviation': 'Delta'}, {'Airline': 'Southwest Airlines', 'Abbreviation': 'Southwest'}, {'Airline': 'American Airlines', 'Abbreviation': 'American'}, {'Airline': 'Northwest Airlines', 'Abbreviation': 'Northwest'}, {'Airline': 'Continental Airlines', 'Abbreviation': 'Continental'}, {'Airline': 'JetBlue Airways', 'Abbreviation': 'JetBlue'}, {'Airline': 'Frontier Airlines', 'Abbreviation': 'Frontier'}, {'Airline': 'AirTran Airways', 'Abbreviation': 'AirTran'}, {'Airline': 'Allegiant Air', 'Abbreviation': 'Allegiant'}, {'Airline': 'Virgin America', 'Abbreviation': 'Virgin'}]
medium
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Table airports ( airports.City (TEXT), airports.AirportCode (TEXT), airports.AirportName (TEXT), airports.Country (TEXT), airports.CountryAbbrev (TEXT), ) Table flights ( flights.Airline (INTEGER), flights.FlightNo (INTEGER), flights.SourceAirport (TEXT), flights.DestAirport (TEXT), ) Possible JOINs: flights.SourceAirport = airports.AirportCode flights.DestAirport = airports.AirportCode
SELECT Airline , Abbreviation FROM AIRLINES WHERE Country = "USA"
{ 'airlines': ['uid', 'airline', 'abbreviation', 'country'] }
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Possible JOINs:
Table airlines ( airlines.uid (INTEGER), airlines.Airline (TEXT), airlines.Abbreviation (TEXT), airlines.Country (TEXT), ) Possible JOINs:
concert_singer
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") )
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) /* 2 rows from concert table: concert_ID concert_Name Theme Stadium_ID Year 1 Auditions Free choice 1 2014 2 Super bootcamp Free choice 2 2 2014 */ CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Country Song_Name Song_release_year Age Is_male 1 Joe Sharp Netherlands You 1992 52 True 2 Timbaland United States Dangerous 2008 32 True */ CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from singer_in_concert table: concert_ID Singer_ID 1 2 1 3 */ CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") ) /* 2 rows from stadium table: Stadium_ID Location Name Capacity Highest Lowest Average 1 Raith Rovers Stark's Park 10104 4812 1294 2106 2 Ayr United Somerset Park 11998 2363 1057 1477 */
How many concerts occurred in 2014 or 2015?
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
[{'count(*)': 6}]
medium
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), singer.Song_release_year (TEXT), singer.Age (INT), singer.Is_male (bool), ) Table singer_in_concert ( singer_in_concert.concert_ID (INT), singer_in_concert.Singer_ID (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Location (TEXT), stadium.Name (TEXT), stadium.Capacity (INT), stadium.Highest (INT), stadium.Lowest (INT), stadium.Average (INT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID singer_in_concert.concert_ID = concert.concert_ID singer_in_concert.Singer_ID = singer.Singer_ID
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
{ 'concert': ['concert_id', 'year'] }
Table concert ( concert.concert_ID (INT), concert.Year (TEXT), )
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID
dog_kennels
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) )
CREATE TABLE "Breeds" ( breed_code VARCHAR(10), breed_name VARCHAR(80), PRIMARY KEY (breed_code) ) /* 2 rows from Breeds table: breed_code breed_name ESK Eskimo HUS Husky */ CREATE TABLE "Charges" ( charge_id INTEGER, charge_type VARCHAR(10), charge_amount DECIMAL(19, 4), PRIMARY KEY (charge_id) ) /* 2 rows from Charges table: charge_id charge_type charge_amount 1 Daily Accommodation 98.0000 2 Drugs 322.0000 */ CREATE TABLE "Dogs" ( dog_id INTEGER, owner_id INTEGER NOT NULL, abandoned_yn VARCHAR(1), breed_code VARCHAR(10) NOT NULL, size_code VARCHAR(10) NOT NULL, name VARCHAR(50), age VARCHAR(20), date_of_birth DATETIME, gender VARCHAR(1), weight VARCHAR(20), date_arrived DATETIME, date_adopted DATETIME, date_departed DATETIME, PRIMARY KEY (dog_id), FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id), FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code), FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code) ) /* 2 rows from Dogs table: dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed 1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44 2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32 */ CREATE TABLE "Owners" ( owner_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (owner_id) ) /* 2 rows from Owners table: owner_id first_name last_name street city state zip_code email_address home_phone cell_number 1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729 2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484 */ CREATE TABLE "Professionals" ( professional_id INTEGER, role_code VARCHAR(10) NOT NULL, first_name VARCHAR(50), street VARCHAR(50), city VARCHAR(50), state VARCHAR(20), zip_code VARCHAR(20), last_name VARCHAR(50), email_address VARCHAR(50), home_phone VARCHAR(20), cell_number VARCHAR(20), PRIMARY KEY (professional_id) ) /* 2 rows from Professionals table: professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number 1 Employee Taryn 6915 Oberbrunner Point Suite 491 Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863 2 Employee Jayson 88665 Terence Lodge Apt. 904 Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676 */ CREATE TABLE "Sizes" ( size_code VARCHAR(10), size_description VARCHAR(80), PRIMARY KEY (size_code) ) /* 2 rows from Sizes table: size_code size_description SML Small MED Medium */ CREATE TABLE "Treatment_Types" ( treatment_type_code VARCHAR(10), treatment_type_description VARCHAR(80), PRIMARY KEY (treatment_type_code) ) /* 2 rows from Treatment_Types table: treatment_type_code treatment_type_description EXAM Physical examination VAC Vaccination */ CREATE TABLE "Treatments" ( treatment_id INTEGER, dog_id INTEGER NOT NULL, professional_id INTEGER NOT NULL, treatment_type_code VARCHAR(10) NOT NULL, date_of_treatment DATETIME, cost_of_treatment DECIMAL(19, 4), PRIMARY KEY (treatment_id), FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id), FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id), FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code) ) /* 2 rows from Treatments table: treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment 1 14 9 WALK 2018-03-19 04:39:54 567.0000 2 4 10 VAC 2018-03-15 20:25:34 147.0000 */
List the last name of the owner owning the youngest dog.
SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = ( SELECT max(age) FROM Dogs )
[{'last_name': 'Feil'}, {'last_name': 'Fisher'}, {'last_name': 'Rippin'}]
extra
Table Breeds ( Breeds.breed_code (VARCHAR(10)), Breeds.breed_name (VARCHAR(80)), ) Table Charges ( Charges.charge_id (INTEGER), Charges.charge_type (VARCHAR(10)), Charges.charge_amount (DECIMAL(19,4)), ) Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Table Professionals ( Professionals.professional_id (INTEGER), Professionals.role_code (VARCHAR(10)), Professionals.first_name (VARCHAR(50)), Professionals.street (VARCHAR(50)), Professionals.city (VARCHAR(50)), Professionals.state (VARCHAR(20)), Professionals.zip_code (VARCHAR(20)), Professionals.last_name (VARCHAR(50)), Professionals.email_address (VARCHAR(50)), Professionals.home_phone (VARCHAR(20)), Professionals.cell_number (VARCHAR(20)), ) Table Sizes ( Sizes.size_code (VARCHAR(10)), Sizes.size_description (VARCHAR(80)), ) Table Treatment_Types ( Treatment_Types.treatment_type_code (VARCHAR(10)), Treatment_Types.treatment_type_description (VARCHAR(80)), ) Table Treatments ( Treatments.treatment_id (INTEGER), Treatments.dog_id (INTEGER), Treatments.professional_id (INTEGER), Treatments.treatment_type_code (VARCHAR(10)), Treatments.date_of_treatment (DATETIME), Treatments.cost_of_treatment (DECIMAL(19,4)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code Treatments.dog_id = Dogs.dog_id Treatments.professional_id = Professionals.professional_id Treatments.treatment_type_code = Treatment_Types.treatment_type_code
SELECT Owners.last_name FROM Owners JOIN Dogs ON Owners.owner_id = Dogs.owner_id WHERE Dogs.age = ( SELECT max(age) FROM Dogs )
{ 'owners': ['owner_id', 'last_name'], 'dogs': ['dog_id', 'owner_id', 'age'] }
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.age (VARCHAR(20)), ) Table Owners ( Owners.owner_id (INTEGER), Owners.last_name (VARCHAR(50)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id
Table Dogs ( Dogs.dog_id (INTEGER), Dogs.owner_id (INTEGER), Dogs.abandoned_yn (VARCHAR(1)), Dogs.breed_code (VARCHAR(10)), Dogs.size_code (VARCHAR(10)), Dogs.name (VARCHAR(50)), Dogs.age (VARCHAR(20)), Dogs.date_of_birth (DATETIME), Dogs.gender (VARCHAR(1)), Dogs.weight (VARCHAR(20)), Dogs.date_arrived (DATETIME), Dogs.date_adopted (DATETIME), Dogs.date_departed (DATETIME), ) Table Owners ( Owners.owner_id (INTEGER), Owners.first_name (VARCHAR(50)), Owners.last_name (VARCHAR(50)), Owners.street (VARCHAR(50)), Owners.city (VARCHAR(50)), Owners.state (VARCHAR(20)), Owners.zip_code (VARCHAR(20)), Owners.email_address (VARCHAR(50)), Owners.home_phone (VARCHAR(20)), Owners.cell_number (VARCHAR(20)), ) Possible JOINs: Dogs.owner_id = Owners.owner_id Dogs.breed_code = Breeds.breed_code Dogs.size_code = Sizes.size_code
wta_1
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 0 rows from players table: player_id first_name last_name hand birth_date country_code */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 0 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 0 rows from rankings table: ranking_date ranking player_id ranking_points tours */
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 2 rows from players table: player_id first_name last_name hand birth_date country_code 200001 Martina Hingis R 19800930 SUI 200002 Mirjana Lucic R 19820309 CRO */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 2 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year 3 4 24.626967830300003 R 170 201474 POL Agnieszka Radwanska 4 5890 3 297 82 RR 6-2 6-4 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 3 4 23.6221765914 L 183 201520 CZE Petra Kvitova 6 4370 5 296 72 RR 6-2 6-3 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 2 rows from rankings table: ranking_date ranking player_id ranking_points tours 20000101 3 200748 4378 13 20000101 4 200033 3021 15 */
List the first and last name of all players in the order of birth date.
SELECT first_name , last_name FROM players ORDER BY birth_date
[{'Error': "(sqlite3.OperationalError) Could not decode to UTF-8 column 'last_name' with text 'Treyes Albarrac��N'\n(Background on this error at: https://sqlalche.me/e/20/e3q8)"}]
medium
Table matches ( matches.best_of (INT), matches.draw_size (INT), matches.loser_age (FLOAT), matches.loser_entry (TEXT), matches.loser_hand (TEXT), matches.loser_ht (INT), matches.loser_id (INT), matches.loser_ioc (TEXT), matches.loser_name (TEXT), matches.loser_rank (INT), matches.loser_rank_points (INT), matches.loser_seed (INT), matches.match_num (INT), matches.minutes (INT), matches.round (TEXT), matches.score (TEXT), matches.surface (TEXT), matches.tourney_date (DATE), matches.tourney_id (TEXT), matches.tourney_level (TEXT), matches.tourney_name (TEXT), matches.winner_age (FLOAT), matches.winner_entry (TEXT), matches.winner_hand (TEXT), matches.winner_ht (INT), matches.winner_id (INT), matches.winner_ioc (TEXT), matches.winner_name (TEXT), matches.winner_rank (INT), matches.winner_rank_points (INT), matches.winner_seed (INT), matches.year (INT), ) Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Table rankings ( rankings.ranking_date (DATE), rankings.ranking (INT), rankings.player_id (INT), rankings.ranking_points (INT), rankings.tours (INT), ) Possible JOINs: matches.loser_id = players.player_id matches.winner_id = players.player_id rankings.player_id = players.player_id
SELECT first_name , last_name FROM players ORDER BY birth_date
{ 'players': ['player_id', 'first_name', 'last_name', 'birth_date'] }
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.birth_date (DATE), ) Possible JOINs:
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Possible JOINs:
poker_player
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") )
CREATE TABLE people ( "People_ID" INTEGER, "Nationality" TEXT, "Name" TEXT, "Birth_Date" TEXT, "Height" REAL, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Nationality Name Birth_Date Height 1 Russia Aleksey Ostapenko May 26, 1986 207.0 2 Bulgaria Teodor Salparov August 16, 1982 182.0 */ CREATE TABLE poker_player ( "Poker_Player_ID" INTEGER, "People_ID" INTEGER, "Final_Table_Made" REAL, "Best_Finish" REAL, "Money_Rank" REAL, "Earnings" REAL, PRIMARY KEY ("Poker_Player_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from poker_player table: Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings 1 1 42.0 1.0 68.0 476090.0 2 2 10.0 2.0 141.0 189233.0 */
What are the names of people who are not from Russia?
SELECT Name FROM people WHERE Nationality != "Russia"
[{'Name': 'Teodor Salparov'}]
easy
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Table poker_player ( poker_player.Poker_Player_ID (INT), poker_player.People_ID (INT), poker_player.Final_Table_Made (REAL), poker_player.Best_Finish (REAL), poker_player.Money_Rank (REAL), poker_player.Earnings (REAL), ) Possible JOINs: poker_player.People_ID = people.People_ID
SELECT Name FROM people WHERE Nationality != "Russia"
{ 'people': ['people_id', 'nationality', 'name'] }
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), ) Possible JOINs:
Table people ( people.People_ID (INT), people.Nationality (TEXT), people.Name (TEXT), people.Birth_Date (TEXT), people.Height (REAL), ) Possible JOINs:
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What is the average miles per gallon(mpg) of the cars with 4 cylinders?
SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders = 4;
[{'avg(mpg)': 28.862318840579714}]
easy
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders = 4;
{ 'cars_data': ['id', 'mpg', 'cylinders'] }
Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), )
Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Possible JOINs: cars_data.Id = car_names.MakeId
battle_death
CREATE TABLE battle ( id INTEGER, name TEXT, date TEXT, bulgarian_commander TEXT, latin_commander TEXT, result TEXT, PRIMARY KEY (id) ) CREATE TABLE death ( caused_by_ship_id INTEGER, id INTEGER, note TEXT, killed INTEGER, injured INTEGER, PRIMARY KEY (id), FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id) ) CREATE TABLE ship ( lost_in_battle INTEGER, id INTEGER, name TEXT, tonnage TEXT, ship_type TEXT, location TEXT, disposition_of_ship TEXT, PRIMARY KEY (id), FOREIGN KEY(lost_in_battle) REFERENCES battle (id) )
CREATE TABLE battle ( id INTEGER, name TEXT, date TEXT, bulgarian_commander TEXT, latin_commander TEXT, result TEXT, PRIMARY KEY (id) ) /* 2 rows from battle table: id name date bulgarian_commander latin_commander result 1 Battle of Adrianople 14 April 1205 Kaloyan Baldwin I Bulgarian victory 2 Battle of Serres June 1205 Kaloyan Unknown Bulgarian victory */ CREATE TABLE death ( caused_by_ship_id INTEGER, id INTEGER, note TEXT, killed INTEGER, injured INTEGER, PRIMARY KEY (id), FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id) ) /* 2 rows from death table: caused_by_ship_id id note killed injured 1 1 Dantewada, Chhattisgarh 8 0 2 2 Dantewada, Chhattisgarh 3 0 */ CREATE TABLE ship ( lost_in_battle INTEGER, id INTEGER, name TEXT, tonnage TEXT, ship_type TEXT, location TEXT, disposition_of_ship TEXT, PRIMARY KEY (id), FOREIGN KEY(lost_in_battle) REFERENCES battle (id) ) /* 2 rows from ship table: lost_in_battle id name tonnage ship_type location disposition_of_ship 8 1 Lettice t Brig English Channel Captured 7 2 Bon Accord t Brig English Channel Captured */
What is the ship id and name that caused most total injuries?
SELECT T2.id , T2.name FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
[{'id': 5, 'name': 'Three Brothers'}]
extra
Table battle ( battle.id (INT), battle.name (TEXT), battle.date (TEXT), battle.bulgarian_commander (TEXT), battle.latin_commander (TEXT), battle.result (TEXT), ) Table death ( death.caused_by_ship_id (INT), death.id (INT), death.note (TEXT), death.killed (INT), death.injured (INT), ) Table ship ( ship.lost_in_battle (INT), ship.id (INT), ship.name (TEXT), ship.tonnage (TEXT), ship.ship_type (TEXT), ship.location (TEXT), ship.disposition_of_ship (TEXT), ) Possible JOINs: death.caused_by_ship_id = ship.id ship.lost_in_battle = battle.id
SELECT T2.id , T2.name FROM death JOIN ship ON death.caused_by_ship_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
{ 'death': ['caused_by_ship_id', 'id'], 'ship': ['id'] }
Table death ( death.caused_by_ship_id (INT), death.id (INT), ) Table ship ( ship.id (INT), ) Possible JOINs: death.caused_by_ship_id = ship.id
Table death ( death.caused_by_ship_id (INT), death.id (INT), death.note (TEXT), death.killed (INT), death.injured (INT), ) Table ship ( ship.lost_in_battle (INT), ship.id (INT), ship.name (TEXT), ship.tonnage (TEXT), ship.ship_type (TEXT), ship.location (TEXT), ship.disposition_of_ship (TEXT), ) Possible JOINs: death.caused_by_ship_id = ship.id ship.lost_in_battle = battle.id
singer
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") )
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Birth_Year Net_Worth_Millions Citizenship 1 Liliane Bettencourt 1944.0 30.0 France 2 Christy Walton 1948.0 28.8 United States */ CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from song table: Song_ID Title Singer_ID Sales Highest_Position 1 Do They Know It's Christmas 1 1094000.0 1.0 2 F**k It (I Don't Want You Back) 1 552407.0 1.0 */
Show the names of singers and the total sales of their songs.
SELECT T1.Name , sum(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name
[{'Name': 'Christy Walton', 'sum(T2.Sales)': 651421.0}, {'Name': 'Gina Rinehart', 'sum(T2.Sales)': 292000.0}, {'Name': 'Iris Fontbona', 'sum(T2.Sales)': 335000.0}, {'Name': 'Jacqueline Mars', 'sum(T2.Sales)': 275000.0}, {'Name': 'Liliane Bettencourt', 'sum(T2.Sales)': 1646407.0}, {'Name': 'Susanne Klatten', 'sum(T2.Sales)': 261000.0}]
medium
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Table song ( song.Song_ID (INT), song.Title (TEXT), song.Singer_ID (INT), song.Sales (REAL), song.Highest_Position (REAL), ) Possible JOINs: song.Singer_ID = singer.Singer_ID
SELECT singer.Name , sum(song.Sales) FROM singer JOIN song ON singer.Singer_ID = song.Singer_ID GROUP BY singer.Name
{ 'singer': ['singer_id', 'name'], 'song': ['song_id', 'singer_id', 'sales'] }
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), ) Table song ( song.Song_ID (INT), song.Singer_ID (INT), song.Sales (REAL), )
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Table song ( song.Song_ID (INT), song.Title (TEXT), song.Singer_ID (INT), song.Sales (REAL), song.Highest_Position (REAL), ) Possible JOINs: song.Singer_ID = singer.Singer_ID
orchestra
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") )
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) /* 2 rows from conductor table: Conductor_ID Name Age Nationality Year_of_Work 1 Antal Doráti 40 USA 10 2 Igor Stravinsky 41 UK 11 */ CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) /* 2 rows from orchestra table: Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format 1 London Symphony Orchestra 1 Mercury Records 2003.0 CD 2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP */ CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) /* 2 rows from performance table: Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share 1 1 Auditions 1 9 June 5.2 12 22.7% 2 2 Auditions 2 10 June 6.73 8 28.0% */ CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") ) /* 2 rows from show table: Show_ID Performance_ID If_first_show Result Attendance 1 1 True T 1026.0 2 2 True T 695.0 */
Show the name of the conductor that has conducted the most number of orchestras.
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1
[{'Name': 'Michael Tilson Thomas'}]
extra
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Table show ( show.Show_ID (INT), show.Performance_ID (INT), show.If_first_show (bool), show.Result (TEXT), show.Attendance (REAL), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID show.Performance_ID = performance.Performance_ID
SELECT conductor.Name FROM conductor JOIN orchestra ON conductor.Conductor_ID = orchestra.Conductor_ID GROUP BY orchestra.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1
{ 'conductor': ['conductor_id', 'name'], 'orchestra': ['orchestra_id', 'orchestra', 'conductor_id'] }
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), )
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID
singer
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") )
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Birth_Year Net_Worth_Millions Citizenship 1 Liliane Bettencourt 1944.0 30.0 France 2 Christy Walton 1948.0 28.8 United States */ CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from song table: Song_ID Title Singer_ID Sales Highest_Position 1 Do They Know It's Christmas 1 1094000.0 1.0 2 F**k It (I Don't Want You Back) 1 552407.0 1.0 */
What are the names of singers ordered by ascending net worth?
SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC
[{'Name': 'Abigail Johnson'}, {'Name': 'Susanne Klatten'}, {'Name': 'Gina Rinehart'}, {'Name': 'Iris Fontbona'}, {'Name': 'Jacqueline Mars'}, {'Name': 'Alice Walton'}, {'Name': 'Christy Walton'}, {'Name': 'Liliane Bettencourt'}]
easy
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Table song ( song.Song_ID (INT), song.Title (TEXT), song.Singer_ID (INT), song.Sales (REAL), song.Highest_Position (REAL), ) Possible JOINs: song.Singer_ID = singer.Singer_ID
SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC
{ 'singer': ['singer_id', 'name', 'net_worth_millions'] }
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Net_Worth_Millions (REAL), ) Possible JOINs:
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Possible JOINs:
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
What are the name, independence year, and surface area of the country with the smallest population?
SELECT Name , SurfaceArea , IndepYear FROM country ORDER BY Population LIMIT 1
[{'Name': 'Antarctica', 'SurfaceArea': 13120000.0, 'IndepYear': None}]
medium
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT Name , SurfaceArea , IndepYear FROM country ORDER BY Population LIMIT 1
{ 'country': ['code', 'name', 'surfacearea', 'indepyear', 'population'] }
Table country ( country.Code (char(3)), country.Name (char(52)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), ) Possible JOINs:
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Possible JOINs:
employee_hire_evaluation
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") )
CREATE TABLE employee ( "Employee_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "City" TEXT, PRIMARY KEY ("Employee_ID") ) /* 2 rows from employee table: Employee_ID Name Age City 1 George Chuter 23 Bristol 2 Lee Mears 29 Bath */ CREATE TABLE evaluation ( "Employee_ID" TEXT, "Year_awarded" TEXT, "Bonus" REAL, PRIMARY KEY ("Employee_ID", "Year_awarded"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID") ) /* 2 rows from evaluation table: Employee_ID Year_awarded Bonus 1 2011 3000.0 2 2015 3200.0 */ CREATE TABLE hiring ( "Shop_ID" INTEGER, "Employee_ID" INTEGER, "Start_from" TEXT, "Is_full_time" BOOLEAN, PRIMARY KEY ("Employee_ID"), FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) /* 2 rows from hiring table: Shop_ID Employee_ID Start_from Is_full_time 1 1 2009 True 1 2 2003 True */ CREATE TABLE shop ( "Shop_ID" INTEGER, "Name" TEXT, "Location" TEXT, "District" TEXT, "Number_products" INTEGER, "Manager_name" TEXT, PRIMARY KEY ("Shop_ID") ) /* 2 rows from shop table: Shop_ID Name Location District Number_products Manager_name 1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen 2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen */
Which district has both stores with less than 3000 products and stores with more than 10000 products?
SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000
[{'Nenhum': 'Nenhum resultado encontrado'}]
hard
Table employee ( employee.Employee_ID (INT), employee.Name (TEXT), employee.Age (INT), employee.City (TEXT), ) Table evaluation ( evaluation.Employee_ID (TEXT), evaluation.Year_awarded (TEXT), evaluation.Bonus (REAL), ) Table hiring ( hiring.Shop_ID (INT), hiring.Employee_ID (INT), hiring.Start_from (TEXT), hiring.Is_full_time (bool), ) Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs: evaluation.Employee_ID = employee.Employee_ID hiring.Shop_ID = shop.Shop_ID hiring.Employee_ID = employee.Employee_ID
SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000
{ 'shop': ['shop_id', 'district', 'number_products'] }
Table shop ( shop.Shop_ID (INT), shop.District (TEXT), shop.Number_products (INT), ) Possible JOINs:
Table shop ( shop.Shop_ID (INT), shop.Name (TEXT), shop.Location (TEXT), shop.District (TEXT), shop.Number_products (INT), shop.Manager_name (TEXT), ) Possible JOINs:
orchestra
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") )
CREATE TABLE conductor ( "Conductor_ID" INTEGER, "Name" TEXT, "Age" INTEGER, "Nationality" TEXT, "Year_of_Work" INTEGER, PRIMARY KEY ("Conductor_ID") ) /* 2 rows from conductor table: Conductor_ID Name Age Nationality Year_of_Work 1 Antal Doráti 40 USA 10 2 Igor Stravinsky 41 UK 11 */ CREATE TABLE orchestra ( "Orchestra_ID" INTEGER, "Orchestra" TEXT, "Conductor_ID" INTEGER, "Record_Company" TEXT, "Year_of_Founded" REAL, "Major_Record_Format" TEXT, PRIMARY KEY ("Orchestra_ID"), FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID") ) /* 2 rows from orchestra table: Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format 1 London Symphony Orchestra 1 Mercury Records 2003.0 CD 2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP */ CREATE TABLE performance ( "Performance_ID" INTEGER, "Orchestra_ID" INTEGER, "Type" TEXT, "Date" TEXT, "Official_ratings_(millions)" REAL, "Weekly_rank" TEXT, "Share" TEXT, PRIMARY KEY ("Performance_ID"), FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID") ) /* 2 rows from performance table: Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share 1 1 Auditions 1 9 June 5.2 12 22.7% 2 2 Auditions 2 10 June 6.73 8 28.0% */ CREATE TABLE show ( "Show_ID" INTEGER, "Performance_ID" INTEGER, "If_first_show" BOOLEAN, "Result" TEXT, "Attendance" REAL, FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID") ) /* 2 rows from show table: Show_ID Performance_ID If_first_show Result Attendance 1 1 True T 1026.0 2 2 True T 695.0 */
Count the number of conductors.
SELECT count(*) FROM conductor
[{'count(*)': 12}]
easy
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Table orchestra ( orchestra.Orchestra_ID (INT), orchestra.Orchestra (TEXT), orchestra.Conductor_ID (INT), orchestra.Record_Company (TEXT), orchestra.Year_of_Founded (REAL), orchestra.Major_Record_Format (TEXT), ) Table performance ( performance.Performance_ID (INT), performance.Orchestra_ID (INT), performance.Type (TEXT), performance.Date (TEXT), performance.Official_ratings_(millions) (REAL), performance.Weekly_rank (TEXT), performance.Share (TEXT), ) Table show ( show.Show_ID (INT), show.Performance_ID (INT), show.If_first_show (bool), show.Result (TEXT), show.Attendance (REAL), ) Possible JOINs: orchestra.Conductor_ID = conductor.Conductor_ID performance.Orchestra_ID = orchestra.Orchestra_ID show.Performance_ID = performance.Performance_ID
SELECT count(*) FROM conductor
{ 'conductor': ['conductor_id'] }
Table conductor ( conductor.Conductor_ID (INT), ) Possible JOINs:
Table conductor ( conductor.Conductor_ID (INT), conductor.Name (TEXT), conductor.Age (INT), conductor.Nationality (TEXT), conductor.Year_of_Work (INT), ) Possible JOINs:
tvshow
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) )
CREATE TABLE "Cartoon" ( id REAL, "Title" TEXT, "Directed_by" TEXT, "Written_by" TEXT, "Original_air_date" TEXT, "Production_code" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from Cartoon table: id Title Directed_by Written_by Original_air_date Production_code Channel 1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700 2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701 */ CREATE TABLE "TV_Channel" ( id TEXT, series_name TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "Pixel_aspect_ratio_PAR" TEXT, "Hight_definition_TV" TEXT, "Pay_per_view_PPV" TEXT, "Package_Option" TEXT, PRIMARY KEY (id) ) /* 2 rows from TV_Channel table: id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option 700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia 701 Sky Music Italy Italian music 4:3 no no Sky Famiglia */ CREATE TABLE "TV_series" ( id REAL, "Episode" TEXT, "Air_Date" TEXT, "Rating" TEXT, "Share" REAL, "18_49_Rating_Share" TEXT, "Viewers_m" TEXT, "Weekly_Rank" REAL, "Channel" TEXT, PRIMARY KEY (id), FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id) ) /* 2 rows from TV_series table: id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel 1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700 2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701 */
What is the series name and country of all TV channels that are playing cartoons directed by Ben Jones and cartoons directed by Michael Chang?
SELECT T1.series_name , T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Michael Chang' INTERSECT SELECT T1.series_name , T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Ben Jones'
[{'series_name': 'MTV Dance', 'Country': 'United Kingdom'}]
extra
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Table TV_series ( TV_series.id (REAL), TV_series.Episode (TEXT), TV_series.Air_Date (TEXT), TV_series.Rating (TEXT), TV_series.Share (REAL), TV_series.18_49_Rating_Share (TEXT), TV_series.Viewers_m (TEXT), TV_series.Weekly_Rank (REAL), TV_series.Channel (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id TV_series.Channel = TV_Channel.id
SELECT TV_Channel.series_name , TV_Channel.country FROM TV_Channel JOIN cartoon ON TV_Channel.id = cartoon.Channel WHERE cartoon.directed_by = 'Michael Chang' INTERSECT SELECT TV_Channel.series_name , TV_Channel.country FROM TV_Channel JOIN cartoon ON TV_Channel.id = cartoon.Channel WHERE cartoon.directed_by = 'Ben Jones'
{ 'tv_channel': ['id', 'series_name', 'country'], 'cartoon': ['id', 'directed_by', 'channel'] }
Table Cartoon ( Cartoon.id (REAL), Cartoon.Directed_by (TEXT), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), )
Table Cartoon ( Cartoon.id (REAL), Cartoon.Title (TEXT), Cartoon.Directed_by (TEXT), Cartoon.Written_by (TEXT), Cartoon.Original_air_date (TEXT), Cartoon.Production_code (REAL), Cartoon.Channel (TEXT), ) Table TV_Channel ( TV_Channel.id (TEXT), TV_Channel.series_name (TEXT), TV_Channel.Country (TEXT), TV_Channel.Language (TEXT), TV_Channel.Content (TEXT), TV_Channel.Pixel_aspect_ratio_PAR (TEXT), TV_Channel.Hight_definition_TV (TEXT), TV_Channel.Pay_per_view_PPV (TEXT), TV_Channel.Package_Option (TEXT), ) Possible JOINs: Cartoon.Channel = TV_Channel.id
world_1
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") )
CREATE TABLE city ( "ID" INTEGER NOT NULL, "Name" CHAR(35) DEFAULT '' NOT NULL, "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "District" CHAR(20) DEFAULT '' NOT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, PRIMARY KEY ("ID"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from city table: ID Name CountryCode District Population 1 Kabul AFG Kabol 1780000 2 Qandahar AFG Qandahar 237500 */ CREATE TABLE country ( "Code" CHAR(3) DEFAULT '' NOT NULL, "Name" CHAR(52) DEFAULT '' NOT NULL, "Continent" TEXT DEFAULT 'Asia' NOT NULL, "Region" CHAR(26) DEFAULT '' NOT NULL, "SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL, "IndepYear" INTEGER DEFAULT NULL, "Population" INTEGER DEFAULT '0' NOT NULL, "LifeExpectancy" FLOAT DEFAULT NULL, "GNP" FLOAT DEFAULT NULL, "GNPOld" FLOAT DEFAULT NULL, "LocalName" CHAR(45) DEFAULT '' NOT NULL, "GovernmentForm" CHAR(45) DEFAULT '' NOT NULL, "HeadOfState" CHAR(60) DEFAULT NULL, "Capital" INTEGER DEFAULT NULL, "Code2" CHAR(2) DEFAULT '' NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from country table: Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2 ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF */ CREATE TABLE countrylanguage ( "CountryCode" CHAR(3) DEFAULT '' NOT NULL, "Language" CHAR(30) DEFAULT '' NOT NULL, "IsOfficial" TEXT DEFAULT 'F' NOT NULL, "Percentage" FLOAT DEFAULT '0.0' NOT NULL, PRIMARY KEY ("CountryCode", "Language"), FOREIGN KEY("CountryCode") REFERENCES country ("Code") ) /* 2 rows from countrylanguage table: CountryCode Language IsOfficial Percentage ABW Dutch T 5.3000000000 ABW English F 9.5000000000 */
Which continent speaks the most languages?
SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1
[{'Continent': 'Africa'}]
extra
Table city ( city.ID (INTEGER), city.Name (char(35)), city.CountryCode (char(3)), city.District (char(20)), city.Population (INTEGER), ) Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: city.CountryCode = country.Code countrylanguage.CountryCode = country.Code
SELECT country.Continent FROM country JOIN countrylanguage ON country.Code = countrylanguage.CountryCode GROUP BY country.Continent ORDER BY COUNT(*) DESC LIMIT 1
{ 'country': ['code', 'continent'], 'countrylanguage': ['countrycode'] }
Table country ( country.Code (char(3)), country.Continent (TEXT), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), )
Table country ( country.Code (char(3)), country.Name (char(52)), country.Continent (TEXT), country.Region (char(26)), country.SurfaceArea (float(10,2)), country.IndepYear (INTEGER), country.Population (INTEGER), country.LifeExpectancy (float(3,1)), country.GNP (float(10,2)), country.GNPOld (float(10,2)), country.LocalName (char(45)), country.GovernmentForm (char(45)), country.HeadOfState (char(60)), country.Capital (INTEGER), country.Code2 (char(2)), ) Table countrylanguage ( countrylanguage.CountryCode (char(3)), countrylanguage.Language (char(30)), countrylanguage.IsOfficial (TEXT), countrylanguage.Percentage (float(4,1)), ) Possible JOINs: countrylanguage.CountryCode = country.Code
cre_Doc_Template_Mgt
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") )
CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Template_ID" INTEGER, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID") ) /* 2 rows from Documents table: Document_ID Template_ID Document_Name Document_Description Other_Details 0 7 Introduction of OS n None 1 25 Understanding DB y None */ CREATE TABLE "Paragraphs" ( "Paragraph_ID" INTEGER NOT NULL, "Document_ID" INTEGER NOT NULL, "Paragraph_Text" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Paragraph_ID"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Paragraphs table: Paragraph_ID Document_ID Paragraph_Text Other_Details 7 2394 Korea None 9 3 Somalia None */ CREATE TABLE "Ref_Template_Types" ( "Template_Type_Code" CHAR(15) NOT NULL, "Template_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_Type_Code") ) /* 2 rows from Ref_Template_Types table: Template_Type_Code Template_Type_Description PPT Presentation CV CV */ CREATE TABLE "Templates" ( "Template_ID" INTEGER NOT NULL, "Version_Number" INTEGER NOT NULL, "Template_Type_Code" CHAR(15) NOT NULL, "Date_Effective_From" DATETIME, "Date_Effective_To" DATETIME, "Template_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Template_ID"), FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code") ) /* 2 rows from Templates table: Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details 0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28 1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04 */
Count the number of templates of the type CV.
SELECT count(*) FROM Templates WHERE template_type_code = "CV"
[{'count(*)': 2}]
easy
Table Documents ( Documents.Document_ID (INTEGER), Documents.Template_ID (INTEGER), Documents.Document_Name (VARCHAR(255)), Documents.Document_Description (VARCHAR(255)), Documents.Other_Details (VARCHAR(255)), ) Table Paragraphs ( Paragraphs.Paragraph_ID (INTEGER), Paragraphs.Document_ID (INTEGER), Paragraphs.Paragraph_Text (VARCHAR(255)), Paragraphs.Other_Details (VARCHAR(255)), ) Table Ref_Template_Types ( Ref_Template_Types.Template_Type_Code (CHAR(15)), Ref_Template_Types.Template_Type_Description (VARCHAR(255)), ) Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Documents.Template_ID = Templates.Template_ID Paragraphs.Document_ID = Documents.Document_ID Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
SELECT count(*) FROM Templates WHERE template_type_code = "CV"
{ 'templates': ['template_id', 'template_type_code'] }
Table Templates ( Templates.Template_ID (INTEGER), Templates.Template_Type_Code (CHAR(15)), )
Table Templates ( Templates.Template_ID (INTEGER), Templates.Version_Number (INTEGER), Templates.Template_Type_Code (CHAR(15)), Templates.Date_Effective_From (DATETIME), Templates.Date_Effective_To (DATETIME), Templates.Template_Details (VARCHAR(255)), ) Possible JOINs: Templates.Template_Type_Code = Ref_Template_Types.Template_Type_Code
concert_singer
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") )
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) /* 2 rows from concert table: concert_ID concert_Name Theme Stadium_ID Year 1 Auditions Free choice 1 2014 2 Super bootcamp Free choice 2 2 2014 */ CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Country Song_Name Song_release_year Age Is_male 1 Joe Sharp Netherlands You 1992 52 True 2 Timbaland United States Dangerous 2008 32 True */ CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from singer_in_concert table: concert_ID Singer_ID 1 2 1 3 */ CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") ) /* 2 rows from stadium table: Stadium_ID Location Name Capacity Highest Lowest Average 1 Raith Rovers Stark's Park 10104 4812 1294 2106 2 Ayr United Somerset Park 11998 2363 1057 1477 */
what is the name and nation of the singer who have a song having 'Hey' in its name?
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
[{'Name': 'Justin Brown', 'Country': 'France'}]
medium
Table concert ( concert.concert_ID (INT), concert.concert_Name (TEXT), concert.Theme (TEXT), concert.Stadium_ID (TEXT), concert.Year (TEXT), ) Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), singer.Song_release_year (TEXT), singer.Age (INT), singer.Is_male (bool), ) Table singer_in_concert ( singer_in_concert.concert_ID (INT), singer_in_concert.Singer_ID (TEXT), ) Table stadium ( stadium.Stadium_ID (INT), stadium.Location (TEXT), stadium.Name (TEXT), stadium.Capacity (INT), stadium.Highest (INT), stadium.Lowest (INT), stadium.Average (INT), ) Possible JOINs: concert.Stadium_ID = stadium.Stadium_ID singer_in_concert.concert_ID = concert.concert_ID singer_in_concert.Singer_ID = singer.Singer_ID
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
{ 'singer': ['singer_id', 'name', 'country', 'song_name'] }
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), ) Possible JOINs:
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Country (TEXT), singer.Song_Name (TEXT), singer.Song_release_year (TEXT), singer.Age (INT), singer.Is_male (bool), ) Possible JOINs:
car_1
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") )
CREATE TABLE car_makers ( "Id" INTEGER, "Maker" TEXT, "FullName" TEXT, "Country" TEXT, PRIMARY KEY ("Id"), FOREIGN KEY("Country") REFERENCES countries ("CountryId") ) /* 2 rows from car_makers table: Id Maker FullName Country 1 amc American Motor Company 1 2 volkswagen Volkswagen 2 */ CREATE TABLE car_names ( "MakeId" INTEGER, "Model" TEXT, "Make" TEXT, PRIMARY KEY ("MakeId"), FOREIGN KEY("Model") REFERENCES model_list ("Model") ) /* 2 rows from car_names table: MakeId Model Make 1 chevrolet chevrolet chevelle malibu 2 buick buick skylark 320 */ CREATE TABLE cars_data ( "Id" INTEGER, "MPG" TEXT, "Cylinders" INTEGER, "Edispl" REAL, "Horsepower" TEXT, "Weight" INTEGER, "Accelerate" REAL, "Year" INTEGER, PRIMARY KEY ("Id"), FOREIGN KEY("Id") REFERENCES car_names ("MakeId") ) /* 2 rows from cars_data table: Id MPG Cylinders Edispl Horsepower Weight Accelerate Year 1 18 8 307.0 130 3504 12.0 1970 2 15 8 350.0 165 3693 11.5 1970 */ CREATE TABLE continents ( "ContId" INTEGER, "Continent" TEXT, PRIMARY KEY ("ContId") ) /* 2 rows from continents table: ContId Continent 1 america 2 europe */ CREATE TABLE countries ( "CountryId" INTEGER, "CountryName" TEXT, "Continent" INTEGER, PRIMARY KEY ("CountryId"), FOREIGN KEY("Continent") REFERENCES continents ("ContId") ) /* 2 rows from countries table: CountryId CountryName Continent 1 usa 1 2 germany 2 */ CREATE TABLE model_list ( "ModelId" INTEGER, "Maker" INTEGER, "Model" TEXT, PRIMARY KEY ("ModelId"), FOREIGN KEY("Maker") REFERENCES car_makers ("Id"), UNIQUE ("Model") ) /* 2 rows from model_list table: ModelId Maker Model 1 1 amc 2 2 audi */
What are the id and names of the countries which have more than 3 car makers or produce the 'fiat' model?
SELECT T1.countryId , T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.countryId HAVING count(*) > 3 UNION SELECT T1.countryId , T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country JOIN MODEL_LIST AS T3 ON T2.Id = T3.Maker WHERE T3.Model = 'fiat';
[{'CountryId': 1, 'CountryName': 'usa'}, {'CountryId': 2, 'CountryName': 'germany'}, {'CountryId': 4, 'CountryName': 'japan'}, {'CountryId': 5, 'CountryName': 'italy'}]
extra
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table car_names ( car_names.MakeId (INTEGER), car_names.Model (TEXT), car_names.Make (TEXT), ) Table cars_data ( cars_data.Id (INTEGER), cars_data.MPG (TEXT), cars_data.Cylinders (INTEGER), cars_data.Edispl (REAL), cars_data.Horsepower (TEXT), cars_data.Weight (INTEGER), cars_data.Accelerate (REAL), cars_data.Year (INTEGER), ) Table continents ( continents.ContId (INTEGER), continents.Continent (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId car_names.Model = model_list.Model cars_data.Id = car_names.MakeId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
SELECT Countries.countryId , Countries.CountryName FROM Countries JOIN CAR_MAKERS ON Countries.CountryId = CAR_MAKERS.Country GROUP BY Countries.countryId HAVING count(*) > 3 UNION SELECT Countries.countryId , Countries.CountryName FROM Countries JOIN CAR_MAKERS ON Countries.CountryId = CAR_MAKERS.Country JOIN MODEL_LIST ON CAR_MAKERS.Id = MODEL_LIST.Maker WHERE MODEL_LIST.Model = 'fiat';
{ 'countries': ['countryid', 'countryname'], 'car_makers': ['id', 'country'], 'model_list': ['modelid', 'maker', 'model'] }
Table car_makers ( car_makers.Id (INTEGER), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs:
Table car_makers ( car_makers.Id (INTEGER), car_makers.Maker (TEXT), car_makers.FullName (TEXT), car_makers.Country (TEXT), ) Table countries ( countries.CountryId (INTEGER), countries.CountryName (TEXT), countries.Continent (INTEGER), ) Table model_list ( model_list.ModelId (INTEGER), model_list.Maker (INTEGER), model_list.Model (TEXT), ) Possible JOINs: car_makers.Country = countries.CountryId countries.Continent = continents.ContId model_list.Maker = car_makers.Id
wta_1
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 0 rows from players table: player_id first_name last_name hand birth_date country_code */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 0 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 0 rows from rankings table: ranking_date ranking player_id ranking_points tours */
CREATE TABLE players( "player_id" INT PRIMARY KEY, "first_name" TEXT, "last_name" TEXT, "hand" TEXT, "birth_date" DATE, "country_code" TEXT ) /* 2 rows from players table: player_id first_name last_name hand birth_date country_code 200001 Martina Hingis R 19800930 SUI 200002 Mirjana Lucic R 19820309 CRO */ CREATE TABLE matches( "best_of" INT, "draw_size" INT, "loser_age" FLOAT, "loser_entry" TEXT, "loser_hand" TEXT, "loser_ht" INT, "loser_id" INT, "loser_ioc" TEXT, "loser_name" TEXT, "loser_rank" INT, "loser_rank_points" INT, "loser_seed" INT, "match_num" INT, "minutes" INT, "round" TEXT, "score" TEXT, "surface" TEXT, "tourney_date" DATE, "tourney_id" TEXT, "tourney_level" TEXT, "tourney_name" TEXT, "winner_age" FLOAT, "winner_entry" TEXT, "winner_hand" TEXT, "winner_ht" INT, "winner_id" INT, "winner_ioc" TEXT, "winner_name" TEXT, "winner_rank" INT, "winner_rank_points" INT, "winner_seed" INT, "year" INT, FOREIGN KEY(loser_id) REFERENCES players(player_id), FOREIGN KEY(winner_id) REFERENCES players(player_id) ) /* 2 rows from matches table: best_of draw_size loser_age loser_entry loser_hand loser_ht loser_id loser_ioc loser_name loser_rank loser_rank_points loser_seed match_num minutes round score surface tourney_date tourney_id tourney_level tourney_name winner_age winner_entry winner_hand winner_ht winner_id winner_ioc winner_name winner_rank winner_rank_points winner_seed year 3 4 24.626967830300003 R 170 201474 POL Agnieszka Radwanska 4 5890 3 297 82 RR 6-2 6-4 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 3 4 23.6221765914 L 183 201520 CZE Petra Kvitova 6 4370 5 296 72 RR 6-2 6-3 Hard 20131021 2013-W-WT-TUR-01A-2013 W WTA Championships 32.0684462697 R 175 200033 USA Serena Williams 1 12040 1 2013 */ CREATE TABLE rankings("ranking_date" DATE,"ranking" INT,"player_id" INT,"ranking_points" INT,"tours" INT,FOREIGN KEY(player_id) REFERENCES players(player_id)) /* 2 rows from rankings table: ranking_date ranking player_id ranking_points tours 20000101 3 200748 4378 13 20000101 4 200033 3021 15 */
Find the average ranking for each player and their first name.
SELECT avg(ranking) , T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name
[{'avg(ranking)': 1199.8235294117646, 'first_name': 'Aastha'}, {'avg(ranking)': 1110.0434782608695, 'first_name': 'Abbi'}, {'avg(ranking)': 808.4545454545455, 'first_name': 'Abbie'}, {'avg(ranking)': 387.66706161137444, 'first_name': 'Abigail'}, {'avg(ranking)': 1039.6744186046512, 'first_name': 'Abiodun'}, {'avg(ranking)': 1228.75, 'first_name': 'Abir'}, {'avg(ranking)': 790.1538461538462, 'first_name': 'Adeliya'}, {'avg(ranking)': 1122.4423076923076, 'first_name': 'Adnya'}, {'avg(ranking)': 619.6814159292036, 'first_name': 'Adriana'}, {'avg(ranking)': 1213.1666666666667, 'first_name': 'Adrienn'}, {'avg(ranking)': 627.12, 'first_name': 'Adrijana'}, {'avg(ranking)': 1255.3333333333333, 'first_name': 'Adva'}, {'avg(ranking)': 1155.0392156862745, 'first_name': 'Afroditi'}, {'avg(ranking)': 960.6770186335403, 'first_name': 'Agata'}, {'avg(ranking)': 1082.3548387096773, 'first_name': 'Agata Jadwiga'}, {'avg(ranking)': 1231.5, 'first_name': 'Agne'}, {'avg(ranking)': 391.3003629764065, 'first_name': 'Agnes'}, {'avg(ranking)': 694.0659898477157, 'first_name': 'Agnese'}, {'avg(ranking)': 940.2125603864735, 'first_name': 'Agni'}, {'avg(ranking)': 122.19587628865979, 'first_name': 'Agnieszka'}, {'avg(ranking)': 684.8497652582159, 'first_name': 'Agustina'}, {'avg(ranking)': 1154.25, 'first_name': 'Agustina Elena'}, {'avg(ranking)': 1156.340425531915, 'first_name': 'Ah'}, {'avg(ranking)': 1248.72, 'first_name': 'Ahlam'}, {'avg(ranking)': 728.5, 'first_name': 'Ahsha'}, {'avg(ranking)': 890.8728448275862, 'first_name': 'Ai'}, {'avg(ranking)': 912.1523178807947, 'first_name': 'Ai Wen'}, {'avg(ranking)': 1110.3333333333333, 'first_name': 'Aida'}, {'avg(ranking)': 284.8724727838258, 'first_name': 'Aiko'}, {'avg(ranking)': 1034.5833333333333, 'first_name': 'Ailen'}, {'avg(ranking)': 1200.2, 'first_name': 'Aimee'}, {'avg(ranking)': 1164.95, 'first_name': 'Aina'}, {'avg(ranking)': 943.7397959183673, 'first_name': 'Ainhoa'}, {'avg(ranking)': 1024.625, 'first_name': 'Aishwarya'}, {'avg(ranking)': 302.84831460674155, 'first_name': 'Ajla'}, {'avg(ranking)': 704.9618138424821, 'first_name': 'Akari'}, {'avg(ranking)': 215.25185185185185, 'first_name': 'Akgul'}, {'avg(ranking)': 710.9617224880383, 'first_name': 'Aki'}, {'avg(ranking)': 1145.8235294117646, 'first_name': 'Akiho'}, {'avg(ranking)': 493.98205383848455, 'first_name': 'Akiko'}, {'avg(ranking)': 772.8571428571429, 'first_name': 'Akilah'}, {'avg(ranking)': 1038.35, 'first_name': 'Akvile'}, {'avg(ranking)': 1119.1639344262296, 'first_name': 'Alana'}, {'avg(ranking)': 843.7260273972603, 'first_name': 'Alba'}, {'avg(ranking)': 343.22432701894314, 'first_name': 'Alberta'}, {'avg(ranking)': 775.2734375, 'first_name': 'Albina'}, {'avg(ranking)': 1185.7142857142858, 'first_name': 'Aldana'}, {'avg(ranking)': 1067.019801980198, 'first_name': 'Alejandra'}, {'avg(ranking)': 450.22998544395927, 'first_name': 'Aleksandra'}, {'avg(ranking)': 578.07962529274, 'first_name': 'Aleksandrina'}, {'avg(ranking)': 820.4563492063492, 'first_name': 'Alena'}, {'avg(ranking)': 1123.4864864864865, 'first_name': 'Alessandra'}, {'avg(ranking)': 1057.628205128205, 'first_name': 'Alessia'}, {'avg(ranking)': 1145.1641791044776, 'first_name': 'Alessondra'}, {'avg(ranking)': 383.9921465968586, 'first_name': 'Alexa'}, {'avg(ranking)': 569.2647632558965, 'first_name': 'Alexandra'}, {'avg(ranking)': 945.625, 'first_name': 'Alexandria'}, {'avg(ranking)': 718.5202702702703, 'first_name': 'Alexia'}, {'avg(ranking)': 604.15, 'first_name': 'Alexis'}, {'avg(ranking)': 441.9846743295019, 'first_name': 'Aliaksandra'}, {'avg(ranking)': 710.3822682786414, 'first_name': 'Alice'}, {'avg(ranking)': 951.9764150943396, 'first_name': 'Alice Andrada'}, {'avg(ranking)': 1105.1298701298701, 'first_name': 'Alicia'}, {'avg(ranking)': 855.813627254509, 'first_name': 'Alicja'}, {'avg(ranking)': 925.0028776978418, 'first_name': 'Alina'}, {'avg(ranking)': 611.35, 'first_name': 'Aliona'}, {'avg(ranking)': 453.01556420233464, 'first_name': 'Alisa'}, {'avg(ranking)': 403.48784576697403, 'first_name': 'Alison'}, {'avg(ranking)': 822.3459915611814, 'first_name': 'Alix'}, {'avg(ranking)': 252.11485774499474, 'first_name': 'Alize'}, {'avg(ranking)': 217.85922330097088, 'first_name': 'Alla'}, {'avg(ranking)': 557.9232456140351, 'first_name': 'Allie'}, {'avg(ranking)': 1157.8, 'first_name': 'Almudena'}, {'avg(ranking)': 871.6926829268293, 'first_name': 'Alona'}, {'avg(ranking)': 1181.6078431372548, 'first_name': 'Alory Regina Elorriaga'}, {'avg(ranking)': 496.9431818181818, 'first_name': 'Alyona'}, {'avg(ranking)': 650.6240276577355, 'first_name': 'Amanda'}, {'avg(ranking)': 747.4375, 'first_name': 'Amandine'}, {'avg(ranking)': 1011.3666666666667, 'first_name': 'Amelie'}, {'avg(ranking)': 803.9764705882353, 'first_name': 'Amina'}, {'avg(ranking)': 613.195652173913, 'first_name': 'Aminat'}, {'avg(ranking)': 1075.8260869565217, 'first_name': 'Amira'}, {'avg(ranking)': 415.9078341013825, 'first_name': 'Amra'}, {'avg(ranking)': 1209.4, 'first_name': 'Amrita'}, {'avg(ranking)': 763.888198757764, 'first_name': 'Amy'}, {'avg(ranking)': 460.8932038834951, 'first_name': 'An Sophie'}, {'avg(ranking)': 396.2893280632411, 'first_name': 'Ana'}, {'avg(ranking)': 842.8446601941747, 'first_name': 'Ana Bianca'}, {'avg(ranking)': 524.9192825112108, 'first_name': 'Ana Clara'}, {'avg(ranking)': 1084.7916666666667, 'first_name': 'Ana Gabriela'}, {'avg(ranking)': 1243.4285714285713, 'first_name': 'Ana Luisa'}, {'avg(ranking)': 1031.228855721393, 'first_name': 'Ana Paula'}, {'avg(ranking)': 496.7156398104265, 'first_name': 'Ana Sofia'}, {'avg(ranking)': 961.2631578947369, 'first_name': 'Ana Victoria'}, {'avg(ranking)': 144.3264367816092, 'first_name': 'Anabel'}, {'avg(ranking)': 922.2255639097745, 'first_name': 'Anaeve'}, {'avg(ranking)': 482.26169844020797, 'first_name': 'Anais'}, {'avg(ranking)': 859.3059701492538, 'first_name': 'Anamika'}, {'avg(ranking)': 430.0872542522642, 'first_name': 'Anastasia'}, {'avg(ranking)': 956.5754716981132, 'first_name': 'Anastasia Evgenyevna'}, {'avg(ranking)': 1245.75, 'first_name': 'Anastasiia'}, {'avg(ranking)': 221.66153846153847, 'first_name': 'Anastasija'}, {'avg(ranking)': 671.2584369449378, 'first_name': 'Anastasiya'}, {'avg(ranking)': 1127.7368421052631, 'first_name': 'Anca'}, {'avg(ranking)': 1150.0, 'first_name': 'Anda'}, {'avg(ranking)': 970.3620689655172, 'first_name': 'Andie K'}, {'avg(ranking)': 1063.4736842105262, 'first_name': 'Andjela'}, {'avg(ranking)': 1275.8235294117646, 'first_name': 'Andra Maria'}, {'avg(ranking)': 414.4332292750607, 'first_name': 'Andrea'}, {'avg(ranking)': 878.3939393939394, 'first_name': 'Andrea Renee'}, {'avg(ranking)': 956.0333333333333, 'first_name': 'Andreea'}, {'avg(ranking)': 801.84375, 'first_name': 'Andreea Amalia'}, {'avg(ranking)': 726.2657657657658, 'first_name': 'Andreea Roxana'}, {'avg(ranking)': 424.64521739130436, 'first_name': 'Andreja'}, {'avg(ranking)': 1184.0416666666667, 'first_name': 'Andressa Cristina'}, {'avg(ranking)': 1045.6666666666667, 'first_name': 'Andrina'}, {'avg(ranking)': 1152.0857142857142, 'first_name': 'Aneta'}, {'avg(ranking)': 367.2274678111588, 'first_name': 'Anett'}, {'avg(ranking)': 969.8181818181819, 'first_name': 'Anette'}, {'avg(ranking)': 1226.3333333333333, 'first_name': 'Ange Oby'}, {'avg(ranking)': 1128.7272727272727, 'first_name': 'Angela'}, {'avg(ranking)': 686.2234432234433, 'first_name': 'Angelica'}, {'avg(ranking)': 1089.1603773584907, 'first_name': 'Angeliki'}, {'avg(ranking)': 750.3207810320781, 'first_name': 'Angelina'}, {'avg(ranking)': 308.56833824975416, 'first_name': 'Angelique'}, {'avg(ranking)': 432.6949152542373, 'first_name': 'Anhelina'}, {'avg(ranking)': 850.9791666666666, 'first_name': 'Anhzelika'}, {'avg(ranking)': 720.1431870669746, 'first_name': 'Ani'}, {'avg(ranking)': 947.472972972973, 'first_name': 'Anita'}, {'avg(ranking)': 725.3893333333333, 'first_name': 'Anja'}, {'avg(ranking)': 1228.388888888889, 'first_name': 'Anke'}, {'avg(ranking)': 618.4714285714285, 'first_name': 'Ankita'}, {'avg(ranking)': 907.4, 'first_name': 'Ann'}, {'avg(ranking)': 551.5557158312297, 'first_name': 'Anna'}, {'avg(ranking)': 760.639175257732, 'first_name': 'Anna Arina'}, {'avg(ranking)': 428.5496828752643, 'first_name': 'Anna Giulia'}, {'avg(ranking)': 345.51020408163265, 'first_name': 'Anna Karolina'}, {'avg(ranking)': 916.7115384615385, 'first_name': 'Anna Katalina'}, {'avg(ranking)': 201.87700534759358, 'first_name': 'Anna Lena'}, {'avg(ranking)': 1070.3967391304348, 'first_name': 'Anna Maria'}, {'avg(ranking)': 583.9347826086956, 'first_name': 'Annalisa'}, {'avg(ranking)': 248.74237737516572, 'first_name': 'Anne'}, {'avg(ranking)': 762.7606382978723, 'first_name': 'Anne Liz'}, {'avg(ranking)': 1237.6363636363637, 'first_name': 'Anne Marie'}, {'avg(ranking)': 1252.0, 'first_name': 'Anne Sophie'}, {'avg(ranking)': 1042.037037037037, 'first_name': 'Annie'}, {'avg(ranking)': 265.79487179487177, 'first_name': 'Annika'}, {'avg(ranking)': 969.5882352941177, 'first_name': 'Anouk'}, {'avg(ranking)': 1051.7096774193549, 'first_name': 'Antonela'}, {'avg(ranking)': 589.1298076923077, 'first_name': 'Antonia'}, {'avg(ranking)': 1049.4655172413793, 'first_name': 'Antonina'}, {'avg(ranking)': 1037.0833333333333, 'first_name': 'Anushka'}, {'avg(ranking)': 617.3333333333334, 'first_name': 'Ao'}, {'avg(ranking)': 1016.5714285714286, 'first_name': 'Apichaya'}, {'avg(ranking)': 658.5074074074074, 'first_name': 'Arabela'}, {'avg(ranking)': 279.23336006415394, 'first_name': 'Arantxa'}, {'avg(ranking)': 490.4144736842105, 'first_name': 'Aranza'}, {'avg(ranking)': 200.97080291970804, 'first_name': 'Aravane'}, {'avg(ranking)': 951.4146341463414, 'first_name': 'Ariadna'}, {'avg(ranking)': 560.6778190830236, 'first_name': 'Arina'}, {'avg(ranking)': 1224.0, 'first_name': 'Arina Gabriela'}, {'avg(ranking)': 1074.3333333333333, 'first_name': 'Arlinda'}, {'avg(ranking)': 1281.8461538461538, 'first_name': 'Arthi'}, {'avg(ranking)': 349.54794520547944, 'first_name': 'Aryna'}, {'avg(ranking)': 1181.27868852459, 'first_name': 'Aselya'}, {'avg(ranking)': 1151.95, 'first_name': 'Asha'}, {'avg(ranking)': 331.3681818181818, 'first_name': 'Ashleigh'}, {'avg(ranking)': 638.88, 'first_name': 'Ashley'}, {'avg(ranking)': 823.0909090909091, 'first_name': 'Ashling'}, {'avg(ranking)': 1018.6637931034483, 'first_name': 'Ashmitha'}, {'avg(ranking)': 803.3904761904762, 'first_name': 'Ashvarya'}, {'avg(ranking)': 453.43392070484583, 'first_name': 'Asia'}, {'avg(ranking)': 790.46875, 'first_name': 'Asiya'}, {'avg(ranking)': 1172.5531914893618, 'first_name': 'Assia'}, {'avg(ranking)': 829.5625, 'first_name': 'Astra'}, {'avg(ranking)': 1086.45, 'first_name': 'Astrid Wanja'}, {'avg(ranking)': 591.2544731610338, 'first_name': 'Audrey'}, {'avg(ranking)': 1208.4285714285713, 'first_name': 'Avgusta'}, {'avg(ranking)': 1064.0, 'first_name': 'Axana'}, {'avg(ranking)': 552.4653465346535, 'first_name': 'Ayaka'}, {'avg(ranking)': 901.8717948717949, 'first_name': 'Ayan'}, {'avg(ranking)': 597.6981132075472, 'first_name': 'Ayano'}, {'avg(ranking)': 397.83561643835617, 'first_name': 'Ayla'}, {'avg(ranking)': 915.5932203389831, 'first_name': 'Aymet'}, {'avg(ranking)': 479.5530612244898, 'first_name': 'Ayu Fani'}, {'avg(ranking)': 412.74466019417474, 'first_name': 'Ayumi'}, {'avg(ranking)': 556.2303370786517, 'first_name': 'Azra'}, {'avg(ranking)': 763.8900651465798, 'first_name': 'Barbara'}, {'avg(ranking)': 252.6093155893536, 'first_name': 'Barbora'}, {'avg(ranking)': 656.2932551319648, 'first_name': 'Basak'}, {'avg(ranking)': 785.0707482993197, 'first_name': 'Beatrice'}, {'avg(ranking)': 457.4050279329609, 'first_name': 'Beatriz'}, {'avg(ranking)': 1253.4, 'first_name': 'Beatriz Magdalena'}, {'avg(ranking)': 971.2865853658536, 'first_name': 'Beatriz Maria'}, {'avg(ranking)': 1382.1538461538462, 'first_name': 'Beauty'}, {'avg(ranking)': 1167.3368421052633, 'first_name': 'Belen'}, {'avg(ranking)': 681.7736842105263, 'first_name': 'Belinda'}, {'avg(ranking)': 705.4688346883469, 'first_name': 'Benedetta'}, {'avg(ranking)': 625.013698630137, 'first_name': 'Berfu'}, {'avg(ranking)': 717.7932330827068, 'first_name': 'Bermet'}, {'avg(ranking)': 541.273631840796, 'first_name': 'Bernarda'}, {'avg(ranking)': 834.1005025125628, 'first_name': 'Bernice'}, {'avg(ranking)': 1005.75, 'first_name': 'Berta'}, {'avg(ranking)': 146.59709379128137, 'first_name': 'Bethanie'}, {'avg(ranking)': 1229.5714285714287, 'first_name': 'Betina'}, {'avg(ranking)': 878.0138888888889, 'first_name': 'Bhuvana'}, {'avg(ranking)': 653.2805383022775, 'first_name': 'Bianca'}, {'avg(ranking)': 696.952380952381, 'first_name': 'Bianka'}, {'avg(ranking)': 550.1941544885177, 'first_name': 'Bibiane'}, {'avg(ranking)': 912.71875, 'first_name': 'Blair'}, {'avg(ranking)': 904.6538461538462, 'first_name': 'Blanca'}, {'avg(ranking)': 1221.8333333333333, 'first_name': 'Blessing'}, {'avg(ranking)': 1254.6341463414635, 'first_name': 'Boba'}, {'avg(ranking)': 392.7313829787234, 'first_name': 'Bojana'}, {'avg(ranking)': 834.2066115702479, 'first_name': 'Borislava'}, {'avg(ranking)': 992.4222222222222, 'first_name': 'Boyan'}, {'avg(ranking)': 970.9846153846154, 'first_name': 'Brandy'}, {'avg(ranking)': 872.0930232558139, 'first_name': 'Breaunna'}, {'avg(ranking)': 211.01377118644066, 'first_name': 'Brenda'}, {'avg(ranking)': 854.3170731707318, 'first_name': 'Brianna'}, {'avg(ranking)': 917.0, 'first_name': 'Brienne'}, {'avg(ranking)': 1126.3333333333333, 'first_name': 'Brindtha'}, {'avg(ranking)': 647.5205479452055, 'first_name': 'Britt'}, {'avg(ranking)': 990.5210084033613, 'first_name': 'Brittany'}, {'avg(ranking)': 804.6277056277056, 'first_name': 'Brooke'}, {'avg(ranking)': 952.5619834710744, 'first_name': 'Brynn'}, {'avg(ranking)': 555.3384615384615, 'first_name': 'Bunyawi'}, {'avg(ranking)': 1140.981981981982, 'first_name': 'Busra'}, {'avg(ranking)': 311.87854251012146, 'first_name': 'Cagla'}, {'avg(ranking)': 709.4247787610619, 'first_name': 'Caitlin'}, {'avg(ranking)': 803.7139479905437, 'first_name': 'Camelia Elena'}, {'avg(ranking)': 1192.1818181818182, 'first_name': 'Cameron'}, {'avg(ranking)': 539.7944621938232, 'first_name': 'Camila'}, {'avg(ranking)': 1192.3783783783783, 'first_name': 'Camila Vital'}, {'avg(ranking)': 801.6850649350649, 'first_name': 'Camilla'}, {'avg(ranking)': 1112.9450549450548, 'first_name': 'Camille'}, {'avg(ranking)': 236.07412398921832, 'first_name': 'Cara'}, {'avg(ranking)': 416.3666666666667, 'first_name': 'Carina'}, {'avg(ranking)': 411.70779777206513, 'first_name': 'Carla'}, {'avg(ranking)': 1236.7777777777778, 'first_name': 'Carlota'}, {'avg(ranking)': 1127.9338842975208, 'first_name': 'Carlotta'}, {'avg(ranking)': 318.69978858350953, 'first_name': 'Carly'}, {'avg(ranking)': 890.6351351351351, 'first_name': 'Carmen'}, {'avg(ranking)': 842.1553398058253, 'first_name': 'Carmen Raluca'}, {'avg(ranking)': 564.1434426229508, 'first_name': 'Carol'}, {'avg(ranking)': 645.2279792746114, 'first_name': 'Carolin'}, {'avg(ranking)': 718.725321888412, 'first_name': 'Carolina'}, {'avg(ranking)': 799.0650406504066, 'first_name': 'Carolina Meligeni Rodrigues'}, {'avg(ranking)': 342.40130505709624, 'first_name': 'Caroline'}, {'avg(ranking)': 1161.5675675675675, 'first_name': 'Caroline B'}, {'avg(ranking)': 1197.578947368421, 'first_name': 'Carolyn'}, {'avg(ranking)': 1020.6, 'first_name': 'Carson'}, {'avg(ranking)': 378.0163727959698, 'first_name': 'Casey'}, {'avg(ranking)': 293.76942355889724, 'first_name': 'Catalina'}, {'avg(ranking)': 941.4724409448819, 'first_name': 'Catherine'}, {'avg(ranking)': 134.21917808219177, 'first_name': 'Catherine Cartan'}, {'avg(ranking)': 744.0, 'first_name': 'Caty'}, {'avg(ranking)': 755.4649681528663, 'first_name': 'Cecilia'}, {'avg(ranking)': 1141.842105263158, 'first_name': 'Cecilie Lundgaard'}, {'avg(ranking)': 708.618398637138, 'first_name': 'Celine'}, {'avg(ranking)': 1123.3855421686746, 'first_name': 'Cemre'}, {'avg(ranking)': 650.1367521367522, 'first_name': 'Chalena'}, {'avg(ranking)': 343.2835365853659, 'first_name': 'Chanel'}, {'avg(ranking)': 215.6615811373093, 'first_name': 'Chanelle'}, {'avg(ranking)': 575.4626436781609, 'first_name': 'Chang'}, {'avg(ranking)': 1281.8461538461538, 'first_name': 'Chanikarn'}, {'avg(ranking)': 609.90625, 'first_name': 'Chantal'}, {'avg(ranking)': 1128.030303030303, 'first_name': 'Chantelle'}, {'avg(ranking)': 1232.8, 'first_name': 'Chaoyi'}, {'avg(ranking)': 766.4794520547945, 'first_name': 'Charlene'}, {'avg(ranking)': 927.7647058823529, 'first_name': 'Charlotte'}, {'avg(ranking)': 593.9759036144578, 'first_name': 'Chayenne'}, {'avg(ranking)': 1132.0, 'first_name': 'Chelsea'}, {'avg(ranking)': 719.3061224489796, 'first_name': 'Chelsey'}, {'avg(ranking)': 524.7444668008048, 'first_name': 'Chen'}, {'avg(ranking)': 789.2857142857143, 'first_name': 'Chengyiyi'}, {'avg(ranking)': 464.1367781155015, 'first_name': 'Chi Chi'}, {'avg(ranking)': 1039.3902439024391, 'first_name': 'Chi Fan'}, {'avg(ranking)': 950.8813559322034, 'first_name': 'Chia Hsien'}, {'avg(ranking)': 359.3764705882353, 'first_name': 'Chia Jung'}, {'avg(ranking)': 437.73858921161826, 'first_name': 'Chiaki'}, {'avg(ranking)': 977.9640591966173, 'first_name': 'Chiara'}, {'avg(ranking)': 533.9586374695864, 'first_name': 'Chieh Yu'}, {'avg(ranking)': 848.9908952959029, 'first_name': 'Chihiro'}, {'avg(ranking)': 385.2651515151515, 'first_name': 'Chin Wei'}, {'avg(ranking)': 615.2230215827338, 'first_name': 'Chinami'}, {'avg(ranking)': 583.530303030303, 'first_name': 'Ching Wen'}, {'avg(ranking)': 749.3582089552239, 'first_name': 'Chiraz'}, {'avg(ranking)': 874.8181818181819, 'first_name': 'Chisa'}, {'avg(ranking)': 675.2445414847161, 'first_name': 'Chloe'}, {'avg(ranking)': 1112.1458333333333, 'first_name': 'Chompoothip'}, {'avg(ranking)': 1112.875, 'first_name': 'Christie'}, {'avg(ranking)': 454.9920529801324, 'first_name': 'Christina'}, {'avg(ranking)': 841.4051724137931, 'first_name': 'Christine'}, {'avg(ranking)': 692.390625, 'first_name': 'Chun Mei'}, {'avg(ranking)': 986.3944099378882, 'first_name': 'Chun Yan'}, {'avg(ranking)': 659.3055555555555, 'first_name': 'Cindy'}, {'avg(ranking)': 443.45754716981133, 'first_name': 'Claire'}, {'avg(ranking)': 1190.7307692307693, 'first_name': 'Clara'}, {'avg(ranking)': 826.2619047619048, 'first_name': 'Claudia'}, {'avg(ranking)': 967.2978723404256, 'first_name': 'Claudia Antonia'}, {'avg(ranking)': 996.2574257425742, 'first_name': 'Claudia Gianina'}, {'avg(ranking)': 383.6413199426112, 'first_name': 'Claudine'}, {'avg(ranking)': 823.6306306306307, 'first_name': 'Clelia'}, {'avg(ranking)': 875.9772727272727, 'first_name': 'Clemence'}, {'avg(ranking)': 964.1224489795918, 'first_name': 'Clementina Eugenia'}, {'avg(ranking)': 620.4120171673819, 'first_name': 'Clothilde'}, {'avg(ranking)': 270.5896860986547, 'first_name': 'Coco'}, {'avg(ranking)': 1165.093023255814, 'first_name': 'Colomba'}, {'avg(ranking)': 390.0, 'first_name': 'Conny'}, {'avg(ranking)': 570.2723004694835, 'first_name': 'Constance'}, {'avg(ranking)': 835.1132075471698, 'first_name': 'Constanza'}, {'avg(ranking)': 1245.3333333333333, 'first_name': 'Constanze'}, {'avg(ranking)': 832.7818181818182, 'first_name': 'Corina'}, {'avg(ranking)': 356.8219696969697, 'first_name': 'Corinna'}, {'avg(ranking)': 757.2253521126761, 'first_name': 'Cornelia'}, {'avg(ranking)': 406.5511363636364, 'first_name': 'Cory Ann'}, {'avg(ranking)': 1049.0, 'first_name': 'Costanza'}, {'avg(ranking)': 554.5376344086021, 'first_name': 'Cristiana'}, {'avg(ranking)': 643.616049382716, 'first_name': 'Cristina'}, {'avg(ranking)': 439.5747863247863, 'first_name': 'Cristina Andreea'}, {'avg(ranking)': 720.6428571428571, 'first_name': 'Cristina Madalina'}, {'avg(ranking)': 949.7944444444445, 'first_name': 'Csilla'}, {'avg(ranking)': 998.7722772277227, 'first_name': 'Cynthia'}, {'avg(ranking)': 1010.3333333333334, 'first_name': 'Da Hye'}, {'avg(ranking)': 920.1276595744681, 'first_name': 'Dabin'}, {'avg(ranking)': 1159.1818181818182, 'first_name': 'Dagmara'}, {'avg(ranking)': 720.7490039840637, 'first_name': 'Daiana'}, {'avg(ranking)': 1181.4736842105262, 'first_name': 'Dajana'}, {'avg(ranking)': 801.6933333333334, 'first_name': 'Dalia'}, {'avg(ranking)': 525.9552572706936, 'first_name': 'Dalila'}, {'avg(ranking)': 279.16438356164383, 'first_name': 'Dalma'}, {'avg(ranking)': 1493.0, 'first_name': 'Damilola'}, {'avg(ranking)': 1242.0, 'first_name': 'Damini'}, {'avg(ranking)': 1198.3333333333333, 'first_name': 'Damira'}, {'avg(ranking)': 994.4769230769231, 'first_name': 'Dan Ni'}, {'avg(ranking)': 805.7028985507246, 'first_name': 'Dana'}, {'avg(ranking)': 977.4539007092199, 'first_name': 'Daneika'}, {'avg(ranking)': 380.609375, 'first_name': 'Danica'}, {'avg(ranking)': 348.6364892881825, 'first_name': 'Daniela'}, {'avg(ranking)': 643.9216101694915, 'first_name': 'Daniella'}, {'avg(ranking)': 744.7453250222618, 'first_name': 'Danielle'}, {'avg(ranking)': 434.68, 'first_name': 'Danielle Rose'}, {'avg(ranking)': 1107.0919540229886, 'first_name': 'Danijela'}, {'avg(ranking)': 302.83268482490274, 'first_name': 'Danka'}, {'avg(ranking)': 1226.5454545454545, 'first_name': 'Daphne'}, {'avg(ranking)': 629.6443987667009, 'first_name': 'Daria'}, {'avg(ranking)': 464.95631067961165, 'first_name': 'Darija'}, {'avg(ranking)': 1132.1744186046512, 'first_name': 'Dariya'}, {'avg(ranking)': 531.1829405162739, 'first_name': 'Darya'}, {'avg(ranking)': 722.6986301369863, 'first_name': 'Dasha'}, {'avg(ranking)': 576.4307692307692, 'first_name': 'Dayana'}, {'avg(ranking)': 550.9545454545455, 'first_name': 'Dea'}, {'avg(ranking)': 764.6785714285714, 'first_name': 'Deborah'}, {'avg(ranking)': 1115.0851063829787, 'first_name': 'Deeon'}, {'avg(ranking)': 758.5342960288808, 'first_name': 'Dejana'}, {'avg(ranking)': 983.4174757281553, 'first_name': 'Demi'}, {'avg(ranking)': 419.1633466135458, 'first_name': 'Denisa'}, {'avg(ranking)': 949.1239316239316, 'first_name': 'Denise'}, {'avg(ranking)': 1160.3125, 'first_name': 'Denise Antonela'}, {'avg(ranking)': 551.5304659498208, 'first_name': 'Deniz'}, {'avg(ranking)': 1123.6486486486488, 'first_name': 'Deria'}, {'avg(ranking)': 863.7826086956521, 'first_name': 'Desirae'}, {'avg(ranking)': 1032.2666666666667, 'first_name': 'Desiree'}, {'avg(ranking)': 665.686684073107, 'first_name': 'Despina'}, {'avg(ranking)': 746.0962962962963, 'first_name': 'Despoina'}, {'avg(ranking)': 483.77464788732397, 'first_name': 'Destanee'}, {'avg(ranking)': 1154.2857142857142, 'first_name': 'Dewi'}, {'avg(ranking)': 615.1506849315068, 'first_name': 'Dhruthi'}, {'avg(ranking)': 736.1650485436893, 'first_name': 'Di'}, {'avg(ranking)': 383.7832512315271, 'first_name': 'Dia'}, {'avg(ranking)': 654.3773657782928, 'first_name': 'Diana'}, {'avg(ranking)': 1205.7692307692307, 'first_name': 'Diana Maria'}, {'avg(ranking)': 809.697247706422, 'first_name': 'Dianne'}, {'avg(ranking)': 669.2982456140351, 'first_name': 'Dijana'}, {'avg(ranking)': 1248.2, 'first_name': 'Dilara'}, {'avg(ranking)': 1094.4583333333333, 'first_name': 'Dina'}, {'avg(ranking)': 268.05945945945945, 'first_name': 'Dinah'}, {'avg(ranking)': 1234.6176470588234, 'first_name': 'Doga Selen'}, {'avg(ranking)': 803.8666666666667, 'first_name': 'Domenica'}, {'avg(ranking)': 171.71134020618555, 'first_name': 'Dominika'}, {'avg(ranking)': 1042.7843137254902, 'first_name': 'Dominique'}, {'avg(ranking)': 1131.6333333333334, 'first_name': 'Donika'}, {'avg(ranking)': 223.50900900900902, 'first_name': 'Donna'}, {'avg(ranking)': 1196.56, 'first_name': 'Dorien'}, {'avg(ranking)': 520.9397993311037, 'first_name': 'Doroteja'}, {'avg(ranking)': 913.7272727272727, 'first_name': 'Draginja'}, {'avg(ranking)': 929.0599369085173, 'first_name': 'Dunja'}, {'avg(ranking)': 1073.1752577319587, 'first_name': 'Ebony'}, {'avg(ranking)': 1029.6888888888889, 'first_name': 'Eden'}, {'avg(ranking)': 211.67325428194994, 'first_name': 'Edina'}, {'avg(ranking)': 656.2851711026616, 'first_name': 'Eduarda'}, {'avg(ranking)': 842.7045454545455, 'first_name': 'Eetee'}, {'avg(ranking)': 1214.857142857143, 'first_name': 'Ege'}, {'avg(ranking)': 471.8367290748899, 'first_name': 'Ekaterina'}, {'avg(ranking)': 553.9434782608696, 'first_name': 'Ekaterine'}, {'avg(ranking)': 1221.7931034482758, 'first_name': 'Elaine'}, {'avg(ranking)': 1066.5343511450383, 'first_name': 'Eleanor'}, {'avg(ranking)': 324.3720930232558, 'first_name': 'Elena'}, {'avg(ranking)': 392.44444444444446, 'first_name': 'Elena Gabriela'}, {'avg(ranking)': 686.6470588235294, 'first_name': 'Elena Teodora'}, {'avg(ranking)': 249.5244140625, 'first_name': 'Eleni'}, {'avg(ranking)': 950.0277777777778, 'first_name': 'Eleonora'}, {'avg(ranking)': 1087.372340425532, 'first_name': 'Eleonore'}, {'avg(ranking)': 876.1730769230769, 'first_name': 'Eliessa'}, {'avg(ranking)': 421.6573033707865, 'first_name': 'Elina'}, {'avg(ranking)': 888.2213114754098, 'first_name': 'Elisabeth'}, {'avg(ranking)': 334.7118644067797, 'first_name': 'Elise'}, {'avg(ranking)': 418.39748953974896, 'first_name': 'Elitsa'}, {'avg(ranking)': 579.5214723926381, 'first_name': 'Elixane'}, {'avg(ranking)': 978.2708333333334, 'first_name': 'Eliza'}, {'avg(ranking)': 1154.2714285714285, 'first_name': 'Elizabeta'}, {'avg(ranking)': 736.9747747747748, 'first_name': 'Elizabeth'}, {'avg(ranking)': 1006.2982456140351, 'first_name': 'Elizabeth Anita Alexandria'}, {'avg(ranking)': 489.5307517084282, 'first_name': 'Elizaveta'}, {'avg(ranking)': 981.9814814814815, 'first_name': 'Elizaveta Anna'}, {'avg(ranking)': 1011.9433962264151, 'first_name': 'Elke'}, {'avg(ranking)': 1168.7967479674796, 'first_name': 'Ella'}, {'avg(ranking)': 750.9460093896714, 'first_name': 'Ellen'}, {'avg(ranking)': 508.340206185567, 'first_name': 'Ellie'}, {'avg(ranking)': 1211.2333333333333, 'first_name': 'Elodie'}, {'avg(ranking)': 652.1984732824427, 'first_name': 'Elyne'}, {'avg(ranking)': 819.3400503778338, 'first_name': 'Ema'}, {'avg(ranking)': 672.730407523511, 'first_name': 'Emelyn'}, {'avg(ranking)': 770.8472222222222, 'first_name': 'Emi'}, {'avg(ranking)': 1232.0, 'first_name': 'Emilia'}, {'avg(ranking)': 1022.9174311926605, 'first_name': 'Emiliana'}, {'avg(ranking)': 705.4716981132076, 'first_name': 'Emilie'}, {'avg(ranking)': 1209.625, 'first_name': 'Emilija'}, {'avg(ranking)': 1092.2771084337348, 'first_name': 'Emiliya'}, {'avg(ranking)': 585.093851132686, 'first_name': 'Emily'}, {'avg(ranking)': 1041.948717948718, 'first_name': 'Emily J'}, {'avg(ranking)': 682.0972222222222, 'first_name': 'Emina'}, {'avg(ranking)': 641.046992481203, 'first_name': 'Emma'}, {'avg(ranking)': 1193.3529411764705, 'first_name': 'Emma Christine'}, {'avg(ranking)': 943.7716535433071, 'first_name': 'Emmanuelle'}, {'avg(ranking)': 1229.7333333333333, 'first_name': 'En Pei'}, {'avg(ranking)': 980.3333333333334, 'first_name': 'Ena'}, {'avg(ranking)': 321.23595505617976, 'first_name': 'Eri'}, {'avg(ranking)': 788.0384615384615, 'first_name': 'Erica'}, {'avg(ranking)': 544.5041866028708, 'first_name': 'Erika'}, {'avg(ranking)': 942.7969696969697, 'first_name': 'Erin'}, {'avg(ranking)': 733.1351351351351, 'first_name': 'Erina'}, {'avg(ranking)': 1218.5652173913043, 'first_name': 'Esen'}, {'avg(ranking)': 966.0540540540541, 'first_name': 'Estela'}, {'avg(ranking)': 617.4935251798561, 'first_name': 'Estelle'}, {'avg(ranking)': 950.9090909090909, 'first_name': 'Ester'}, {'avg(ranking)': 347.34943639291464, 'first_name': 'Estrella'}, {'avg(ranking)': 781.3218390804598, 'first_name': 'Etsuko'}, {'avg(ranking)': 911.7241379310345, 'first_name': 'Eudice Wong'}, {'avg(ranking)': 1157.5, 'first_name': 'Eugenia'}, {'avg(ranking)': 477.62886597938143, 'first_name': 'Eugenie'}, {'avg(ranking)': 620.6746411483253, 'first_name': 'Eugeniya'}, {'avg(ranking)': 500.29483037156706, 'first_name': 'Eva'}, {'avg(ranking)': 1083.8333333333333, 'first_name': 'Eva Marie'}, {'avg(ranking)': 1023.8690476190476, 'first_name': 'Eveliina'}, {'avg(ranking)': 471.5439093484419, 'first_name': 'Evelyn'}, {'avg(ranking)': 414.66339869281046, 'first_name': 'Evgenia'}, {'avg(ranking)': 442.0344827586207, 'first_name': 'Evgeniya'}, {'avg(ranking)': 612.0185185185185, 'first_name': 'Fang Ying'}, {'avg(ranking)': 406.9281767955801, 'first_name': 'Fangzhou'}, {'avg(ranking)': 569.1904761904761, 'first_name': 'Fanny'}, {'avg(ranking)': 1106.3076923076924, 'first_name': 'Farah'}, {'avg(ranking)': 673.7509157509157, 'first_name': 'Fatima'}, {'avg(ranking)': 1070.9463414634147, 'first_name': 'Fatimah'}, {'avg(ranking)': 648.2984054669704, 'first_name': 'Fatma'}, {'avg(ranking)': 1015.5, 'first_name': 'Fatyha'}, {'avg(ranking)': 722.7286493034525, 'first_name': 'Federica'}, {'avg(ranking)': 1204.7272727272727, 'first_name': 'Federica Joe'}, {'avg(ranking)': 647.922077922078, 'first_name': 'Fernanda'}, {'avg(ranking)': 1187.0384615384614, 'first_name': 'Ferny'}, {'avg(ranking)': 853.3908045977012, 'first_name': 'Fiona'}, {'avg(ranking)': 376.47888446215137, 'first_name': 'Flavia'}, {'avg(ranking)': 451.5810397553517, 'first_name': 'Florencia'}, {'avg(ranking)': 999.2, 'first_name': 'Frances'}, {'avg(ranking)': 570.534951862704, 'first_name': 'Francesca'}, {'avg(ranking)': 903.1666666666666, 'first_name': 'Francisca'}, {'avg(ranking)': 437.05298013245033, 'first_name': 'Francoise'}, {'avg(ranking)': 949.6575342465753, 'first_name': 'Franziska'}, {'avg(ranking)': 1244.3333333333333, 'first_name': 'Frederikke'}, {'avg(ranking)': 544.1627906976744, 'first_name': 'Freya'}, {'avg(ranking)': 696.7697332607512, 'first_name': 'Gabriela'}, {'avg(ranking)': 994.0612244897959, 'first_name': 'Gabriela Nicole'}, {'avg(ranking)': 792.5, 'first_name': 'Gabriella'}, {'avg(ranking)': 985.7211538461538, 'first_name': 'Gabrielle Faith'}, {'avg(ranking)': 1052.8314606741574, 'first_name': 'Gaelle'}, {'avg(ranking)': 759.5352697095435, 'first_name': 'Gaia'}, {'avg(ranking)': 526.2644836272041, 'first_name': 'Gail'}, {'avg(ranking)': 305.19563522992985, 'first_name': 'Galina'}, {'avg(ranking)': 606.7211740041929, 'first_name': 'Ganna'}, {'avg(ranking)': 229.3774193548387, 'first_name': 'Garbine'}, {'avg(ranking)': 1152.142857142857, 'first_name': 'Gebriela'}, {'avg(ranking)': 772.2857142857143, 'first_name': 'Genevieve'}, {'avg(ranking)': 533.5940594059406, 'first_name': 'Georgia'}, {'avg(ranking)': 763.1014492753624, 'first_name': 'Georgia Andreea'}, {'avg(ranking)': 1153.9166666666667, 'first_name': 'Georgiana'}, {'avg(ranking)': 396.225, 'first_name': 'Georgina'}, {'avg(ranking)': 1150.6607142857142, 'first_name': 'Ghislaine'}, {'avg(ranking)': 813.1351351351351, 'first_name': 'Giada'}, {'avg(ranking)': 567.8518518518518, 'first_name': 'Gioia'}, {'avg(ranking)': 960.4941860465116, 'first_name': 'Giorgia'}, {'avg(ranking)': 1226.5, 'first_name': 'Giorgie'}, {'avg(ranking)': 1197.0, 'first_name': 'Giovanna'}, {'avg(ranking)': 693.6215943491422, 'first_name': 'Giulia'}, {'avg(ranking)': 584.359375, 'first_name': 'Giuliana'}, {'avg(ranking)': 794.7118644067797, 'first_name': 'Gloria'}, {'avg(ranking)': 716.3150684931506, 'first_name': 'Gozal'}, {'avg(ranking)': 454.06233062330625, 'first_name': 'Grace'}, {'avg(ranking)': 783.8288043478261, 'first_name': 'Gracia'}, {'avg(ranking)': 547.277108433735, 'first_name': 'Greetje'}, {'avg(ranking)': 296.8219584569733, 'first_name': 'Greta'}, {'avg(ranking)': 797.383606557377, 'first_name': 'Guadalupe'}, {'avg(ranking)': 1027.0, 'first_name': 'Guillermina'}, {'avg(ranking)': 957.9512195121952, 'first_name': 'Guiomar'}, {'avg(ranking)': 1168.3396226415093, 'first_name': 'Gulben'}, {'avg(ranking)': 1196.0, 'first_name': 'Gulchekhra'}, {'avg(ranking)': 1236.6153846153845, 'first_name': 'Gulnaz'}, {'avg(ranking)': 995.4074074074074, 'first_name': 'Guzal'}, {'avg(ranking)': 1087.6216216216217, 'first_name': 'Gyulnara'}, {'avg(ranking)': 1051.623188405797, 'first_name': 'Habiba'}, {'avg(ranking)': 844.3856812933026, 'first_name': 'Hae Sung'}, {'avg(ranking)': 1179.4153846153847, 'first_name': 'Haine'}, {'avg(ranking)': 1110.5376344086021, 'first_name': 'Hana'}, {'avg(ranking)': 957.2, 'first_name': 'Hanna'}, {'avg(ranking)': 543.968253968254, 'first_name': 'Hanyu'}, {'avg(ranking)': 680.1050228310502, 'first_name': 'Hao Chen'}, {'avg(ranking)': 1153.936507936508, 'first_name': 'Hao Ching'}, {'avg(ranking)': 574.8723404255319, 'first_name': 'Harmony'}, {'avg(ranking)': 694.341935483871, 'first_name': 'Harriet'}, {'avg(ranking)': 774.6837606837607, 'first_name': 'Haruka'}, {'avg(ranking)': 512.1515151515151, 'first_name': 'Haruna'}, {'avg(ranking)': 914.5321100917431, 'first_name': 'Hayley'}, {'avg(ranking)': 1214.7692307692307, 'first_name': 'Hazal'}, {'avg(ranking)': 167.50632911392404, 'first_name': 'Heather'}, {'avg(ranking)': 417.44323483670297, 'first_name': 'Heidi'}, {'avg(ranking)': 1019.4107142857143, 'first_name': 'Helen'}, {'avg(ranking)': 696.4752475247525, 'first_name': 'Helene'}, {'avg(ranking)': 1095.1176470588234, 'first_name': 'Hikari'}, {'avg(ranking)': 673.6635071090047, 'first_name': 'Hilda'}, {'avg(ranking)': 1219.0, 'first_name': 'Himari'}, {'avg(ranking)': 534.890243902439, 'first_name': 'Hiroko'}, {'avg(ranking)': 860.8104265402843, 'first_name': 'Hirono'}, {'avg(ranking)': 925.9865771812081, 'first_name': 'Ho Ching'}, {'avg(ranking)': 1185.75, 'first_name': 'Hollie'}, {'avg(ranking)': 914.8607594936709, 'first_name': 'Hongrui'}, {'avg(ranking)': 1251.1333333333334, 'first_name': 'Hortencia'}, {'avg(ranking)': 1107.7142857142858, 'first_name': 'Hsin Yuan'}, {'avg(ranking)': 726.1737089201878, 'first_name': 'Hua Chen'}, {'avg(ranking)': 1118.904761904762, 'first_name': 'Huijie'}, {'avg(ranking)': 888.0055096418732, 'first_name': 'Hulya'}, {'avg(ranking)': 1020.28125, 'first_name': 'Hye Min'}, {'avg(ranking)': 1069.3208955223881, 'first_name': 'Hyojung'}, {'avg(ranking)': 729.0671936758894, 'first_name': 'Hyun Hui'}, {'avg(ranking)': 1038.6911764705883, 'first_name': 'I Hsuan'}, {'avg(ranking)': 1085.581818181818, 'first_name': 'Iana'}, {'avg(ranking)': 962.5, 'first_name': 'Ida'}, {'avg(ranking)': 1232.2, 'first_name': 'Idia'}, {'avg(ranking)': 705.5625, 'first_name': 'Iga'}, {'avg(ranking)': 1135.5, 'first_name': 'Ilay'}, {'avg(ranking)': 868.2191780821918, 'first_name': 'Ilka'}, {'avg(ranking)': 452.625, 'first_name': 'Ilona'}, {'avg(ranking)': 847.0941176470589, 'first_name': 'Ilze'}, {'avg(ranking)': 845.375, 'first_name': 'Imane Maelle'}, {'avg(ranking)': 1165.5573770491803, 'first_name': 'Ina'}, {'avg(ranking)': 1069.0925925925926, 'first_name': 'Inci'}, {'avg(ranking)': 954.046875, 'first_name': 'India'}, {'avg(ranking)': 627.7027027027027, 'first_name': 'Indire'}, {'avg(ranking)': 485.9559748427673, 'first_name': 'Indy'}, {'avg(ranking)': 919.6147540983607, 'first_name': 'Ineke'}, {'avg(ranking)': 687.0229885057471, 'first_name': 'Ines'}, {'avg(ranking)': 1039.0, 'first_name': 'Inger'}, {'avg(ranking)': 766.2549019607843, 'first_name': 'Ingrid'}, {'avg(ranking)': 869.3571428571429, 'first_name': 'Ingrid Alexandra'}, {'avg(ranking)': 748.6622691292876, 'first_name': 'Ingrid Esperanza'}, {'avg(ranking)': 1192.5454545454545, 'first_name': 'Intissar'}, {'avg(ranking)': 980.2232142857143, 'first_name': 'Ioana'}, {'avg(ranking)': 482.43243243243245, 'first_name': 'Ioana Diana'}, {'avg(ranking)': 646.0441176470588, 'first_name': 'Ioana Loredana'}, {'avg(ranking)': 799.0552486187845, 'first_name': 'Ionela Andreea'}, {'avg(ranking)': 655.7828348504552, 'first_name': 'Ipek'}, {'avg(ranking)': 288.74423480083857, 'first_name': 'Irena'}, {'avg(ranking)': 579.2153846153847, 'first_name': 'Irene'}, {'avg(ranking)': 436.84339509862525, 'first_name': 'Irina'}, {'avg(ranking)': 285.84388185654007, 'first_name': 'Irina Camelia'}, {'avg(ranking)': 578.1381578947369, 'first_name': 'Irina Maria'}, {'avg(ranking)': 866.1075949367089, 'first_name': 'Iris'}, {'avg(ranking)': 489.5294964028777, 'first_name': 'Iryna'}, {'avg(ranking)': 724.9178743961353, 'first_name': 'Isabel'}, {'avg(ranking)': 1114.99375, 'first_name': 'Isabela'}, {'avg(ranking)': 566.7873931623932, 'first_name': 'Isabella'}, {'avg(ranking)': 781.6993464052288, 'first_name': 'Isabelle'}, {'avg(ranking)': 1170.9411764705883, 'first_name': 'Iulia Maria'}, {'avg(ranking)': 732.7386018237082, 'first_name': 'Iva'}, {'avg(ranking)': 439.81414868105514, 'first_name': 'Ivana'}, {'avg(ranking)': 871.109375, 'first_name': 'Ivania'}, {'avg(ranking)': 1079.05, 'first_name': 'Ivanka'}, {'avg(ranking)': 117.95684523809524, 'first_name': 'Iveta'}, {'avg(ranking)': 1136.8535031847134, 'first_name': 'Ivette'}, {'avg(ranking)': 872.0, 'first_name': 'Ivone'}, {'avg(ranking)': 591.3809523809524, 'first_name': 'Ivonne'}, {'avg(ranking)': 624.6089494163424, 'first_name': 'Jacqueline'}, {'avg(ranking)': 909.2, 'first_name': 'Jada'}, {'avg(ranking)': 739.04802259887, 'first_name': 'Jade'}, {'avg(ranking)': 760.4920634920635, 'first_name': 'Jaeda'}, {'avg(ranking)': 562.8450704225352, 'first_name': 'Jaimee'}, {'avg(ranking)': 1243.875, 'first_name': 'Jaimy Gayle'}, {'avg(ranking)': 1037.5274725274726, 'first_name': 'Jainy'}, {'avg(ranking)': 402.36756756756756, 'first_name': 'Jamie'}, {'avg(ranking)': 1247.3333333333333, 'first_name': 'Jamilya'}, {'avg(ranking)': 592.5990783410139, 'first_name': 'Jan'}, {'avg(ranking)': 406.6258503401361, 'first_name': 'Jana'}, {'avg(ranking)': 240.5306603773585, 'first_name': 'Janette'}, {'avg(ranking)': 699.7864583333334, 'first_name': 'Janina'}, {'avg(ranking)': 1262.5416666666667, 'first_name': 'Janja'}, {'avg(ranking)': 861.5102040816327, 'first_name': 'Janneke'}, {'avg(ranking)': 748.7238095238096, 'first_name': 'Jaqueline Adina'}, {'avg(ranking)': 1121.767857142857, 'first_name': 'Jara'}, {'avg(ranking)': 149.46360759493672, 'first_name': 'Jarmila'}, {'avg(ranking)': 633.027027027027, 'first_name': 'Jasmin'}, {'avg(ranking)': 642.1811989100818, 'first_name': 'Jasmina'}, {'avg(ranking)': 437.86915887850466, 'first_name': 'Jasmine'}, {'avg(ranking)': 1117.64, 'first_name': 'Jasmine Amber'}, {'avg(ranking)': 1070.5648854961833, 'first_name': 'Jawairiah'}, {'avg(ranking)': 1035.46, 'first_name': 'Jazmin'}, {'avg(ranking)': 983.1290322580645, 'first_name': 'Jazzamay'}, {'avg(ranking)': 767.7730496453901, 'first_name': 'Jeannine'}, {'avg(ranking)': 348.19338235294117, 'first_name': 'Jelena'}, {'avg(ranking)': 556.7936681222708, 'first_name': 'Jennifer'}, {'avg(ranking)': 902.1470588235294, 'first_name': 'Jenny'}, {'avg(ranking)': 501.5860215053763, 'first_name': 'Jesika'}, {'avg(ranking)': 655.7464059804486, 'first_name': 'Jessica'}, {'avg(ranking)': 818.2043795620438, 'first_name': 'Jessika'}, {'avg(ranking)': 967.6708860759494, 'first_name': 'Jessy'}, {'avg(ranking)': 823.9789029535865, 'first_name': 'Ji Hee'}, {'avg(ranking)': 833.5061082024433, 'first_name': 'Ji Young'}, {'avg(ranking)': 1169.6923076923076, 'first_name': 'Jia'}, {'avg(ranking)': 682.961038961039, 'first_name': 'Jia Jing'}, {'avg(ranking)': 529.7777777777778, 'first_name': 'Jia Qi'}, {'avg(ranking)': 794.4931506849315, 'first_name': 'Jiahui'}, {'avg(ranking)': 1230.6, 'first_name': 'Jiakang'}, {'avg(ranking)': 1232.032258064516, 'first_name': 'Jiatian'}, {'avg(ranking)': 578.5, 'first_name': 'Jiaxi'}, {'avg(ranking)': 1161.0, 'first_name': 'Jiaxue'}, {'avg(ranking)': 114.05571428571429, 'first_name': 'Jie'}, {'avg(ranking)': 501.0619469026549, 'first_name': 'Jil Belen'}, {'avg(ranking)': 1116.4190476190477, 'first_name': 'Jil Nora'}, {'avg(ranking)': 121.9579326923077, 'first_name': 'Jill'}, {'avg(ranking)': 721.14, 'first_name': 'Jillian'}, {'avg(ranking)': 1267.0, 'first_name': 'Jin'}, {'avg(ranking)': 492.8915187376726, 'first_name': 'Jin A'}, {'avg(ranking)': 1035.6470588235295, 'first_name': 'Jin Ju'}, {'avg(ranking)': 369.1620469083156, 'first_name': 'Jing Jing'}, {'avg(ranking)': 863.3225806451613, 'first_name': 'Joana'}, {'avg(ranking)': 931.025641025641, 'first_name': 'Joanna'}, {'avg(ranking)': 1227.8, 'first_name': 'Joanne'}, {'avg(ranking)': 925.4230769230769, 'first_name': 'Jodie Anna'}, {'avg(ranking)': 1111.8333333333333, 'first_name': 'Johana'}, {'avg(ranking)': 310.3405299313052, 'first_name': 'Johanna'}, {'avg(ranking)': 1022.6198347107438, 'first_name': 'Jordana'}, {'avg(ranking)': 924.9325842696629, 'first_name': 'Josepha'}, {'avg(ranking)': 684.4892086330935, 'first_name': 'Josephine'}, {'avg(ranking)': 993.2105263157895, 'first_name': 'Josie'}, {'avg(ranking)': 601.9846625766871, 'first_name': 'Jovana'}, {'avg(ranking)': 812.6, 'first_name': 'Ju Eun'}, {'avg(ranking)': 1224.0, 'first_name': 'Judith'}, {'avg(ranking)': 1243.904761904762, 'first_name': 'Jule'}, {'avg(ranking)': 576.9173467252564, 'first_name': 'Julia'}, {'avg(ranking)': 1024.6666666666667, 'first_name': 'Julia Mansano'}, {'avg(ranking)': 1110.0816326530612, 'first_name': 'Juliana'}, {'avg(ranking)': 1175.7666666666667, 'first_name': 'Juliana Rocha'}, {'avg(ranking)': 512.3787128712871, 'first_name': 'Julie'}, {'avg(ranking)': 707.1467889908257, 'first_name': 'Julieta Lara'}, {'avg(ranking)': 1019.9411764705883, 'first_name': 'Julita'}, {'avg(ranking)': 732.1666666666666, 'first_name': 'Julyette Maria Josephine'}, {'avg(ranking)': 1189.0, 'first_name': 'June'}, {'avg(ranking)': 262.30884808013354, 'first_name': 'Junri'}, {'avg(ranking)': 1212.9166666666667, 'first_name': 'Justina'}, {'avg(ranking)': 521.5358361774744, 'first_name': 'Justine'}, {'avg(ranking)': 585.8517745302714, 'first_name': 'Justyna'}, {'avg(ranking)': 1055.020202020202, 'first_name': 'Kady'}, {'avg(ranking)': 272.08855291576674, 'first_name': 'Kai Chen'}, {'avg(ranking)': 522.6561403508772, 'first_name': 'Kai Lin'}, {'avg(ranking)': 127.06775067750678, 'first_name': 'Kaia'}, {'avg(ranking)': 901.3333333333334, 'first_name': 'Kaitlin'}, {'avg(ranking)': 756.2549019607843, 'first_name': 'Kaitlyn'}, {'avg(ranking)': 633.5454545454545, 'first_name': 'Kaja'}, {'avg(ranking)': 661.9589041095891, 'first_name': 'Kajsa'}, {'avg(ranking)': 568.2547169811321, 'first_name': 'Kamila'}, {'avg(ranking)': 1162.8301886792453, 'first_name': 'Kamilla'}, {'avg(ranking)': 765.1395348837209, 'first_name': 'Kamonwan'}, {'avg(ranking)': 924.2782608695652, 'first_name': 'Kana'}, {'avg(ranking)': 635.346516007533, 'first_name': 'Kanae'}, {'avg(ranking)': 1105.3125, 'first_name': 'Kanako'}, {'avg(ranking)': 799.9940828402367, 'first_name': 'Kanami'}, {'avg(ranking)': 962.8536585365854, 'first_name': 'Kanika'}, {'avg(ranking)': 871.0790513833992, 'first_name': 'Kaori'}, {'avg(ranking)': 674.9672514619883, 'first_name': 'Karen'}, {'avg(ranking)': 1068.9166666666667, 'first_name': 'Kariann'}, {'avg(ranking)': 472.338003502627, 'first_name': 'Karin'}, {'avg(ranking)': 883.6090909090909, 'first_name': 'Karina'}, {'avg(ranking)': 696.9606060606061, 'first_name': 'Karina Ildor'}, {'avg(ranking)': 1062.795918367347, 'first_name': 'Karina Kristina'}, {'avg(ranking)': 868.8904109589041, 'first_name': 'Karine'}, {'avg(ranking)': 1001.0679611650486, 'first_name': 'Karis'}, {'avg(ranking)': 807.616, 'first_name': 'Karla'}, {'avg(ranking)': 652.917808219178, 'first_name': 'Karman'}, {'avg(ranking)': 928.3333333333334, 'first_name': 'Karola Patricia'}, {'avg(ranking)': 1077.8095238095239, 'first_name': 'Karolayne'}, {'avg(ranking)': 586.9412296564195, 'first_name': 'Karolina'}, {'avg(ranking)': 873.6229508196722, 'first_name': 'Karoline'}, {'avg(ranking)': 903.5769230769231, 'first_name': 'Karyn'}, {'avg(ranking)': 927.0350877192982, 'first_name': 'Kassandra'}, {'avg(ranking)': 331.93949394939494, 'first_name': 'Katalin'}, {'avg(ranking)': 401.0998263888889, 'first_name': 'Katarina'}, {'avg(ranking)': 459.29286608260327, 'first_name': 'Katarzyna'}, {'avg(ranking)': 1117.7142857142858, 'first_name': 'Kate'}, {'avg(ranking)': 491.8507295173962, 'first_name': 'Katerina'}, {'avg(ranking)': 294.33209990749305, 'first_name': 'Kateryna'}, {'avg(ranking)': 680.677700348432, 'first_name': 'Katharina'}, {'avg(ranking)': 882.1071428571429, 'first_name': 'Katharine'}, {'avg(ranking)': 836.6804511278195, 'first_name': 'Katherine'}, {'avg(ranking)': 910.396694214876, 'first_name': 'Katherine Gabriela'}, {'avg(ranking)': 415.7, 'first_name': 'Kathinka'}, {'avg(ranking)': 291.4792817679558, 'first_name': 'Kathrin'}, {'avg(ranking)': 620.9404580152672, 'first_name': 'Katie'}, {'avg(ranking)': 1111.08, 'first_name': 'Katrine Isabel'}, {'avg(ranking)': 492.6608695652174, 'first_name': 'Katy'}, {'avg(ranking)': 1050.7, 'first_name': 'Katya'}, {'avg(ranking)': 1010.1818181818181, 'first_name': 'Katyarina'}, {'avg(ranking)': 583.1686746987951, 'first_name': 'Kayla'}, {'avg(ranking)': 1163.3478260869565, 'first_name': 'Kaylah'}, {'avg(ranking)': 772.2402912621359, 'first_name': 'Kazusa'}, {'avg(ranking)': 1003.1212121212121, 'first_name': 'Kei'}, {'avg(ranking)': 1114.9433962264152, 'first_name': 'Kelia'}, {'avg(ranking)': 804.873831775701, 'first_name': 'Kelly'}, {'avg(ranking)': 312.7584269662921, 'first_name': 'Kelly S'}, {'avg(ranking)': 1012.325, 'first_name': 'Kelsey'}, {'avg(ranking)': 807.7222222222222, 'first_name': 'Kennedy'}, {'avg(ranking)': 643.422641509434, 'first_name': 'Keren'}, {'avg(ranking)': 1018.6534653465346, 'first_name': 'Keri'}, {'avg(ranking)': 1020.4271844660194, 'first_name': 'Kerstin'}, {'avg(ranking)': 978.0229885057471, 'first_name': 'Khristina'}, {'avg(ranking)': 1164.090909090909, 'first_name': 'Ki Ryang'}, {'avg(ranking)': 287.71625344352617, 'first_name': 'Kiki'}, {'avg(ranking)': 687.3120567375887, 'first_name': 'Kim'}, {'avg(ranking)': 762.4081632653061, 'first_name': 'Kim Alice'}, {'avg(ranking)': 846.9154228855722, 'first_name': 'Kimberley'}, {'avg(ranking)': 618.6923076923077, 'first_name': 'Kimberly'}, {'avg(ranking)': 1097.219512195122, 'first_name': 'Kimika'}, {'avg(ranking)': 95.03465982028241, 'first_name': 'Kimiko'}, {'avg(ranking)': 606.1467576791808, 'first_name': 'Kinnie'}, {'avg(ranking)': 308.64912280701753, 'first_name': 'Kirsten'}, {'avg(ranking)': 1035.0384615384614, 'first_name': 'Kirsten Andrea'}, {'avg(ranking)': 576.9, 'first_name': 'Klaartje'}, {'avg(ranking)': 235.31431431431432, 'first_name': 'Klara'}, {'avg(ranking)': 780.7905027932961, 'first_name': 'Klaudia'}, {'avg(ranking)': 826.0238095238095, 'first_name': 'Komola'}, {'avg(ranking)': 567.0507399577167, 'first_name': 'Korina'}, {'avg(ranking)': 844.7460317460317, 'first_name': 'Kotomi'}, {'avg(ranking)': 522.984693877551, 'first_name': 'Krista'}, {'avg(ranking)': 445.18918918918916, 'first_name': 'Kristie'}, {'avg(ranking)': 343.25546975546973, 'first_name': 'Kristina'}, {'avg(ranking)': 1060.5633802816901, 'first_name': 'Kristina N'}, {'avg(ranking)': 837.7730496453901, 'first_name': 'Kristy'}, {'avg(ranking)': 443.8467908902692, 'first_name': 'Kristyna'}, {'avg(ranking)': 482.36648501362396, 'first_name': 'Ksenia'}, {'avg(ranking)': 990.6, 'first_name': 'Kseniia'}, {'avg(ranking)': 975.6271186440678, 'first_name': 'Ksenija'}, {'avg(ranking)': 488.76107382550333, 'first_name': 'Kumiko'}, {'avg(ranking)': 165.96132596685084, 'first_name': 'Kurumi'}, {'avg(ranking)': 159.62397820163488, 'first_name': 'Kveta'}, {'avg(ranking)': 1070.0377358490566, 'first_name': 'Kwan Yau'}, {'avg(ranking)': 887.502487562189, 'first_name': 'Kyle'}, {'avg(ranking)': 798.3181818181819, 'first_name': 'Kylie'}, {'avg(ranking)': 348.54794520547944, 'first_name': 'Kyoka'}, {'avg(ranking)': 443.76148409893995, 'first_name': 'Kyra'}, {'avg(ranking)': 533.433770014556, 'first_name': 'Kyung Mi'}, {'avg(ranking)': 677.4458598726114, 'first_name': 'Laetitia'}, {'avg(ranking)': 996.8148148148148, 'first_name': 'Laili'}, {'avg(ranking)': 1062.3666666666666, 'first_name': 'Lamis'}, {'avg(ranking)': 643.6939163498099, 'first_name': 'Lara'}, {'avg(ranking)': 1054.9019607843138, 'first_name': 'Larikah'}, {'avg(ranking)': 504.4145867098865, 'first_name': 'Laura'}, {'avg(ranking)': 910.5714285714286, 'first_name': 'Laura D'}, {'avg(ranking)': 516.1982942430703, 'first_name': 'Laura Ioana'}, {'avg(ranking)': 1198.1538461538462, 'first_name': 'Laura Sofia'}, {'avg(ranking)': 484.9442231075697, 'first_name': 'Lauren'}, {'avg(ranking)': 1107.0882352941176, 'first_name': 'Lauryn'}, {'avg(ranking)': 612.736, 'first_name': 'Lavinia'}, {'avg(ranking)': 1226.076923076923, 'first_name': 'Laylo'}, {'avg(ranking)': 1184.0, 'first_name': 'Layne'}, {'avg(ranking)': 858.4107142857143, 'first_name': 'Lea'}, {'avg(ranking)': 1179.6216216216217, 'first_name': 'Leah'}, {'avg(ranking)': 908.156862745098, 'first_name': 'Lee'}, {'avg(ranking)': 594.9436936936937, 'first_name': 'Lena'}, {'avg(ranking)': 657.8934169278997, 'first_name': 'Lena Marie'}, {'avg(ranking)': 451.33577981651376, 'first_name': 'Lenka'}, {'avg(ranking)': 773.5666666666667, 'first_name': 'Leolia'}, {'avg(ranking)': 825.972972972973, 'first_name': 'Leonie'}, {'avg(ranking)': 887.4545454545455, 'first_name': 'Lesedi Sheya'}, {'avg(ranking)': 205.17590361445784, 'first_name': 'Lesia'}, {'avg(ranking)': 514.7174515235457, 'first_name': 'Lesley'}, {'avg(ranking)': 1180.5454545454545, 'first_name': 'Leslie'}, {'avg(ranking)': 481.3229166666667, 'first_name': 'Leticia'}, {'avg(ranking)': 1072.4, 'first_name': 'Leticia Garcia'}, {'avg(ranking)': 1030.5, 'first_name': 'Leylah Annie'}, {'avg(ranking)': 988.7425149700599, 'first_name': 'Li'}, {'avg(ranking)': 387.87113402061857, 'first_name': 'Liana Gabriela'}, {'avg(ranking)': 899.9150326797386, 'first_name': 'Libby'}, {'avg(ranking)': 1035.327868852459, 'first_name': 'Libi'}, {'avg(ranking)': 1147.8529411764705, 'first_name': 'Lidia'}, {'avg(ranking)': 797.2128378378378, 'first_name': 'Lidziya'}, {'avg(ranking)': 284.8326771653543, 'first_name': 'Liezel'}, {'avg(ranking)': 567.9464544138929, 'first_name': 'Liga'}, {'avg(ranking)': 722.5087719298245, 'first_name': 'Lilla'}, {'avg(ranking)': 497.42124542124543, 'first_name': 'Lin'}, {'avg(ranking)': 574.9808362369338, 'first_name': 'Lina'}, {'avg(ranking)': 929.4398496240601, 'first_name': 'Linda'}, {'avg(ranking)': 275.6055900621118, 'first_name': 'Lindsay'}, {'avg(ranking)': 986.82, 'first_name': 'Lindsey'}, {'avg(ranking)': 418.81925343811395, 'first_name': 'Ling'}, {'avg(ranking)': 1184.7222222222222, 'first_name': 'Liniques'}, {'avg(ranking)': 959.6981132075472, 'first_name': 'Linnea'}, {'avg(ranking)': 356.0105210420842, 'first_name': 'Lisa'}, {'avg(ranking)': 758.06, 'first_name': 'Lisa Maria'}, {'avg(ranking)': 996.0408163265306, 'first_name': 'Lisa Marie'}, {'avg(ranking)': 673.6507936507936, 'first_name': 'Lisanne'}, {'avg(ranking)': 887.2875, 'first_name': 'Liubov'}, {'avg(ranking)': 1179.875, 'first_name': 'Livia'}, {'avg(ranking)': 870.9007633587786, 'first_name': 'Liz Tatiane'}, {'avg(ranking)': 1120.5652173913043, 'first_name': 'Lizaveta'}, {'avg(ranking)': 666.1496062992126, 'first_name': 'Lizette'}, {'avg(ranking)': 1231.2727272727273, 'first_name': 'Lorenza'}, {'avg(ranking)': 972.75, 'first_name': 'Lorraine M'}, {'avg(ranking)': 680.1724137931035, 'first_name': 'Lou'}, {'avg(ranking)': 1220.0, 'first_name': 'Loudmilla'}, {'avg(ranking)': 380.5308641975309, 'first_name': 'Louisa'}, {'avg(ranking)': 1070.1025641025642, 'first_name': 'Louise'}, {'avg(ranking)': 188.06095041322314, 'first_name': 'Lourdes'}, {'avg(ranking)': 907.3557312252965, 'first_name': 'Lu'}, {'avg(ranking)': 859.8644067796611, 'first_name': 'Luca'}, {'avg(ranking)': 845.740638002774, 'first_name': 'Lucia'}, {'avg(ranking)': 885.7495107632094, 'first_name': 'Luciana'}, {'avg(ranking)': 322.62611607142856, 'first_name': 'Lucie'}, {'avg(ranking)': 845.986301369863, 'first_name': 'Lucrezia'}, {'avg(ranking)': 756.3141592920354, 'first_name': 'Lucy'}, {'avg(ranking)': 846.2727272727273, 'first_name': 'Ludmila'}, {'avg(ranking)': 787.5416666666666, 'first_name': 'Ludmilla'}, {'avg(ranking)': 981.7517730496454, 'first_name': 'Luisa'}, {'avg(ranking)': 820.59375, 'first_name': 'Luisa Marie'}, {'avg(ranking)': 284.22813688212926, 'first_name': 'Luksika'}, {'avg(ranking)': 1098.2888888888888, 'first_name': 'Lulu'}, {'avg(ranking)': 1139.0, 'first_name': 'Luna'}, {'avg(ranking)': 974.2702702702703, 'first_name': 'Lusine'}, {'avg(ranking)': 1190.0629921259842, 'first_name': 'Lutfiye'}, {'avg(ranking)': 982.6666666666666, 'first_name': 'Lyann'}, {'avg(ranking)': 952.4411764705883, 'first_name': 'Lynn'}, {'avg(ranking)': 382.82479784366575, 'first_name': 'Lyudmyla'}, {'avg(ranking)': 607.3360995850622, 'first_name': 'Macall'}, {'avg(ranking)': 692.1515151515151, 'first_name': 'Macarena'}, {'avg(ranking)': 324.63613231552165, 'first_name': 'Madalina'}, {'avg(ranking)': 748.0, 'first_name': 'Maddison'}, {'avg(ranking)': 1028.0365853658536, 'first_name': 'Madeleine'}, {'avg(ranking)': 1217.469387755102, 'first_name': 'Madeline'}, {'avg(ranking)': 1203.5, 'first_name': 'Madina'}, {'avg(ranking)': 290.64452214452217, 'first_name': 'Madison'}, {'avg(ranking)': 958.0955414012739, 'first_name': 'Madrie'}, {'avg(ranking)': 787.0, 'first_name': 'Maegan'}, {'avg(ranking)': 1139.7, 'first_name': 'Mafalda'}, {'avg(ranking)': 1173.75, 'first_name': 'Maftuna'}, {'avg(ranking)': 734.0, 'first_name': 'Magali'}, {'avg(ranking)': 1036.1214953271028, 'first_name': 'Magalie'}, {'avg(ranking)': 300.3974358974359, 'first_name': 'Magda'}, {'avg(ranking)': 443.6296006264683, 'first_name': 'Magdalena'}, {'avg(ranking)': 1092.7621951219512, 'first_name': 'Magy'}, {'avg(ranking)': 875.0, 'first_name': 'Mahak'}, {'avg(ranking)': 1007.15, 'first_name': 'Mahitha'}, {'avg(ranking)': 687.25, 'first_name': 'Mai'}, {'avg(ranking)': 745.433962264151, 'first_name': 'Maia'}, {'avg(ranking)': 1206.6666666666667, 'first_name': 'Maia A'}, {'avg(ranking)': 438.4245810055866, 'first_name': 'Maiko'}, {'avg(ranking)': 1152.888888888889, 'first_name': 'Maileen'}, {'avg(ranking)': 410.8463541666667, 'first_name': 'Mailen'}, {'avg(ranking)': 896.7413793103449, 'first_name': 'Maja'}, {'avg(ranking)': 784.8009049773756, 'first_name': 'Makiho'}, {'avg(ranking)': 516.6615384615385, 'first_name': 'Makoto'}, {'avg(ranking)': 999.15625, 'first_name': 'Malene'}, {'avg(ranking)': 1004.7428571428571, 'first_name': 'Malika'}, {'avg(ranking)': 825.039603960396, 'first_name': 'Malin'}, {'avg(ranking)': 1031.5342465753424, 'first_name': 'Mallaurie'}, {'avg(ranking)': 143.48235294117646, 'first_name': 'Mallory'}, {'avg(ranking)': 947.3333333333334, 'first_name': 'Malou'}, {'avg(ranking)': 1153.590909090909, 'first_name': 'Mami'}, {'avg(ranking)': 1202.2692307692307, 'first_name': 'Man Ying Maggie'}, {'avg(ranking)': 689.891129032258, 'first_name': 'Mana'}, {'avg(ranking)': 1230.6, 'first_name': 'Mananchaya'}, {'avg(ranking)': 838.1780821917808, 'first_name': 'Manca'}, {'avg(ranking)': 361.0, 'first_name': 'Mandy'}, {'avg(ranking)': 897.0974358974358, 'first_name': 'Manisha'}, {'avg(ranking)': 622.7673469387755, 'first_name': 'Manon'}, {'avg(ranking)': 1181.3548387096773, 'first_name': 'Manya'}, {'avg(ranking)': 908.3962264150944, 'first_name': 'Mara'}, {'avg(ranking)': 774.64, 'first_name': 'Marcela'}, {'avg(ranking)': 1143.7957746478874, 'first_name': 'Marcela Guimaraes'}, {'avg(ranking)': 1247.3636363636363, 'first_name': 'Marcelina'}, {'avg(ranking)': 657.0171919770773, 'first_name': 'Marcella'}, {'avg(ranking)': 325.5912596401028, 'first_name': 'Margalita'}, {'avg(ranking)': 987.6739130434783, 'first_name': 'Margarida'}, {'avg(ranking)': 611.4060995184591, 'first_name': 'Margarita'}, {'avg(ranking)': 1051.1224489795918, 'first_name': 'Margaux'}, {'avg(ranking)': 753.8346456692914, 'first_name': 'Margot'}, {'avg(ranking)': 526.3698630136986, 'first_name': 'Mari'}, {'avg(ranking)': 426.6002565198803, 'first_name': 'Maria'}, {'avg(ranking)': 1190.0833333333333, 'first_name': 'Maria Agustina'}, {'avg(ranking)': 1072.9591836734694, 'first_name': 'Maria Andrea'}, {'avg(ranking)': 1188.5277777777778, 'first_name': 'Maria Camila'}, {'avg(ranking)': 861.5050505050505, 'first_name': 'Maria Constanza De Las Mercedes'}, {'avg(ranking)': 1119.4897959183672, 'first_name': 'Maria Del Rosario'}, {'avg(ranking)': 194.2392065344224, 'first_name': 'Maria Elena'}, {'avg(ranking)': 443.0228531855956, 'first_name': 'Maria Fernanda'}, {'avg(ranking)': 1170.1830985915492, 'first_name': 'Maria Jesus'}, {'avg(ranking)': 486.6092544987147, 'first_name': 'Maria Joao'}, {'avg(ranking)': 306.1794310722101, 'first_name': 'Maria Jose'}, {'avg(ranking)': 918.0769230769231, 'first_name': 'Maria Lourdes'}, {'avg(ranking)': 1047.98224852071, 'first_name': 'Maria Paulina'}, {'avg(ranking)': 359.81081081081084, 'first_name': 'Maria Teresa'}, {'avg(ranking)': 662.1182795698925, 'first_name': 'Mariam'}, {'avg(ranking)': 556.0428051001821, 'first_name': 'Mariana'}, {'avg(ranking)': 730.3831168831168, 'first_name': 'Marianna'}, {'avg(ranking)': 993.175925925926, 'first_name': 'Marianne'}, {'avg(ranking)': 1085.4242424242425, 'first_name': 'Mariaryeni'}, {'avg(ranking)': 695.574074074074, 'first_name': 'Marie'}, {'avg(ranking)': 300.56296296296296, 'first_name': 'Marie Eve'}, {'avg(ranking)': 1148.9166666666667, 'first_name': 'Mariia'}, {'avg(ranking)': 544.2636655948553, 'first_name': 'Marija'}, {'avg(ranking)': 1215.0, 'first_name': 'Marijana'}, {'avg(ranking)': 532.6881807180315, 'first_name': 'Marina'}, {'avg(ranking)': 774.5654761904761, 'first_name': 'Marine'}, {'avg(ranking)': 279.78655282817505, 'first_name': 'Marion'}, {'avg(ranking)': 1163.0, 'first_name': 'Mariona'}, {'avg(ranking)': 1067.3413173652696, 'first_name': 'Marisa'}, {'avg(ranking)': 281.871335504886, 'first_name': 'Mariya'}, {'avg(ranking)': 353.44444444444446, 'first_name': 'Marketa'}, {'avg(ranking)': 946.8934426229508, 'first_name': 'Marlies'}, {'avg(ranking)': 783.1711711711712, 'first_name': 'Marrit'}, {'avg(ranking)': 419.32988047808766, 'first_name': 'Marta'}, {'avg(ranking)': 851.1224489795918, 'first_name': 'Marta Huqi'}, {'avg(ranking)': 1056.0588235294117, 'first_name': 'Martha'}, {'avg(ranking)': 751.8679119412942, 'first_name': 'Martina'}, {'avg(ranking)': 869.1666666666666, 'first_name': 'Mary'}, {'avg(ranking)': 1188.7096774193549, 'first_name': 'Mary Ann'}, {'avg(ranking)': 323.86176470588236, 'first_name': 'Maryna'}, {'avg(ranking)': 355.7223168654174, 'first_name': 'Masa'}, {'avg(ranking)': 437.11396648044695, 'first_name': 'Mathilde'}, {'avg(ranking)': 799.1875, 'first_name': 'Matilda'}, {'avg(ranking)': 1013.4761904761905, 'first_name': 'Maud'}, {'avg(ranking)': 1070.21875, 'first_name': 'Maureen'}, {'avg(ranking)': 1121.0869565217392, 'first_name': 'Maurien'}, {'avg(ranking)': 973.8717948717949, 'first_name': 'Maxine'}, {'avg(ranking)': 1084.0294117647059, 'first_name': 'May'}, {'avg(ranking)': 732.4260679079956, 'first_name': 'Maya'}, {'avg(ranking)': 891.6309523809524, 'first_name': 'Mayar'}, {'avg(ranking)': 407.029702970297, 'first_name': 'Mayo'}, {'avg(ranking)': 619.9064748201439, 'first_name': 'Mayya'}, {'avg(ranking)': 736.4809523809524, 'first_name': 'Megan'}, {'avg(ranking)': 1025.0, 'first_name': 'Megumi'}, {'avg(ranking)': 1031.6, 'first_name': 'Mei Xu'}, {'avg(ranking)': 812.85, 'first_name': 'Meiling'}, {'avg(ranking)': 1029.1666666666667, 'first_name': 'Meiqi'}, {'avg(ranking)': 372.32502965599053, 'first_name': 'Melanie'}, {'avg(ranking)': 1039.8333333333333, 'first_name': 'Melany Solange'}, {'avg(ranking)': 1017.2560553633218, 'first_name': 'Melina'}, {'avg(ranking)': 169.13578500707214, 'first_name': 'Melinda'}, {'avg(ranking)': 634.7950310559006, 'first_name': 'Melis'}, {'avg(ranking)': 993.1351351351351, 'first_name': 'Melisa'}, {'avg(ranking)': 1154.093023255814, 'first_name': 'Melissa'}, {'avg(ranking)': 1104.357142857143, 'first_name': 'Melissa Ishuan'}, {'avg(ranking)': 1035.95, 'first_name': 'Meng Ning'}, {'avg(ranking)': 1213.2142857142858, 'first_name': 'Mercedes'}, {'avg(ranking)': 900.75, 'first_name': 'Merel'}, {'avg(ranking)': 1182.9107142857142, 'first_name': 'Meritxell'}, {'avg(ranking)': 337.5292682926829, 'first_name': 'Mervana'}, {'avg(ranking)': 554.3953934740883, 'first_name': 'Mi'}, {'avg(ranking)': 1071.3076923076924, 'first_name': 'Mi Jeong'}, {'avg(ranking)': 992.7225433526012, 'first_name': 'Mi Rae'}, {'avg(ranking)': 999.375, 'first_name': 'Mi Zhuoma'}, {'avg(ranking)': 987.504761904762, 'first_name': 'Mia Nicole'}, {'avg(ranking)': 1332.0737704918033, 'first_name': 'Micaela'}, {'avg(ranking)': 676.90589198036, 'first_name': 'Michaela'}, {'avg(ranking)': 185.3469387755102, 'first_name': 'Michaella'}, {'avg(ranking)': 1228.9285714285713, 'first_name': 'Michela'}, {'avg(ranking)': 946.8846153846154, 'first_name': 'Michele Alexandra'}, {'avg(ranking)': 280.79959100204496, 'first_name': 'Michelle'}, {'avg(ranking)': 718.047619047619, 'first_name': 'Michika'}, {'avg(ranking)': 376.7356115107914, 'first_name': 'Mihaela'}, {'avg(ranking)': 1223.4, 'first_name': 'Mihaela Lorena'}, {'avg(ranking)': 523.2788844621514, 'first_name': 'Miharu'}, {'avg(ranking)': 1064.142857142857, 'first_name': 'Mihika'}, {'avg(ranking)': 1110.4411764705883, 'first_name': 'Mihoki'}, {'avg(ranking)': 586.2250489236791, 'first_name': 'Miki'}, {'avg(ranking)': 1201.16, 'first_name': 'Mila'}, {'avg(ranking)': 1234.2857142857142, 'first_name': 'Milagros'}, {'avg(ranking)': 626.441935483871, 'first_name': 'Milana'}, {'avg(ranking)': 1114.4074074074074, 'first_name': 'Milena'}, {'avg(ranking)': 1221.904761904762, 'first_name': 'Milica'}, {'avg(ranking)': 866.0693069306931, 'first_name': 'Min'}, {'avg(ranking)': 819.8425531914894, 'first_name': 'Min Hwa'}, {'avg(ranking)': 1238.0625, 'first_name': 'Minami'}, {'avg(ranking)': 788.2622950819672, 'first_name': 'Mira'}, {'avg(ranking)': 721.1643835616438, 'first_name': 'Mirabelle'}, {'avg(ranking)': 1169.4864864864865, 'first_name': 'Miranda'}, {'avg(ranking)': 912.120218579235, 'first_name': 'Miriam'}, {'avg(ranking)': 628.075, 'first_name': 'Miriam Bianca'}, {'avg(ranking)': 950.6263736263736, 'first_name': 'Miriana'}, {'avg(ranking)': 843.6428571428571, 'first_name': 'Mirjam'}, {'avg(ranking)': 186.76587795765877, 'first_name': 'Mirjana'}, {'avg(ranking)': 617.0379241516966, 'first_name': 'Misa'}, {'avg(ranking)': 208.95263157894738, 'first_name': 'Misaki'}, {'avg(ranking)': 1121.04, 'first_name': 'Mitsumi'}, {'avg(ranking)': 447.93283582089555, 'first_name': 'Miyabi'}, {'avg(ranking)': 594.9036697247707, 'first_name': 'Miyu'}, {'avg(ranking)': 593.1506849315068, 'first_name': 'Mizuno'}, {'avg(ranking)': 1029.0, 'first_name': 'Molly'}, {'avg(ranking)': 772.6981132075472, 'first_name': 'Momoko'}, {'avg(ranking)': 273.57517899761336, 'first_name': 'Mona'}, {'avg(ranking)': 210.0846394984326, 'first_name': 'Monica'}, {'avg(ranking)': 980.575, 'first_name': 'Monika'}, {'avg(ranking)': 462.4270462633452, 'first_name': 'Monique'}, {'avg(ranking)': 541.952380952381, 'first_name': 'Montserrat'}, {'avg(ranking)': 880.6527777777778, 'first_name': 'Morgane'}, {'avg(ranking)': 1243.4, 'first_name': 'Moulika'}, {'avg(ranking)': 1258.5, 'first_name': 'Mouna'}, {'avg(ranking)': 1198.25, 'first_name': 'Moyuka'}, {'avg(ranking)': 1227.0, 'first_name': 'Muazzez'}, {'avg(ranking)': 1186.9444444444443, 'first_name': 'Muge'}, {'avg(ranking)': 485.40168539325845, 'first_name': 'Myrtille'}, {'avg(ranking)': 82.13112391930835, 'first_name': 'Na'}, {'avg(ranking)': 608.7791798107255, 'first_name': 'Na Lae'}, {'avg(ranking)': 573.5197368421053, 'first_name': 'Na Ri'}, {'avg(ranking)': 868.6521739130435, 'first_name': 'Nadezda'}, {'avg(ranking)': 407.5463976945245, 'first_name': 'Nadia'}, {'avg(ranking)': 637.4607407407408, 'first_name': 'Nadiya'}, {'avg(ranking)': 631.8181818181819, 'first_name': 'Nadja'}, {'avg(ranking)': 828.0675675675676, 'first_name': 'Nagi'}, {'avg(ranking)': 767.4963503649635, 'first_name': 'Naiktha'}, {'avg(ranking)': 930.7027027027027, 'first_name': 'Naima'}, {'avg(ranking)': 878.6666666666666, 'first_name': 'Nam Yeon'}, {'avg(ranking)': 890.4455445544554, 'first_name': 'Nan Nan'}, {'avg(ranking)': 542.7168141592921, 'first_name': 'Nanuli'}, {'avg(ranking)': 313.45625, 'first_name': 'Nao'}, {'avg(ranking)': 1180.3828125, 'first_name': 'Naoko'}, {'avg(ranking)': 483.97225572979494, 'first_name': 'Naomi'}, {'avg(ranking)': 929.4388489208633, 'first_name': 'Napatsakorn'}, {'avg(ranking)': 1138.9166666666667, 'first_name': 'Nastassia'}, {'avg(ranking)': 554.5290322580645, 'first_name': 'Nastassja'}, {'avg(ranking)': 593.1772853185596, 'first_name': 'Nastja'}, {'avg(ranking)': 720.132932166302, 'first_name': 'Natalia'}, {'avg(ranking)': 577.9677419354839, 'first_name': 'Natalie'}, {'avg(ranking)': 634.3620689655172, 'first_name': 'Natalija'}, {'avg(ranking)': 1247.909090909091, 'first_name': 'Nataliya'}, {'avg(ranking)': 666.2853403141361, 'first_name': 'Natasa'}, {'avg(ranking)': 883.0777142857143, 'first_name': 'Natasha'}, {'avg(ranking)': 566.4943396226415, 'first_name': 'Natela'}, {'avg(ranking)': 962.0188679245283, 'first_name': 'Natella'}, {'avg(ranking)': 543.031185031185, 'first_name': 'Nathalia'}, {'avg(ranking)': 617.4615384615385, 'first_name': 'Nathaly'}, {'avg(ranking)': 929.6928104575163, 'first_name': 'Natia'}, {'avg(ranking)': 547.7037037037037, 'first_name': 'Natsumi'}, {'avg(ranking)': 1177.622641509434, 'first_name': 'Nattawadee'}, {'avg(ranking)': 1087.3823529411766, 'first_name': 'Naz'}, {'avg(ranking)': 825.7291666666666, 'first_name': 'Nazari'}, {'avg(ranking)': 745.421052631579, 'first_name': 'Neda'}, {'avg(ranking)': 1164.107142857143, 'first_name': 'Nelise'}, {'avg(ranking)': 1069.15, 'first_name': 'Nermeen'}, {'avg(ranking)': 1031.0, 'first_name': 'Nevena'}, {'avg(ranking)': 515.3191489361702, 'first_name': 'Nicha'}, {'avg(ranking)': 843.9007633587786, 'first_name': 'Nicky'}, {'avg(ranking)': 753.2253164556962, 'first_name': 'Nicola'}, {'avg(ranking)': 499.4127634660422, 'first_name': 'Nicole'}, {'avg(ranking)': 485.46875, 'first_name': 'Nicoleta Catalina'}, {'avg(ranking)': 778.1648648648649, 'first_name': 'Nicolette'}, {'avg(ranking)': 762.1578947368421, 'first_name': 'Nidhi'}, {'avg(ranking)': 376.7617554858934, 'first_name': 'Nigina'}, {'avg(ranking)': 913.4380165289256, 'first_name': 'Nika'}, {'avg(ranking)': 1174.0, 'first_name': 'Nikita'}, {'avg(ranking)': 1017.3134328358209, 'first_name': 'Nikki'}, {'avg(ranking)': 1054.0813953488373, 'first_name': 'Nikol'}, {'avg(ranking)': 723.484076433121, 'first_name': 'Nikola'}, {'avg(ranking)': 528.8673050615595, 'first_name': 'Nina'}, {'avg(ranking)': 1124.1666666666667, 'first_name': 'Nina Isabella'}, {'avg(ranking)': 841.0514705882352, 'first_name': 'Nives'}, {'avg(ranking)': 965.5343511450382, 'first_name': 'Noel'}, {'avg(ranking)': 1049.834745762712, 'first_name': 'Noelia'}, {'avg(ranking)': 883.7787610619469, 'first_name': 'Noelle'}, {'avg(ranking)': 1167.2758620689656, 'first_name': 'Nonna'}, {'avg(ranking)': 374.93926247288505, 'first_name': 'Noppawan'}, {'avg(ranking)': 921.6216216216217, 'first_name': 'Nora'}, {'avg(ranking)': 1096.1140350877192, 'first_name': 'Nour'}, {'avg(ranking)': 936.3392857142857, 'first_name': 'Nozomi'}, {'avg(ranking)': 436.66881028938906, 'first_name': 'Nudnida'}, {'avg(ranking)': 537.577922077922, 'first_name': 'Nungnadda'}, {'avg(ranking)': 395.6680227827502, 'first_name': 'Nuria'}, {'avg(ranking)': 1027.1382978723404, 'first_name': 'Oana'}, {'avg(ranking)': 686.3047619047619, 'first_name': 'Oana Georgeta'}, {'avg(ranking)': 728.7630208333334, 'first_name': 'Oceane'}, {'avg(ranking)': 839.4923664122138, 'first_name': 'Ofri'}, {'avg(ranking)': 533.9652351738241, 'first_name': 'Oksana'}, {'avg(ranking)': 660.8924731182796, 'first_name': 'Ola'}, {'avg(ranking)': 1397.5, 'first_name': 'Olawaseun'}, {'avg(ranking)': 1112.75, 'first_name': 'Olaya'}, {'avg(ranking)': 903.4289156626506, 'first_name': 'Oleksandra'}, {'avg(ranking)': 1179.1555555555556, 'first_name': 'Olena'}, {'avg(ranking)': 501.44444444444446, 'first_name': 'Olesya'}, {'avg(ranking)': 432.6511627906977, 'first_name': 'Olga'}, {'avg(ranking)': 446.7231833910035, 'first_name': 'Olivia'}, {'avg(ranking)': 1006.5128205128206, 'first_name': 'Oliwia'}, {'avg(ranking)': 435.1470588235294, 'first_name': 'Ons'}, {'avg(ranking)': 978.7321428571429, 'first_name': 'Ornella'}, {'avg(ranking)': 866.0454545454545, 'first_name': 'Oyku'}, {'avg(ranking)': 1156.28125, 'first_name': 'Paige Mary'}, {'avg(ranking)': 989.1904761904761, 'first_name': 'Pamela'}, {'avg(ranking)': 683.1081081081081, 'first_name': 'Panna'}, {'avg(ranking)': 132.12638580931264, 'first_name': 'Paola'}, {'avg(ranking)': 1099.625, 'first_name': 'Parris'}, {'avg(ranking)': 863.5507246376811, 'first_name': 'Patcharin'}, {'avg(ranking)': 572.8059701492538, 'first_name': 'Patricia'}, {'avg(ranking)': 403.935, 'first_name': 'Patricia Maria'}, {'avg(ranking)': 657.3816155988858, 'first_name': 'Patrycja'}, {'avg(ranking)': 385.8135593220339, 'first_name': 'Patty'}, {'avg(ranking)': 558.0162601626016, 'first_name': 'Paula'}, {'avg(ranking)': 1175.909090909091, 'first_name': 'Paula Andrea'}, {'avg(ranking)': 868.7624113475177, 'first_name': 'Paula Catalina'}, {'avg(ranking)': 508.4679802955665, 'first_name': 'Paula Cristina'}, {'avg(ranking)': 1035.7780678851175, 'first_name': 'Paulina'}, {'avg(ranking)': 298.1861898890259, 'first_name': 'Pauline'}, {'avg(ranking)': 915.5892857142857, 'first_name': 'Pavla'}, {'avg(ranking)': 514.586319218241, 'first_name': 'Peangtarn'}, {'avg(ranking)': 755.5813953488372, 'first_name': 'Peggy'}, {'avg(ranking)': 673.9809523809524, 'first_name': 'Pei Chi'}, {'avg(ranking)': 1106.5, 'first_name': 'Pei Hsuan'}, {'avg(ranking)': 1061.3076923076924, 'first_name': 'Pei Ju'}, {'avg(ranking)': 465.24962852897477, 'first_name': 'Pemra'}, {'avg(ranking)': 619.4154929577464, 'first_name': 'Pernilla'}, {'avg(ranking)': 710.3972602739726, 'first_name': 'Petia'}, {'avg(ranking)': 365.50280484204313, 'first_name': 'Petra'}, {'avg(ranking)': 1211.0, 'first_name': 'Phenomena'}, {'avg(ranking)': 826.6486486486486, 'first_name': 'Phillis'}, {'avg(ranking)': 737.862676056338, 'first_name': 'Pia'}, {'avg(ranking)': 668.2581196581197, 'first_name': 'Piia'}, {'avg(ranking)': 740.5879828326181, 'first_name': 'Pilar'}, {'avg(ranking)': 1041.0740740740741, 'first_name': 'Pippa'}, {'avg(ranking)': 937.7945205479452, 'first_name': 'Plobrung'}, {'avg(ranking)': 630.7953529937444, 'first_name': 'Polina'}, {'avg(ranking)': 478.30369515011546, 'first_name': 'Polona'}, {'avg(ranking)': 729.1047904191616, 'first_name': 'Poojashree'}, {'avg(ranking)': 795.4736842105264, 'first_name': 'Pranjala'}, {'avg(ranking)': 653.5070422535211, 'first_name': 'Prarthana G'}, {'avg(ranking)': 740.5361842105264, 'first_name': 'Prerna'}, {'avg(ranking)': 1137.19, 'first_name': 'Priscila'}, {'avg(ranking)': 675.4124293785311, 'first_name': 'Priscilla'}, {'avg(ranking)': 383.4714587737844, 'first_name': 'Qiang'}, {'avg(ranking)': 826.1388888888889, 'first_name': 'Qianhui'}, {'avg(ranking)': 943.421052631579, 'first_name': 'Qianqian'}, {'avg(ranking)': 705.8493150684932, 'first_name': 'Qiu Yu'}, {'avg(ranking)': 883.2352941176471, 'first_name': 'Quinn'}, {'avg(ranking)': 633.9770491803279, 'first_name': 'Quirine'}, {'avg(ranking)': 859.2706766917294, 'first_name': 'Rachael'}, {'avg(ranking)': 1147.8526315789475, 'first_name': 'Rachel'}, {'avg(ranking)': 955.7833333333333, 'first_name': 'Radina'}, {'avg(ranking)': 1121.2432432432433, 'first_name': 'Rafaela'}, {'avg(ranking)': 1176.5, 'first_name': 'Ralina'}, {'avg(ranking)': 304.4619771863118, 'first_name': 'Raluca'}, {'avg(ranking)': 672.2258064516129, 'first_name': 'Raluca Elena'}, {'avg(ranking)': 539.6164383561644, 'first_name': 'Raluca Georgiana'}, {'avg(ranking)': 1010.4545454545455, 'first_name': 'Ramu'}, {'avg(ranking)': 1121.8846153846155, 'first_name': 'Ramya'}, {'avg(ranking)': 598.2655172413793, 'first_name': 'Ran'}, {'avg(ranking)': 1117.6666666666667, 'first_name': 'Rana'}, {'avg(ranking)': 700.7644444444444, 'first_name': 'Raquel'}, {'avg(ranking)': 1089.2100840336134, 'first_name': 'Rashmi'}, {'avg(ranking)': 1021.6504854368932, 'first_name': 'Ratnika'}, {'avg(ranking)': 487.6268656716418, 'first_name': 'Raveena'}, {'avg(ranking)': 1145.4333333333334, 'first_name': 'Rebeca'}, {'avg(ranking)': 568.3374316939891, 'first_name': 'Rebecca'}, {'avg(ranking)': 676.1090909090909, 'first_name': 'Rebeka'}, {'avg(ranking)': 289.60283687943263, 'first_name': 'Regina'}, {'avg(ranking)': 1019.0, 'first_name': 'Reina'}, {'avg(ranking)': 323.1388101983003, 'first_name': 'Reka Luca'}, {'avg(ranking)': 494.6111111111111, 'first_name': 'Remi'}, {'avg(ranking)': 274.85317919075146, 'first_name': 'Renata'}, {'avg(ranking)': 669.448275862069, 'first_name': 'Ria'}, {'avg(ranking)': 638.6666666666666, 'first_name': 'Rianna'}, {'avg(ranking)': 246.19871794871796, 'first_name': 'Richel'}, {'avg(ranking)': 290.0614657210402, 'first_name': 'Rika'}, {'avg(ranking)': 495.22641509433964, 'first_name': 'Riko'}, {'avg(ranking)': 1125.0363636363636, 'first_name': 'Rio'}, {'avg(ranking)': 489.65909090909093, 'first_name': 'Risa'}, {'avg(ranking)': 775.7269624573379, 'first_name': 'Rishika'}, {'avg(ranking)': 1051.7349397590363, 'first_name': 'Rita'}, {'avg(ranking)': 651.4246575342465, 'first_name': 'Riya'}, {'avg(ranking)': 150.96681415929203, 'first_name': 'Roberta'}, {'avg(ranking)': 431.19607843137254, 'first_name': 'Robin'}, {'avg(ranking)': 1054.606896551724, 'first_name': 'Robyn'}, {'avg(ranking)': 795.6201232032854, 'first_name': 'Rocio'}, {'avg(ranking)': 402.49931972789113, 'first_name': 'Romana'}, {'avg(ranking)': 669.8542372881356, 'first_name': 'Romana Caroline'}, {'avg(ranking)': 283.63246554364474, 'first_name': 'Romina'}, {'avg(ranking)': 758.1714285714286, 'first_name': 'Romy'}, {'avg(ranking)': 1125.5471698113208, 'first_name': 'Rona'}, {'avg(ranking)': 427.0, 'first_name': 'Ronit'}, {'avg(ranking)': 1072.857142857143, 'first_name': 'Ronke'}, {'avg(ranking)': 1168.2857142857142, 'first_name': 'Roosh'}, {'avg(ranking)': 965.0, 'first_name': 'Rosa'}, {'avg(ranking)': 1059.73, 'first_name': 'Rosalia'}, {'avg(ranking)': 1066.5887096774193, 'first_name': 'Rosalie'}, {'avg(ranking)': 984.1714285714286, 'first_name': 'Rosie'}, {'avg(ranking)': 479.51738241308794, 'first_name': 'Roxane'}, {'avg(ranking)': 1209.625, 'first_name': 'Rui'}, {'avg(ranking)': 573.8729603729604, 'first_name': 'Rushmi'}, {'avg(ranking)': 808.5096774193548, 'first_name': 'Rutuja'}, {'avg(ranking)': 1069.0379746835442, 'first_name': 'Ryann'}, {'avg(ranking)': 1117.88, 'first_name': 'Saana'}, {'avg(ranking)': 982.7397260273973, 'first_name': 'Sabastiani'}, {'avg(ranking)': 682.2005532503458, 'first_name': 'Sabina'}, {'avg(ranking)': 1184.6666666666667, 'first_name': 'Sabina Elena'}, {'avg(ranking)': 203.5871080139373, 'first_name': 'Sabine'}, {'avg(ranking)': 905.6324786324786, 'first_name': 'Sabrina'}, {'avg(ranking)': 340.2890442890443, 'first_name': 'Sacha'}, {'avg(ranking)': 400.8093385214008, 'first_name': 'Sachia'}, {'avg(ranking)': 368.26881720430106, 'first_name': 'Sachie'}, {'avg(ranking)': 665.8219178082192, 'first_name': 'Sadafmoh'}, {'avg(ranking)': 998.5238095238095, 'first_name': 'Sai Samhitha'}, {'avg(ranking)': 297.39032258064515, 'first_name': 'Saisai'}, {'avg(ranking)': 832.9585365853659, 'first_name': 'Sakiko'}, {'avg(ranking)': 529.583908045977, 'first_name': 'Sally'}, {'avg(ranking)': 1204.6666666666667, 'first_name': 'Salma'}, {'avg(ranking)': 406.21702404158543, 'first_name': 'Samantha'}, {'avg(ranking)': 932.8940397350993, 'first_name': 'Samira'}, {'avg(ranking)': 1105.171875, 'first_name': 'Sanae'}, {'avg(ranking)': 703.1372549019608, 'first_name': 'Sanaz'}, {'avg(ranking)': 563.964505613908, 'first_name': 'Sandra'}, {'avg(ranking)': 1028.9565217391305, 'first_name': 'Sandy'}, {'avg(ranking)': 857.9508196721312, 'first_name': 'Sang Hee'}, {'avg(ranking)': 177.22695035460993, 'first_name': 'Sania'}, {'avg(ranking)': 509.80945757997216, 'first_name': 'Sara'}, {'avg(ranking)': 546.5551763367463, 'first_name': 'Sarah'}, {'avg(ranking)': 875.9277108433735, 'first_name': 'Sarah Beth'}, {'avg(ranking)': 743.6062176165804, 'first_name': 'Sarah Rebecca'}, {'avg(ranking)': 1139.2340425531916, 'first_name': 'Sarahi'}, {'avg(ranking)': 1191.6470588235295, 'first_name': 'Sarai Delfina'}, {'avg(ranking)': 840.0776699029126, 'first_name': 'Saray'}, {'avg(ranking)': 1081.1666666666667, 'first_name': 'Sari'}, {'avg(ranking)': 1209.7777777777778, 'first_name': 'Sarlota'}, {'avg(ranking)': 1235.1960784313726, 'first_name': 'Sarvinoz'}, {'avg(ranking)': 1033.027027027027, 'first_name': 'Sasa'}, {'avg(ranking)': 747.3695652173913, 'first_name': 'Saska'}, {'avg(ranking)': 888.7272727272727, 'first_name': 'Satsuki'}, {'avg(ranking)': 1142.9285714285713, 'first_name': 'Savannah'}, {'avg(ranking)': 1188.2941176470588, 'first_name': 'Schena'}, {'avg(ranking)': 1210.2571428571428, 'first_name': 'Se Hyun'}, {'avg(ranking)': 1122.4545454545455, 'first_name': 'Se Jin'}, {'avg(ranking)': 1240.92, 'first_name': 'Sean'}, {'avg(ranking)': 1003.5367647058823, 'first_name': 'Seda'}, {'avg(ranking)': 1115.72, 'first_name': 'Seira'}, {'avg(ranking)': 1168.6571428571428, 'first_name': 'Selin'}, {'avg(ranking)': 858.9173789173789, 'first_name': 'Seo Kyung'}, {'avg(ranking)': 889.8028169014085, 'first_name': 'Seone'}, {'avg(ranking)': 14.654294803817603, 'first_name': 'Serena'}, {'avg(ranking)': 162.3505747126437, 'first_name': 'Sesil'}, {'avg(ranking)': 784.0465949820789, 'first_name': 'Seung Yeon'}, {'avg(ranking)': 218.4701086956522, 'first_name': 'Severine'}, {'avg(ranking)': 166.41358024691357, 'first_name': 'Shahar'}, {'avg(ranking)': 924.8818897637796, 'first_name': 'Shakhlo'}, {'avg(ranking)': 1236.7627118644068, 'first_name': 'Shakhnoza'}, {'avg(ranking)': 1228.3235294117646, 'first_name': 'Shangqing'}, {'avg(ranking)': 694.2, 'first_name': 'Shanshan'}, {'avg(ranking)': 967.9034090909091, 'first_name': 'Shao Yuan'}, {'avg(ranking)': 851.5633802816901, 'first_name': 'Sharmada'}, {'avg(ranking)': 296.5792682926829, 'first_name': 'Sharon'}, {'avg(ranking)': 1097.0, 'first_name': 'Sharon Sanchana'}, {'avg(ranking)': 372.89398280802294, 'first_name': 'Shelby'}, {'avg(ranking)': 1171.0, 'first_name': 'Shelly'}, {'avg(ranking)': 451.8657487091222, 'first_name': 'Sheng Nan'}, {'avg(ranking)': 649.5154639175257, 'first_name': 'Sherazad'}, {'avg(ranking)': 1024.0116279069769, 'first_name': 'Sherry'}, {'avg(ranking)': 500.688679245283, 'first_name': 'Shiho'}, {'avg(ranking)': 632.2824427480916, 'first_name': 'Shilin'}, {'avg(ranking)': 1070.6666666666667, 'first_name': 'Shiori'}, {'avg(ranking)': 1154.4166666666667, 'first_name': 'Shir'}, {'avg(ranking)': 1187.9245283018868, 'first_name': 'Shiran'}, {'avg(ranking)': 935.2322946175638, 'first_name': 'Shivika'}, {'avg(ranking)': 1120.388888888889, 'first_name': 'Shou Na'}, {'avg(ranking)': 1148.0, 'first_name': 'Shreya'}, {'avg(ranking)': 1042.6802325581396, 'first_name': 'Shu Ying'}, {'avg(ranking)': 167.90740740740742, 'first_name': 'Shuai'}, {'avg(ranking)': 421.44179894179894, 'first_name': 'Shuko'}, {'avg(ranking)': 864.1538461538462, 'first_name': 'Shuo'}, {'avg(ranking)': 966.0588235294117, 'first_name': 'Shuyue'}, {'avg(ranking)': 897.6951219512196, 'first_name': 'Shweta'}, {'avg(ranking)': 1047.7575757575758, 'first_name': 'Si Qi'}, {'avg(ranking)': 565.8211508553654, 'first_name': 'Silvia'}, {'avg(ranking)': 542.2382851445662, 'first_name': 'Simona'}, {'avg(ranking)': 1070.3417721518988, 'first_name': 'Simone'}, {'avg(ranking)': 974.8, 'first_name': 'Simran Kaur'}, {'avg(ranking)': 728.7443609022556, 'first_name': 'Sina'}, {'avg(ranking)': 975.3484848484849, 'first_name': 'Sinead'}, {'avg(ranking)': 1141.842105263158, 'first_name': 'Sing Le'}, {'avg(ranking)': 980.9076923076923, 'first_name': 'Siqi'}, {'avg(ranking)': 949.7916666666666, 'first_name': 'Sirui'}, {'avg(ranking)': 1241.1379310344828, 'first_name': 'Siyu'}, {'avg(ranking)': 259.63589743589745, 'first_name': 'Sloane'}, {'avg(ranking)': 1184.8260869565217, 'first_name': 'Smriti'}, {'avg(ranking)': 1225.388888888889, 'first_name': 'Sneha'}, {'avg(ranking)': 632.3150684931506, 'first_name': 'Snehadevi S'}, {'avg(ranking)': 514.1732026143791, 'first_name': 'So Jung'}, {'avg(ranking)': 572.2654545454545, 'first_name': 'So Ra'}, {'avg(ranking)': 526.3535641547861, 'first_name': 'Sofia'}, {'avg(ranking)': 1084.107142857143, 'first_name': 'Sofico'}, {'avg(ranking)': 724.5, 'first_name': 'Sofie'}, {'avg(ranking)': 541.1570881226054, 'first_name': 'Sofiya'}, {'avg(ranking)': 640.8727272727273, 'first_name': 'Sofya'}, {'avg(ranking)': 1004.6666666666666, 'first_name': 'Sohyun'}, {'avg(ranking)': 1029.0980392156862, 'first_name': 'Sonia'}, {'avg(ranking)': 885.0976744186047, 'first_name': 'Sonja'}, {'avg(ranking)': 1221.3333333333333, 'first_name': 'Sophia'}, {'avg(ranking)': 600.6881091617934, 'first_name': 'Sophie'}, {'avg(ranking)': 213.75043630017453, 'first_name': 'Sorana'}, {'avg(ranking)': 813.1357142857142, 'first_name': 'Sowjanya'}, {'avg(ranking)': 1149.3125, 'first_name': 'Spurti'}, {'avg(ranking)': 792.1927710843373, 'first_name': 'Sri Vaishnavi'}, {'avg(ranking)': 841.8387096774194, 'first_name': 'Stamatia'}, {'avg(ranking)': 312.54158964879855, 'first_name': 'Stanislava'}, {'avg(ranking)': 993.4255319148937, 'first_name': 'Stefana'}, {'avg(ranking)': 1167.3333333333333, 'first_name': 'Stefani'}, {'avg(ranking)': 759.2894995093228, 'first_name': 'Stefania'}, {'avg(ranking)': 387.73412112259973, 'first_name': 'Stefanie'}, {'avg(ranking)': 939.746835443038, 'first_name': 'Steffi'}, {'avg(ranking)': 439.87772357723577, 'first_name': 'Stephanie'}, {'avg(ranking)': 1035.5548387096774, 'first_name': 'Stephanie Mariel'}, {'avg(ranking)': 573.6708333333333, 'first_name': 'Storm'}, {'avg(ranking)': 426.3886462882096, 'first_name': 'Su Jeong'}, {'avg(ranking)': 217.2493188010899, 'first_name': 'Su Wei'}, {'avg(ranking)': 911.7619047619048, 'first_name': 'Suellen'}, {'avg(ranking)': 944.2432432432432, 'first_name': 'Sultan'}, {'avg(ranking)': 812.4581005586592, 'first_name': 'Sun Jung'}, {'avg(ranking)': 1229.8, 'first_name': 'Sunae'}, {'avg(ranking)': 611.0757575757576, 'first_name': 'Sunam'}, {'avg(ranking)': 635.7449168207024, 'first_name': 'Sung Hee'}, {'avg(ranking)': 1015.6792452830189, 'first_name': 'Susan'}, {'avg(ranking)': 417.8053097345133, 'first_name': 'Susanne'}, {'avg(ranking)': 982.7222222222222, 'first_name': 'Suzan'}, {'avg(ranking)': 980.6666666666666, 'first_name': 'Suzuho'}, {'avg(ranking)': 698.7567567567568, 'first_name': 'Suzy'}, {'avg(ranking)': 844.203007518797, 'first_name': 'Svenja'}, {'avg(ranking)': 267.03227571115974, 'first_name': 'Svetlana'}, {'avg(ranking)': 691.9934640522875, 'first_name': 'Sviatlana'}, {'avg(ranking)': 1002.6792452830189, 'first_name': 'Sybille'}, {'avg(ranking)': 869.1702127659574, 'first_name': 'Sylvia'}, {'avg(ranking)': 787.7645348837209, 'first_name': 'Sylwia'}, {'avg(ranking)': 791.1240506329113, 'first_name': 'Syna'}, {'avg(ranking)': 772.3186813186813, 'first_name': 'Szabina'}, {'avg(ranking)': 343.0985324947589, 'first_name': 'Tadeja'}, {'avg(ranking)': 969.6588235294117, 'first_name': 'Taisiya'}, {'avg(ranking)': 1230.2, 'first_name': 'Talya'}, {'avg(ranking)': 949.8059701492538, 'first_name': 'Tamachan'}, {'avg(ranking)': 1118.4166666666667, 'first_name': 'Tamar'}, {'avg(ranking)': 614.0434782608696, 'first_name': 'Tamara'}, {'avg(ranking)': 1146.3934426229507, 'first_name': 'Tamari'}, {'avg(ranking)': 121.82273948075202, 'first_name': 'Tamarine'}, {'avg(ranking)': 386.7025316455696, 'first_name': 'Tamaryn'}, {'avg(ranking)': 135.88910505836577, 'first_name': 'Tamira'}, {'avg(ranking)': 601.906914893617, 'first_name': 'Tammi'}, {'avg(ranking)': 1113.2325581395348, 'first_name': 'Tanaporn'}, {'avg(ranking)': 1023.089430894309, 'first_name': 'Tanya'}, {'avg(ranking)': 475.2979683972912, 'first_name': 'Tara'}, {'avg(ranking)': 1075.0, 'first_name': 'Tatia'}, {'avg(ranking)': 681.9417582417583, 'first_name': 'Tatiana'}, {'avg(ranking)': 247.7449768160742, 'first_name': 'Tatjana'}, {'avg(ranking)': 912.1077844311377, 'first_name': 'Tatsiana'}, {'avg(ranking)': 747.3172413793103, 'first_name': 'Tayisiya'}, {'avg(ranking)': 387.5662100456621, 'first_name': 'Taylor'}, {'avg(ranking)': 1068.7457627118645, 'first_name': 'Tea'}, {'avg(ranking)': 461.06702898550725, 'first_name': 'Teliana'}, {'avg(ranking)': 614.9346733668342, 'first_name': 'Tena'}, {'avg(ranking)': 489.27513227513225, 'first_name': 'Teodora'}, {'avg(ranking)': 557.241418764302, 'first_name': 'Tereza'}, {'avg(ranking)': 963.5, 'first_name': 'Terri'}, {'avg(ranking)': 696.2878787878788, 'first_name': 'Tess'}, {'avg(ranking)': 390.2361111111111, 'first_name': 'Tessah'}, {'avg(ranking)': 437.4119658119658, 'first_name': 'Tetiana'}, {'avg(ranking)': 398.83478260869566, 'first_name': 'Tetyana'}, {'avg(ranking)': 802.7222222222222, 'first_name': 'Thai Sa Grana'}, {'avg(ranking)': 650.1206896551724, 'first_name': 'Theo'}, {'avg(ranking)': 1159.5632183908046, 'first_name': 'Theresa'}, {'avg(ranking)': 1017.7777777777778, 'first_name': 'Tijana'}, {'avg(ranking)': 182.02426160337552, 'first_name': 'Timea'}, {'avg(ranking)': 425.82394366197184, 'first_name': 'Tina'}, {'avg(ranking)': 810.6666666666666, 'first_name': 'Tinatin'}, {'avg(ranking)': 739.7727272727273, 'first_name': 'Ting Fei'}, {'avg(ranking)': 789.6113989637306, 'first_name': 'Ting Jr'}, {'avg(ranking)': 1015.2352941176471, 'first_name': 'Tingting'}, {'avg(ranking)': 743.1953125, 'first_name': 'Tjasa'}, {'avg(ranking)': 838.8065217391304, 'first_name': 'Tomoko'}, {'avg(ranking)': 841.7167381974249, 'first_name': 'Tori'}, {'avg(ranking)': 878.1666666666666, 'first_name': 'Tornado Alicia'}, {'avg(ranking)': 1029.3196721311476, 'first_name': 'Trang'}, {'avg(ranking)': 1009.8666666666667, 'first_name': 'Treta'}, {'avg(ranking)': 131.02074074074073, 'first_name': 'Tsvetana'}, {'avg(ranking)': 992.4870588235294, 'first_name': 'Tyra'}, {'avg(ranking)': 506.39344262295083, 'first_name': 'Ulrikke'}, {'avg(ranking)': 844.0692307692308, 'first_name': 'Ulyana'}, {'avg(ranking)': 229.35687022900763, 'first_name': 'Urszula'}, {'avg(ranking)': 1132.4109589041095, 'first_name': 'Ushna'}, {'avg(ranking)': 411.5068493150685, 'first_name': 'Usue Maitane'}, {'avg(ranking)': 921.3333333333334, 'first_name': 'Valentina'}, {'avg(ranking)': 751.2668918918919, 'first_name': 'Valentine'}, {'avg(ranking)': 479.8914728682171, 'first_name': 'Valentini'}, {'avg(ranking)': 368.14331210191085, 'first_name': 'Valentyna'}, {'avg(ranking)': 661.8474576271186, 'first_name': 'Valeria'}, {'avg(ranking)': 806.2648401826484, 'first_name': 'Valerie'}, {'avg(ranking)': 799.8668224299065, 'first_name': 'Valeriya'}, {'avg(ranking)': 696.4126984126984, 'first_name': 'Vanda'}, {'avg(ranking)': 579.437984496124, 'first_name': 'Vanesa'}, {'avg(ranking)': 398.3106546854942, 'first_name': 'Vanessa'}, {'avg(ranking)': 185.75, 'first_name': 'Vania'}, {'avg(ranking)': 1130.6037735849056, 'first_name': 'Vaniya'}, {'avg(ranking)': 1089.7111111111112, 'first_name': 'Vanja'}, {'avg(ranking)': 450.4642082429501, 'first_name': 'Varatchaya'}, {'avg(ranking)': 894.3846153846154, 'first_name': 'Varunya'}, {'avg(ranking)': 382.6888217522659, 'first_name': 'Varvara'}, {'avg(ranking)': 613.5330490405117, 'first_name': 'Vasilisa'}, {'avg(ranking)': 859.8103448275862, 'first_name': 'Vaszilisza'}, {'avg(ranking)': 729.0117647058823, 'first_name': 'Vendula'}, {'avg(ranking)': 32.984862819299906, 'first_name': 'Venus'}, {'avg(ranking)': 195.66923570969814, 'first_name': 'Vera'}, {'avg(ranking)': 958.1327800829876, 'first_name': 'Verena'}, {'avg(ranking)': 726.1852387843704, 'first_name': 'Veronica'}, {'avg(ranking)': 951.0075757575758, 'first_name': 'Veronica M'}, {'avg(ranking)': 734.6018957345972, 'first_name': 'Veronika'}, {'avg(ranking)': 240.0448979591837, 'first_name': 'Vesna'}, {'avg(ranking)': 1252.9130434782608, 'first_name': 'Vicky'}, {'avg(ranking)': 1138.8490566037735, 'first_name': 'Victoire'}, {'avg(ranking)': 444.9760935910478, 'first_name': 'Victoria'}, {'avg(ranking)': 1236.0, 'first_name': 'Victoria Ariadna'}, {'avg(ranking)': 566.9148936170212, 'first_name': 'Viktoria'}, {'avg(ranking)': 1236.5333333333333, 'first_name': 'Viktoriia'}, {'avg(ranking)': 507.4, 'first_name': 'Viktorija'}, {'avg(ranking)': 736.2288557213931, 'first_name': 'Viktoriya'}, {'avg(ranking)': 966.4671052631579, 'first_name': 'Viktoryia'}, {'avg(ranking)': 1243.0, 'first_name': 'Vilma Y'}, {'avg(ranking)': 1214.1142857142856, 'first_name': 'Vincenza'}, {'avg(ranking)': 1150.0, 'first_name': 'Vinciane'}, {'avg(ranking)': 1170.840579710145, 'first_name': 'Violetta'}, {'avg(ranking)': 355.88102893890675, 'first_name': 'Virginie'}, {'avg(ranking)': 1208.952380952381, 'first_name': 'Vishesh'}, {'avg(ranking)': 1201.25, 'first_name': 'Vita'}, {'avg(ranking)': 296.2025641025641, 'first_name': 'Vitalia'}, {'avg(ranking)': 670.9108527131783, 'first_name': 'Vivian'}, {'avg(ranking)': 607.2810218978102, 'first_name': 'Vivien'}, {'avg(ranking)': 659.2103004291846, 'first_name': 'Vivienne'}, {'avg(ranking)': 595.3291666666667, 'first_name': 'Vlada'}, {'avg(ranking)': 943.5432098765432, 'first_name': 'Vladica'}, {'avg(ranking)': 823.8770833333333, 'first_name': 'Vladimira'}, {'avg(ranking)': 1006.1769911504425, 'first_name': 'Vladislava'}, {'avg(ranking)': 856.0782608695653, 'first_name': 'Vladyslava'}, {'avg(ranking)': 555.6572164948453, 'first_name': 'Vojislava'}, {'avg(ranking)': 999.0215053763441, 'first_name': 'Voni'}, {'avg(ranking)': 701.4009009009009, 'first_name': 'Wan Ting'}, {'avg(ranking)': 1081.142857142857, 'first_name': 'Wan Yi'}, {'avg(ranking)': 1249.3333333333333, 'first_name': 'Warona'}, {'avg(ranking)': 440.35214446952597, 'first_name': 'Wen Hsin'}, {'avg(ranking)': 1117.55, 'first_name': 'Wen Ling'}, {'avg(ranking)': 1011.469696969697, 'first_name': 'Wendy Qi Wen'}, {'avg(ranking)': 1152.7837837837837, 'first_name': 'Weronika Jasmina'}, {'avg(ranking)': 886.1407407407407, 'first_name': 'Whitney'}, {'avg(ranking)': 1083.1454545454546, 'first_name': 'Wiktoria'}, {'avg(ranking)': 585.2589641434263, 'first_name': 'Wing Yau Venise'}, {'avg(ranking)': 937.7878787878788, 'first_name': 'Wushuang'}, {'avg(ranking)': 661.2222222222222, 'first_name': 'Xenia'}, {'avg(ranking)': 714.8653846153846, 'first_name': 'Xi Yao'}, {'avg(ranking)': 814.4171122994652, 'first_name': 'Xiao'}, {'avg(ranking)': 467.24657534246575, 'first_name': 'Xiaodi'}, {'avg(ranking)': 848.4418604651163, 'first_name': 'Xiaorong'}, {'avg(ranking)': 737.7547169811321, 'first_name': 'Xiaoxi'}, {'avg(ranking)': 712.2780373831775, 'first_name': 'Ximena'}, {'avg(ranking)': 694.4808743169399, 'first_name': 'Xin'}, {'avg(ranking)': 1022.3333333333334, 'first_name': 'Xin Yu'}, {'avg(ranking)': 480.646017699115, 'first_name': 'Xinyu'}, {'avg(ranking)': 309.35767790262173, 'first_name': 'Xinyun'}, {'avg(ranking)': 954.6, 'first_name': 'Xiyu'}, {'avg(ranking)': 488.7671232876712, 'first_name': 'Xu Liu'}, {'avg(ranking)': 1225.75, 'first_name': 'Ya'}, {'avg(ranking)': 586.865, 'first_name': 'Ya Hsuan'}, {'avg(ranking)': 325.6162790697674, 'first_name': 'Yafan'}, {'avg(ranking)': 768.560975609756, 'first_name': 'Yan'}, {'avg(ranking)': 740.0214504596527, 'first_name': 'Yana'}, {'avg(ranking)': 1177.8823529411766, 'first_name': 'Yang'}, {'avg(ranking)': 381.2581602373887, 'first_name': 'Yanina'}, {'avg(ranking)': 1059.2702702702702, 'first_name': 'Yanni'}, {'avg(ranking)': 1166.875, 'first_name': 'Yarden'}, {'avg(ranking)': 211.41240310077518, 'first_name': 'Yaroslava'}, {'avg(ranking)': 702.1784386617101, 'first_name': 'Yasmin'}, {'avg(ranking)': 1227.7777777777778, 'first_name': 'Yasmina'}, {'avg(ranking)': 983.0410958904109, 'first_name': 'Yasmine'}, {'avg(ranking)': 1261.8181818181818, 'first_name': 'Yasmyn'}, {'avg(ranking)': 1110.4594594594594, 'first_name': 'Yawna'}, {'avg(ranking)': 114.78806907378336, 'first_name': 'Yayuk'}, {'avg(ranking)': 431.3144424131627, 'first_name': 'Ye Ra'}, {'avg(ranking)': 1048.081081081081, 'first_name': 'Ye Xin'}, {'avg(ranking)': 1155.8191489361702, 'first_name': 'Yekaterina'}, {'avg(ranking)': 897.4873949579832, 'first_name': 'Yelena'}, {'avg(ranking)': 973.8617021276596, 'first_name': 'Yeong Won'}, {'avg(ranking)': 724.8712871287129, 'first_name': 'Yevgeniya'}, {'avg(ranking)': 791.0756207674943, 'first_name': 'Yi'}, {'avg(ranking)': 381.5512572533849, 'first_name': 'Yi Fan'}, {'avg(ranking)': 656.8787276341948, 'first_name': 'Yi Jing'}, {'avg(ranking)': 418.2566137566138, 'first_name': 'Yi Miao'}, {'avg(ranking)': 1185.030303030303, 'first_name': 'Yidi'}, {'avg(ranking)': 1209.625, 'first_name': 'Yihong'}, {'avg(ranking)': 1063.9411764705883, 'first_name': 'Yijia'}, {'avg(ranking)': 661.3972602739726, 'first_name': 'Ying'}, {'avg(ranking)': 403.8775981524249, 'first_name': 'Ying Ying'}, {'avg(ranking)': 801.6712328767123, 'first_name': 'Yixuan'}, {'avg(ranking)': 892.3561643835617, 'first_name': 'Ylena'}, {'avg(ranking)': 642.9487179487179, 'first_name': 'Ylona Georgiana'}, {'avg(ranking)': 1128.901098901099, 'first_name': 'Yoko'}, {'avg(ranking)': 1068.4619883040937, 'first_name': 'Yolande'}, {'avg(ranking)': 1263.7666666666667, 'first_name': 'Yoo Ri'}, {'avg(ranking)': 844.9310344827586, 'first_name': 'Yoon Young'}, {'avg(ranking)': 1096.9130434782608, 'first_name': 'Yoshimi'}, {'avg(ranking)': 1222.24, 'first_name': 'Yosr'}, {'avg(ranking)': 1170.3461538461538, 'first_name': 'You Na'}, {'avg(ranking)': 458.86633663366337, 'first_name': 'Ysaline'}, {'avg(ranking)': 1098.357142857143, 'first_name': 'Yu Jin'}, {'avg(ranking)': 1239.6666666666667, 'first_name': 'Yu Tong'}, {'avg(ranking)': 1054.0, 'first_name': 'Yuan'}, {'avg(ranking)': 891.2340425531914, 'first_name': 'Yuanyi'}, {'avg(ranking)': 983.359649122807, 'first_name': 'Yue'}, {'avg(ranking)': 444.96190476190475, 'first_name': 'Yue Yue'}, {'avg(ranking)': 961.876923076923, 'first_name': 'Yuenu'}, {'avg(ranking)': 1034.1304347826087, 'first_name': 'Yujia'}, {'avg(ranking)': 748.8250591016548, 'first_name': 'Yuka'}, {'avg(ranking)': 1071.5833333333333, 'first_name': 'Yukako'}, {'avg(ranking)': 876.7428571428571, 'first_name': 'Yuki'}, {'avg(ranking)': 698.8285714285714, 'first_name': 'Yuki Kristina'}, {'avg(ranking)': 857.1692307692308, 'first_name': 'Yukina'}, {'avg(ranking)': 824.3936170212766, 'first_name': 'Yukun'}, {'avg(ranking)': 485.35135135135135, 'first_name': 'Yulia'}, {'avg(ranking)': 725.5322195704057, 'first_name': 'Yuliana'}, {'avg(ranking)': 384.87776983559684, 'first_name': 'Yuliya'}, {'avg(ranking)': 799.1332586786115, 'first_name': 'Yumi'}, {'avg(ranking)': 166.6586270871985, 'first_name': 'Yung Jan'}, {'avg(ranking)': 1047.3529411764705, 'first_name': 'Yuqi'}, {'avg(ranking)': 322.17758620689654, 'first_name': 'Yurika'}, {'avg(ranking)': 1041.5367231638418, 'first_name': 'Yuriko'}, {'avg(ranking)': 746.4803493449782, 'first_name': 'Yurina'}, {'avg(ranking)': 608.1309090909091, 'first_name': 'Yuuki'}, {'avg(ranking)': 1230.2, 'first_name': 'Yuval'}, {'avg(ranking)': 545.449074074074, 'first_name': 'Yuxuan'}, {'avg(ranking)': 318.2867132867133, 'first_name': 'Yvonne'}, {'avg(ranking)': 1227.344827586207, 'first_name': 'Zaineb'}, {'avg(ranking)': 867.5288461538462, 'first_name': 'Zalina'}, {'avg(ranking)': 709.625, 'first_name': 'Zarah'}, {'avg(ranking)': 222.81428571428572, 'first_name': 'Zarina'}, {'avg(ranking)': 791.2352941176471, 'first_name': 'Zeel'}, {'avg(ranking)': 1229.5714285714287, 'first_name': 'Zeynep Sena'}, {'avg(ranking)': 627.7777777777778, 'first_name': 'Zhanlan'}, {'avg(ranking)': 629.0081967213115, 'first_name': 'Zhaoxuan'}, {'avg(ranking)': 1058.0, 'first_name': 'Zhibek'}, {'avg(ranking)': 1144.45, 'first_name': 'Zhima'}, {'avg(ranking)': 1237.9, 'first_name': 'Zhou'}, {'avg(ranking)': 989.75, 'first_name': 'Zhuoma'}, {'avg(ranking)': 391.4656290531777, 'first_name': 'Zi'}, {'avg(ranking)': 1221.5, 'first_name': 'Zinovia'}, {'avg(ranking)': 878.4606741573034, 'first_name': 'Ziyue'}, {'avg(ranking)': 765.3777777777777, 'first_name': 'Zoe'}, {'avg(ranking)': 935.081081081081, 'first_name': 'Zoe Gwen'}, {'avg(ranking)': 916.559633027523, 'first_name': 'Zsofia'}, {'avg(ranking)': 451.92875448487956, 'first_name': 'Zuzana'}, {'avg(ranking)': 794.5416666666666, 'first_name': 'Zuzanna'}]
medium
Table matches ( matches.best_of (INT), matches.draw_size (INT), matches.loser_age (FLOAT), matches.loser_entry (TEXT), matches.loser_hand (TEXT), matches.loser_ht (INT), matches.loser_id (INT), matches.loser_ioc (TEXT), matches.loser_name (TEXT), matches.loser_rank (INT), matches.loser_rank_points (INT), matches.loser_seed (INT), matches.match_num (INT), matches.minutes (INT), matches.round (TEXT), matches.score (TEXT), matches.surface (TEXT), matches.tourney_date (DATE), matches.tourney_id (TEXT), matches.tourney_level (TEXT), matches.tourney_name (TEXT), matches.winner_age (FLOAT), matches.winner_entry (TEXT), matches.winner_hand (TEXT), matches.winner_ht (INT), matches.winner_id (INT), matches.winner_ioc (TEXT), matches.winner_name (TEXT), matches.winner_rank (INT), matches.winner_rank_points (INT), matches.winner_seed (INT), matches.year (INT), ) Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Table rankings ( rankings.ranking_date (DATE), rankings.ranking (INT), rankings.player_id (INT), rankings.ranking_points (INT), rankings.tours (INT), ) Possible JOINs: matches.loser_id = players.player_id matches.winner_id = players.player_id rankings.player_id = players.player_id
SELECT avg(ranking) , players.first_name FROM players JOIN rankings ON players.player_id = rankings.player_id GROUP BY players.first_name
{ 'players': ['player_id', 'first_name'], 'rankings': ['ranking', 'player_id'] }
Table players ( players.player_id (INT), players.first_name (TEXT), ) Table rankings ( rankings.ranking (INT), rankings.player_id (INT), ) Possible JOINs: rankings.player_id = players.player_id
Table players ( players.player_id (INT), players.first_name (TEXT), players.last_name (TEXT), players.hand (TEXT), players.birth_date (DATE), players.country_code (TEXT), ) Table rankings ( rankings.ranking_date (DATE), rankings.ranking (INT), rankings.player_id (INT), rankings.ranking_points (INT), rankings.tours (INT), ) Possible JOINs: rankings.player_id = players.player_id
singer
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") )
CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Birth_Year" REAL, "Net_Worth_Millions" REAL, "Citizenship" TEXT, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Birth_Year Net_Worth_Millions Citizenship 1 Liliane Bettencourt 1944.0 30.0 France 2 Christy Walton 1948.0 28.8 United States */ CREATE TABLE song ( "Song_ID" INTEGER, "Title" TEXT, "Singer_ID" INTEGER, "Sales" REAL, "Highest_Position" REAL, PRIMARY KEY ("Song_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from song table: Song_ID Title Singer_ID Sales Highest_Position 1 Do They Know It's Christmas 1 1094000.0 1.0 2 F**k It (I Don't Want You Back) 1 552407.0 1.0 */
For each citizenship, what is the maximum net worth?
SELECT Citizenship , max(Net_Worth_Millions) FROM singer GROUP BY Citizenship
[{'Citizenship': 'Australia', 'max(Net_Worth_Millions)': 17.0}, {'Citizenship': 'Chile', 'max(Net_Worth_Millions)': 17.4}, {'Citizenship': 'France', 'max(Net_Worth_Millions)': 30.0}, {'Citizenship': 'Germany', 'max(Net_Worth_Millions)': 14.3}, {'Citizenship': 'United States', 'max(Net_Worth_Millions)': 28.8}]
medium
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Table song ( song.Song_ID (INT), song.Title (TEXT), song.Singer_ID (INT), song.Sales (REAL), song.Highest_Position (REAL), ) Possible JOINs: song.Singer_ID = singer.Singer_ID
SELECT Citizenship , max(Net_Worth_Millions) FROM singer GROUP BY Citizenship
{ 'singer': ['singer_id', 'net_worth_millions', 'citizenship'] }
Table singer ( singer.Singer_ID (INT), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Possible JOINs:
Table singer ( singer.Singer_ID (INT), singer.Name (TEXT), singer.Birth_Year (REAL), singer.Net_Worth_Millions (REAL), singer.Citizenship (TEXT), ) Possible JOINs: