instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_14220 ( "Rank" real, "Heat" real, "Athlete" text, "Country" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest time for athlete torri edwards, and a rank larger than 6?
SELECT MAX("Time") FROM table_14220 WHERE "Athlete" = 'torri edwards' AND "Rank" > '6'
wikisql
CREATE TABLE table_name_43 ( total VARCHAR, bronze VARCHAR, silver VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If there are more than 0 Silver medals, less than 5 gold medals, and no bronze medals, what was the total number of medals...
SELECT COUNT(total) FROM table_name_43 WHERE silver > 0 AND gold < 5 AND bronze < 0
sql_create_context
CREATE TABLE table_29502 ( "Number" real, "Player" text, "Position" text, "Seasons by team" text, "Year of induction into Pro Football Hall of Fame" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest amount of Pro Bowl appearances any...
SELECT MIN("Number") FROM table_29502
wikisql
CREATE TABLE parties ( party_email VARCHAR, party_id VARCHAR ) CREATE TABLE party_services ( customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the email of the party that has used the services the most number of times?
SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_37623 ( "Type" text, "Owns" text, "Length" text, "Delivery Date" text, "Gross Tonnage" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with delivery date of 2001 2001 what is the owns?
SELECT "Owns" FROM table_37623 WHERE "Delivery Date" = '2001 2001'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
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 = '030-44598') AND patient.unitdischargetime IS NULL...
eicu
CREATE TABLE table_12146 ( "Seat" real, "Series 1" text, "Series 3" text, "Series 4" text, "Series 5" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series 3 with gavin duffy in series 5?
SELECT "Series 3" FROM table_12146 WHERE "Series 5" = 'gavin duffy'
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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郑阳荣' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-09-03' AND '2010-03-27' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '郑阳荣' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2009-09-0...
css
CREATE TABLE table_name_13 ( score VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the 2014 FIFA World Cup Qual. competition?
SELECT score FROM table_name_13 WHERE competition = "2014 fifa world cup qual."
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css
CREATE TABLE table_11640 ( "Route Name" text, "Direction" text, "Termini" text, "Junctions" text, "Length" text, "Population Area" text, "Remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length of the highway with remarks ...
SELECT "Length" FROM table_11640 WHERE "Remarks" = 'replaced by bsi-35'
wikisql
CREATE TABLE table_22827 ( "DMA" real, "Market" text, "Station" text, "Frequency" text, "Branding" text, "Format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which frequency is station wlfv-fm?
SELECT "Frequency" FROM table_22827 WHERE "Station" = 'WLFV-FM'
wikisql
CREATE TABLE table_name_51 ( laps INTEGER, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the average Laps for grid of 6
SELECT AVG(laps) FROM table_name_51 WHERE grid = 6
sql_create_context
CREATE TABLE table_54313 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the location for win with record of 8-5
SELECT "Location" FROM table_54313 WHERE "Res." = 'win' AND "Record" = '8-5'
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25461) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TI...
mimic_iii
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, ha...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'albuterol inhaler' AND DATETIME(prescriptions.startdate) >= DATET...
mimic_iii
CREATE TABLE table_name_61 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game with 40,005 in attendance?
SELECT date FROM table_name_61 WHERE attendance = "40,005"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Thomas Nazario"
mimicsql_data
CREATE TABLE table_1571238_2 ( fourth_place INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the team is lake superior state how many times did they place fourth?
SELECT MIN(fourth_place) FROM table_1571238_2 WHERE team = "Lake Superior State"
sql_create_context
CREATE TABLE table_22822559_8 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the Piston's record at 23-47?
SELECT date FROM table_22822559_8 WHERE record = "23-47"
sql_create_context
CREATE TABLE table_68582 ( "Frequency" real, "Callsign" text, "Brand" text, "Format" text, "City of License" text, "Website" text, "Webcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the webcast for website of and frequency of 103....
SELECT "Webcast" FROM table_68582 WHERE "Website" = '•' AND "Frequency" = '103.3'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83709) AND prescriptions.drug = 'levetiracetam' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-66 month') ORDER BY prescriptions.startdate DESC...
mimic_iii
CREATE TABLE table_82 ( "Particulars and Characteristics" text, "Shivalik Zone" text, "Mid-Hill Zone" text, "High hill zone" text, "Trance- n Himalaya Zone" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the climatic conditions for the tran...
SELECT "Trance- n Himalaya Zone" FROM table_82 WHERE "Particulars and Characteristics" = 'Climatic conditions'
wikisql
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 Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY Affiliation DESC
nvbench
CREATE TABLE table_name_93 ( surface VARCHAR, partner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which surface had a partner of Sandrine Testud on November 14, 1999?
SELECT surface FROM table_name_93 WHERE partner = "sandrine testud" AND date = "november 14, 1999"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab.label = "Osmolality, Measured"
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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2174.0" AND procedures.long_title = "Infusion of vasopressor agent"
mimicsql_data
CREATE TABLE table_39474 ( "Name" text, "Type" text, "Year Built" real, "Where Built" text, "Initial Owners" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the type of boat built in Port Blakeley
SELECT "Type" FROM table_39474 WHERE "Where Built" = 'port blakeley'
wikisql
CREATE TABLE table_name_8 ( accolade VARCHAR, country VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Accolade, when Country is 'United States', and when Year is '1999'?
SELECT accolade FROM table_name_8 WHERE country = "united states" AND year = 1999
sql_create_context
CREATE TABLE table_name_70 ( position VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the race with a point of test driver?
SELECT position FROM table_name_70 WHERE points = "test driver"
sql_create_context
CREATE TABLE document_sections_images ( section_id VARCHAR ) CREATE TABLE documents ( document_name VARCHAR ) CREATE TABLE document_sections ( document_code VARCHAR, section_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find names of the docume...
SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS AN...
atis
CREATE TABLE table_name_88 ( natural_change VARCHAR, crude_death_rate__per_1000_ VARCHAR, deaths VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Natural change has a Crude death rate (per 1000) larger than 9, and Deaths of 40 399?
SELECT natural_change FROM table_name_88 WHERE crude_death_rate__per_1000_ > 9 AND deaths = "40 399"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId numb...
SELECT t.TagName AS TAG, SUM(q.Score) * 5 + SUM(a.Score) * 10 AS TOTAL_REPUTATION FROM Tags AS t JOIN PostTags AS pt ON t.Id = pt.TagId JOIN Posts AS q ON pt.PostId = q.Id JOIN Posts AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 GROUP BY t.TagName ORDER BY TOTAL_REPUTATION DESC
sede
CREATE TABLE table_name_37 ( record VARCHAR, opponent VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record with opponent of bos and loss of morris
SELECT record FROM table_name_37 WHERE opponent = "bos" AND loss = "morris"
sql_create_context
CREATE TABLE table_19615 ( "Stage (Winner)" text, "General Classification" text, "Mountains Classification" text, "Points Classification" text, "Young rider classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Points Classification" FROM table_19615 WHERE "General Classification" = 'Mark Renshaw' AND "Team Classification" = 'Team CSC'
wikisql
CREATE TABLE table_name_94 ( laps INTEGER, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the laps for qual of 144.665
SELECT SUM(laps) FROM table_name_94 WHERE qual = "144.665"
sql_create_context
CREATE TABLE table_53742 ( "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. -- Which away team played at Kardinia Park?
SELECT "Away team" FROM table_53742 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-35481')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '彭哲茂' AND t_kc22.STA_DATE BETWEEN '2014-06-18' AND '2014-12-24' AND t_kc22.SOC_SRT_DIRE_NM = '氟哌噻吨美利曲辛片'
css
CREATE TABLE table_60134 ( "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Year of the Player with a Weight of 230 or less from San Antonio, Texas?
SELECT "Year" FROM table_60134 WHERE "Weight" < '230' AND "Home Town" = 'san antonio, texas'
wikisql
CREATE TABLE table_48027 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Country is 'United States', and when Player is 'John Mahaffey'?
SELECT "Score" FROM table_48027 WHERE "Country" = 'united states' AND "Player" = 'john mahaffey'
wikisql
CREATE TABLE table_27255 ( "Rank" real, "WS Points" real, "Name" text, "Country" text, "09-10 I/O best" real, "09-10 GP/JGP best" real, "09-10 GP/JGP 2nd" real, "09-10 OI best" real, "09-10 OI 2nd" real, "08-09 I/O best" real, "08-09 GP/JGP best" real, "08-09 GP/JGP 2nd" ...
SELECT "08-09 GP/JGP 2nd" FROM table_27255 WHERE "WS Points" = '947'
wikisql
CREATE TABLE table_21501565_1 ( original_artist VARCHAR, order__number VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With order number 7 and the theme is Motown, who were the original artists?
SELECT original_artist FROM table_21501565_1 WHERE order__number = "7" AND theme = "Motown"
sql_create_context
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 Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType DESC
nvbench
CREATE TABLE table_name_18 ( torque VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What torque does daewoo have?
SELECT torque FROM table_name_18 WHERE type = "daewoo"
sql_create_context
CREATE TABLE invoices ( invoice_id number, order_id number, payment_method_code text, product_id number, order_quantity text, other_item_details text, order_item_id number ) CREATE TABLE stores ( store_id text, address_id number, marketing_region_code text, store_name text, ...
SELECT COUNT(DISTINCT currency_code) FROM drama_workshop_groups
spider
CREATE TABLE table_24162 ( "University" text, "Nick" text, "University status" real, "Founded" real, "Location" text, "Division" text, "Specialization" text, "Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is every locatio...
SELECT "Location" FROM table_24162 WHERE "Nick" = 'BRU'
wikisql
CREATE TABLE table_65719 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the speed with a time of 1:03.41.86 and a rank smaller than 3?
SELECT "Speed" FROM table_65719 WHERE "Rank" < '3' AND "Time" = '1:03.41.86'
wikisql
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_...
css
CREATE TABLE table_name_60 ( game VARCHAR, team VARCHAR, début VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the game whose team is Waterford and debuted later than 1995?
SELECT game FROM table_name_60 WHERE team = "waterford" AND début > 1995
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age >= "41"
mimicsql_data
CREATE TABLE table_dev_29 ( "id" int, "gender" string, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "creatinine_clearance_cl" float, "post_load_glucose" int, "platelet_count" float, "fasting_plasma_glucos...
SELECT * FROM table_dev_29 WHERE white_blood_cell_count_wbc < 3000 AND platelet_count < 100000 AND baseline_hemoglobin_hgb < 10
criteria2sql
CREATE TABLE table_name_8 ( attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what game had a score of 86-71
SELECT attendance FROM table_name_8 WHERE record = "86-71"
sql_create_context
CREATE TABLE table_name_96 ( release_date VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release in Germany?
SELECT release_date FROM table_name_96 WHERE location = "germany"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
SELECT Posts.OwnerUserId AS "user_link", COUNT(*) AS Count FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId = 3 AND Posts.OwnerUserId > 0 GROUP BY Posts.OwnerUserId ORDER BY Count DESC, Posts.OwnerUserId LIMIT 100
sede
CREATE TABLE table_64507 ( "Year" real, "Title" text, "Hangul / Japanese" text, "Role" text, "Network" text, "Genre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Hangul/Japanese that happened before 2014 having a role of Baek Seung-...
SELECT "Hangul / Japanese" FROM table_64507 WHERE "Year" < '2014' AND "Role" = 'baek seung-jo'
wikisql
CREATE TABLE table_52398 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me constructor for Laps less than 17 and Grid more than 11 for alan jones
SELECT "Constructor" FROM table_52398 WHERE "Laps" < '17' AND "Grid" > '11' AND "Driver" = 'alan jones'
wikisql
CREATE TABLE table_train_101 ( "id" int, "systolic_blood_pressure_sbp" int, "uncontrolled_diabetes" bool, "hemoglobin_a1c_hba1c" float, "allergy_to_contrast_agent_gadolinium" bool, "diastolic_blood_pressure_dbp" int, "hypotension" bool, "hypertension" bool, "NOUSE" float ) -- Using...
SELECT * FROM table_train_101 WHERE (hypertension = 1 OR (systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 95)) OR (hypotension = 1 OR (systolic_blood_pressure_sbp < 90 OR diastolic_blood_pressure_dbp < 60))
criteria2sql
CREATE TABLE table_78039 ( "Full Name" text, "Nickname" text, "Gender" text, "Weight at birth" text, "Meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nickname of the boy who weighed 810g (26.0 oz.) at birth?
SELECT "Nickname" FROM table_78039 WHERE "Gender" = 'boy' AND "Weight at birth" = '810g (26.0 oz.)'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Neutropenia NOS" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_59 ( attendance VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance when the Result is l0-13?
SELECT attendance FROM table_name_59 WHERE result = "l0-13"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party_host ( party_id number, host_id number, is_main_in_charge others ) CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, ...
SELECT location FROM party ORDER BY number_of_hosts DESC LIMIT 1
spider
CREATE TABLE table_15611 ( "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real, "Current Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Founded for ...
SELECT AVG("Founded") FROM table_15611 WHERE "Location" = 'chicopee, massachusetts'
wikisql
CREATE TABLE table_name_61 ( venue VARCHAR, score VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue of the match where the score was 1:3 and team 2 was binh duong?
SELECT venue FROM table_name_61 WHERE score = "1:3" AND team_2 = "binh duong"
sql_create_context
CREATE TABLE table_36768 ( "Rank" real, "Airport" text, "Code (IATA/ICAO)" text, "Total Cargo (Metric Tonnes)" real, "% Change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank is the average one that has a % Change of 0.7%, and a Total Car...
SELECT AVG("Rank") FROM table_36768 WHERE "% Change" = '0.7%' AND "Total Cargo (Metric Tonnes)" < '1,556,203'
wikisql
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARC...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY Fname DESC
nvbench
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id...
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 = 26469 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.ite...
mimic_iii
CREATE TABLE table_name_49 ( position_in_table VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How was Sammy Lee's team doing on the table before being replaced?
SELECT position_in_table FROM table_name_49 WHERE outgoing_manager = "sammy lee"
sql_create_context
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TA...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week DESC
nvbench
CREATE TABLE table_19030 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the mens doubles with year being 1978
SELECT "Mens doubles" FROM table_19030 WHERE "Year" = '1978'
wikisql
CREATE TABLE table_64290 ( "Title" text, "Series" text, "Director" text, "Production Number" text, "Release date" text, "reissue?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- From what series is Peck Up Your Troubles?
SELECT "Series" FROM table_64290 WHERE "Title" = 'peck up your troubles'
wikisql
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Name, Age FROM artist ORDER BY Name
nvbench
CREATE TABLE table_2226817_6 ( no_in_series INTEGER, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What' the series number of the episode with season number 13?
SELECT MIN(no_in_series) FROM table_2226817_6 WHERE no_in_season = 13
sql_create_context
CREATE TABLE table_name_56 ( played VARCHAR, try_bonus VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For Pontyberem RFC that has a Try Bonus of 2, what is the played?
SELECT played FROM table_name_56 WHERE try_bonus = "2" AND club = "pontyberem rfc"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "COMPLETE HEART BLOCK"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '72531455' AND zzmzjzjlb.JZKSRQ BETWEEN '2000-01-22' AND '2008-11-08' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '72531455' AND fzzmzjzjlb.JZKSRQ BETWEEN '2000-01-22' AND '2008-11-08'
css
CREATE TABLE table_16984 ( "Series #" real, "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. -- What is the number of series with pr...
SELECT COUNT("Series #") FROM table_16984 WHERE "Production code" = '503'
wikisql
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 Name, AVG(Price) FROM Products GROUP BY Name
nvbench
CREATE TABLE table_63134 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score 1 with a h ground?
SELECT "Score1" FROM table_63134 WHERE "Ground" = 'h'
wikisql
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 jybgb.KSBM, jybgb.KSMC FROM jybgb WHERE jybgb.BGDH = '55858343244'
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "4"
mimicsql_data
CREATE TABLE table_19179465_1 ( bp VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the B.P. of club Halifax?
SELECT bp FROM table_19179465_1 WHERE club = "Halifax"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'INTLSTD' AND number = 486
advising
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE...
SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.facid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_16636344_1 ( league VARCHAR, regular_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the league name for the regular season status of 2nd, mid atlantic?
SELECT league FROM table_16636344_1 WHERE regular_season = "2nd, Mid Atlantic"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight ( aircraft_code_sequence text, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN...
atis
CREATE TABLE table_41708 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team 2 had a Team 1 of montreal impact?
SELECT "Team 2" FROM table_41708 WHERE "Team 1" = 'montreal impact'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
WITH UsersSample AS (SELECT u.Id FROM Users AS u) SELECT p.PostTypeId, p.OwnerUserId, p.OwnerUserId AS "user_link", COUNT(*) AS n FROM Posts AS p RIGHT OUTER JOIN UsersSample AS u ON u.Id = p.OwnerUserId WHERE p.OwnerUserId > 0 GROUP BY p.OwnerUserId, p.PostTypeId ORDER BY p.OwnerUserId, p.PostTypeId
sede
CREATE TABLE table_30260 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What pick number was the player that was picked by Edmonton?
SELECT "Pick #" FROM table_30260 WHERE "CFL Team" = 'Edmonton'
wikisql
CREATE TABLE table_10006 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Points" real, "Wins" text, "Second" text, "Third" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average position for a driver with less th...
SELECT AVG("Position") FROM table_10006 WHERE "Points" < '54' AND "Equipment" = 'husaberg-bsu'
wikisql
CREATE TABLE table_37194 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text, "Customer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of a location in Nigeria?
SELECT "Name" FROM table_37194 WHERE "Location" = 'nigeria'
wikisql
CREATE TABLE train ( Name VARCHAR, Arrival VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names and arrival times of trains?
SELECT Name, Arrival FROM train
sql_create_context
CREATE TABLE table_name_41 ( games_covered VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Games covered had a round of divisional finals?
SELECT games_covered FROM table_name_41 WHERE round = "divisional finals"
sql_create_context
CREATE TABLE table_63322 ( "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's the score of Tie number 11?
SELECT "Score" FROM table_63322 WHERE "Tie no" = '11'
wikisql
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_72 ( formula VARCHAR, prefix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Formula has a Prefix of alkyl-?
SELECT formula FROM table_name_72 WHERE prefix = "alkyl-"
sql_create_context
CREATE TABLE table_dev_29 ( "id" int, "gender" string, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "creatinine_clearance_cl" float, "post_load_glucose" int, "platelet_count" float, "fasting_plasma_glucos...
SELECT * FROM table_dev_29 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female')
criteria2sql