instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_58 ( result VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result from the 2000 asian cup qualification?
SELECT result FROM table_name_58 WHERE competition = "2000 asian cup qualification"
sql_create_context
CREATE TABLE table_name_62 ( city_of_license VARCHAR, frequency_mhz INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city has larger than 94.1 as a frequency?
SELECT city_of_license FROM table_name_62 WHERE frequency_mhz > 94.1
sql_create_context
CREATE TABLE table_204_302 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is ranked # 1 ?
SELECT "nation" FROM table_204_302 WHERE "rank" = 1
squall
CREATE TABLE table_38191 ( "Year (Ceremony)" text, "Film title" text, "Language(s)" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the fil Paljas?
SELECT "Result" FROM table_38191 WHERE "Film title" = 'paljas'
wikisql
CREATE TABLE table_11649123_1 ( disaster VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 2005-06 what was the disaster?
SELECT disaster FROM table_11649123_1 WHERE year = "2005-06"
sql_create_context
CREATE TABLE table_name_28 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of Mark O'Meara?
SELECT place FROM table_name_28 WHERE player = "mark o'meara"
sql_create_context
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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name 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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '14901191' AND t_kc21.MED_SER_ORG_NO = '1058628' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-03-25' AND '2010-01-16')
css
CREATE TABLE table_204_3 ( id number, "rank" number, "name" text, "nationality" text, "time" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who ranked number 8 after jose meolans finished in 7th ?
SELECT "name" FROM table_204_3 WHERE "rank" = 8
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE wdmzjzjlb ( 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 wdmzjzjlb WHERE wdmzjzjlb.ZZYSGH = '62380761' AND wdmzjzjlb.JZKSRQ BETWEEN '2014-01-24' AND '2020-12-29' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZZYSGH = '62380761' AND bdmzjzjlb.JZKSRQ BETWEEN '2014-01-24' AND '2020-12-29'
css
CREATE TABLE table_203_561 ( id number, "pos" number, "team" text, "total" number, "high" number, "low" number, "average" number, "change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name the only team whose percentage change was posi...
SELECT "team" FROM table_203_561 WHERE "change" > 0
squall
CREATE TABLE table_name_94 ( total INTEGER, bronze VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average total medals of the nation with 4 bronze and more than 1 silver medals?
SELECT AVG(total) FROM table_name_94 WHERE bronze = 4 AND silver > 1
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND DATETIME(medication.drugstarttime, 'start of year...
eicu
CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CREATE TABLE companies ( id number, name text, headquarters text, indu...
SELECT name FROM buildings ORDER BY height DESC
spider
CREATE TABLE table_67680 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the race in Vienna, Austria?
SELECT MIN("Year") FROM table_67680 WHERE "Venue" = 'vienna, austria'
wikisql
CREATE TABLE table_24144 ( "Season" text, "1st Place" text, "2nd Place" text, "3rd Place" text, "4th Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 1st place for limoges csp
SELECT "1st Place" FROM table_24144 WHERE "3rd Place" = 'Limoges CSP'
wikisql
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is average age for dif...
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job DESC
nvbench
CREATE TABLE Customers ( customer_status_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which customer status code has least number of customers?
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1
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(School_ID) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE table_name_35 ( grid VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid total associated with 18 laps?
SELECT COUNT(grid) FROM table_name_35 WHERE laps = 18
sql_create_context
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '77266571'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12985')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_62274 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "National final" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the language when the e...
SELECT "Language" FROM table_62274 WHERE "English translation" = 'come to me'
wikisql
CREATE TABLE table_71360 ( "Year" text, "Division" text, "League" text, "Regular Season" text, "Playoffs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did the Nashville Metros have Usisl Indoor League?
SELECT "Year" FROM table_71360 WHERE "League" = 'usisl indoor'
wikisql
CREATE TABLE table_name_24 ( laps INTEGER, time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest laps for time/retired of +2 laps and driver of felice bonetto
SELECT MAX(laps) FROM table_name_24 WHERE time_retired = "+2 laps" AND driver = "felice bonetto"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
SELECT Id FROM Tags WHERE TagName IN ('office-js')
sede
CREATE TABLE table_60992 ( "Season" text, "LKF Cup" text, "Regional Competitions" text, "Europe" text, "Head Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT SEASON HAD COACH JONAS KAZLAUSKAS AT champions cup group stage?
SELECT "Season" FROM table_60992 WHERE "Head Coach" = 'jonas kazlauskas' AND "Europe" = 'champions cup group stage'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
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 = 4368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b...
mimic_iii
CREATE TABLE table_34691 ( "Date" real, "Name" text, "Developer" text, "Clock" text, "Process" text, "Cores per die / Dies per module" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest date with Cores per die / Dies per module of...
SELECT MAX("Date") FROM table_34691 WHERE "Cores per die / Dies per module" = '2 / 1' AND "Clock" = '1.4-1.6ghz'
wikisql
CREATE TABLE table_name_49 ( competition VARCHAR, goal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition has a goal number of 13?
SELECT competition FROM table_name_49 WHERE goal = 13
sql_create_context
CREATE TABLE table_name_73 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had 67,472 in attendance?
SELECT date FROM table_name_73 WHERE attendance = "67,472"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108') AND NOT patient.unitdischargetime I...
eicu
CREATE TABLE table_name_72 ( date VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Crowd smaller than 4,485?
SELECT date FROM table_name_72 WHERE crowd < 4 OFFSET 485
sql_create_context
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 jybgb.SHSJ FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞...
css
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
(SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '33303356' AND jybgb.BGRQ BETWEEN '2011-04-24' AND '2015-10-06') UNI...
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_29 ( score VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score of the game against Lenka Novotn ?
SELECT score FROM table_name_29 WHERE opponent_in_the_final = "lenka novotná"
sql_create_context
CREATE TABLE d_icd_procedures ( 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 admissions ( row_id numbe...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2514) AND STRFTIME('%y', procedures_icd.charttime) >= '2103' ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE table_name_97 ( opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent at the game with Attendance of 68,436?
SELECT opponent FROM table_name_97 WHERE attendance = "68,436"
sql_create_context
CREATE TABLE table_11621915_1 ( date VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the date with tournament value of ford senior players championship
SELECT date FROM table_11621915_1 WHERE tournament = "Ford Senior Players Championship"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_c...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
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_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '24030773' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
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 jybgb ( BBCJBW text, BBDM tex...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '61753289782'
css
CREATE TABLE table_62186 ( "Name" text, "Championship" real, "League Cup" real, "FA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest league up with less than 3 championships, a total less than 2, and a FA cup lar...
SELECT MAX("League Cup") FROM table_62186 WHERE "Championship" < '3' AND "Total" < '2' AND "FA Cup" > '0'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ex cereb meningeal les') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_5050 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the result 106-105?
SELECT "Date" FROM table_5050 WHERE "Result" = '106-105'
wikisql
CREATE TABLE departments ( department_id number, dept_store_id number, department_name text ) CREATE TABLE customers ( customer_id number, payment_method_code text, customer_code text, customer_name text, customer_address text, customer_phone text, customer_email text ) CREATE ...
SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code <> "Credit Card"
spider
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27591) AND STRFTIME('%y', cost.chargetime) <= '2102'
mimic_iii
CREATE TABLE table_52806 ( "Year" text, "2010" real, "2009" real, "2008" real, "2005" real, "2000" real, "1995" real, "1990" real, "1985" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest 2000 GDP when the 2008 GDP i...
SELECT MAX("2000") FROM table_52806 WHERE "2008" < '3,632' AND "2010" = '2,558' AND "2009" > '2,239'
wikisql
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 treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL)) ORDER BY ...
eicu
CREATE TABLE table_14757 ( "Series" text, "Name" text, "Hometown" text, "Occupation" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Hasan Shah's hometown?
SELECT "Hometown" FROM table_14757 WHERE "Name" = 'hasan shah'
wikisql
CREATE TABLE table_204_418 ( id number, "date" text, "opponent" text, "score" text, "overall record" text, "scba record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- on how many dates was the sum of the scores at most 10 ?
SELECT COUNT("date") FROM table_204_418 WHERE "score" + "score" <= 10
squall
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM 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 te...
SELECT zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '54549955809'
css
CREATE TABLE table_75602 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Frequency MHz smaller than 95.3, and a Call sign of k234ag is what c...
SELECT "Class" FROM table_75602 WHERE "Frequency MHz" < '95.3' AND "Call sign" = 'k234ag'
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 demographic.admission_type, demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_26847237_1 ( win_loss VARCHAR, round__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Was it a win or loss for Wanganui in round 3?
SELECT win_loss FROM table_26847237_1 WHERE round__number = "Round 3"
sql_create_context
CREATE TABLE table_203_43 ( id number, "polling firm" text, "month" text, "link" text, "favor" number, "oppose" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many zogby international polls took place in the month of august ?
SELECT COUNT("polling firm") FROM table_203_43 WHERE "polling firm" = 'zogby international' AND "month" = 8
squall
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 text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT (SELECT COUNT(*) 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 = '13034482' AND mzjzjlb.JZKSRQ BETWEEN '2003-04-25' AND '2009-02-02') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_...
css
CREATE TABLE table_33414 ( "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. -- Who was the home team when the away team scored ...
SELECT "Home team score" FROM table_33414 WHERE "Away team score" = '5.9 (39)'
wikisql
CREATE TABLE table_62689 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Partner in the Algiers 2, Algeria Tournament?
SELECT "Partner" FROM table_62689 WHERE "Tournament" = 'algiers 2, algeria'
wikisql
CREATE TABLE table_49747 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nationality of the Aracataca Ship?
SELECT "Nationality" FROM table_49747 WHERE "Ship" = 'aracataca'
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '华嘉淑' AND t_kc22.STA_DATE BETWEEN '2005-12-06' AND '2015-09-07' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22....
css
CREATE TABLE table_80454 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has an attendance greater than 29,904 and 11-8 as the record?
SELECT "Opponent" FROM table_80454 WHERE "Attendance" > '29,904' AND "Record" = '11-8'
wikisql
CREATE TABLE table_20342 ( "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. -- WHO DI...
SELECT "Team" FROM table_20342 WHERE "Date" = 'January 9'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_203_295 ( id number, "position" number, "driver / passenger" text, "equipment" text, "points" number, "wins" number, "second" number, "third" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the number of points daniel...
SELECT "points" FROM table_203_295 WHERE "driver / passenger" = 'daniel willemsen'
squall
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) -- U...
SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY COUNT(*)
nvbench
CREATE TABLE table_10694 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the lowest Laps for time/retired of engine and driver of charles de tornaco
SELECT MIN("Laps") FROM table_10694 WHERE "Time/Retired" = 'engine' AND "Driver" = 'charles de tornaco'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "2184"
mimicsql_data
CREATE TABLE table_32732 ( "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 score for Hawthorn as an away team?
SELECT "Away team score" FROM table_32732 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_21025437_5 ( viewers__millions_ VARCHAR, episode_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many million viewers watched episode number 20?
SELECT viewers__millions_ FROM table_21025437_5 WHERE episode_no = 20
sql_create_context
CREATE TABLE table_73337 ( "Chapter" text, "Installation Date" text, "Institution" text, "Location" text, "Inactive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the installation date in El Paso, Texas?
SELECT "Installation Date" FROM table_73337 WHERE "Location" = 'El Paso, Texas'
wikisql
CREATE TABLE table_29747178_2 ( title VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title when the series # is 7?
SELECT title FROM table_29747178_2 WHERE series__number = 7
sql_create_context
CREATE TABLE table_10935205_1 ( canadian_airdate VARCHAR, us_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The U.S. airdate of 8 august 2008 also had canadian airdates of what?
SELECT canadian_airdate FROM table_10935205_1 WHERE us_airdate = "8 August 2008"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pain' AND STRFT...
eicu
CREATE TABLE table_40074 ( "Ring name" text, "Current rank" text, "Debut" text, "Stable" text, "Birthplace" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Current Rank, when Ring Name is Tamaasuka Daisuke?
SELECT "Current rank" FROM table_40074 WHERE "Ring name" = 'tamaasuka daisuke'
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 WHERE demographic.admityear < "2138" AND procedures.icd9_code = "966"
mimicsql_data
CREATE TABLE table_67806 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Attendance that has the Date of april 12?
SELECT "Attendance" FROM table_67806 WHERE "Date" = 'april 12'
wikisql
CREATE TABLE table_30482 ( "Parent unit" text, "Geschwader Base" text, "Unit (Gruppe/Staffel)" text, "Aircraft Type" text, "Commanding Officer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the aircraft type for jagdgeschwader 6
SELECT "Aircraft Type" FROM table_30482 WHERE "Parent unit" = 'Jagdgeschwader 6'
wikisql
CREATE TABLE table_name_16 ( inclination VARCHAR, semimajor_axis___au__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What inclination has a semimajor axis of 20 au?
SELECT inclination FROM table_name_16 WHERE semimajor_axis___au__ = "20 au"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 o...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'special symptom nec/nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16571) AND DATETIME(diagnoses...
mimic_iii
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 prescriptions ( subject_id text, hadm_id...
SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell"
mimicsql_data
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.short_title = "Crn ath atlg vn bps grft" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_51665 ( "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 number of laps for Grid 14?
SELECT COUNT("Laps") FROM table_51665 WHERE "Grid" = '14'
wikisql
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.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '81389511365'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.route = "NG"
mimicsql_data
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 ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID
nvbench
CREATE TABLE table_name_44 ( split_off___continuation_of VARCHAR, church_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Independent Church's Split off/ Continuation?
SELECT split_off___continuation_of FROM table_name_44 WHERE church_name = "independent church"
sql_create_context
CREATE TABLE table_56976 ( "Rank" real, "Name" text, "Nation" text, "SP+FS" real, "Points" real, "Placings" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average points value for a rank less than 12 for David Santee?
SELECT AVG("Points") FROM table_56976 WHERE "Rank" < '12' AND "Name" = 'david santee'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') ORDER BY labevents.chartt...
mimic_iii
CREATE TABLE table_30969 ( "Episode" real, "Broadcast date" text, "Guest(s)" text, "Singer(s)" text, "Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which episode did sarah millican and grayson perry appear in
SELECT MIN("Episode") FROM table_30969 WHERE "Guest(s)" = 'Sarah Millican and Grayson Perry'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT mzjzjlb.JZJSSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '44952998423'
css
CREATE TABLE table_1712 ( "Episode #" real, "US air date" text, "Rating" text, "Share" text, "Rating/Share (18\u201349)" text, "Viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rating/share values does the episode aire...
SELECT COUNT("Rating/Share (18\u201349)") FROM table_1712 WHERE "US air date" = 'Saturday, May 9, 2009'
wikisql
CREATE TABLE table_name_58 ( city VARCHAR, state VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city in Texas hosts the Frank Erwin center?
SELECT city FROM table_name_58 WHERE state = "texas" AND venue = "frank erwin center"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "42067"
mimicsql_data
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.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.short_title = "Open sigmoidectomy NEC"
mimicsql_data
CREATE TABLE table_57691 ( "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 scoreof the away team Collingwood?
SELECT "Away team score" FROM table_57691 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE table_name_68 ( total VARCHAR, nation VARCHAR, rank VARCHAR, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Total, when Gold is less than 1, when Silver is greater than 0, when Rank is...
SELECT COUNT(total) FROM table_name_68 WHERE gold < 1 AND silver > 0 AND rank = "14" AND nation = "afghanistan"
sql_create_context