instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.long_title = "Diverticulitis of colon (without mention of hemorrhage)"
mimicsql_data
CREATE TABLE table_20799587_1 ( obama_number INTEGER, mccain_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people voted for Obama in the county where McCain got 72.75% of the votes?
SELECT MIN(obama_number) FROM table_20799587_1 WHERE mccain_percentage = "72.75%"
sql_create_context
CREATE TABLE table_204_503 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long was her was her champoinship and olympice career ?
SELECT MAX("year") - MIN("year") FROM table_204_503
squall
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( ...
SELECT COUNT(*) > 0 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 = 4401) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELEC...
mimic_iii
CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT name, location FROM track
spider
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
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 procedures.short_title FROM procedures WHERE procedures.subject_id = "21796"
mimicsql_data
CREATE TABLE table_41790 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Matches have a Rank smaller than 5, a Years of 1995 2003, and a Goals smaller than 104?
SELECT AVG("Matches") FROM table_41790 WHERE "Rank" < '5' AND "Years" = '1995–2003' AND "Goals" < '104'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9833) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-73 month')
mimic_iii
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3850390' AND gwyjzb.IN_DIAG_DIS_NM = '躁狂抑郁性精神病当前为抑郁相' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3850390' AND fgwyjzb...
css
CREATE TABLE table_name_98 ( format VARCHAR, code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the format of code pro-cd-4662?
SELECT format FROM table_name_98 WHERE code = "pro-cd-4662"
sql_create_context
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 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 = 31473) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_cv...
mimic_iii
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
nvbench
CREATE TABLE table_name_75 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team played the away team of Richmond?
SELECT home_team FROM table_name_75 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_22270 ( "Departure" text, "Going to" text, "Calling at" text, "Arrival" text, "Operator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the calling at for the 09.50 departure?
SELECT "Calling at" FROM table_22270 WHERE "Departure" = '09.50'
wikisql
CREATE TABLE table_name_82 ( performer_3 VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Episode of 9 in which performer 3 had?
SELECT performer_3 FROM table_name_82 WHERE episode = 9
sql_create_context
CREATE TABLE product_suppliers ( product_id VARCHAR, supplier_id VARCHAR ) CREATE TABLE products ( product_id VARCHAR, product_price INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Return ids of all the products that are supplied by supplier id 2 and...
SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM products)
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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, ...
SELECT jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '14839053409'
css
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 t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924') AND diagnosis.diagnos...
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
CREATE TABLE table_name_93 ( date VARCHAR, competition VARCHAR, venue VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the k-league cup, which has less than 28 goals, at the jeonju venue?
SELECT date FROM table_name_93 WHERE venue = "jeonju" AND goals < 28 AND competition = "k-league cup"
sql_create_context
CREATE TABLE table_name_86 ( latitude VARCHAR, year_named VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Latitude of the Alajen Vallis named after 1997?
SELECT latitude FROM table_name_86 WHERE year_named > 1997 AND name = "alajen vallis"
sql_create_context
CREATE TABLE table_name_79 ( grid INTEGER, driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average grid of driver Christian Vietoris who has less than 12 laps?
SELECT AVG(grid) FROM table_name_79 WHERE driver = "christian vietoris" AND laps < 12
sql_create_context
CREATE TABLE table_69036 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people went to the game that lasted 2:37 after game 2?
SELECT SUM("Attendance") FROM table_69036 WHERE "Game" > '2' AND "Time" = '2:37'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%mysore%' OR UPPER(Location) LIKE '%MYSORE%' OR Location LIKE '%mysore%' AND Reputation >= 1000 ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE table_name_96 ( release_price___usd__ VARCHAR, gpu_frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release price for the GPU frequency of standard power, embedded?
SELECT release_price___usd__ FROM table_name_96 WHERE gpu_frequency = "standard power, embedded"
sql_create_context
CREATE TABLE table_10706879_3 ( winning_driver VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winning drivers in the kraco twin 125 (r2) race were there?
SELECT COUNT(winning_driver) FROM table_10706879_3 WHERE name = "Kraco Twin 125 (R2)"
sql_create_context
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Pr...
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry DESC
nvbench
CREATE TABLE table_23003 ( "House name" text, "House mascot" text, "House colour" text, "Year opened" real, "House leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many house colours are associated with house names of Hillary?
SELECT COUNT("House colour") FROM table_23003 WHERE "House name" = 'Hillary'
wikisql
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 prescriptions ( subject_id text, hadm_id...
SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "24425"
mimicsql_data
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 d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DE...
mimic_iii
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3979463' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 18
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 t_kc24.CLINIC_ID FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '82392960392'
css
CREATE TABLE table_60098 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the match in round 1r against tunisia and on...
SELECT "Result" FROM table_60098 WHERE "Round" = '1r' AND "Surface" = 'hard' AND "Against" = 'tunisia'
wikisql
CREATE TABLE table_60695 ( "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. -- Who was the team who played home team woking?
SELECT "Away team" FROM table_60695 WHERE "Home team" = 'woking'
wikisql
CREATE TABLE table_name_26 ( genre VARCHAR, year_recorded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What genre is the song recorded in 1929?
SELECT genre FROM table_name_26 WHERE year_recorded = "1929"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '78487358' AND gwyjzb.MED_SER_ORG_NO = '4050783' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '韦%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '78487358' AND fgwyjzb.MED_SER_ORG_NO = '4...
css
CREATE TABLE table_41954 ( "Tournament" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text...
SELECT "2009" FROM table_41954 WHERE "2000" = '1r' AND "1998" = '3r'
wikisql
CREATE TABLE table_39106 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of years that the event was foil team and took place in Los Angeles?
SELECT COUNT("Year") FROM table_39106 WHERE "Venue" = 'los angeles' AND "Event" = 'foil team'
wikisql
CREATE TABLE table_52160 ( "Track" real, "Recorded" text, "Original Issue" text, "Song Title" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which track has a title : Just a little bit
SELECT MIN("Track") FROM table_52160 WHERE "Song Title" = 'just a little bit'
wikisql
CREATE TABLE table_name_4 ( country VARCHAR, player VARCHAR, score VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Score smaller than 70, and a Place of t3, and a Player of andr s romero?
SELECT country FROM table_name_4 WHERE score < 70 AND place = "t3" AND player = "andrés romero"
sql_create_context
CREATE TABLE table_1057316_1 ( wheel_arrangement___whyte_notation__ VARCHAR, disposition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the wheel arrangement for the train in Riverdale, Georgia?
SELECT wheel_arrangement___whyte_notation__ FROM table_1057316_1 WHERE disposition = "Riverdale, Georgia"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE month ( ...
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.departure_time < 630 AND flight.to_airport = AIRPOR...
atis
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.marital_status = "SINGLE"
mimicsql_data
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name te...
SELECT COUNT(*) FROM Posts WHERE CreationDate BETWEEN '2018-01-01' AND '2018-12-31' AND Tags LIKE '%python%'
sede
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BCS' AND course.num...
advising
CREATE TABLE table_name_83 ( title VARCHAR, production_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the production with a number of 1039?
SELECT title FROM table_name_83 WHERE production_number = "1039"
sql_create_context
CREATE TABLE table_65905 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Laura Diaz's score for place t9?
SELECT "Score" FROM table_65905 WHERE "Place" = 't9' AND "Player" = 'laura diaz'
wikisql
CREATE TABLE table_45743 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nationality of the Player with Jersey Number 6?
SELECT "Nationality" FROM table_45743 WHERE "Jersey Number(s)" = '6'
wikisql
CREATE TABLE table_1341577_44 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates when Jack Fields was the incumbent?
SELECT candidates FROM table_1341577_44 WHERE incumbent = "Jack Fields"
sql_create_context
CREATE TABLE table_22850 ( "Rank" real, "London Borough" text, "Indian Population" real, "Pakistani Population" real, "Bangladeshi Population" real, "Chinese Population" real, "Other Asian Population" real, "Total Asian Population" real ) -- Using valid SQLite, answer the following que...
SELECT MAX("Bangladeshi Population") FROM table_22850 WHERE "Rank" = '14'
wikisql
CREATE TABLE table_76832 ( "Name" text, "Country" text, "Status" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the free transfer fee with a transfer status and an ENG country?
SELECT "Name" FROM table_76832 WHERE "Transfer fee" = 'free' AND "Status" = 'transfer' AND "Country" = 'eng'
wikisql
CREATE TABLE table_name_54 ( attendance INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of attendance when the result was l 16-13?
SELECT SUM(attendance) FROM table_name_54 WHERE result = "l 16-13"
sql_create_context
CREATE TABLE table_54982 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which mean rank had a silver number smaller than 0?
SELECT AVG("Rank") FROM table_54982 WHERE "Silver" < '0'
wikisql
CREATE TABLE table_name_60 ( to_par VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is T5 Place Vijay Singh's To par?
SELECT to_par FROM table_name_60 WHERE place = "t5" AND player = "vijay singh"
sql_create_context
CREATE TABLE table_29451 ( "Club" text, "Chairman" text, "Current manager" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the team captain when the club is k.f.c. germinal beersc...
SELECT "Team captain" FROM table_29451 WHERE "Club" = 'K.F.C. Germinal Beerschot'
wikisql
CREATE TABLE table_56544 ( "Round" text, "Player" text, "Position" text, "Team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who plays f position for depauw?
SELECT "Player" FROM table_56544 WHERE "Position" = 'f' AND "College" = 'depauw'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'monte carlo simulation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2011
scholar
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Antifungal antibiotics causing adverse effects in therapeutic use"
mimicsql_data
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '孔雅静' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2011-01-25')
css
CREATE TABLE table_52559 ( "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. -- Where was the game that had an attenda...
SELECT "Game site" FROM table_52559 WHERE "Attendance" = '39,889'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, ...
SELECT CreationDate FROM PostFeedback WHERE CAST(CreationDate AS DATETIME) BETWEEN '2017-01-01 00:00:00' AND '2017-12-31 23:59:59'
sede
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 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.person_info_XM = '喻浩岚' AND hz_info.YLJGDM = '8360401' AND NOT zyjzjlb.CYKSMC LIKE '%整形科%'
css
CREATE TABLE table_59448 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score where Olga Lugin...
SELECT "Score in the final" FROM table_59448 WHERE "Partner" = 'olga lugina' AND "Tournament" = 'poitiers , france itf $25,000'
wikisql
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9550631' AND IN_HOSP_DATE BETWEEN '2007-02-26' AND '2020-08-03' AND INSURED_STS = '未就业' AND MED_AMOUT >= 5252.43
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 qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1150862' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1150862' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
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, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '38996454394'
css
CREATE TABLE table_74908 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 2 1 has what record?
SELECT "Record" FROM table_74908 WHERE "Score" = '2–1'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'WOMENSTD' AND number = 444
advising
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 qtb.MED_CLINIC_ID, qtb.PERSON_ID, qtb.PERSON_NM, qtb.IDENTITY_CARD, qtb.PERSON_SEX, qtb.PERSON_AGE FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '18542009470') UNION SELECT gyb.MED_CLINIC_ID, gyb.PERSON_...
css
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREAT...
SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_99 ( league VARCHAR, open_cup VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which League that has a Open Cup of 1st round, and a Year of 2009?
SELECT league FROM table_name_99 WHERE open_cup = "1st round" AND year = 2009
sql_create_context
CREATE TABLE table_1342013_9 ( result VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the result with dbeingtrict being florida 4
SELECT result FROM table_1342013_9 WHERE district = "Florida 4"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '华曼衍' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7616.57)
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '花春雪' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-04-01' AND '2018-05-25'
css
CREATE TABLE table_20468206_1 ( obama_number INTEGER, mccain_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most abama number for mccain being 29266
SELECT MAX(obama_number) FROM table_20468206_1 WHERE mccain_number = 29266
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABL...
SELECT DISTINCT description, name FROM course WHERE department = 'STRATEGY' AND number = 564
advising
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb...
css
CREATE TABLE 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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT MIN(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 = '006-78314')) AND intakeoutput.celllabel = 'volum...
eicu
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 174 AND program_course.course_id = course.course_id
advising
CREATE TABLE table_21318 ( "Game" real, "Date" text, "Opponent" 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. -- Wh...
SELECT "Score" FROM table_21318 WHERE "Date" = 'September 9'
wikisql
CREATE TABLE table_name_35 ( league_apps VARCHAR, fa_cup_apps VARCHAR, league_goals VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the league apps with league goals less than 2 and position of df and FA cup apps of 5
SELECT league_apps FROM table_name_35 WHERE league_goals < 2 AND position = "df" AND fa_cup_apps = "5"
sql_create_context
CREATE TABLE table_64529 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is th...
SELECT "Outgoing manager" FROM table_64529 WHERE "Replaced by" = 'pablo centrone'
wikisql
CREATE TABLE table_name_14 ( date_s_ VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Virginia Commonwealth Rams win?
SELECT date_s_ FROM table_name_14 WHERE winner = "virginia commonwealth rams"
sql_create_context
CREATE TABLE table_1341843_19 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district is F. Edward Hebert the incumbent in?
SELECT district FROM table_1341843_19 WHERE incumbent = "F. Edward Hebert"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patientheal...
SELECT SUM(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 = '006-157753') AND patient.unitdischargetime IS NU...
eicu
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int...
SELECT DISTINCT day_name FROM days WHERE days_code = 'SA'
atis
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.language FROM demographic WHERE demographic.subject_id = "52118"
mimicsql_data
CREATE TABLE table_name_92 ( stadium VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the match ending in a score of 66-20, what was the stadium?
SELECT stadium FROM table_name_92 WHERE score = "66-20"
sql_create_context
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHA...
SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
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 Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY SUM(T1.Show_times_per_day) DESC
nvbench
CREATE TABLE table_11545282_10 ( years_for_jazz VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During which years did player number 35 play for Jazz?
SELECT years_for_jazz FROM table_11545282_10 WHERE no = "35"
sql_create_context
CREATE TABLE table_32161 ( "Region" text, "Date" real, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the format for european union
SELECT "Format" FROM table_32161 WHERE "Region" = 'european union'
wikisql
CREATE TABLE table_15869 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the number of the player from Boise State?
SELECT "No." FROM table_15869 WHERE "School/Club Team" = 'Boise State'
wikisql
CREATE TABLE table_50585 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which county had a Bush number of votes of 566?
SELECT "County" FROM table_50585 WHERE "Bush#" = '566'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID)
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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_id varchar ) CREATE TABLE job...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'RCNSCI' AND semester.semester = 'WN' AND...
advising
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 DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'gabapentin 300 mg po caps'
eicu