instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '曹诗蕾' AND jybg...
css
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "7" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_2144389_9 ( japanese_translation VARCHAR, vocalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When momoiro clover z is the vocalist what is the japanese translation?
SELECT japanese_translation FROM table_2144389_9 WHERE vocalist = "Momoiro Clover Z"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight i...
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, state WHERE ((flight.arrival_time <= 1930 AND flight.arrival_time >= 1830) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND fli...
atis
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 WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.days_stay > "14"
mimicsql_data
CREATE TABLE table_5809 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What the average amount of field goals Clark has if he has less than 3 touch downs and less ...
SELECT AVG("Field goals") FROM table_5809 WHERE "Touchdowns" < '3' AND "Player" = 'clark' AND "Points" < '5'
wikisql
CREATE TABLE table_33441 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Browns play week 12?
SELECT "Opponent" FROM table_33441 WHERE "Week" = '12'
wikisql
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Malfunc oth device/graft"
mimicsql_data
CREATE TABLE table_name_61 ( leading_scorer VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the leading scorer of the game on 20 November 2007?
SELECT leading_scorer FROM table_name_61 WHERE date = "20 november 2007"
sql_create_context
CREATE TABLE table_name_10 ( result VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for round r3?
SELECT result FROM table_name_10 WHERE round = "r3"
sql_create_context
CREATE TABLE table_57117 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time/Retired when the grid is larger than 9 and Rolf Stommelen is the driver?
SELECT "Time/Retired" FROM table_57117 WHERE "Grid" > '9' AND "Driver" = 'rolf stommelen'
wikisql
CREATE TABLE gyb ( 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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '6694892' AND qtb.OUT_DIAG_DIS_NM = '腔隙性脑梗死' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '6694892' AND gyb.OUT_DIAG_DIS_NM = '腔隙性脑梗死' UNION S...
css
CREATE TABLE table_name_94 ( draws INTEGER, byes INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of draws for all byes larger than 0?
SELECT SUM(draws) FROM table_name_94 WHERE byes > 0
sql_create_context
CREATE TABLE table_1825751_4 ( binibining_pilipinas_international VARCHAR, binibining_pilipinas_world VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winners of binibining pilipinas-International when Maria Karla Bautista won binibining pilipinas-wor...
SELECT COUNT(binibining_pilipinas_international) FROM table_1825751_4 WHERE binibining_pilipinas_world = "Maria Karla Bautista"
sql_create_context
CREATE TABLE table_28839 ( "Place" real, "Nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "Table points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT MAX("lost") FROM table_28839
wikisql
CREATE TABLE table_59560 ( "Show" text, "Date" text, "Official ratings (millions)" real, "Weekly rank" text, "Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Weekly Rank has an Official ratings (millions) of 11.58?
SELECT "Weekly rank" FROM table_59560 WHERE "Official ratings (millions)" = '11.58'
wikisql
CREATE TABLE table_19294812_2 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 1st leg have team 1 ofk belgrade?
SELECT COUNT(1 AS st_leg) FROM table_19294812_2 WHERE team_1 = "OFK Belgrade"
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.expire_flag = "1" AND demographic.diagnosis = "RUQ PAIN"
mimicsql_data
CREATE TABLE table_20552 ( "Vehicle" text, "EPA rated All-electric range" text, "EPA rated combined fuel economy" text, "Alaska ( Juneau )" text, "California (San Francisco)" text, "Mid-Atlantic South (Washington, D.C.)" text, "U.S. national average electric mix" text, "Southeast (Atlant...
SELECT "Mid-Atlantic South (Washington, D.C.)" FROM table_20552 WHERE "Midwest (Des Moines)" = '300 g/mi (186 g/km)'
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '卫博裕' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8489.49)
css
CREATE TABLE table_name_13 ( gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the gold when Jules van Dyk Belgium won bronze?
SELECT gold FROM table_name_13 WHERE bronze = "jules van dyk belgium"
sql_create_context
CREATE TABLE table_55893 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college has Chito Victolero?
SELECT "College" FROM table_55893 WHERE "Player" = 'chito victolero'
wikisql
CREATE TABLE table_2220432_1 ( report VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the report in the race where the winning team was Roush Fenway Racing?
SELECT report FROM table_2220432_1 WHERE team = "Roush Fenway Racing"
sql_create_context
CREATE TABLE table_27665 ( "GB" text, "ISO \u2116" text, "Province" text, "Chinese Name" text, "Capital" text, "Population\u00b9" real, "Density\u00b2" text, "Area\u00b3" real, "Abbreviation/Symbol" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT MAX("Area\u00b3") FROM table_27665 WHERE "Density\u00b2" = '533.59'
wikisql
CREATE TABLE table_51351 ( "Player" text, "Span" text, "Start" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- on the span of 1992-2000, what was the conv ?
SELECT "Conv" FROM table_51351 WHERE "Span" = '1992-2000'
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 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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Replacement of tube or enterostomy device of small intestine" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) AS tags_count FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE (LOWER(Location) LIKE LOWER('%coimbatore%') O...
sede
CREATE TABLE table_28744929_1 ( joined_acc INTEGER, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year did north carolina institution join the acc?
SELECT MAX(joined_acc) FROM table_28744929_1 WHERE institution = "North Carolina"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-61035')) AND diagnosis.diagnosisname = 'primary lung cancer -...
eicu
CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE albums...
SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands"
spider
CREATE TABLE table_1504 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Falcons points" real, "Opponents" real, "Record" text, "Streak" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1984, Did the F...
SELECT "Result" FROM table_1504 WHERE "Opponent" = 'New Orleans Saints'
wikisql
CREATE TABLE table_name_99 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people in total have attended games where carlton played as away?
SELECT COUNT(crowd) FROM table_name_99 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, ...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '45393885' AND hz_info.YLJGDM = '3398838' AND NOT zyjzjlb.CYKSMC LIKE '%康复科%'
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID
nvbench
CREATE TABLE table_name_17 ( driver VARCHAR, grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove in grids more than 3 and exited in an accident?
SELECT driver FROM table_name_17 WHERE grid > 3 AND time_retired = "accident"
sql_create_context
CREATE TABLE table_11633 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- From which school did the Minnesota Twins SS come from?
SELECT "School" FROM table_11633 WHERE "Team" = 'minnesota twins' AND "Position" = 'ss'
wikisql
CREATE TABLE table_73323 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode ...
SELECT MIN("#") FROM table_73323 WHERE "U.S. viewers (million)" = '10.14'
wikisql
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE author ( authorid int...
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'knn' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
scholar
CREATE TABLE table_name_21 ( writer VARCHAR, issue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the writer for issue 224?
SELECT writer FROM table_name_21 WHERE issue = 224
sql_create_context
CREATE TABLE table_21434 ( "Episode Number" real, "Air Date" text, "Event 1" text, "Event 2" text, "Event 3" text, "Event 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which episode number is event 4 The Wall and event 1 the Pendulum?
SELECT COUNT("Episode Number") FROM table_21434 WHERE "Event 4" = 'The Wall' AND "Event 1" = 'Pendulum'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'aspirin (baby asa) 81 mg tab' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-6 year')
eicu
CREATE TABLE table_70679 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when there was a Loss of birkbeck (0 3)?
SELECT "Score" FROM table_70679 WHERE "Loss" = 'birkbeck (0–3)'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
SELECT P.Score, p.Id AS "post_link", YEAR(p.CreationDate) AS Year, MONTH(p.CreationDate) AS Month, p.Body AS Body, U.DisplayName AS UserName FROM Posts AS P, Users AS U WHERE (P.PostTypeId = 2 AND P.Score = 0 AND P.Body LIKE '%lmgtfy%' AND P.OwnerUserId = U.Id AND P.ClosedDate IS NULL) ORDER BY Year, Month LIMIT 1000
sede
CREATE TABLE table_6405 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Channel" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record for the game held on Decemb...
SELECT "Record" FROM table_6405 WHERE "Date" = 'december 2, 2001'
wikisql
CREATE TABLE table_name_12 ( week VARCHAR, opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks have an Opponent of at san francisco 49ers, and an Attendance smaller than 34,354?
SELECT COUNT(week) FROM table_name_12 WHERE opponent = "at san francisco 49ers" AND attendance < 34 OFFSET 354
sql_create_context
CREATE TABLE table_test_4 ( "id" int, "ejection_fraction_ef" int, "systolic_blood_pressure_sbp" int, "active_infection" bool, "heart_disease" bool, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, "diastolic_blood_pressure_dbp" int, ...
SELECT * FROM table_test_4 WHERE active_infection = 1 OR active_infection = 1
criteria2sql
CREATE TABLE table_20996923_20 ( city VARCHAR, television VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the city when the Television network was the NFL Network?
SELECT city FROM table_20996923_20 WHERE television = "NFL Network"
sql_create_context
CREATE TABLE table_7838 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE STUDIO WITH A GROSS $81,198,894?
SELECT "Studio" FROM table_7838 WHERE "Gross" = '$81,198,894'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
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.icd9_code = "28860" AND prescriptions.route = "IH"
mimicsql_data
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc24 WHERE t_kc24.PERSON_ID = '96723822' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-03-22' AND '2008-07-26' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE table_1458412_1 ( team_s_ VARCHAR, winnings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total amount o teams where winnings is $1,752,299?
SELECT COUNT(team_s_) FROM table_1458412_1 WHERE winnings = "$1,752,299"
sql_create_context
CREATE TABLE table_name_84 ( tournament VARCHAR, year VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tournament that happened in 1974 in gothenburg , sweden?
SELECT tournament FROM table_name_84 WHERE year = 1974 AND venue = "gothenburg , sweden"
sql_create_context
CREATE TABLE table_24295 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What t...
SELECT "Time" FROM table_24295 WHERE "ACC Team" = '#17 Wake Forest'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valve replacement < 7days - mitral' AND STRFTIME('...
eicu
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, a...
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY Rank
nvbench
CREATE TABLE table_name_26 ( ipsos_5_25_09 VARCHAR, tns_sofres_5_28_09 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Ipsos 5/25/09 has a TNS-Sofres 5/28/09 of 20%?
SELECT ipsos_5_25_09 FROM table_name_26 WHERE tns_sofres_5_28_09 = "20%"
sql_create_context
CREATE TABLE table_14998 ( "No.1" text, "No.2" text, "No.3" text, "No.4" text, "No.5" text, "No.6" text, "No.7" text, "No.8" text, "No.9" text, "No.10" text, "FINAL" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was numb...
SELECT "No.3" FROM table_14998 WHERE "No.2" = 'delfina' AND "FINAL" = 'pedro'
wikisql
CREATE TABLE table_21378339_5 ( artist VARCHAR, panel_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of artists for panel points being 5
SELECT COUNT(artist) FROM table_21378339_5 WHERE panel_points = 5
sql_create_context
CREATE TABLE table_21578303_2 ( stage VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which stage has kourdali as the name?
SELECT stage FROM table_21578303_2 WHERE name = "Kourdali"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_in...
css
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0...
SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_name_93 ( avg_g INTEGER, gain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Avg/G has a Gain of 1,839?
SELECT SUM(avg_g) FROM table_name_93 WHERE gain = 1 OFFSET 839
sql_create_context
CREATE TABLE table_58859 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country of the Player with a Score of 73-71-76-70=290?
SELECT "Country" FROM table_58859 WHERE "Score" = '73-71-76-70=290'
wikisql
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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.departure_time > 1500 AND flight.to_airport = AIRPORT_SERVICE_1.ai...
atis
CREATE TABLE table_12025 ( "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 the date of the game when the venue is P...
SELECT "Date" FROM table_12025 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_55253 ( "Outcome" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had a score of 6 7 (0 7) , 6 2, 4 6?
SELECT "Tournament" FROM table_55253 WHERE "Score" = '6–7 (0–7) , 6–2, 4–6'
wikisql
CREATE TABLE table_204_73 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was their highest points scored in a game ?
SELECT MAX("score") FROM table_204_73
squall
CREATE TABLE table_name_15 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the away team with st kilda as the away team?
SELECT away_team AS score FROM table_name_15 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE table_67892 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Try BP" text, "Losing BP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the club that has played 22 rounds, has a drawn score of 0, has lost 14, and whos...
SELECT "Club" FROM table_67892 WHERE "Played" = '22' AND "Drawn" = '0' AND "Lost" = '14' AND "Losing BP" = '5'
wikisql
CREATE TABLE table_name_41 ( gold INTEGER, bronze VARCHAR, silver VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the gold when silver is 1, event is 2000 summer paralympics and bronze is more than 3?
SELECT AVG(gold) FROM table_name_41 WHERE silver = 1 AND event = "2000 summer paralympics" AND bronze > 3
sql_create_context
CREATE TABLE table_78348 ( "Player" text, "Pos." text, "From" real, "School/Country" text, "Rebs" real, "Asts" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rebounds for players from 1976 and over 67 assists?
SELECT AVG("Rebs") FROM table_78348 WHERE "From" = '1976' AND "Asts" > '67'
wikisql
CREATE TABLE table_23085 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the successor for pennsylvania 15th
SELECT "Successor" FROM table_23085 WHERE "District" = 'Pennsylvania 15th'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Subjects ( subj...
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY course_name DESC
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id nu...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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 = 'oth spcf p...
mimic_iii
CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_add...
SELECT T3.stu_fname FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT zyjzjlb.MZZYZDZZBM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '33429029356'
css
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(25...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code
nvbench
CREATE TABLE table_train_280 ( "id" int, "fpg" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "hba1c" float, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- have a gl...
SELECT * FROM table_train_280 WHERE hba1c > 7 AND hemoglobin_a1c_hba1c <= 10.5
criteria2sql
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 TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE table_name_70 ( season VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year's Season had an Overall of 77?
SELECT season FROM table_name_70 WHERE overall = "77"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CR...
SELECT P.Id AS "post_link", P.FavoriteCount FROM Votes AS V, Posts AS P, PostTypes AS Pt, VoteTypes AS Vt WHERE P.Id = V.PostId AND P.PostTypeId = Pt.Id AND V.VoteTypeId = Vt.Id AND Pt.Id = 1 AND Vt.Id = 5 AND P.Score > 0 AND P.DeletionDate IS NULL AND P.CommunityOwnedDate IS NULL AND NOT P.OwnerUserId IS NULL AND NOT ...
sede
CREATE TABLE table_1974545_3 ( softball_stadium VARCHAR, baseball_stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the softball stadium for the school that has Eastern Baseball Stadium?
SELECT softball_stadium FROM table_1974545_3 WHERE baseball_stadium = "Eastern Baseball Stadium"
sql_create_context
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 SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8958826' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-02-01' AND '2003-04-23'
css
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Ad...
SELECT Fname, COUNT(Fname) FROM Student WHERE Major <> (SELECT Major FROM Student) GROUP BY Fname ORDER BY COUNT(Fname) DESC
nvbench
CREATE TABLE table_33480 ( "Season" real, "Coach" text, "Record as played" text, "Actual adjusted record" text, "Regular season Vacated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons did coach steve fisher have?
SELECT COUNT("Season") FROM table_33480 WHERE "Coach" = 'steve fisher'
wikisql
CREATE TABLE table_78528 ( "Superlative" text, "Actor" text, "Record Set" text, "Year" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year had the oldest winner?
SELECT "Year" FROM table_78528 WHERE "Superlative" = 'oldest winner'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_46565 ( "Year" real, "Championship" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During the championship where the winning score was 9 (66-69-73-71=279)?, who ...
SELECT "Runner(s)-up" FROM table_46565 WHERE "Winning score" = '−9 (66-69-73-71=279)'
wikisql
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different cities do people originate from...
SELECT COUNT(DISTINCT city) FROM person
spider
CREATE TABLE table_17525955_2 ( episode__number VARCHAR, us_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes aired Saturday, July 11, 2009
SELECT COUNT(episode__number) FROM table_17525955_2 WHERE us_air_date = "Saturday, July 11, 2009"
sql_create_context
CREATE TABLE table_62692 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fe...
SELECT MIN("Loses") FROM table_62692 WHERE "Position" < '8' AND "Games played" < '30'
wikisql
CREATE TABLE table_72663 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "To par" text, "Margin of victory" text, "Purse ( US$ )" real, "Winners share" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What c...
SELECT "Country" FROM table_72663 WHERE "Margin of victory" = '6 strokes'
wikisql
CREATE TABLE table_7378 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Format has a Catalog of vcrdx 106?
SELECT "Format" FROM table_7378 WHERE "Catalog" = 'vcrdx 106'
wikisql
CREATE TABLE table_67633 ( "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. -- What is the smallest roll with a Decile larger than 6, and a Name of bro...
SELECT MIN("Roll") FROM table_67633 WHERE "Decile" > '6' AND "Name" = 'broomfield school'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture - neonate' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', ...
mimic_iii
CREATE TABLE gymnast ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gymnasts are there?
SELECT COUNT(*) FROM gymnast
sql_create_context
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW t...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) 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 (((flight.departure_time BETWEEN 1800 AND 2200) AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_...
atis
CREATE TABLE table_71143 ( "Team" text, "Manager 1" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the manager with the Hewlett-Packard shirt sponsor?
SELECT "Manager 1" FROM table_71143 WHERE "Shirt sponsor" = 'hewlett-packard'
wikisql
CREATE TABLE table_14129 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has money ($) greater than 233,125 and Tiger Woods as the player?
SELECT "Country" FROM table_14129 WHERE "Money ( $ )" > '233,125' AND "Player" = 'tiger woods'
wikisql