context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_80 ( runners_up VARCHAR, year VARCHAR, champions VARCHAR, name_of_tournament VARCHAR )
What were the Runners-up prior to 1990 when Ivan Lendl was Champion in the Seiko Super Tennis Tournament?
SELECT runners_up FROM table_name_80 WHERE champions = "ivan lendl" AND name_of_tournament = "seiko super tennis" AND year < 1990
sql_create_context
CREATE TABLE furniture ( name VARCHAR, Num_of_Component VARCHAR, market_rate VARCHAR )
Find the name and component amount of the least popular furniture.
SELECT name, Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1
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...
在编号为6439728的医院的入院诊断为颅脑外伤所致的精神障碍的医疗记录中,最少和最多的医疗费总额分别是多少
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 = '6439728' AND gwyjzb.IN_DIAG_DIS_NM = '颅脑外伤所致的精神障碍' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6439728' AND fgwyjzb.IN...
css
CREATE TABLE table_52811 ( "Code" real, "Type" text, "Name" text, "Area (km 2 )" real, "Population" real, "Regional County Municipality" text, "Region" real )
When populatioin is greater than 7,747 and the type is V, what is the sum of code?
SELECT COUNT("Code") FROM table_52811 WHERE "Type" = 'v' AND "Population" > '7,747'
wikisql
CREATE TABLE table_62212 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Streak" text )
When did they play at the wachovia center?
SELECT "Date" FROM table_62212 WHERE "Location/Attendance" = 'wachovia center'
wikisql
CREATE TABLE table_name_12 ( loss VARCHAR, attendance VARCHAR )
What is the loss of the game with 38,062 folks in attendance?
SELECT loss FROM table_name_12 WHERE attendance = "38,062"
sql_create_context
CREATE TABLE table_37864 ( "orbit" text, "center-to-center distance" text, "altitude above the Earth's surface" text, "Orbital period" text, "specific orbital energy" text )
specific orbital energy of 29.8 mj/kg has what orbit?
SELECT "orbit" FROM table_37864 WHERE "specific orbital energy" = '−29.8 mj/kg'
wikisql
CREATE TABLE table_27823359_1 ( written_by VARCHAR, season__number VARCHAR )
Who wrote episode 23 in the season?
SELECT written_by FROM table_27823359_1 WHERE season__number = "23"
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar,...
show me the flights from DENVER to PITTSBURGH and ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.c...
atis
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...
编码为48885255的病患不少于7137.7元的药物在哪几次医疗记录中被开出?列出医疗就诊号码都是什么?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '48885255' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7137.7)
css
CREATE TABLE table_name_89 ( district VARCHAR, result VARCHAR, incumbent VARCHAR )
wWhich district has a retired republican hold with an incumbent of rufus p. spalding?
SELECT district FROM table_name_89 WHERE result = "retired republican hold" AND incumbent = "rufus p. spalding"
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, ...
在15年8月6日到16年2月8日这段时间,患者37516141一共有多少检验报告单,把这些检验报告单的标本采集部位列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '37516141' AND jybgb.BGRQ BETWEEN '2015-08-06' AND '201...
css
CREATE TABLE table_name_68 ( winning_team VARCHAR, losing_team VARCHAR, score VARCHAR )
Who beat the Marlins with a score of 4-0?
SELECT winning_team FROM table_name_68 WHERE losing_team = "marlins" AND score = "4-0"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx tex...
what were the three most frequently prescribed drugs at the same time since 4 years ago for patients who were prescribed d5 1/4ns?
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 = 'd5 1/4ns' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRE...
mimic_iii
CREATE TABLE table_name_57 ( name VARCHAR, status VARCHAR, moving_to VARCHAR )
What is the name listed for the country that has a status of loaned and a moving to listed as leyton orient?
SELECT name FROM table_name_57 WHERE status = "loaned" AND moving_to = "leyton orient"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
询问一下患者98644163往常有过什么异常情况吗?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '98644163' AND jyjgzbb.JCZBJGDL < jyjgzbb.CKZFWXX OR jyjgzbb...
css
CREATE TABLE table_name_78 ( crowd INTEGER, home_team VARCHAR )
How big was the crowd for Essendon?
SELECT SUM(crowd) FROM table_name_78 WHERE home_team = "essendon"
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 ...
患者64170409以前有某些异常情况她还记得么?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE table_69257 ( "Week" real, "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
The final score was 24-34 on what date?
SELECT "Date" FROM table_69257 WHERE "Final Score" = '24-34'
wikisql
CREATE TABLE table_21703 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What's part 1 of the verb whose part 4 is gevroren?
SELECT "Part 1" FROM table_21703 WHERE "Part 4" = 'gevroren'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
give me the number of patients whose diagnoses short title is atrial fibrillation and procedure long title is other and unspecified coronary arteriography?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.short_title = "Atrial fibrillation" AND procedures.long_title = "Other and unspecified coronary arteriography"
mimicsql_data
CREATE TABLE table_48776 ( "Title" text, "Season" real, "Director" text, "Teleplay" text, "First Broadcast" text )
What is Title, when Season is less than 1.8, and when First Broadcast is March 6, 1981?
SELECT "Title" FROM table_48776 WHERE "Season" < '1.8' AND "First Broadcast" = 'march 6, 1981'
wikisql
CREATE TABLE table_name_20 ( goals INTEGER, goal_ratio VARCHAR, debut_in_europe VARCHAR )
What are the smallest goals with a Goal Ratio of 0.14, and a Debut in Europe smaller than 1995?
SELECT MIN(goals) FROM table_name_20 WHERE goal_ratio = 0.14 AND debut_in_europe < 1995
sql_create_context
CREATE TABLE table_name_8 ( evening_gown INTEGER, average VARCHAR, swimsuit VARCHAR )
What is the highest evening gown with an average of 9.531 and swimsuit smaller than 9.449?
SELECT MAX(evening_gown) FROM table_name_8 WHERE average = 9.531 AND swimsuit < 9.449
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
when was the last time patient 009-3149 was prescribed a medication in 09/this year via ng route?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-3149')) AND medication.routeadmin = 'ng' AND DATETIME(medi...
eicu
CREATE TABLE table_42801 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "Prohibition ticket" text, "Greenback ticket" text )
Who was on the Prohibition ticket when Thomas Armstrong ran on the Greenback ticket?
SELECT "Prohibition ticket" FROM table_42801 WHERE "Greenback ticket" = 'thomas armstrong'
wikisql
CREATE TABLE qtb ( 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 SUM(mzb.MED_CLINIC_ID) FROM mzb WHERE mzb.PERSON_SEX = '尤云梦'
css
CREATE TABLE table_42743 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the smallest silver that has a bronze less than 0?
SELECT MIN("Silver") FROM table_42743 WHERE "Bronze" < '0'
wikisql
CREATE TABLE table_name_40 ( week INTEGER, date VARCHAR )
Which week was on october 30, 1983?
SELECT SUM(week) FROM table_name_40 WHERE date = "october 30, 1983"
sql_create_context
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...
Draw a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, display by the X from low to high.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_368 ( "Date of Issue" text, "Theme" text, "Denomination" text, "Design" text, "Illustration" text, "Printing Process" text, "Paper Type" text, "First Day Cover Cancellation" text )
Who is the designer of the Christmas: Winter Fun (USA) stamp?
SELECT "Design" FROM table_368 WHERE "Theme" = 'Christmas: Winter Fun (USA)'
wikisql
CREATE TABLE table_name_79 ( tournament VARCHAR )
Which tournament had a performance of 1R in 2004 and 2R in 1998?
SELECT tournament FROM table_name_79 WHERE 2004 = "1r" AND 1998 = "2r"
sql_create_context
CREATE TABLE table_204_185 ( id number, "location" text, "town" text, "output (mw ac)" number, "modules" number, "number of arrays" number )
there is at least how many locations ?
SELECT COUNT("location") FROM table_204_185
squall
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Vehicles ( vehicle_id INTEGER, vehicle_details VARCHAR(255) ) CREATE TABLE Lessons ( le...
List all customer status codes and the number of customers having each status code in a bar chart, could you rank bar in descending order?
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code DESC
nvbench
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NU...
What are the first names of all employees that are professors ordered by date of birth, and count them by a bar chart
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM EMPLOYEE WHERE EMP_JOBCODE = 'PROF' GROUP BY EMP_FNAME ORDER BY EMP_DOB
nvbench
CREATE TABLE table_name_65 ( k_themistokleous VARCHAR, i_kasoulidis VARCHAR )
What was the percentage for K. Themistokleous when I. Kasoulidis was 30.1%?
SELECT k_themistokleous FROM table_name_65 WHERE i_kasoulidis = "30.1%"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, ...
从0八年二月十六日到二0年五月十三日,患者36214973的医保被刷了多少金额
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '36214973' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-02-16' AND '2020-05-13'
css
CREATE TABLE table_72095 ( "Iowa State vs." text, "Overall Record" text, "in Ames" text, "at Opponents Venue" text, "at Neutral Site" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text, "Since Beginning of Big 12" text )
When the value of 'since beginning of big 12' is synonymous with its' category, what are the in Ames values?
SELECT "in Ames" FROM table_72095 WHERE "Since Beginning of Big 12" = 'Since Beginning of Big 12'
wikisql
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid...
ACL papers with less than 5 citations
SELECT DISTINCT cite.citingpaperid FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) < 5
scholar
CREATE TABLE table_6401 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text )
What was the date for the G1 group race at Flemington?
SELECT "Date" FROM table_6401 WHERE "Group" = 'g1' AND "Venue" = 'flemington'
wikisql
CREATE TABLE table_train_240 ( "id" int, "anemia" bool, "gender" string, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "insulin_requirement" float, "kidney_disease" bool, "body...
insulin requirement > 1 u / kg / d.
SELECT * FROM table_train_240 WHERE insulin_requirement > 1
criteria2sql
CREATE TABLE table_33700 ( "Episode Number" real, "Title" text, "Podcast Date" text, "Run time" text, "Historical References" text )
What is the topic of the episode that runs 6:07?
SELECT "Historical References" FROM table_33700 WHERE "Run time" = '6:07'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, ...
i need a flight from SALT LAKE CITY to PHOENIX departing wednesday after 1700
SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1700 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa...
atis
CREATE TABLE table_name_72 ( title VARCHAR, songwriter_s_ VARCHAR )
Which Title has a Songwriter(s) of hadise a kg z, stefaan fernande, elio deepcore?
SELECT title FROM table_name_72 WHERE songwriter_s_ = "hadise açıkgöz, stefaan fernande, elio deepcore"
sql_create_context
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), ...
Visualize a bar chart for how many students are in each department?, and show in descending by the names.
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY dept_name DESC
nvbench
CREATE TABLE table_name_43 ( Id VARCHAR )
What is the 2010 result of a tournament that is 1R in 2009, Q2 in 2011 and 1R in 2012?
SELECT 2010 FROM table_name_43 WHERE 2011 = "q2" AND 2012 = "1r" AND 2009 = "1r"
sql_create_context
CREATE TABLE table_203_279 ( id number, "interferometer and observing mode" text, "waveband" text, "limiting magnitude" number, "minimum baseline (m)\n(un-projected)" number, "maximum baseline (m)" number, "approx. no. visibility measurements per year\n(measurements per night x nights used p...
what is the number of interferometers that use wavebands r ?
SELECT COUNT("interferometer and observing mode") FROM table_203_279 WHERE "waveband" = 'r'
squall
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, ...
count the number of patients whose admission type is urgent and procedure short title is percutaneous liver aspiration.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Percutan liver aspirat"
mimicsql_data
CREATE TABLE table_1974545_2 ( primary_conference VARCHAR, institution VARCHAR )
What's Salem State University's primary conference?
SELECT primary_conference FROM table_1974545_2 WHERE institution = "Salem State University"
sql_create_context
CREATE TABLE table_557 ( "Basic stem (root)" text, "Present stem" text, "Non-present stem" text, "Participle" text, "Verbal noun" text, "Short stem" text, "Meaning" text )
What does the basic stem (root) -rama- mean?
SELECT "Meaning" FROM table_557 WHERE "Basic stem (root)" = '-rama-'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Descr...
Get old unanswered questions from users with recent activity.
SELECT question.Id AS "post_link" FROM Posts AS question
sede
CREATE TABLE table_204_961 ( id number, "title" text, "director" text, "production" text, "music" text, "cast" text, "release date" text )
what is the last title on the chart ?
SELECT "title" FROM table_204_961 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit ...
what is the maximum total cost for the hospital involving a procedure called dermal regener graft since 2103?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dermal regener graft')) AND STRFTIME('%y', cost.chargetim...
mimic_iii
CREATE TABLE table_10554 ( "Class" text, "Wheel arrangement" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) withdrawn" text, "Comments" text )
What year was the wheel arrangement 0-6-0 and a class 302?
SELECT "Year made" FROM table_10554 WHERE "Wheel arrangement" = '0-6-0' AND "Class" = '302'
wikisql
CREATE TABLE table_20083 ( "First District" text, "Second District" text, "Third District" text, "Fourth District" text, "Fifth District" text )
Name the third district for christine young
SELECT "Third District" FROM table_20083 WHERE "Fifth District" = 'Christine Young'
wikisql
CREATE TABLE fgwyjzb ( 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, ...
58160776号团伙成员最常去的医生排序是怎么排的?
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '58160776' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '58160776' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) ...
css
CREATE TABLE table_name_92 ( pick__number INTEGER, round INTEGER )
Name the sum of pick # for round less than 1
SELECT SUM(pick__number) FROM table_name_92 WHERE round < 1
sql_create_context
CREATE TABLE table_47798 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Place of the Player with a Score of 73-68-71=212?
SELECT "Place" FROM table_47798 WHERE "Score" = '73-68-71=212'
wikisql
CREATE TABLE table_68718 ( "Name" text, "Years" text, "League" text, "FA Cup" text, "League Cup" text, "Europe" text, "Other [C ]" text, "Total" text )
With a FA Cup of 0 44 0 (0), the other [C] is listed as what?
SELECT "Other [C ]" FROM table_68718 WHERE "FA Cup" = '0 44 0 (0)'
wikisql
CREATE TABLE table_name_62 ( draft INTEGER, player VARCHAR, pick VARCHAR, round VARCHAR )
What is the lowest draft of player jim farrell, who has a pick greater than 197 and a round of 14?
SELECT MIN(draft) FROM table_name_62 WHERE pick > 197 AND round = 14 AND player = "jim farrell"
sql_create_context
CREATE TABLE table_27415 ( "Club" text, "Location" text, "Stadium" text, "Capacity" real, "Manager" text, "Kitmaker" text )
Who is the kitmaker for TPS?
SELECT "Kitmaker" FROM table_27415 WHERE "Club" = 'TPS'
wikisql
CREATE TABLE table_name_11 ( tennessee VARCHAR, kentucky VARCHAR )
What is the Tennessee with a Kentucky of Larry Seiple
SELECT tennessee FROM table_name_11 WHERE kentucky = "larry seiple"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the average of department_id , and group by attribute job_id.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE table_4295 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text )
Name the poor law union for area being 332
SELECT COUNT("Poor law union") FROM table_4295 WHERE "Area( acres )" = '332'
wikisql
CREATE TABLE table_14856 ( "Game" real, "Date" text, "Score" text, "Location" text, "Time" text, "Attendance" real )
Name the score for 1:36 time
SELECT "Score" FROM table_14856 WHERE "Time" = '1:36'
wikisql
CREATE TABLE debate ( debate_id number, date text, venue text, num_of_audience number ) CREATE TABLE people ( people_id number, district text, name text, party text, age number ) CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_...
Show the party that has the most people.
SELECT party FROM people GROUP BY party ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_18838 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What is the played total when the points against was 321?
SELECT "Played" FROM table_18838 WHERE "Points against" = '321'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
how many days has it been since patient 40059's last stay in the careunit csru during the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059 AND admissions.dischtime IS NULL) AND transfers.careunit = 'csru' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_i...
total the number of drugs patient 31615 has been prescribed so far this year.
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31615) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_4465 ( "Round" real, "Track" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winner" text, "Team" text )
Who was the winner when Katsuyuki Hiranaka had the fastest lap?
SELECT "Winner" FROM table_4465 WHERE "Fastest Lap" = 'katsuyuki hiranaka'
wikisql
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 patient ( uniquep...
how many current patients are of the age 30s?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 30 AND 39
eicu
CREATE TABLE table_name_57 ( name VARCHAR, terminus VARCHAR )
Which route has a terminus of pine Forest?
SELECT name FROM table_name_57 WHERE terminus = "pine forest"
sql_create_context
CREATE TABLE Ref_Service_Types ( Service_Type_Description VARCHAR, Service_Type_Code VARCHAR ) CREATE TABLE Services ( Service_Type_Code VARCHAR, Product_Name VARCHAR )
What is the description of the service type which offers both the photo product and the film product?
SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product...
sql_create_context
CREATE TABLE table_56609 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the score of the game when the New York Rangers were the home team?
SELECT "Score" FROM table_56609 WHERE "Home" = 'new york rangers'
wikisql
CREATE TABLE table_1213511_3 ( nationality VARCHAR, player VARCHAR )
How many nationalities are listed for the player Glen Irwin?
SELECT COUNT(nationality) FROM table_1213511_3 WHERE player = "Glen Irwin"
sql_create_context
CREATE TABLE table_76226 ( "Alianza wins" real, "Draws" real, "U wins" real, "Alianza goals" real, "U goals" real )
What is the sum of Alianza Wins, when Alianza Goals is '317, and when U Goals is greater than 296?
SELECT SUM("Alianza wins") FROM table_76226 WHERE "Alianza goals" = '317' AND "U goals" > '296'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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 instructor ( instructo...
PATH 585 and 520 have what prerequisites ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 585 OR COURSE_1.number = 520) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar...
advising
CREATE TABLE table_1443 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
What was the score for the home team when the away team was Sydney?
SELECT "Home team score" FROM table_1443 WHERE "Away team" = 'Sydney'
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,...
Tell me short title of theprocedure of patient with patient id 3343.
SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "3343"
mimicsql_data
CREATE TABLE table_2062148_2 ( weight__kg_ VARCHAR, jockey VARCHAR )
What was the weight in kg when the jockey was B. York?
SELECT weight__kg_ FROM table_2062148_2 WHERE jockey = "B. York"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, depart...
i'd like to know the earliest flights from BOSTON to ATLANTA georgia
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 = 'ATLANT...
atis
CREATE TABLE table_28884858_2 ( total_attendance INTEGER, team VARCHAR )
What was the total attendance of the New York Giants?
SELECT MIN(total_attendance) FROM table_28884858_2 WHERE team = "New York Giants"
sql_create_context
CREATE TABLE table_28288 ( "Rank" real, "Average" text, "Player" text, "Matches" real, "Innings" real, "Period" text )
What was kumar sangakkara's average?
SELECT "Average" FROM table_28288 WHERE "Player" = 'Kumar Sangakkara'
wikisql
CREATE TABLE table_2731431_1 ( location VARCHAR, elevation__m_ VARCHAR )
Which location has an elevation of 3798?
SELECT location FROM table_2731431_1 WHERE elevation__m_ = 3798
sql_create_context
CREATE TABLE table_24747844_2 ( money_list_rank INTEGER, best_finish VARCHAR )
What is the minimum money list rank for the players having a best finish of T9?
SELECT MIN(money_list_rank) FROM table_24747844_2 WHERE best_finish = "T9"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob...
in 2102, what are the top five most common procedures?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2102' GROUP BY procedures_icd.icd9_code) AS t1 ...
mimic_iii
CREATE TABLE table_73962 ( "Member countries" text, "Population" text, "Area (km\u00b2)" text, "GDP (billion US$)" text, "GDP per capita (US$)" text, "Languages" text )
Name the member countries for finnish swedish
SELECT "Member countries" FROM table_73962 WHERE "Languages" = 'Finnish Swedish'
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, ...
what was the name of the laboratory test that patient 025-53538 has received for the last time last month?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-53538')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(),...
eicu
CREATE TABLE table_57296 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
Name the speed for 1:36.46.93
SELECT "Speed" FROM table_57296 WHERE "Time" = '1:36.46.93'
wikisql
CREATE TABLE table_32964 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Which airport has an IATA of TYN?
SELECT "Airport" FROM table_32964 WHERE "IATA" = 'tyn'
wikisql
CREATE TABLE table_20550 ( "Season" text, "1st Place" text, "2nd Place" text, "3rd Place" text, "4th Place" text )
What teams finished in 3rd when panathinaikos finished 2nd?
SELECT "3rd Place" FROM table_20550 WHERE "2nd Place" = 'Panathinaikos'
wikisql
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...
Which Spring classes are ECON upper level ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ECON' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring...
advising
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
tell me the name of the last lab test that patient 31482 got since 04/2105?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-04' ORDER BY labevents.charttime DESC LIMIT 1)
mimic_iii
CREATE TABLE table_name_32 ( position VARCHAR, birthplace VARCHAR )
What is the Position when the person's birthplace was toledo, ohio?
SELECT position FROM table_name_32 WHERE birthplace = "toledo, ohio"
sql_create_context
CREATE TABLE table_1417184_1 ( population INTEGER, canton VARCHAR )
what is the minimum population with canton being redange
SELECT MIN(population) FROM table_1417184_1 WHERE canton = "Redange"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those products with a price between 60 and 120, a scatter chart shows the correlation between price and manufacturer , and group by attribute name.
SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
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 procedures ( ...
count the number of patients whose religion is jewish and procedure short title is closed liver biopsy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.religion = "JEWISH" AND procedures.short_title = "Closed liver biopsy"
mimicsql_data
CREATE TABLE table_name_28 ( driver VARCHAR, points VARCHAR, team VARCHAR )
Which driver has 7 points for team Australia?
SELECT driver FROM table_name_28 WHERE points = 7 AND team = "team australia"
sql_create_context
CREATE TABLE table_34644 ( "Year" real, "US Cham. Rank" real, "US Cham. Spending" text, "Next Highest Spender" text, "Next Highest Amount" text )
Which US Cham Rank is the lowest one that has a Next Highest Spender of national assn of realtors, and a Year smaller than 2012?
SELECT MIN("US Cham. Rank") FROM table_34644 WHERE "Next Highest Spender" = 'national assn of realtors' AND "Year" < '2012'
wikisql
CREATE TABLE gyb ( 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...
医院4523226所有的记录里,根据科室名与出院的时候诊断编码的区别看一下自费额度与总医疗费用相比的最小值并按升序来排列显示
SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4523226' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_...
css