instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_3744 ( "Version" text, "Codename" text, "Edition" text, "Code Base" text, "Compatible repository" text, "Default desktop environment" text, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the the code...
SELECT "Codename" FROM table_3744 WHERE "Code Base" = 'Ubuntu 8.04' AND "Edition" = 'Fluxbox CE'
wikisql
CREATE TABLE table_340 ( "Dep." text, "Chief town" text, "Arrondissement" text, "Population (1999)" text, "Area (Square km)" real, "Pop density" real, "Cantons" real, "Communes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many com...
SELECT MIN("Communes") FROM table_340 WHERE "Arrondissement" = 'Cosne-Cours-sur-Loire'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id ...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction
nvbench
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE course ( course_id va...
SELECT title, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title
nvbench
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.days_stay > "6" AND procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified"
mimicsql_data
CREATE TABLE table_54872 ( "Party" text, "Results 2004" text, "Ifop 11/12/08" text, "Ifop 1/9/09" text, "Ipsos 3/14/09" text, "CSA 4/16/09" text, "OpinionWay 4/17/09" text, "Ifop 4/24/09" text, "Ipsos 5/2/09" text, "Ifop 5/11/09" text, "OpinionWay 5/11/09" text ) -- Using v...
SELECT "CSA 4/16/09" FROM table_54872 WHERE "OpinionWay 4/17/09" = '12%'
wikisql
CREATE TABLE table_name_5 ( year_s__won VARCHAR, to_par VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year (s) won was +2 the To par, and t22 the finish?
SELECT year_s__won FROM table_name_5 WHERE to_par = "+2" AND finish = "t22"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "5% Dextrose"
mimicsql_data
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.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '48319787' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3818.79)
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Chlorothiazide"
mimicsql_data
CREATE TABLE writes ( aid int, pid int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE cite ( cited int, citing int ) CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE domain ( did int, ...
SELECT COUNT(DISTINCT (publication.title)), publication.year FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid GROUP BY publication.year
academic
CREATE TABLE table_42961 ( "Year" real, "Result" real, "World Rank" text, "Location" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest Year with a World Rank of 5th, with a Result greater than 20.31?
SELECT MIN("Year") FROM table_42961 WHERE "World Rank" = '5th' AND "Result" > '20.31'
wikisql
CREATE TABLE table_49208 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "High points" FROM table_49208 WHERE "Game" = '3'
wikisql
CREATE TABLE table_name_70 ( date VARCHAR, year VARCHAR, location VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Location is Polo Grounds, when Winner is Philadelphia Eagles, and when Year is 1948?
SELECT date FROM table_name_70 WHERE location = "polo grounds" AND winner = "philadelphia eagles" AND year = 1948
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-9767')) AND vitalperiodic.heartrate > 116.0 AND NOT vitalperiodi...
eicu
CREATE TABLE table_19856 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Combination classification" text, "Team classification" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT("Stage") FROM table_19856 WHERE "Winner" = 'Jose Vicente Garcia Acosta'
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND diagnoses.long_title = "Hypotension of hemodialysis"
mimicsql_data
CREATE TABLE table_name_91 ( country VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country that placed 4?
SELECT country FROM table_name_91 WHERE place = "4"
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_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID DESC
nvbench
CREATE TABLE table_17131 ( "Series #" real, "Season #" real, "Title" text, "Director(s)" text, "Writer(s)" text, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many series has the title 'interior loft'?
SELECT COUNT("Series #") FROM table_17131 WHERE "Title" = 'Interior Loft'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2198" AND prescriptions.drug = "Risperidone Oral Solution"
mimicsql_data
CREATE TABLE table_20140132_1 ( head_coach VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the head coach of the team who's venue is Lokomotiv?
SELECT head_coach FROM table_20140132_1 WHERE venue = "Lokomotiv"
sql_create_context
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 zyjzjlb WHERE zyjzjlb.YLJGDM = '5099708' AND zyjzjlb.JZKSMC = '胸部肿瘤科' AND zyjzjlb.RYDJSJ BETWEEN '2009-01-05' AND '2020-10-20'
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6226694' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-07-25' AND '2019-11-30' AND t_kc21.INSU_TYPE = '儿童'
css
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), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '7987100' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-09-21' AND '2015-12-28'
css
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 SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '范清宁' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2018-09-12' AND '2019-07-01'
css
CREATE TABLE checking ( balance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the average checking balance.
SELECT AVG(balance) FROM checking
sql_create_context
CREATE TABLE table_name_2 ( took_office INTEGER, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest date of taking office for district 22?
SELECT MIN(took_office) FROM table_name_2 WHERE district = 22
sql_create_context
CREATE TABLE table_name_26 ( english VARCHAR, german VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which English has German of leben?
SELECT english FROM table_name_26 WHERE german = "leben"
sql_create_context
CREATE TABLE table_name_25 ( december INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average day in December of the game with a 8-2-3 record?
SELECT AVG(december) FROM table_name_25 WHERE record = "8-2-3"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, had...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '...
mimic_iii
CREATE TABLE table_31402 ( "Rank" real, "Country/Territory" text, "Miss International" real, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "Semifinalists" real, "Total" real ) -- Using valid SQLite, answer the following questions for the ta...
SELECT MIN("1st Runner-up") FROM table_31402
wikisql
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt/left heart card cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56635 AND N...
mimic_iii
CREATE TABLE table_26541 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed 'Torn Between...
SELECT "Directed by" FROM table_26541 WHERE "Title" = 'Torn Between Two Lovers'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
mimicsql_data
CREATE TABLE table_name_86 ( ethernet_ports VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ethernet ports of the u150 appliance?
SELECT ethernet_ports FROM table_name_86 WHERE name = "u150"
sql_create_context
CREATE TABLE table_204_918 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in attendance between the...
SELECT ABS((SELECT "attendance" FROM table_204_918 WHERE "date" = 9 ORDER BY "date" LIMIT 1) - (SELECT "attendance" FROM table_204_918 WHERE "date" = 1 ORDER BY "date" DESC LIMIT 1))
squall
CREATE TABLE table_24600706_1 ( released INTEGER, song VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most released for right here, right now
SELECT MAX(released) FROM table_24600706_1 WHERE song = "Right Here, Right Now"
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '15314573' AND t_kc22.STA_DATE BETWEEN '2004-04-10' AND '2021-08-16' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_76168 ( "Year" text, "Winner" text, "Points" real, "Playoff result" text, "Win #" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Playoff Result, when Winner is 'Alaska Aces', when Win # is greater than 1, when Points is le...
SELECT "Playoff result" FROM table_76168 WHERE "Winner" = 'alaska aces' AND "Win #" > '1' AND "Points" < '106' AND "Year" = '2011-12'
wikisql
CREATE TABLE table_name_79 ( touchdowns INTEGER, receptions VARCHAR, games_started VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With games started smaller than 16 plus receptions of 51, what is the smallest amount of touchdowns listed?
SELECT MIN(touchdowns) FROM table_name_79 WHERE receptions = 51 AND games_started < 16
sql_create_context
CREATE TABLE table_name_80 ( result VARCHAR, score VARCHAR, couple VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for Steve & Anna when the score was 21 (7, 7, 7)?
SELECT result FROM table_name_80 WHERE score = "21 (7, 7, 7)" AND couple = "steve & anna"
sql_create_context
CREATE TABLE table_name_37 ( bronze INTEGER, total VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronzes were held by those with a total of 4 and less than 3 silvers.
SELECT SUM(bronze) FROM table_name_37 WHERE total = 4 AND silver < 3
sql_create_context
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ...
css
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 ...
css
CREATE TABLE table_40042 ( "Chapter" real, "Chinese" text, "Pinyin" text, "English Translation" text, "Articles" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the lowest Chapter that has the Pinyin of dehua, and the Articles smaller...
SELECT MIN("Chapter") FROM table_40042 WHERE "Pinyin" = 'dehua' AND "Articles" < '16'
wikisql
CREATE TABLE table_21436373_12 ( stadium VARCHAR, type_of_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where was the total attendance-regular season record made
SELECT stadium FROM table_21436373_12 WHERE type_of_record = "Total attendance-Regular season"
sql_create_context
CREATE TABLE table_73333 ( "Administrative division" text, "Area (km\u00b2) 2005" text, "Population 2010 Census" real, "Population 2011 SIAK Database" text, "Population density (/km\u00b2 2010)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is...
SELECT "Population density (/km\u00b2 2010)" FROM table_73333 WHERE "Administrative division" = 'Bandung Regency'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABL...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d...
atis
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
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 = '66129206' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2016-07-31')
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "3799"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute renal failure' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOI...
eicu
CREATE TABLE table_203_817 ( id number, "state" text, "incumbent" text, "party" text, "result" text, "candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many states were listed as democratic ?
SELECT COUNT("state") FROM table_203_817 WHERE "party" = 'democratic'
squall
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM...
advising
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, SUM(Height) FROM people GROUP BY Sex
nvbench
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2180.0" AND prescriptions.drug = "Lidocaine"
mimicsql_data
CREATE TABLE Aircraft ( aid VARCHAR, name VARCHAR ) CREATE TABLE Flight ( flno VARCHAR, aid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all flight numbers with aircraft Airbus A340-300.
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
sql_create_context
CREATE TABLE table_32127 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest value for Wins when the number of cuts is greater than 4 and t...
SELECT MIN("Wins") FROM table_32127 WHERE "Cuts made" > '4' AND "Top-5" < '1'
wikisql
CREATE TABLE table_42758 ( "Sport" text, "Record" text, "Nation - athlete(s)" text, "Date" text, "Time (seconds)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date, when the Sport is luge - men's doubles, and when the Record is, 'start...
SELECT "Date" FROM table_42758 WHERE "Sport" = 'luge - men''s doubles' AND "Record" = 'start'
wikisql
CREATE TABLE table_204_158 ( id number, "official name" text, "designation" text, "area km2" number, "population" number, "parish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the only rural community on the list
SELECT "official name" FROM table_204_158 WHERE "designation" = 'rural community'
squall
CREATE TABLE table_12711 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what place is the golfer with a score of 68-69-73-70=280?
SELECT "Place" FROM table_12711 WHERE "Score" = '68-69-73-70=280'
wikisql
CREATE TABLE table_38760 ( "The Kennel Club (UK) Toy Group" text, "Canadian Kennel Club Toy Dogs Group" text, "American Kennel Club Toy Group" text, "Australian National Kennel Council Toy Dogs Group" text, "New Zealand Kennel Club Toy Group" text ) -- Using valid SQLite, answer the following ques...
SELECT "Australian National Kennel Council Toy Dogs Group" FROM table_38760 WHERE "The Kennel Club (UK) Toy Group" = 'papillon'
wikisql
CREATE TABLE table_55439 ( "Year" real, "Nominated work" text, "Event" text, "Award" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Herself nominated at the MTV Movie Awards?
SELECT MAX("Year") FROM table_55439 WHERE "Nominated work" = 'herself' AND "Event" = 'mtv movie awards'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(*) AS QuestionCount, t.TagId FROM Posts AS p JOIN PostTags AS t ON p.Id = t.PostId WHERE t.TagId = 1589 AND p.PostTypeId = 1 GROUP BY t.TagId
sede
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)
nvbench
CREATE TABLE table_49498 ( "Issued" real, "Type" text, "Design" text, "Serial format" text, "Serials issued" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type was issued in 1964?
SELECT "Type" FROM table_49498 WHERE "Issued" = '1964'
wikisql
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Title, COUNT(Title) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title
nvbench
CREATE TABLE table_18066 ( "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's the title of the episode directed by David von ...
SELECT "Title" FROM table_18066 WHERE "Directed by" = 'David Von Ancken' AND "No. in series" > '16.0'
wikisql
CREATE TABLE table_12161822_5 ( fastest_lap VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the fastest lap with grand prix being european grand prix
SELECT fastest_lap FROM table_12161822_5 WHERE grand_prix = "European grand_prix"
sql_create_context
CREATE TABLE table_name_34 ( country VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was ole ellefs ter from?
SELECT country FROM table_name_34 WHERE winner = "ole ellefsæter"
sql_create_context
CREATE TABLE table_34560 ( "Year" text, "Team" text, "Progress" text, "Score" text, "Opponents" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponents have a Team of arsenal, and a Year of 1963 64?
SELECT "Opponents" FROM table_34560 WHERE "Team" = 'arsenal' AND "Year" = '1963–64'
wikisql
CREATE TABLE table_204_104 ( id number, "title" text, "genre" text, "sub\u00addivisions" text, "libretto" text, "premiere date" text, "place, theatre" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many operas on this l...
SELECT COUNT("title") FROM table_204_104 WHERE "sub\u00addivisions" >= 3
squall
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 procedures.long_title, prescriptions.route FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "24425"
mimicsql_data
CREATE TABLE table_33903 ( "Denomination" text, "Metal" text, "Weight" text, "Shape" text, "Size" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What metal has one rupee as the denomination?
SELECT "Metal" FROM table_33903 WHERE "Denomination" = 'one rupee'
wikisql
CREATE TABLE table_26842217_8 ( date VARCHAR, site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the site is sanford stadium athens, ga, what is the date?
SELECT date FROM table_26842217_8 WHERE site = "Sanford Stadium • Athens, GA"
sql_create_context
CREATE TABLE table_name_6 ( total INTEGER, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Year(s) won of 1994 , 1997 has what average total?
SELECT AVG(total) FROM table_name_6 WHERE year_s__won = "1994 , 1997"
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.admission_type = "ELECTIVE" AND demographic.admityear < "2108"
mimicsql_data
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees ORDER BY LAST_NAME DESC
nvbench
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) -- Using valid SQLite, answer...
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY COUNT(Location)
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( 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.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "Psyllium Wafer"
mimicsql_data
CREATE TABLE table_3089 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the period total number if the name is Gerald o?
SELECT COUNT("Period") FROM table_3089 WHERE "Name" = 'Geraldão'
wikisql
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number )...
SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25
spider
CREATE TABLE table_name_55 ( stadium VARCHAR, final_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what stadium was the game with the final score of 9-23 played?
SELECT stadium FROM table_name_55 WHERE final_score = "9-23"
sql_create_context
CREATE TABLE Students ( personal_name VARCHAR ) CREATE TABLE Student_Course_Enrolment ( student_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the personal names of students not enrolled in any course.
SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id
sql_create_context
CREATE TABLE table_78096 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week was it on November 19, 1995?...
SELECT "Week" FROM table_78096 WHERE "Date" = 'november 19, 1995'
wikisql
CREATE TABLE table_70935 ( "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. -- On which team was Robbie Earle the captain?
SELECT "Team" FROM table_70935 WHERE "Captain" = 'robbie earle'
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 t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '62391480' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 7064.81)
css
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 (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9399745' AND IN_HOSP_DATE BETWEEN '2011-08-19' AND '2013-05-30') - (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9399745' AND IN_HOSP_DATE BETWEEN '2011-08-19' AND '2013-05-30' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD)
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATIO...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_22879262_13 ( team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where does the team play May 3?
SELECT team FROM table_22879262_13 WHERE date = "May 3"
sql_create_context
CREATE TABLE table_name_11 ( score VARCHAR, decision VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the record was 18 14 4 with a toivonen decision?
SELECT score FROM table_name_11 WHERE decision = "toivonen" AND record = "18–14–4"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '41538489' AND qtb.MED_SER_ORG_NO = '7012713' AND qtb.IN_DIAG_DIS_NM LIKE '%未%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '41538489' AND gyb.MED_SER_ORG_NO = '7012713' AND gyb.IN_DIAG_DIS_NM LIKE '%未%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WH...
css
CREATE TABLE table_39080 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Game larger than 7, and Points smaller than 14?
SELECT "Score" FROM table_39080 WHERE "Game" > '7' AND "Points" < '14'
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE < 28 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE < 28)
css
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( I...
SELECT u.Id AS "user_link", u.Reputation, COUNT(a.Score) AS TotalCount, SUM(a.Score) AS TotalScore FROM Users AS u INNER JOIN Posts AS a ON a.OwnerUserId = u.Id WHERE a.PostTypeId = 2 AND a.CommunityOwnedDate >= '20110101' GROUP BY u.Id, u.Reputation ORDER BY TotalCount DESC LIMIT 50
sede
CREATE TABLE table_name_94 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on October 13?
SELECT score FROM table_name_94 WHERE date = "october 13"
sql_create_context
CREATE TABLE table_name_84 ( title VARCHAR, published_in VARCHAR, main_characters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the title when the main characters are grant calthorpe, lee neilan and the published in of astounding stories
SELECT title FROM table_name_84 WHERE published_in = "astounding stories" AND main_characters = "grant calthorpe, lee neilan"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT PostId AS "post_link", Score, Text FROM Comments WHERE UserId = @UserId AND Score >= 5 ORDER BY Score DESC
sede
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-32860')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETI...
eicu