instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_73946 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the maximum rank for the vote percentage of 5.6%
SELECT MIN("Rank") FROM table_73946 WHERE "Vote percentage" = '5.6%'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50808"
mimicsql_data
CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, ...
SELECT SUM(checkin.count) FROM business, category AS CATEGORY_0, category AS CATEGORY_1, checkin WHERE business.city = 'Los Angeles' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Moroccan' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'restaurant' A...
yelp
CREATE TABLE table_23508196_2 ( tot_enlisted VARCHAR, enlisted_o_s VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different numbers of Tot enlisted are there on the dates when the number of Enlisted o/s was 801471?
SELECT COUNT(tot_enlisted) FROM table_23508196_2 WHERE enlisted_o_s = 801471
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSBM = '6381' AND mzjzjlb.JZKSRQ BETWEEN '2003-08-25' AND '2015-09-03'
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.days_stay = "20"
mimicsql_data
CREATE TABLE table_64430 ( "Name" text, "Hull" real, "Pennant number" text, "Status" text, "Date of commission" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The boat named Agamemnon has what status?
SELECT "Status" FROM table_64430 WHERE "Name" = 'agamemnon'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Coronary atherosclerosis of autologous vein bypass graft"
mimicsql_data
CREATE TABLE table_name_51 ( nationality VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Utah Jazz Player from UTEP was what nationality?
SELECT nationality FROM table_name_51 WHERE school_club_team = "utep"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Routine circumcision" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Pressure ulcer, lower back" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_20 ( block INTEGER, spike VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest block that has 328 as the spike, and a height less than 186?
SELECT MIN(block) FROM table_name_20 WHERE spike = 328 AND height < 186
sql_create_context
CREATE TABLE table_49962 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" text, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the school established in 2013?
SELECT "Location" FROM table_49962 WHERE "Established" = '2013'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '70297325' AND t_kc22.STA_DATE BETWEEN '2016-05-13' AND '2020-10-13' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fa...
SELECT COUNT(DISTINCT airline.airline_code) FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LO...
atis
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT Posts.Id, Posts.Id AS "post_link", Posts.Title, Users.DisplayName, Posts.Score, Posts.ViewCount, Posts.CreationDate, Posts.LastEditDate, Posts.DeletionDate, Posts.ClosedDate FROM Posts, Users WHERE Posts.PostTypeId = 1 AND Posts.OwnerUserId = Users.Id AND (LOWER(Posts.Title) LIKE '%' + '##Keyword1:String##' + '%...
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.admityear >= "2155"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '31337680' AND t_kc22.STA_DATE BETWEEN '2002-03-31' AND '2004-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, R...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY COUNT(*)
nvbench
CREATE TABLE table_203_735 ( id number, "rd" number, "pick" number, "player" text, "position" text, "school" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was picked after roy lester ?
SELECT "player" FROM table_203_735 WHERE "pick" > (SELECT "pick" FROM table_203_735 WHERE "player" = 'roy lester') ORDER BY "pick" LIMIT 1
squall
CREATE TABLE table_37513 ( "Season" text, "Competition" text, "Round" text, "Against" text, "Played" text, "Drew" text, "Lost" text, "Goals for" text, "Goals against" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were...
SELECT "Lost" FROM table_37513 WHERE "Goals against" = '5'
wikisql
CREATE TABLE table_name_88 ( points INTEGER, time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the greatest points for a time/retired of +32.256 secs, and a a grid larger than 12?
SELECT MAX(points) FROM table_name_88 WHERE time_retired = "+32.256 secs" AND grid > 12
sql_create_context
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare AS FARE_0, fare AS FARE_1, fare_basis, flight, flight_fare AS FLIGHT_FARE_0, flight_fare AS FLIGHT_FARE_1 WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY...
atis
CREATE TABLE table_68505 ( "Year" text, "Division" text, "Place" text, "Played" real, "Drawn" text, "Lost" text, "G.F." text, "G.A." text, "G.D." text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did the 11t...
SELECT "Year" FROM table_68505 WHERE "Place" = '11th' AND "Played" = '26'
wikisql
CREATE TABLE addresses ( country VARCHAR, address_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the countries having more than 4 addresses listed.
SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4
sql_create_context
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT wdmzjzjlb.CYKSDM, wdmzjzjlb.CYKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '21569454871' UNION SELECT bdmzjzjlb.CYKSDM, bdmzjzjlb.CYKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '21569454871'
css
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '张修真' AND t_kc22.STA_DATE BETWEEN '2002-01-10' AND '2014-09-10' AND gwyjzb.MED_SER_ORG_NO = '7718159' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Dat...
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform ORDER BY Software_Platform
nvbench
CREATE TABLE table_name_96 ( surface VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has an Opponent in the final of st phane robert?
SELECT surface FROM table_name_96 WHERE opponent_in_the_final = "stéphane robert"
sql_create_context
CREATE TABLE table_60366 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Place has a Country of australia, and a Score of 70-70-72=212?
SELECT "Place" FROM table_60366 WHERE "Country" = 'australia' AND "Score" = '70-70-72=212'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_80 ( mlb_draft VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What MLB draft has Shaun Boyd?
SELECT mlb_draft FROM table_name_80 WHERE player = "shaun boyd"
sql_create_context
CREATE TABLE table_16710829_2 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for game 9
SELECT date FROM table_16710829_2 WHERE game = 9
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('MDE', 'PreMajor') AND program_course.course_id = course.course_id AND semester.semester = 'Sum...
advising
CREATE TABLE table_name_54 ( opponent VARCHAR, type_of_game VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent has euro '84 qualifying as the type and split as the city?
SELECT opponent FROM table_name_54 WHERE type_of_game = "euro '84 qualifying" AND city = "split"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '98623889538'
css
CREATE TABLE table_53191 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is glenferrie oval's home team?
SELECT "Home team" FROM table_53191 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_203_37 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the shortest song from the album ?
SELECT "title" FROM table_203_37 ORDER BY "length" LIMIT 1
squall
CREATE TABLE table_1342149_6 ( first_elected VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all those first elected in the California 22 voting district.
SELECT first_elected FROM table_1342149_6 WHERE district = "California 22"
sql_create_context
CREATE TABLE table_name_96 ( icao VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which ICAO's city is Manchester?
SELECT icao FROM table_name_96 WHERE city = "manchester"
sql_create_context
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '喻英锐' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ...
css
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_30901 ( "Episode" real, "First Air Date" text, "Rating (18\u201349)" text, "Share (18\u201349)" real, "Viewers (millions)" text, "Rank (timeslot)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When there are 10.02 million vie...
SELECT "Rating (18\u201349)" FROM table_30901 WHERE "Viewers (millions)" = '10.02'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8001316' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS)
css
CREATE TABLE table_1625 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What sc...
SELECT "Score" FROM table_1625 WHERE "Date" = 'April 28'
wikisql
CREATE TABLE table_46622 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the years when the grizzlies had a point guard who attended the sch...
SELECT "Years for Grizzlies" FROM table_46622 WHERE "Position" = 'point guard' AND "School/Club Team" = 'florida'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
mimicsql_data
CREATE TABLE table_name_36 ( other_names VARCHAR, death VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is other names when death is may 23, 1821?
SELECT other_names FROM table_name_36 WHERE death = "may 23, 1821"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "18480"
mimicsql_data
CREATE TABLE table_name_21 ( winning_driver VARCHAR, fastest_lap VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Winnning driver in which lorenzo bandini has the fastest lap as well as the Pole position?
SELECT winning_driver FROM table_name_21 WHERE fastest_lap = "lorenzo bandini" AND pole_position = "lorenzo bandini"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "85" AND demographic.admityear < "2190"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.diagnosis, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Betty Campbell"
mimicsql_data
CREATE TABLE table_name_58 ( holmenkollen VARCHAR, fis_nordic_world_ski_championships VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the FIS Nordic World Ski Championships was 1962, 1964 what was the Holmenkollen?
SELECT holmenkollen FROM table_name_58 WHERE fis_nordic_world_ski_championships = "1962, 1964"
sql_create_context
CREATE TABLE table_1341598_11 ( party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the party for District Georgia 9?
SELECT party FROM table_1341598_11 WHERE district = "Georgia 9"
sql_create_context
CREATE TABLE table_name_52 ( to_par INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which To par has a Score of 78-74-71-75=298?
SELECT AVG(to_par) FROM table_name_52 WHERE score = 78 - 74 - 71 - 75 = 298
sql_create_context
CREATE TABLE table_name_20 ( location VARCHAR, result VARCHAR, loser VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location when the new york jets lost earlier than 1997 and a Result of 31 28?
SELECT location FROM table_name_20 WHERE loser = "new york jets" AND year < 1997 AND result = "31–28"
sql_create_context
CREATE TABLE perpetrator ( Killed INTEGER, People_ID VARCHAR ) CREATE TABLE people ( People_ID VARCHAR, Height INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total kills of the perpetrators with height more than 1.84.
SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84
sql_create_context
CREATE TABLE table_name_5 ( first INTEGER, total VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest first year with 0 total medals and over 0 golds?
SELECT MAX(first) FROM table_name_5 WHERE total > 0 AND gold > 0
sql_create_context
CREATE TABLE table_203_300 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what were the total number of times 4th was listed as a result in this chart ?
SELECT COUNT(*) FROM table_203_300 WHERE "result" = 4
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_22 ( venue VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Jack Badcock play?
SELECT venue FROM table_name_22 WHERE player = "jack badcock"
sql_create_context
CREATE TABLE table_21635 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode titled 'the advocate'?
SELECT "Directed by" FROM table_21635 WHERE "Title" = 'The Advocate'
wikisql
CREATE TABLE table_name_59 ( january VARCHAR, march VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the January playmate with a March playmate Alexandria Karlsen?
SELECT january FROM table_name_59 WHERE march = "alexandria karlsen"
sql_create_context
CREATE TABLE table_name_7 ( points_classification VARCHAR, stage VARCHAR, winner VARCHAR, general_classification VARCHAR, trofeo_fast_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which points classification shares a general classification ...
SELECT points_classification FROM table_name_7 WHERE general_classification = "bernard hinault" AND trofeo_fast_team = "bianchi" AND winner = "urs freuler" AND stage = "4"
sql_create_context
CREATE TABLE table_name_63 ( score_in_the_final VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score in the final for january 12, 2013
SELECT score_in_the_final FROM table_name_63 WHERE date = "january 12, 2013"
sql_create_context
CREATE TABLE table_name_63 ( game VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game number was played at Chicago Stadium?
SELECT game FROM table_name_63 WHERE location = "chicago stadium"
sql_create_context
CREATE TABLE table_name_49 ( date VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was king's cup 1996?
SELECT date FROM table_name_49 WHERE competition = "king's cup 1996"
sql_create_context
CREATE TABLE table_2186447_1 ( partner VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many partners were there when the score was 7 6 (7 4) , 6 3?
SELECT COUNT(partner) FROM table_2186447_1 WHERE score = "7–6 (7–4) , 6–3"
sql_create_context
CREATE TABLE table_dev_35 ( "id" int, "white_blood_cell_count_wbc" int, "platelets" int, "neutrophil_count" int, "serum_creatinine" float, "albumin" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- serum creatinine <= 1.8 mg / ...
SELECT * FROM table_dev_35 WHERE serum_creatinine <= 1.8
criteria2sql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '44983349' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_2 ( days_held VARCHAR, reign VARCHAR, wrestlers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What days held has 1 as the reign with eden black as the wrestlers?
SELECT days_held FROM table_name_2 WHERE reign = "1" AND wrestlers = "eden black"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE c...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_name_84 ( place VARCHAR, player VARCHAR, score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Place, when Score is '66', when Country is 'United States', and when Player is 'Dudley Hart'?
SELECT place FROM table_name_84 WHERE score = 66 AND country = "united states" AND player = "dudley hart"
sql_create_context
CREATE TABLE table_63410 ( "Year" text, "Matches" real, "Tries" real, "Goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries have goals greater than 0?
SELECT SUM("Tries") FROM table_63410 WHERE "Goals" > '0'
wikisql
CREATE TABLE table_60757 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score in the final with a hard surface and i...
SELECT "Score in the final" FROM table_60757 WHERE "Surface" = 'hard' AND "Opponent in the final" = 'hiromi nagano'
wikisql
CREATE TABLE party_events ( member_in_charge_id VARCHAR ) CREATE TABLE member ( member_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all member names who are not in charge of any event.
SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id
sql_create_context
CREATE TABLE College ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many colleges in total?
SELECT COUNT(*) FROM College
sql_create_context
CREATE TABLE table_71194 ( "Round" real, "Name" text, "Position" text, "School" text, "Signed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest round drafted for a University of Southern California player?
SELECT MIN("Round") FROM table_71194 WHERE "School" = 'university of southern california'
wikisql
CREATE TABLE table_44864 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest to par of the player with a t3 place and less than $1,500?
SELECT MIN("To par") FROM table_44864 WHERE "Place" = 't3' AND "Money ( $ )" < '1,500'
wikisql
CREATE TABLE appearances ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, g_all NUMERIC, gs NUMERIC, g_batting INTEGER, g_defense NUMERIC, g_p INTEGER, g_c INTEGER, g_1b INTEGER, g_2b INTEGER, g_3b INTEGER, g_ss INTEGER, g_lf INTEGER, g_cf INT...
SELECT year, COUNT(year) FROM home_game ORDER BY COUNT(year)
nvbench
CREATE TABLE company ( id int, name text, country_code varchar ) CREATE TABLE movie ( mid int, title text, release_year int, title_aka text, budget text ) CREATE TABLE genre ( gid int, genre text ) CREATE TABLE actor ( aid int, gender text, name text, nationali...
SELECT COUNT(DISTINCT (actor.name)) FROM actor, cast, movie WHERE actor.nationality = 'China' AND cast.aid = actor.aid AND movie.mid = cast.msid AND movie.title = 'Rush Hour 3'
imdb
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( la...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-85821') AND treatment.treatme...
eicu
CREATE TABLE table_72697 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the centerfold model in the issue where Fergi...
SELECT "Centerfold model" FROM table_72697 WHERE "20 Questions" = 'Fergie'
wikisql
CREATE TABLE table_name_4 ( time VARCHAR, lane VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time in Romania that has a lane larger than 4?
SELECT time FROM table_name_4 WHERE lane > 4 AND nationality = "romania"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT
nvbench
CREATE TABLE table_name_94 ( school VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school has a quarterback?
SELECT school FROM table_name_94 WHERE position = "quarterback"
sql_create_context
CREATE TABLE table_79369 ( "Members" text, "Teammate" text, "Couples Team" text, "Status" text, "Total Votes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were Holly Scouler's total votes?
SELECT "Total Votes" FROM table_79369 WHERE "Members" = 'holly scouler'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescription...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561) AND icustays.outtime IS NULL) A...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
SELECT SG, TZ, TW, SSY, SZY, XL, HXPLC, ML FROM mzjzjlb WHERE JZLSH = '72157551077'
css
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(25...
SELECT Statement_Details, SUM(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details DESC
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid numb...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-36899')) AND medication.drugname = 'senokot-s tab' AND STRFTIME('%y-%m...
eicu
CREATE TABLE table_79548 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the speed for the rider with a time of 1:14.15.64?
SELECT "Speed" FROM table_79548 WHERE "Time" = '1:14.15.64'
wikisql
CREATE TABLE table_9621 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round when the match was against sergis kyratzis?
SELECT "Round" FROM table_9621 WHERE "Opponent" = 'sergis kyratzis'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, body fluid')) GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_203_339 ( id number, "year" text, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many i...
SELECT COUNT(*) FROM table_203_339 WHERE "retired" = 'flagged'
squall
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, d...
SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover)
nvbench
CREATE TABLE table_66762 ( "Rank" real, "Year" real, "Name" text, "Moving from" text, "Moving to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The person with a rank of 8 moving to Shakhtar Donetsk was moving from what Ukrainian Football Club as a...
SELECT "Moving from" FROM table_66762 WHERE "Moving to" = 'shakhtar donetsk' AND "Rank" = '8'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number, subject_id num...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'dicloxacillin' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year'))
mimic_iii