instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_1289860_2 ( background VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many backgrounds are there represented from Memphis, Tennessee?
SELECT COUNT(background) FROM table_1289860_2 WHERE hometown = "Memphis, Tennessee"
sql_create_context
CREATE TABLE table_name_70 ( winner_and_score VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Winner and score has a Finalist of aaron krickstein?
SELECT winner_and_score FROM table_name_70 WHERE finalist = "aaron krickstein"
sql_create_context
CREATE TABLE table_name_78 ( matches INTEGER, drawn VARCHAR, points VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Matches were the points were smaller than 8, the place was larger than 13, and the drawn is less tha...
SELECT MAX(matches) FROM table_name_78 WHERE points < 8 AND place > 13 AND drawn < 1
sql_create_context
CREATE TABLE table_32466 ( "Rank" real, "Player" text, "Years" text, "Games" real, "Reb. Avg." real, "Total Rebounds" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Peter Woolfolk's Total Rebound average?
SELECT SUM("Total Rebounds") FROM table_32466 WHERE "Player" = 'peter woolfolk'
wikisql
CREATE TABLE table_27922 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the passing result for t...
SELECT "passed" FROM table_27922 WHERE "description" = 'Bus and Truck Operating License Bill'
wikisql
CREATE TABLE table_46094 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Lost" FROM table_46094 WHERE "Points" = '86'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_tit...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'clotrimazole' ORDER BY prescriptions.startda...
mimic_iii
CREATE TABLE table_52595 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a roll value of 422?
SELECT "Name" FROM table_52595 WHERE "Roll" = '422'
wikisql
CREATE TABLE table_11964154_9 ( location_attendance VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the location attendance where high rebounds is nick collison (14)
SELECT location_attendance FROM table_11964154_9 WHERE high_rebounds = "Nick Collison (14)"
sql_create_context
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) 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...
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(Years_working) DESC
nvbench
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, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0366537' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-27' AND '2017-04-29' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 19
css
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighb...
SELECT neighborhood.name FROM business, neighborhood, review, user WHERE neighborhood.business_id = business.business_id AND review.business_id = business.business_id AND user.name = 'Michelle' AND user.user_id = review.user_id
yelp
CREATE TABLE table_26661 ( "Province, Community" text, "Contestant" text, "Age" real, "Height" text, "Hometown" text, "Geographical Regions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which contestant is from the province of baoruco
SELECT "Contestant" FROM table_26661 WHERE "Province, Community" = 'Baoruco'
wikisql
CREATE TABLE table_name_42 ( points INTEGER, artist VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Points when the artist is kamil mikul k and nela, and the Place is larger than 18?
SELECT AVG(points) FROM table_name_42 WHERE artist = "kamil mikulčík and nela" AND place > 18
sql_create_context
CREATE TABLE table_204_467 ( id number, "date" text, "opponents" text, "h/a" text, "result\nf-a" text, "scorers" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many games was sapsford a scorer ?
SELECT COUNT(*) FROM table_204_467 WHERE "scorers" = 'sapsford'
squall
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_30872 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did Roseau High School (USHS-MN) play?
SELECT "Position" FROM table_30872 WHERE "College/junior/club team" = 'Roseau High School (USHS-MN)'
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "63" AND prescriptions.drug = "PNEUMOcoccal Vac Polyvalent"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Fiber-optic bronchoscopy"
mimicsql_data
CREATE TABLE table_66565 ( "Year" text, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location did david mccann receive a siver and morgan fox win the gold?
SELECT "Location" FROM table_66565 WHERE "Silver" = 'david mccann' AND "Gold" = 'morgan fox'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE zyb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '2155704' AND qtb.IN_HOSP_DATE BETWEEN '2003-11-10' AND '2009-02-24' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '2155704' AND gyb.IN_HOSP_DATE BETWEEN '2003-11-10' AND '2009-02-24' AND g...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2100-12' ORDER BY lab.labresultt...
eicu
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '柏哲茂' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2019-02-1...
css
CREATE TABLE table_26295 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Matchup/Results" text, "Attendance" real, "Payout (US$)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the television th...
SELECT "Television" FROM table_26295 WHERE "Date" = 'December 28, 2009'
wikisql
CREATE TABLE table_25538763_1 ( poles VARCHAR, season VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many pole data were given on season 2012 with 252 points?
SELECT COUNT(poles) FROM table_25538763_1 WHERE season = 2012 AND points = "252"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND microbiologyevents.spec_type_desc = 'urine' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start o...
mimic_iii
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEG...
SELECT Statement_Details, AVG(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) DESC
nvbench
CREATE TABLE table_17080868_7 ( location_attendance VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of the Indiana game?
SELECT location_attendance FROM table_17080868_7 WHERE team = "Indiana"
sql_create_context
CREATE TABLE tryout ( cName VARCHAR, pPos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of schools that have some players in the mid position but not in the goalie position.
SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'
sql_create_context
CREATE TABLE table_name_62 ( title VARCHAR, presentation_of_credentials VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the title with presentation of credentials of april 10, 1907
SELECT title FROM table_name_62 WHERE presentation_of_credentials = "april 10, 1907"
sql_create_context
CREATE TABLE table_name_50 ( fastest_lap VARCHAR, winning_driver VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap when adam christodoulou was the winning driver and had the pole position?
SELECT fastest_lap FROM table_name_50 WHERE winning_driver = "adam christodoulou" AND pole_position = "adam christodoulou"
sql_create_context
CREATE TABLE table_25220 ( "Rnd" real, "Date" text, "Race Name" text, "Length" text, "Track" text, "Location" text, "Pole Position" text, "Winning Driver" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location for trenton 300
SELECT "Location" FROM table_25220 WHERE "Race Name" = 'Trenton 300'
wikisql
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, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
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 = '65683500' AND t_kc22.STA_DATE BETWEEN '2004-07-13' AND '2012-06-26' AND t_kc22.SELF_PAY_AMO > 6686.51
css
CREATE TABLE table_65715 ( "Player" text, "Round" real, "Pick" real, "Position" text, "NFL Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Pick larger than 179?
SELECT MAX("Round") FROM table_65715 WHERE "Pick" > '179'
wikisql
CREATE TABLE table_76408 ( "Particle name" text, "Particle symbol" text, "Antiparticle symbol" text, "Quark content" text, "Rest mass ( MeV / c 2 )" text, "J P C" text, "Mean lifetime ( s )" text, "Commonly decays to (>5% of decays)" text ) -- Using valid SQLite, answer the following q...
SELECT "Antiparticle symbol" FROM table_76408 WHERE "Rest mass ( MeV / c 2 )" = '.47 ± .33'
wikisql
CREATE TABLE table_75118 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game with a loss of Maholm (2 4)?
SELECT "Score" FROM table_75118 WHERE "Loss" = 'maholm (2–4)'
wikisql
CREATE TABLE procedures ( 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 ) ...
SELECT demographic.admission_type, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "990"
mimicsql_data
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name ORDER BY Name
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '魏嘉云' AND MED_SER_ORG_NO = '7989526' AND IN_HOSP_DATE BETWEEN '2002-01-07' AND '2010-01-02')
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
SELECT q.Id, q.Title, q.CreationDate, q.Body, q.Tags FROM Posts AS q, Users AS u WHERE q.AnswerCount = 0 AND q.OwnerUserId = u.Id AND u.Reputation = 1 AND NOT q.PostTypeId = 2 ORDER BY CreationDate DESC
sede
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '71329181'
css
CREATE TABLE table_41153 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points has a Difference of 3, and a Playe...
SELECT AVG("Points") FROM table_41153 WHERE "Difference" = '3' AND "Played" < '10'
wikisql
CREATE TABLE table_204_229 ( id number, "property" text, "test method" text, "units" text, "4275" text, "4301" text, "4435" text, "4630" text, "4645" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times does mpa -lrb- kpsi -...
SELECT COUNT(*) FROM table_204_229 WHERE "units" = 'mpa (kpsi)'
squall
CREATE TABLE table_name_19 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Opponent is 'Rochester Royals'?
SELECT result FROM table_name_19 WHERE opponent = "rochester royals"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND date_day.day_number = 23 AND date_day.month_number = 4 AND ...
atis
CREATE TABLE table_13606924_1 ( kerry__number VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the kerry # with county being ness county, kansas
SELECT kerry__number FROM table_13606924_1 WHERE county = "Ness county, Kansas"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other anomalies of larynx, trachea, and bronchus"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.long_title = "Other chronic pain"
mimicsql_data
CREATE TABLE table_55136 ( "Year" real, "Award" text, "Category" text, "Nominated work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Did the nominated work of white valentine win an award?
SELECT "Result" FROM table_55136 WHERE "Nominated work" = 'white valentine'
wikisql
CREATE TABLE table_77859 ( "Code" real, "Type" text, "Name" text, "Area (km 2 )" real, "Population" real, "Regional County Municipality" text, "Metropolitan area" text, "Region" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MAX("Region") FROM table_77859 WHERE "Code" < '66112' AND "Name" = 'l''île-dorval'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '何丽姿' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT < 8447.75)
css
CREATE TABLE table_204_381 ( id number, "sum" number, "mongolian" number, "population\n(2005)" number, "population\n(2008)" number, "population\n(2009)" number, "area\nkm2" number, "density\n/km2" number, "sum centre\npopulation" number ) -- Using valid SQLite, answer the following...
SELECT MIN("population\n(2009)") FROM table_204_381
squall
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, depart...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (((flight.airline_code = 'UA') AND flight.flight_number = 21) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANC...
atis
CREATE TABLE table_21500850_1 ( song_title VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every song title for 2007?
SELECT song_title FROM table_21500850_1 WHERE year = 2007
sql_create_context
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAL...
atis
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '39252424' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-12-06' AND '2019-12-13' UNION SELECT COUNT(bdmzjzjlb.ZZYSGH) FROM hz_info JOIN bdmzjzjlb ON hz_...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "61" AND prescriptions.route = "IM"
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 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Resp prob after brth NEC"
mimicsql_data
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE employee ( ei...
SELECT name, distance FROM aircraft ORDER BY name
nvbench
CREATE TABLE table_57522 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals for were scored for the team(s) that won fe...
SELECT SUM("Goals For") FROM table_57522 WHERE "Wins" < '4' AND "Losses" > '6'
wikisql
CREATE TABLE table_62414 ( "Date" text, "Round" text, "Opponents" text, "H / A" text, "Result F\u2013A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result F-A that was the quarter-final first leg round with a H/...
SELECT "Result F\u2013A" FROM table_62414 WHERE "H / A" = 'h' AND "Round" = 'quarter-final first leg'
wikisql
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 FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_39880 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what format was the release from the Nebt068 catalog on April 11, 2005 in?
SELECT "Format" FROM table_39880 WHERE "Date" = 'april 11, 2005' AND "Catalog" = 'nebt068'
wikisql
CREATE TABLE table_67465 ( "Stage" text, "Winner" text, "General classification" text, "Points Classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points classification for quick step-innergetic with s...
SELECT "Points Classification" FROM table_67465 WHERE "Team Classification" = 'quick step-innergetic' AND "Stage" = '7'
wikisql
CREATE TABLE table_name_93 ( club_province VARCHAR, player VARCHAR, position VARCHAR, caps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the club/province of Sireli Bobo, who plays wing and has less than 24 caps?
SELECT club_province FROM table_name_93 WHERE position = "wing" AND caps < 24 AND player = "sireli bobo"
sql_create_context
CREATE TABLE table_16936 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the date with tournament value of ford senior ...
SELECT "Date" FROM table_16936 WHERE "Tournament" = 'Ford Senior Players Championship'
wikisql
CREATE TABLE table_1574968_1 ( viewer VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which viewers have the language of troff (typesetter runoff) , groff (gnu runoff)?
SELECT viewer FROM table_1574968_1 WHERE language = "troff (typesetter runoff) , groff (GNU runoff)"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Abnormal coagulation profile" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_29920800_1 ( written_by VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode that was watched by 2.97 million U.S. viewers?
SELECT written_by FROM table_29920800_1 WHERE us_viewers__million_ = "2.97"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_cod...
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, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 27 AND date_day.month_number =...
atis
CREATE TABLE table_name_95 ( position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Position has a Round of 27?
SELECT position FROM table_name_95 WHERE round = 27
sql_create_context
CREATE TABLE table_58929 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of a country with more than 2 gold, less than 5 silver, and less than 31 total medals?
SELECT SUM("Rank") FROM table_58929 WHERE "Gold" > '2' AND "Total" < '31' AND "Silver" < '5'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
SELECT LAST_NAME, SALARY FROM employees
nvbench
CREATE TABLE table_21363 ( "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 w...
SELECT COUNT("Record") FROM table_21363 WHERE "Team" = 'Washington'
wikisql
CREATE TABLE table_name_50 ( water VARCHAR, wood VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which water has green wood?
SELECT water FROM table_name_50 WHERE wood = "green"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE pap...
SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'nicola dell' AND venue.venueid = paper.venueid AND venue.venuename = 'chi' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "9703"
mimicsql_data
CREATE TABLE table_50568 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is Gary Player from in T9 place?
SELECT "Country" FROM table_50568 WHERE "Place" = 't9' AND "Player" = 'gary player'
wikisql
CREATE TABLE table_name_13 ( regionalliga_süd VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Regionalliga Sud for 1995-96?
SELECT regionalliga_süd FROM table_name_13 WHERE season = "1995-96"
sql_create_context
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEG...
SELECT Fname, COUNT(Fname) FROM Student WHERE Age < (SELECT AVG(Age) FROM Student) GROUP BY Fname ORDER BY COUNT(Fname) DESC
nvbench
CREATE TABLE table_4597 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the player from Oklahoma who was drafted in round 7 play?
SELECT "Position" FROM table_4597 WHERE "Round" = '7' AND "College" = 'oklahoma'
wikisql
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 * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2507652' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2507652' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '250765...
css
CREATE TABLE table_10568553_1 ( milepost VARCHAR, street_names VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many mileposts are there on Anne Street?
SELECT COUNT(milepost) FROM table_10568553_1 WHERE street_names = "Anne Street"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code...
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON...
atis
CREATE TABLE table_2897457_7 ( position VARCHAR, college_junior_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did Roseau High School (USHS-MN) play?
SELECT position FROM table_2897457_7 WHERE college_junior_club_team = "Roseau High School (USHS-MN)"
sql_create_context
CREATE TABLE table_21564794_3 ( championships_in_st_louis VARCHAR, began_in_st_louis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How may championships were won by the team that started in 1950?
SELECT championships_in_st_louis FROM table_21564794_3 WHERE began_in_st_louis = 1950
sql_create_context
CREATE TABLE table_43267 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Date was the Country of japan, and a Label of sony?
SELECT "Date" FROM table_43267 WHERE "Country" = 'japan' AND "Label" = 'sony'
wikisql
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_name_7 ( score VARCHAR, partnering VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game with Nathalie Tauziat as a partner?
SELECT score FROM table_name_7 WHERE partnering = "nathalie tauziat"
sql_create_context
CREATE TABLE table_31730 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "Estimated distribution (2000)*" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the hanja for hangul of
SELECT "Hanja" FROM table_31730 WHERE "Hangul" = '주'
wikisql
CREATE TABLE table_name_36 ( year INTEGER, points VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year for a car with 3 points and Cooper t20 chassis?
SELECT MIN(year) FROM table_name_36 WHERE points = 3 AND chassis = "cooper t20"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_cod...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A...
atis
CREATE TABLE table_58194 ( "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. -- How large was the crowd when North Melbourne pla...
SELECT "Crowd" FROM table_58194 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE table_12637 ( "Clubs" text, "Seasons at this level" text, "Settlements" text, "Season joined league" text, "Position in 1960/1961" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has played for 27 seasons at this level?
SELECT "Clubs" FROM table_12637 WHERE "Seasons at this level" = '27 seasons'
wikisql
CREATE TABLE table_name_31 ( team__number2 VARCHAR, team__number1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team #2 with Deport as team #1?
SELECT team__number2 FROM table_name_31 WHERE team__number1 = "deport"
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 WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA"
mimicsql_data
CREATE TABLE table_name_35 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent for the game on November 20, 1955?
SELECT opponent FROM table_name_35 WHERE date = "november 20, 1955"
sql_create_context