context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_78 ( diameter__km_ INTEGER, latitude VARCHAR )
WHAT IS THE LOWEST DIAMETER FOR A LATITIDE OF 52.0S?
SELECT MIN(diameter__km_) FROM table_name_78 WHERE latitude = "52.0s"
sql_create_context
CREATE TABLE table_53188 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the largest crowd with Home team of hawthorn?
SELECT MAX("Crowd") FROM table_53188 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, ...
Give me a bar chart for how many competition type of each competition type
SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type
nvbench
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, ...
make a count of the number of patients who are discharged from the hospital during this year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top 100 most upvoted comments.
SELECT Score, Id, PostId AS "post_link", Id AS "comment_link", UserId AS "user_link" FROM Comments WHERE Id > 97900000 AND Text LIKE '%Thank%' AND LENGTH(Text) < 18 ORDER BY Id LIMIT 100
sede
CREATE TABLE table_2406 ( "Episode No." real, "Series No." real, "Title" text, "Directed by" text, "Written by" text, "Viewers (millions)" text, "Original airdate" text )
What was the title of the episode written by Keith Temple?
SELECT "Title" FROM table_2406 WHERE "Written by" = 'Keith Temple'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions...
when is patient 702 prescribed the drug for the last time on their last hospital encounter?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 702 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_62392 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Which Country has a To par of 2, and a Player of jim thorpe?
SELECT "Country" FROM table_62392 WHERE "To par" = '–2' AND "Player" = 'jim thorpe'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
从00年3月11日直到2001年6月23日之间医疗机构8880467处理的新生儿门诊的就诊次数一共是多少次?
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '8880467' AND JZKSRQ BETWEEN '2000-03-11' AND '2001-06-23' AND ZSEBZ > 0
css
CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, ...
Count the number of colors.
SELECT COUNT(*) FROM ref_colors
spider
CREATE TABLE table_203_675 ( id number, "match" number, "date" text, "round" text, "home/away" text, "opponent team" text, "score" text, "scorers" text )
which date did a team score 4 points ?
SELECT "date" FROM table_203_675 WHERE "score" = 4
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
which type of admission did patient with patient id 6983 have?
SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_80124 ( "Title" text, "Year" real, "Developer" text, "Publisher" text, "Platform" text )
Which title has xbox as the platform with a year prior to 2006?
SELECT "Title" FROM table_80124 WHERE "Platform" = 'xbox' AND "Year" < '2006'
wikisql
CREATE TABLE table_203_341 ( id number, "season" text, "champion" text, "runner-up" text, "score" text, "third place" text )
team that won before mazowszanka pekaes pruszk w
SELECT "champion" FROM table_203_341 WHERE "season" < (SELECT "season" FROM table_203_341 WHERE "champion" = 'mazowszanka pekaes pruszkow') ORDER BY "season" DESC LIMIT 1
squall
CREATE TABLE table_name_9 ( away_team VARCHAR, venue VARCHAR )
What was the away team that played at Corio Oval?
SELECT away_team FROM table_name_9 WHERE venue = "corio oval"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
how big is the difference in patient 006-254182's weight measured at 2104-09-10 20:41:00 compared to the value measured at 2104-09-08 21:57:00?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182') AND NOT patient.admissionweight IS NULL AND patient.unitadmittime = '2104-09-10 20:41:00') - (SELECT patient.admissionweight FROM ...
eicu
CREATE TABLE table_10865 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which venue has a Score of 1 0, and a Competition of 2002 world cup qualifier?
SELECT "Venue" FROM table_10865 WHERE "Score" = '1–0' AND "Competition" = '2002 world cup qualifier'
wikisql
CREATE TABLE table_46152 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
When they played at Chicago Bulls, what was the Location/Attendance?
SELECT "Location/Attendance" FROM table_46152 WHERE "Opponent" = 'at chicago bulls'
wikisql
CREATE TABLE table_73341 ( "Team" text, "Stadium" text, "Match played" text, "Highest" real, "Lowest" real, "Average" real )
What is the lowest when pohang steelyard is the stadium?
SELECT "Lowest" FROM table_73341 WHERE "Stadium" = 'Pohang Steelyard'
wikisql
CREATE TABLE table_name_20 ( vehicle VARCHAR, class VARCHAR )
Which vehicle has a class 6c3g?
SELECT vehicle FROM table_name_20 WHERE class = "6c3g"
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...
出院诊断医师负责医疗就诊95748539104,他的编号及名称分别是什么?
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '95748539104' UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '95748539104'
css
CREATE TABLE table_name_24 ( name VARCHAR, family VARCHAR, species_authority VARCHAR )
Who has canidae as family and canis rufus audubon & bachman, 1851 as species/authority?
SELECT name FROM table_name_24 WHERE family = "canidae" AND species_authority = "canis rufus audubon & bachman, 1851"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
查看病人72383681之前的住院诊断
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_inf...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many widowed patients have procedure icd9 code 5771?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.icd9_code = "5771"
mimicsql_data
CREATE TABLE table_2488 ( "Issuer" text, "Issue Date" text, "ISIN" text, "Amount Issued [\u20ac]" text, "Coupon" text, "Maturity" text )
What is the maturity date of the ISIN labeled DE000A0BVBN3?
SELECT "Maturity" FROM table_2488 WHERE "ISIN" = 'DE000A0BVBN3'
wikisql
CREATE TABLE table_5731 ( "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text )
What year is guard Mario Chalmers?
SELECT "Year" FROM table_5731 WHERE "Position" = 'guard' AND "Name" = 'mario chalmers'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
what is patient 006-35134's minimum heartrate, on 07/07/this year?
SELECT MIN(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 = '006-35134')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), ...
How many accounts for different statement details? Draw a bar chart, list by the bars in descending.
SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details DESC
nvbench
CREATE TABLE table_21249915_1 ( total VARCHAR, department VARCHAR )
How many total catagories are there for La Paz?
SELECT COUNT(total) FROM table_21249915_1 WHERE department = "La Paz"
sql_create_context
CREATE TABLE table_name_69 ( pick INTEGER, player VARCHAR, round VARCHAR )
What pick in round 5 did the 49ers pick Jim Pilot?
SELECT SUM(pick) FROM table_name_69 WHERE player = "jim pilot" AND round > 5
sql_create_context
CREATE TABLE table_name_32 ( country VARCHAR, iata VARCHAR )
Which Country has a IATA of vie?
SELECT country FROM table_name_32 WHERE iata = "vie"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
when did patient 73693 the last time had urine out foley output on last month/06?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin...
mimic_iii
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREAT...
Visualize a bar chart for how many books fall into each category?, order by the Y in ascending.
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*)
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many patients diagnosed under icd9 code 34830 were admitted before the year 2157?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2157" AND diagnoses.icd9_code = "34830"
mimicsql_data
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
Which of the 400 -level courses are n't courses with labs ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400
advising
CREATE TABLE district ( district_name VARCHAR, city_area VARCHAR, City_Population VARCHAR )
Find the name all districts with city area greater than 10 or population larger than 100000
SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE stud...
For Other classes , what is the average difficulty ?
SELECT AVG(workload) FROM program_course WHERE category LIKE '%Other%'
advising
CREATE TABLE table_name_65 ( director VARCHAR, result VARCHAR, year__ceremony_ VARCHAR )
What is Director, when Result is nominee, and when Year (Ceremony) is 1969 (42nd)?
SELECT director FROM table_name_65 WHERE result = "nominee" AND year__ceremony_ = "1969 (42nd)"
sql_create_context
CREATE TABLE table_80352 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What's the Finish rank of 31?
SELECT "Finish" FROM table_80352 WHERE "Rank" = '31'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
how many patients whose marital status is single and diagnoses long title is late effects of cerebrovascular disease, hemiplegia affecting unspecified side?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side"
mimicsql_data
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...
what was the last time patient 006-195316 received a prescription for trazodone, since 09/2105?
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 = '006-195316')) AND medication.drugname = 'trazodone' AND STRFTI...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many patients whose admission type is newborn and drug route is po/ng?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_27149 ( "Rnd." real, "Circuit" text, "LMP1 Winning Team" text, "LMP2 Winning Team" text, "FLM Winning Team" text, "GT1 Winning Team" text, "GT2 Winning Team" text, "Results" text )
How many winning teams are there on LMP2 if Gabriele Gardel Patrice Goueslard Fernando Rees was the GT1 Winning Team on the Algarve circuit?
SELECT COUNT("LMP2 Winning Team") FROM table_27149 WHERE "GT1 Winning Team" = 'Gabriele Gardel Patrice Goueslard Fernando Rees' AND "Circuit" = 'Algarve'
wikisql
CREATE TABLE table_76003 ( "Rank" real, "Republic" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest number of bronzes for teams ranked number 7 with more than 0 silver?
SELECT MAX("Bronze") FROM table_76003 WHERE "Silver" > '0' AND "Rank" = '7'
wikisql
CREATE TABLE table_44255 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
What is the name for the best of 1:45.361?
SELECT "Name" FROM table_44255 WHERE "Best" = '1:45.361'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE R...
Day of Week Most Popular for Posting.
Go
sede
CREATE TABLE table_16364 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
Which episode was directed by Jean de Segonzac?
SELECT "Title" FROM table_16364 WHERE "Directed by" = 'Jean de Segonzac'
wikisql
CREATE TABLE table_name_35 ( lost INTEGER, played INTEGER )
What's the total Lost that has a Played that's larger than 42?
SELECT SUM(lost) FROM table_name_35 WHERE played > 42
sql_create_context
CREATE TABLE table_203_398 ( id number, "year" number, "vidhan sabha" text, "members of legislative assembly" text, "winning party" text, "nearest contesting party" text )
how many total times has the jnp been the winning party ?
SELECT COUNT(*) FROM table_203_398 WHERE "winning party" = 'jnp'
squall
CREATE TABLE t_kc21 ( 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, ...
这个医疗就诊67248182502中哈西奈德溶液的医疗机构三大目录编码和名称分别是啥呢?
SELECT t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '67248182502' AND t_kc22.SOC_SRT_DIRE_NM = '哈西奈德溶液'
css
CREATE TABLE table_20923 ( "Country" text, "Region" text, "Joined OPEC" real, "Population (July 2012)" real, "Area (km\u00b2)" real, "Production ( bbl /day)" text )
What is the highest poplulation in July 2012 in the country with an area of 2149690 square kilometers?
SELECT MAX("Population (July 2012)") FROM table_20923 WHERE "Area (km\u00b2)" = '2149690'
wikisql
CREATE TABLE table_name_92 ( lost VARCHAR, team VARCHAR, against VARCHAR )
How many Lost have a Team of flamengo, and an Against smaller than 5?
SELECT COUNT(lost) FROM table_name_92 WHERE team = "flamengo" AND against < 5
sql_create_context
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...
编码为4854343的医院在门诊就诊中开出少于30张检验报告单从04年9月23日到06年11月24日内的科室是多少个?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B...
css
CREATE TABLE table_name_78 ( gross_revenue__2011_ VARCHAR, gross_revenue__1982_ VARCHAR )
What was the 2011 gross revenue for the venue that had a gross revenue of $156,315 in 1982?
SELECT gross_revenue__2011_ FROM table_name_78 WHERE gross_revenue__1982_ = "$156,315"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
show me the last ward identification of patient 030-40287 until 2 years ago?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-40287') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_48026 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Place, when Score is '73-71=144', and when Player is 'Scott Simpson'?
SELECT "Place" FROM table_48026 WHERE "Score" = '73-71=144' AND "Player" = 'scott simpson'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREA...
For the next semester , how many REES classes are offered ?
SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'REES' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_45 ( shoulder_charge VARCHAR, body_tackle VARCHAR )
Which shoulder charge has restricted as the body tackle?
SELECT shoulder_charge FROM table_name_45 WHERE body_tackle = "restricted"
sql_create_context
CREATE TABLE table_18401 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What district did Donald Ray Matthews belong to?
SELECT "District" FROM table_18401 WHERE "Incumbent" = 'Donald Ray Matthews'
wikisql
CREATE TABLE table_18847736_2 ( date VARCHAR, opponent VARCHAR )
What is the date when the opponent is the New England Patriots?
SELECT date FROM table_18847736_2 WHERE opponent = "New England Patriots"
sql_create_context
CREATE TABLE table_name_29 ( rank VARCHAR, bronze VARCHAR )
What rank is the nation that has a bronze of source: Maltese Olympic Committee?
SELECT rank FROM table_name_29 WHERE bronze = "source: maltese olympic committee"
sql_create_context
CREATE TABLE table_name_67 ( tournament VARCHAR )
What 1976 has a Tournament of overall win loss?
SELECT 1976 FROM table_name_67 WHERE tournament = "overall win – loss"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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,...
检验结果指标记录的编码为90964222220的检测指标代码、检测项目名称、以及名称、检测方法都是啥?
SELECT jyjgzbb.JCXMMC, jyjgzbb.JCZBDM, jyjgzbb.JCZBMC, jyjgzbb.JCFF FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '90964222220'
css
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
tag wiki's and excerpts that might contain migration advice.
SELECT p.Id AS "post_link", Body, pt.Name FROM Posts AS p INNER JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE PostTypeId IN (4, 5) AND (Body LIKE '%superuser.com%' OR Body LIKE '%serverfault.com%' OR Body LIKE '%.stackexchange.com%')
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what drug is actually the drug that patient 022-47102 is allergic to during their last hospital encounter?
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-47102' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho...
eicu
CREATE TABLE table_12812 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
Who was the opponent at the week 4 game?
SELECT "Opponent" FROM table_12812 WHERE "Week" = '4'
wikisql
CREATE TABLE table_name_95 ( location VARCHAR )
What is the 1st prize of the tournament in Scotland?
SELECT 1 AS st_prize___$__ FROM table_name_95 WHERE location = "scotland"
sql_create_context
CREATE TABLE table_name_39 ( result VARCHAR, competition VARCHAR )
What was the result of the 2007 gulf cup of nations?
SELECT result FROM table_name_39 WHERE competition = "2007 gulf cup of nations"
sql_create_context
CREATE TABLE table_11129123_1 ( audition_city VARCHAR, callback_venue VARCHAR )
Which city had the charleston area convention center as its callback location
SELECT audition_city FROM table_11129123_1 WHERE callback_venue = "Charleston Area Convention Center"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
when did since 09/2105 patient 025-44495 last receive a microbiology test?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= ...
eicu
CREATE TABLE table_50939 ( "Senator" text, "Party" text, "District" real, "Home Town" text, "Took Office" real )
Which Home Town has a Took Office of 1983, and a District larger than 15?
SELECT "Home Town" FROM table_50939 WHERE "Took Office" = '1983' AND "District" > '15'
wikisql
CREATE TABLE table_55665 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
I want to know the 2013 when 2001 was wta premier 5 tournaments
SELECT "2013" FROM table_55665 WHERE "2001" = 'wta premier 5 tournaments'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
iPhone thread volume with accepted answers by month.
SELECT COUNT(*) AS AnsweredVolume, TIME_TO_STR(P.CreationDate, '%Y') AS Year, TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<iphone%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND AcceptedAnswerId > 0 GROUP BY TIME_TO_STR(P.CreationDate, '%YEAR'), TIME_TO_...
sede
CREATE TABLE table_12811 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Justin Leonard with a To par of 7's Score?
SELECT "Score" FROM table_12811 WHERE "To par" = '–7' AND "Player" = 'justin leonard'
wikisql
CREATE TABLE table_50987 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
What score has january 19 as the date?
SELECT "Score" FROM table_50987 WHERE "Date" = 'january 19'
wikisql
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Ot...
Show the number of documents in different starting date and bin starting date by weekday interval with a bar chart, list in ascending by the Y-axis.
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY COUNT(Date_in_Location_From)
nvbench
CREATE TABLE table_2625 ( "Name" text, "#" real, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text, "High School" text )
What is the weight when 20 is the number?
SELECT MAX("Weight") FROM table_2625 WHERE "#" = '20'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId number, Score number,...
StackOverflow Users by Location and Skill sorted by Average Score.
SELECT DISTINCT Users.Id, Users.DisplayName, Users.Location, Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_score", Users.AboutMe AS About, Users.Reputation AS Reputation FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND Commu...
sede
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE sta...
Show me how many home team by home team in a histogram
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team
nvbench
CREATE TABLE table_66968 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What was the team's record at the game attended by 30,452?
SELECT "Record" FROM table_66968 WHERE "Attendance" = '30,452'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
count the number of patients with drug code thiam100i who were born before 1821.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1821" AND prescriptions.formulary_drug_cd = "THIAM100I"
mimicsql_data
CREATE TABLE table_67630 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Which area has Years of 1 8, a Decile smaller than 7, and a Name of waikari school?
SELECT "Area" FROM table_67630 WHERE "Years" = '1–8' AND "Decile" < '7' AND "Name" = 'waikari school'
wikisql
CREATE TABLE FACULTY ( Fname VARCHAR, Rank VARCHAR )
Find the first names of faculties of rank Professor in alphabetic order.
SELECT Fname FROM FACULTY WHERE Rank = "Professor" ORDER BY Fname
sql_create_context
CREATE TABLE table_35222 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text )
Which Label has a Format of 7' single, and a Date of 1988?
SELECT "Label" FROM table_35222 WHERE "Format" = '7" single' AND "Date" = '1988'
wikisql
CREATE TABLE table_68851 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Name the airport with IATA of cxb
SELECT "Airport" FROM table_68851 WHERE "IATA" = 'cxb'
wikisql
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...
count the number of patients whose marital status is married and year of death is less than or equal to 2165?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dod_year <= "2165.0"
mimicsql_data
CREATE TABLE table_18213 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Status" text, "Opponent" text )
What district had someone first elected in 1982?
SELECT "District" FROM table_18213 WHERE "First elected" = '1982'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, ...
has patient 12726 excreted chest tubes left pleural 1 today?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12726)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes le...
mimic_iii
CREATE TABLE table_29460 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
What was the team's position in table when Danny OST was the outgoing manager?
SELECT "Position in table" FROM table_29460 WHERE "Outgoing manager" = 'Danny Ost'
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...
平均医疗住院时长超过4天的科室在医院9519720中有多少个?
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9519720' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING AVG(t_kc21.IN_HOSP_DAYS) > 4) AS T
css
CREATE TABLE table_73616 ( "World record" text, "Denis Nizhegorodov ( RUS )" text, "3:34:14" text, "Cheboksary , Russia" text, "11 May 2008" text )
When 3:41:20 is 3:34:14 what is cheboksary , russia?
SELECT "Cheboksary , Russia" FROM table_73616 WHERE "3:34:14" = '3:41:20'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE aircraft ( aircraft_code varc...
show me the fares on all flights round trip from PITTSBURGH to OAKLAND
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
CREATE TABLE table_12576536_1 ( year INTEGER, population__woocoo_ VARCHAR )
Name the most year when population of woocoo is 2700
SELECT MAX(year) FROM table_12576536_1 WHERE population__woocoo_ = 2700
sql_create_context
CREATE TABLE table_75365 ( "Athlete" text, "Sport" text, "Type" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average gold of the winter athlete with 1 bronze, less than 3 silver, and less than 4 total medals?
SELECT AVG("Gold") FROM table_75365 WHERE "Bronze" = '1' AND "Type" = 'winter' AND "Silver" < '3' AND "Total" < '4'
wikisql
CREATE TABLE table_name_4 ( laps INTEGER, year VARCHAR, co_drivers VARCHAR )
What is the lowest Laps that has a Year after 2002 with Alexander Frei Bruno Besson?
SELECT MIN(laps) FROM table_name_4 WHERE year > 2002 AND co_drivers = "alexander frei bruno besson"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name te...
what was the the organism name found in the first pleural fluid test of patient 17398 until 40 months ago?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398) AND microbiologyevents.spec_type_desc = 'pleural fluid' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) <=...
mimic_iii
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
Date of first questions 2017.
SELECT DATE(Posts.CreationDate) AS asked, COUNT(1) AS questions FROM (SELECT MIN(Id) AS Id, OwnerUserId FROM Posts GROUP BY OwnerUserId) AS temp, Posts WHERE temp.Id = Posts.Id AND DATE(Posts.CreationDate) BETWEEN '01/01/2017' AND '01/01/2018' AND TIME_TO_STR(DATE(Posts.CreationDate), '%W') IN (2, 3, 4, 5, 6) GROUP BY ...
sede
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE T...
topics used by Luke Zettlemoyer
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Luke Zettlemoyer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_name_77 ( height_ft___m VARCHAR, name VARCHAR )
What is the height of the building named 555 17th street?
SELECT height_ft___m FROM table_name_77 WHERE name = "555 17th street"
sql_create_context
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARC...
For the attribute other_details and the amount of other_details, show their proportion by a pie chart.
SELECT other_details, COUNT(other_details) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench