instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 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.icd9_code = "V4511" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_12547 ( "Tournament" text, "1973" text, "1974" text, "1975" text, "1976" text, "1977" text, "1978" text, "1979" text, "1983" text, "1984" text, "1985" text, "1986" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "1976" FROM table_12547 WHERE "Tournament" = 'overall win – loss'
wikisql
CREATE TABLE table_name_14 ( population__2006_ INTEGER, population__2011_ VARCHAR, area__km_2__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average population in 2006 that has more than 5 people in 2011 and an area 5.84km?
SELECT AVG(population__2006_) FROM table_name_14 WHERE population__2011_ > 5 AND area__km_2__ = 5.84
sql_create_context
CREATE TABLE table_46557 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the game against the Washington Bullets, what was the final score?
SELECT "Score" FROM table_46557 WHERE "Opponent" = 'washington bullets'
wikisql
CREATE TABLE table_47647 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Visitor, when Home is Philadelphia, and...
SELECT "Visitor" FROM table_47647 WHERE "Home" = 'philadelphia' AND "Date" = 'november 18'
wikisql
CREATE TABLE zzmzjzjlb ( 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, MZZYZDZ...
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSBM = '16206' AND zzmzjzjlb.JZKSRQ BETWEEN '2000-12-12' AND '2001-10-14' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSBM = '16206' AND fzzmzjzjlb.JZKSRQ BETWEEN '2000-12-12' AND '2001-10-14'
css
CREATE TABLE table_name_24 ( year VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was 7th heaven made?
SELECT year FROM table_name_24 WHERE film = "7th heaven"
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE > 7)
css
CREATE TABLE room ( roomnumber number, roomtype text, blockfloor number, blockcode number, unavailable boolean ) CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE undergoes ( patient nu...
SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures
spider
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.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.BGDH = '97022779675' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.BGDH = '97022779675'
css
CREATE TABLE table_name_3 ( regional_finals INTEGER, record VARCHAR, _number_of_bids VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Regional Finals score when the record is 3-2 and there are more than 3 bids?
SELECT AVG(regional_finals) FROM table_name_3 WHERE record = "3-2" AND _number_of_bids > 3
sql_create_context
CREATE TABLE table_17920 ( "Position" real, "Club" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Pts For" real, "Pts Agst" real, "B.P." real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the numb...
SELECT COUNT("Played") FROM table_17920 WHERE "Pts Agst" = '645'
wikisql
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 JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_33 ( method VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method for the resolution of the fight at UFC 160?
SELECT method FROM table_name_33 WHERE event = "ufc 160"
sql_create_context
CREATE TABLE table_27500 ( "No. in series" real, "No. in 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. -- What date did 'fast friends' originally air?
SELECT "Original air date" FROM table_27500 WHERE "Title" = 'Fast Friends'
wikisql
CREATE TABLE table_202_200 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long did sydney greenstreet 's acting career last ?
SELECT MAX("year") - MIN("year") + 1 FROM table_202_200
squall
CREATE TABLE table_name_58 ( home_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Home Team, when Date is 'April 10'?
SELECT home_team FROM table_name_58 WHERE date = "april 10"
sql_create_context
CREATE TABLE table_16768245_2 ( longitude VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many longitudes have a latitude of 9.9n?
SELECT COUNT(longitude) FROM table_16768245_2 WHERE latitude = "9.9N"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'lasix')) AND STRFTIME('%y', cost.chargetime) =...
eicu
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id nu...
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_item...
mimic_iii
CREATE TABLE table_50352 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player had a To par of +1?
SELECT "Player" FROM table_50352 WHERE "To par" = '+1'
wikisql
CREATE TABLE table_63359 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What lane is from Great Britain and a 57.78 time?
SELECT COUNT("Lane") FROM table_63359 WHERE "Nationality" = 'great britain' AND "Time" > '57.78'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.Y...
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Citalopram Hydrobromide"
mimicsql_data
CREATE TABLE table_59808 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a To par larger than 12?
SELECT MIN("Total") FROM table_59808 WHERE "To par" > '12'
wikisql
CREATE TABLE table_51908 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a 32-29-8 record at home?
SELECT "Home" FROM table_51908 WHERE "Record" = '32-29-8'
wikisql
CREATE TABLE table_9696 ( "Scorer" text, "Club" text, "League goals" text, "FA Cup goals" real, "League Cup goals" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which FA Cup goals have a League goals of 18, and a Club of sheffield...
SELECT MAX("FA Cup goals") FROM table_9696 WHERE "League goals" = '18' AND "Club" = 'sheffield united'
wikisql
CREATE TABLE table_name_91 ( doctor_who_episode VARCHAR, original_airdate__uk_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Doctor Who episode has an Original airdate (UK) of 14 may 2005?
SELECT doctor_who_episode FROM table_name_91 WHERE original_airdate__uk_ = "14 may 2005"
sql_create_context
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 procedures.short_title FROM procedures WHERE procedures.subject_id = "3343"
mimicsql_data
CREATE TABLE table_54217 ( "Character" text, "Position" text, "Actor" text, "First Episode" text, "Final Episode" text, "Duration" text, "Final Episode Count" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number for a fi...
SELECT AVG("Final Episode Count") FROM table_54217 WHERE "Character" = 'maxine valera'
wikisql
CREATE TABLE table_55480 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the categorization in 2012 when it was A in 2008 and 1R in 2011?
SELECT "2012" FROM table_55480 WHERE "2008" = 'a' AND "2011" = '1r'
wikisql
CREATE TABLE table_32370 ( "Name" text, "Architecture" text, "USB support" text, "LFN support" text, "APIs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the LFN support on Windows NT 3.1?
SELECT "LFN support" FROM table_32370 WHERE "Name" = 'windows nt 3.1'
wikisql
CREATE TABLE table_46843 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the home team when the tie no was 27?
SELECT "Home team" FROM table_46843 WHERE "Tie no" = '27'
wikisql
CREATE TABLE table_32158 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue did the African Championships have after 2006 with a position of 2nd and 3000 m s'chase in ...
SELECT "Venue" FROM table_32158 WHERE "Year" > '2006' AND "Notes" = '3000 m s''chase' AND "Position" = '2nd' AND "Competition" = 'african championships'
wikisql
CREATE TABLE table_11375 ( "Grid" real, "Constructor" text, "Qual" real, "Rank" real, "Laps" real, "Time/Retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constructor had a grid number bigger than 14, laps of more than 93, and rank h...
SELECT "Constructor" FROM table_11375 WHERE "Grid" > '14' AND "Laps" > '93' AND "Rank" > '25'
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.MED_AMOUT) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '葛曼妮' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-07-12' AND '2018-11-19' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '葛曼妮' AND t...
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( la...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) ORDER BY microlab.culturetakentime LIMIT 1
eicu
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee
nvbench
CREATE TABLE table_204_375 ( id number, "#" number, "season" number, "competition" text, "date" text, "round" text, "opponent" text, "h / a" text, "result" text, "scorer (s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what wa...
SELECT MAX("result") FROM table_204_375 WHERE "season" = 2013
squall
CREATE TABLE products ( product_name VARCHAR, product_category_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of products with category 'Spices'?
SELECT product_name FROM products WHERE product_category_code = "Spices"
sql_create_context
CREATE TABLE table_name_26 ( game VARCHAR, road_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game has houston as the road team, and june 15 as the date?
SELECT game FROM table_name_26 WHERE road_team = "houston" AND date = "june 15"
sql_create_context
CREATE TABLE table_name_70 ( lost INTEGER, against VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which average Lost has an Against larger than 19, and a Drawn smaller than 1?
SELECT AVG(lost) FROM table_name_70 WHERE against > 19 AND drawn < 1
sql_create_context
CREATE TABLE table_name_47 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 1811 for 1801 of 1801
SELECT 1811 FROM table_name_47 WHERE "1801" = "1801"
sql_create_context
CREATE TABLE table_204_24 ( id number, "year" number, "league" text, "record" text, "finish" text, "manager" text, "playoffs" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which seasons were not played in the california le...
SELECT "year" FROM table_204_24 WHERE "league" <> 'california league'
squall
CREATE TABLE table_58500 ( "Lost" real, "Tied" real, "Pct." real, "Years" real, "Total Games" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total ties had less than 1183 total games, 121 years, and more than 541 losses?
SELECT COUNT("Tied") FROM table_58500 WHERE "Total Games" < '1183' AND "Years" = '121' AND "Lost" > '541'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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 t...
SELECT zyjzjlb.JZLSH 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 = '91823210' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2008-05-03')
css
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters
nvbench
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Customers_Cards ( card_id INTEGER, ...
SELECT card_id, card_number FROM Customers_Cards GROUP BY card_type_code
nvbench
CREATE TABLE table_44343 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the quantity m...
SELECT "Quantity made" FROM table_44343 WHERE "Manufacturer" = '4-6-2 — oooooo — pacific'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ...
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE <= 19)
css
CREATE TABLE table_name_34 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of game 66?
SELECT date FROM table_name_34 WHERE game = 66
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id numbe...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_...
mimic_iii
CREATE TABLE table_15001681_1 ( year INTEGER, womens_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most current year where the women's doubles champions are astrid eidenbenz claudia jehle
SELECT MAX(year) FROM table_15001681_1 WHERE womens_doubles = "Astrid Eidenbenz Claudia Jehle"
sql_create_context
CREATE TABLE table_70213 ( "Grand Prix" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pole position at the german grand prix
SELECT "Pole position" FROM table_70213 WHERE "Grand Prix" = 'german grand prix'
wikisql
CREATE TABLE table_43871 ( "Score" text, "Batsmen" text, "Against" text, "Location" text, "Year" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the batsmen at the Brit Oval location?
SELECT "Batsmen" FROM table_43871 WHERE "Location" = 'the brit oval'
wikisql
CREATE TABLE table_name_59 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a 2004 of 1r?
SELECT tournament FROM table_name_59 WHERE 2004 = "1r"
sql_create_context
CREATE TABLE table_2435 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whe...
SELECT "Tournament Venue (City)" FROM table_2435 WHERE "Regular Season Winner" = 'Louisville'
wikisql
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, ...
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY date_of_birth
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code va...
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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (((DAYS_0.day_name = 'TUESDAY' AND DAYS_1.day_name = 'TUESDAY' AND fare_basis.basis_days = DAYS_1....
atis
CREATE TABLE table_name_96 ( resolution VARCHAR, network VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the resolution of the network Canal de las Estrellas?
SELECT resolution FROM table_name_96 WHERE network = "canal de las estrellas"
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT name, number FROM course WHERE department = 'INSTHUM' AND credits = 11
advising
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(*) 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 = '73755198' AND wdmzjzjlb.JZKSRQ BETWEEN '2003-12-12' AND '2004-04-25' AND wdmzjzjlb.YLJGDM = '7884008' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON ...
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 HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_75 ( material_collected VARCHAR, isbn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Material collected for the 978-1401209674 ISBN?
SELECT material_collected FROM table_name_75 WHERE isbn = "978-1401209674"
sql_create_context
CREATE TABLE table_name_64 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record of the February 26 date?
SELECT record FROM table_name_64 WHERE date = "february 26"
sql_create_context
CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) -...
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
spider
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 zyjzjlb_jybgb ( YLJGDM_ZYJZJLB te...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '褚昊天' AND hz_info.YLJGDM = '2197506' AND NOT zyjzjlb.JZKSMC LIKE '%眼外伤%'
css
CREATE TABLE table_name_84 ( place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place is the player with a score of 69-68=137?
SELECT place FROM table_name_84 WHERE score = 69 - 68 = 137
sql_create_context
CREATE TABLE table_79260 ( "Song" text, "Featured artist" text, "Main artist" text, "Peak date" text, "Peak" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the peak date of Kelis's song?
SELECT "Peak date" FROM table_79260 WHERE "Main artist" = 'kelis'
wikisql
CREATE TABLE table_name_74 ( network VARCHAR, host VARCHAR, viewers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the network who had Ken Squier as a host and 13.9 million viewers?
SELECT network FROM table_name_74 WHERE host = "ken squier" AND viewers = "13.9 million"
sql_create_context
CREATE TABLE table_25580292_13 ( winner VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winners were there for stage 5?
SELECT COUNT(winner) FROM table_25580292_13 WHERE stage = 5
sql_create_context
CREATE TABLE table_204_288 ( id number, "region" text, "seed" number, "team" text, "coach" text, "finished" text, "final opponent" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which of the four regions finished most often...
SELECT "region" FROM table_204_288 WHERE "finished" = 'first round' GROUP BY "region" ORDER BY COUNT(*) DESC LIMIT 1
squall
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 * FROM t_kc21 WHERE PERSON_ID = '45006665' AND MED_SER_ORG_NO = '5335029' AND MED_ORG_DEPT_NM LIKE '%准分子%'
css
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, autho...
SELECT DISTINCT paper.paperid, writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_66447 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game was a Platformer?
SELECT "Game" FROM table_66447 WHERE "Genre" = 'platformer'
wikisql
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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY LName
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-2 year') GR...
eicu
CREATE TABLE table_39018 ( "Station" text, "City of license" text, "Channels TV / RF" text, "First air date" text, "HAAT" text, "Facility ID" real, "Public license information" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City of lic...
SELECT "City of license" FROM table_39018 WHERE "Channels TV / RF" = '67 ( psip ) 29 ( uhf )'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, item...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ammonia'))
mimic_iii
CREATE TABLE table_51326 ( "CERCLIS ID" text, "Name" text, "Municipality" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT "Name" FROM table_51326 WHERE "CERCLIS ID" = 'prd980512362'
wikisql
CREATE TABLE table_name_30 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game on March 11, 1999 played?
SELECT venue FROM table_name_30 WHERE date = "march 11, 1999"
sql_create_context
CREATE TABLE table_name_96 ( number_of_jews__wjc_ VARCHAR, rank___wjc__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the number of WJC Jews with a WJC rank of 6?
SELECT number_of_jews__wjc_ FROM table_name_96 WHERE rank___wjc__ = 6
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.icd9_code = "76528" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_909 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Storyboarded by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT COUNT("Directed by") FROM table_909 WHERE "Written by" = 'Darrick Bachman and Brett Varon'
wikisql
CREATE TABLE table_50685 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest attendance a result of W 30-7?
SELECT MAX("Attendance") FROM table_50685 WHERE "Result" = 'w 30-7'
wikisql
CREATE TABLE table_train_94 ( "id" int, "mini_mental_state_examination_mmse" int, "substance_dependence" bool, "psychiatric_disease" bool, "modified_hachinski_ischemia_scale" int, "smoking" bool, "alcohol_abuse" bool, "NOUSE" float ) -- Using valid SQLite, answer the following question...
SELECT * FROM table_train_94 WHERE smoking = 0
criteria2sql
CREATE TABLE table_18683 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many people won in 1914
SELECT COUNT("District") FROM table_18683 WHERE "First elected" = '1914'
wikisql
CREATE TABLE table_3633 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original U.S. air date" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode titled 'big kings on campus'?
SELECT "Written by" FROM table_3633 WHERE "Title" = 'Big Kings on Campus'
wikisql
CREATE TABLE Document_Sections_Images ( section_id INTEGER, image_id INTEGER ) CREATE TABLE Document_Functional_Areas ( document_code VARCHAR(15), functional_area_code VARCHAR(15) ) CREATE TABLE Users ( user_id INTEGER, role_code VARCHAR(15), user_name VARCHAR(40), user_login VARCHAR(4...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
nvbench
CREATE TABLE table_name_87 ( county VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which county do the Trojans come from?
SELECT county FROM table_name_87 WHERE mascot = "trojans"
sql_create_context
CREATE TABLE department ( dno number, division text, dname text, room text, building text, dphone number ) CREATE TABLE enrolled_in ( stuid number, cid text, grade text ) CREATE TABLE gradeconversion ( lettergrade text, gradepoint number ) CREATE TABLE faculty ( facid ...
SELECT DISTINCT fname FROM student WHERE fname LIKE '%a%'
spider
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE table_name_50 ( country VARCHAR, television_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Television Service is Eurosport 2?
SELECT country FROM table_name_50 WHERE television_service = "eurosport 2"
sql_create_context
CREATE TABLE table_13836704_8 ( transit_passengers INTEGER, freight__metric_tonnes_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the transit passengers for 171078
SELECT MAX(transit_passengers) FROM table_13836704_8 WHERE freight__metric_tonnes_ = 171078
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '06445268' AND t_kc21.MED_SER_ORG_NO = '5566440' AND t_kc21.IN_DIAG_DIS_NM LIKE '%病%'
css
CREATE TABLE table_train_268 ( "id" int, "basal_rate" float, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "major_illness" bool, "creatinine_clearance_cl" float, "injury_to_body" bool, "diastolic_blood_pressure_dbp" int, "injury_to_limb" bool, "hypertension" bool, ...
SELECT * FROM table_train_268 WHERE basal_rate < 0.01
criteria2sql
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 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 = "Polyneuropathy in diabetes" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '18088627' AND MED_SER_ORG_NO = '6281545' AND IN_DIAG_DIS_NM LIKE '%阿弗%'
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_i...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6215 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND charteve...
mimic_iii