context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_37021 ( "Player" text, "League" real, "Malaysia Cup" real, "FA Cup" real, "Total" real )
How many Malaysia Cups have a Total larger than 3, and a Player of ivan yusoff, and a League smaller than 2?
SELECT COUNT("Malaysia Cup") FROM table_37021 WHERE "Total" > '3' AND "Player" = 'ivan yusoff' AND "League" < '2'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
哪几个医院给患者16090485开了编号为056956的药
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '16090485' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '056956')
css
CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, ...
What is the first name of the staff who did not give any lesson?
SELECT first_name FROM staff EXCEPT SELECT T2.first_name FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id
spider
CREATE TABLE table_60209 ( "Season" text, "League" text, "Teams" text, "Home" text, "Away" text )
What is the league for season 1955-56?
SELECT "League" FROM table_60209 WHERE "Season" = '1955-56'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
what is the maximum number of patients diagnosed with ami inferior wall, init daily until 4 years ago?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ami inferior wall, init') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-4 year')...
mimic_iii
CREATE TABLE table_name_85 ( year VARCHAR, performance VARCHAR, age__years_ VARCHAR )
What is the year when the performance is 60.73m and the age (years) is more than 45?
SELECT COUNT(year) FROM table_name_85 WHERE performance = "60.73m" AND age__years_ > 45
sql_create_context
CREATE TABLE table_14751 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original name" text, "Director" text )
What is the original name of the film that used the title Olympics 40 in nomination?
SELECT "Original name" FROM table_14751 WHERE "Film title used in nomination" = 'olympics 40'
wikisql
CREATE TABLE table_name_6 ( year VARCHAR, playoffs VARCHAR, league VARCHAR )
What year had a 1st round playoff in the NASL indoor league?
SELECT year FROM table_name_6 WHERE playoffs = "1st round" AND league = "nasl indoor"
sql_create_context
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_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
how many patients had been diagnosed with ventral hernia nos until 2103?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ventral hernia nos') AND STRFTIME('%y', diagnoses_icd.char...
mimic_iii
CREATE TABLE physician ( employeeid number, name text, position text, ssn number ) CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE undergoes ( patient number, procedures number, s...
How many rooms are located for each block code?
SELECT COUNT(*), T1.blockcode FROM block AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode
spider
CREATE TABLE table_name_61 ( gold VARCHAR, nation VARCHAR, total VARCHAR, bronze VARCHAR )
What is the total number of golds having a total of 1, bronzes of 0, and from West Germany?
SELECT COUNT(gold) FROM table_name_61 WHERE total = 1 AND bronze < 1 AND nation = "west germany"
sql_create_context
CREATE TABLE table_name_18 ( week_13_nov_26 VARCHAR, week_14_dec_3 VARCHAR )
What is the week 13 result where the week 14 resulted in Maryland (10-1)?
SELECT week_13_nov_26 FROM table_name_18 WHERE week_14_dec_3 = "maryland (10-1)"
sql_create_context
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
患有疾病M60.726的患者的在确诊时其D2聚体(柠檬酸盐)的含量参考值范围的下限与上限的数值都是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'M60.726' AND jyjgzbb.JCZBMC = 'D2聚体(柠檬酸盐)' UNION SELECT jyjgzbb.CK...
css
CREATE TABLE table_24550 ( "District" text, "Headquarters" text, "Area (km\u00b2)" real, "Population (2011)" real, "Division" text )
If the 2011 population is 3685681, what is the name of the headquarters?
SELECT "Headquarters" FROM table_24550 WHERE "Population (2011)" = '3685681'
wikisql
CREATE TABLE table_name_63 ( evening_gown INTEGER, average VARCHAR, interview VARCHAR, swimsuit VARCHAR )
Which is the smallest evening gown score when the interview score was more than 9.164, the swimsuit stat was less than 9.35, and the average is less than 9.233?
SELECT MIN(evening_gown) FROM table_name_63 WHERE interview > 9.164 AND swimsuit < 9.35 AND average < 9.233
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
provide the number of hispanic/latino or puerto rican patients who had insertion of one vascular stent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.long_title = "Insertion of one vascular stent"
mimicsql_data
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, ...
医院4248222的出院诊断医生陈医生给患者施方方做的出院诊断结果都分别是什么?
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '施方方' AND gwyjzb.MED_SER_ORG_NO = '4248222' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '陈%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '施方方' AND fgwyjzb.MED_SER_ORG_NO = '4248222' AN...
css
CREATE TABLE table_41719 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text, "Attendance" text )
What is the score where the away team is Exeter City?
SELECT "Score" FROM table_41719 WHERE "Away team" = 'exeter city'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
when was last time the sao2 of patient 027-132801 was greater than 99.0 on this month/04?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-132801')) AND vitalperiodic.sao2 > 99.0 AND NOT...
eicu
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
npm new questions with accepted answers by year.
SELECT CAST(TIME_TO_STR(CreationDate, '%Y/%m/%d') AS TEXT(10)) AS datepart, COUNT(*) AS "new_stackoverflow_q_today" FROM Posts GROUP BY CAST(TIME_TO_STR(CreationDate, '%Y/%m/%d') AS TEXT(10)) ORDER BY datepart DESC
sede
CREATE TABLE table_57181 ( "Round" real, "Pick" real, "Player" text, "Pos." text, "Nationality" text, "Team" text, "School/club team" text )
Which position has a School/club team of jacksonville?
SELECT "Pos." FROM table_57181 WHERE "School/club team" = 'jacksonville'
wikisql
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, ...
请问编号54118858的患者,有哪些检验报告单对应的检验结果指标全部是正常的?能把检验报告单号列出来吗?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '54118858' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number,...
Top 100 Answerers for a Given Tag.
SELECT Users.DisplayName, Tags.TagName, SUM(Answers.Score) AS Score FROM Users JOIN Posts AS Answers ON Answers.OwnerUserId = Users.Id JOIN Posts ON Posts.Id = Answers.ParentId JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON Tags.Id = PostTags.TagId WHERE Users.DisplayName IN (SELECT Users.DisplayName FROM Tag...
sede
CREATE TABLE table_name_2 ( home_team VARCHAR )
What was Footscray's score when it played as the home team?
SELECT home_team AS score FROM table_name_2 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_name_4 ( developer_s_ VARCHAR, game VARCHAR )
Who was the developer of Resident Evil 4?
SELECT developer_s_ FROM table_name_4 WHERE game = "resident evil 4"
sql_create_context
CREATE TABLE table_68886 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." real )
What is the highest number of points the cosworth straight-4 engine scored?
SELECT MAX("Pts.") FROM table_68886 WHERE "Engine" = 'cosworth straight-4'
wikisql
CREATE TABLE table_18118 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
what is the party for the district south carolina 4?
SELECT "Party" FROM table_18118 WHERE "District" = 'South Carolina 4'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
was the value of calcium of patient 028-11360 last measured on the first hospital visit less than it was second to last measured on the first hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-11360' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_name_97 ( rank VARCHAR )
Which 3rd run has rank of 1?
SELECT 3 AS rd_run FROM table_name_97 WHERE rank = 1
sql_create_context
CREATE TABLE table_204_991 ( id number, "name" text, "first\nheld" number, "country" text, "earliest attendance figure known" text, "1998 attendance" number, "2000 attendance" number, "2002 attendance" number, "2004 attendance" number, "2006 attendance" number, "2008 attendan...
how many people attended the 2000 animeiowa ?
SELECT "2000 attendance" FROM table_204_991 WHERE "name" = 'animeiowa'
squall
CREATE TABLE table_6497 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
Which Tie # that has an Attendance of 14 november 1998, and an Away team of hayes?
SELECT "Tie no" FROM table_6497 WHERE "Attendance" = '14 november 1998' AND "Away team" = 'hayes'
wikisql
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, de...
What is the id and name of the aircraft that can cover the maximum distance?
SELECT aid, name FROM aircraft ORDER BY distance DESC LIMIT 1
spider
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 the difference was in the hgb value of patient 007-16517 last measured on the current hospital visit compared to the value first measured on the current hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16517' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'hgb' ...
eicu
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, and sort from low to high by the y-axis.
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
find the number of patients with elective admission type whose procedure title is other conversion of cardiac rhythm.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Other conversion of cardiac rhythm"
mimicsql_data
CREATE TABLE table_29406 ( "Pronoun" text, "Present" text, "1st" text, "2nd" text, "perfect" text, "aorist" text, "imperfect" text, "pluperfect" text )
What aorist has bude in present tense?
SELECT "aorist" FROM table_29406 WHERE "Present" = 'bude'
wikisql
CREATE TABLE table_name_45 ( score VARCHAR, runner_up VARCHAR )
What is the score having a runner-up of Magdalena Maleeva?
SELECT score FROM table_name_45 WHERE runner_up = "magdalena maleeva"
sql_create_context
CREATE TABLE table_275506_1 ( start_of_stage VARCHAR, year VARCHAR )
How many entries for start of stage occur in the year 2006?
SELECT COUNT(start_of_stage) FROM table_275506_1 WHERE year = "2006"
sql_create_context
CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage number, accession_number text, sequence_length number, sequence_identity_to_human_protein text, institution_id text ) CREATE TABLE institution ( institution_id text, institution text, locat...
Show the institution type with the largest number of institutions.
SELECT type FROM institution GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_67 ( away_team VARCHAR, tie_no VARCHAR )
What team was the away team when the tie no is 40?
SELECT away_team FROM table_name_67 WHERE tie_no = "40"
sql_create_context
CREATE TABLE table_22729 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Land area (km\u00b2)" text, "Population density (per km\u00b2)" text )
When 14.85 kilometers squared is the land area what is the name?
SELECT "Name" FROM table_22729 WHERE "Land area (km\u00b2)" = '14.85'
wikisql
CREATE TABLE table_name_62 ( wins VARCHAR, rank VARCHAR, top_fives VARCHAR )
What is the total number of wins when casey mears ranked 36th and had more than 0 top fives?
SELECT COUNT(wins) FROM table_name_62 WHERE rank = "36th" AND top_fives > 0
sql_create_context
CREATE TABLE table_name_1 ( name VARCHAR, time_retired VARCHAR )
Who recorded a time or retired time of 52:56.4653?
SELECT name FROM table_name_1 WHERE time_retired = "52:56.4653"
sql_create_context
CREATE TABLE table_10066 ( "Railway" text, "Builder" text, "Built" text, "Wheels" text, "Location" text, "ObjectNumber" text )
Who was the builder in 1920?
SELECT "Builder" FROM table_10066 WHERE "Built" = '1920'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
What other classes must I take prior to studying MUSED 595 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many patients whose primary disease is rash and year of death is less than or equal to 2154?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.dod_year <= "2154.0"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
how did patient 021-155303 first get admitted in the hospital until 2104?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '021-155303' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_41273 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
What is Result, when Director is Mirza Idrizovi category:articles with hcards?
SELECT "Result" FROM table_41273 WHERE "Director" = 'mirza idrizović category:articles with hcards'
wikisql
CREATE TABLE table_20945 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text )
Who had the fastest lap when the winning team was Tom's Racing?
SELECT "Fastest Lap" FROM table_20945 WHERE "Winning Team" = 'TOM''S Racing'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostsWit...
Top Answers for Negative Questions.
WITH q AS (SELECT * FROM dbo.Posts WHERE PostTypeId = 1) SELECT q.Id AS q_id, 'https://mi.yodeya.com/questions/' + CAST(q.Id AS TEXT(255)) AS q_url, q.Title AS q_title, q.Score AS q_score, A.Id AS a_id, 'https://mi.yodeya.com/a/' + CAST(a.Id AS TEXT(255)) AS a_url, a.Score AS a_score FROM q INNER JOIN dbo.Posts AS a ON...
sede
CREATE TABLE table_12147 ( "Seat" real, "Series 1" text, "Series 3" text, "Series 4" text, "Series 5" text )
What is the series 4 with sarah newman in series 1?
SELECT "Series 4" FROM table_12147 WHERE "Series 1" = 'sarah newman'
wikisql
CREATE TABLE table_60542 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue number(s)" text )
Which Format has a Label of eagle records, and a Catalogue number(s) of edgcd391?
SELECT "Format" FROM table_60542 WHERE "Label" = 'eagle records' AND "Catalogue number(s)" = 'edgcd391'
wikisql
CREATE TABLE table_name_4 ( react INTEGER, athlete VARCHAR, rank VARCHAR )
What is the average react of athlete muna lee, who is ranked greater than 3?
SELECT AVG(react) FROM table_name_4 WHERE athlete = "muna lee" AND rank > 3
sql_create_context
CREATE TABLE table_name_15 ( loss VARCHAR, long VARCHAR, gain VARCHAR )
WHAT IS THE NUMBER OF LOSSES WITH A LONG SMALLER THAN 24, AND GAIN BIGGER THAN 116?
SELECT COUNT(loss) FROM table_name_15 WHERE long < 24 AND gain > 116
sql_create_context
CREATE TABLE table_67307 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
Name the points for Engine of chevrolet 265c
SELECT "Points" FROM table_67307 WHERE "Engine" = 'chevrolet 265c'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is the number of patients whose days of hospital stay is greater than 6 and lab test name is asparate aminotransferase (ast)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab.label = "Asparate Aminotransferase (AST)"
mimicsql_data
CREATE TABLE table_6579 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text )
What celebrity finished 6th?
SELECT "Celebrity" FROM table_6579 WHERE "Finished" = '6th'
wikisql
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 wdmzjzjlb ( CYBQDM text, CYBQ...
从05年8月1日到21年1月3日,病人在8515930这个医疗机构的住院时间超过30天的记录有多少
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '8515930' AND wdmzjzjlb.RYDJSJ BETWEEN '2005-08-01' AND '2021-01-03' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 30 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '8515930' AND bdmzjzjlb.RYDJSJ BETWEEN '2005-08-01' AND '2021-01-03' AND DATEDIFF(b...
css
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
I want to see trend of the number of creation by creation, could you list in descending by the X?
SELECT Creation, COUNT(Creation) FROM department GROUP BY Creation ORDER BY Creation DESC
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
What is the relationship between Team_ID and School_ID ?
SELECT Team_ID, School_ID FROM basketball_match
nvbench
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Give me the comparison about Height over the Name by a bar chart.
SELECT Name, Height FROM people
nvbench
CREATE TABLE table_name_72 ( location VARCHAR, capacity VARCHAR )
Which location has 101,119 as the capacity?
SELECT location FROM table_name_72 WHERE capacity = "101,119"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, C...
分别在哪几家医院患者钱婉娜被开出过编码为814113的药品?
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '钱婉娜' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '814113')
css
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 ) ...
what is primary disease and admission time of subject name gonzalo wasson?
SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.name = "Gonzalo Wasson"
mimicsql_data
CREATE TABLE table_38432 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the Total that has a number of Nation and a Gold smaller than 16?
SELECT MIN("Total") FROM table_38432 WHERE "Nation" = 'total' AND "Gold" < '16'
wikisql
CREATE TABLE table_8081 ( "County or City" text, "NUTS 3 Region" text, "Population (2006)" text, "Area (km\u00b2)" text, "Population Density" text, "Principal town/city" text, "Vehicle Registration Code" text )
What is the NUT 3 region with area of 41.58?
SELECT "NUTS 3 Region" FROM table_8081 WHERE "Area (km\u00b2)" = '41.58'
wikisql
CREATE TABLE table_name_76 ( number_of_vehicles VARCHAR, type_designation VARCHAR )
Which Number of vehicles has a Type designation of u5-25 (bi-directional)?
SELECT number_of_vehicles FROM table_name_76 WHERE type_designation = "u5-25 (bi-directional)"
sql_create_context
CREATE TABLE table_31833 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Tell me the opponents for partner of yvonne meusburger
SELECT "Opponents" FROM table_31833 WHERE "Partner" = 'yvonne meusburger'
wikisql
CREATE TABLE table_49362 ( "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text )
What is the type of the king title?
SELECT "Type" FROM table_49362 WHERE "Title" = 'king'
wikisql
CREATE TABLE table_3658 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
When 'the legacy' is the title what is the production code?
SELECT "Production code" FROM table_3658 WHERE "Title" = 'The Legacy'
wikisql
CREATE TABLE table_name_26 ( college VARCHAR, player VARCHAR )
What college does Dennis Scott attend?
SELECT college FROM table_name_26 WHERE player = "dennis scott"
sql_create_context
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, ...
tell me the three most frequent surgeries that patients received during the same month after having had a sedative agent - lorazepam procedure last year?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'sedative agent - lorazepam' AND DATETIME...
eicu
CREATE TABLE student ( id VARCHAR, dept_name VARCHAR ) CREATE TABLE advisor ( i_id VARCHAR, s_id VARCHAR ) CREATE TABLE instructor ( name VARCHAR, salary VARCHAR, id VARCHAR )
Find the name and salary of the instructors who are advisors of any student from History department?
SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'
sql_create_context
CREATE TABLE table_14242137_11 ( season VARCHAR, regionalliga_nord VARCHAR )
what's the season with regionalliga nord being vfb oldenburg
SELECT season FROM table_14242137_11 WHERE regionalliga_nord = "VfB Oldenburg"
sql_create_context
CREATE TABLE table_name_15 ( Id VARCHAR )
What is 1987, when 1986 is '1R'?
SELECT 1987 FROM table_name_15 WHERE 1986 = "1r"
sql_create_context
CREATE TABLE table_name_16 ( type VARCHAR, works_number VARCHAR )
What is Type, when Works Number is 75823?
SELECT type FROM table_name_16 WHERE works_number = "75823"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
这位谢红香的患者在13年1月13日到14年5月21日期间,在医院看病时一共检查了多少次
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '谢红香' AND t_kc22.STA_DATE BETWEEN '2013-01-13' AND '2014-05-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '谢红香' A...
css
CREATE TABLE table_20063 ( "Class" text, "Wheels" real, "Date" text, "Builder" text, "No. built" real, "1919 nos." text, "LMS Class" text, "LMS nos." text )
How many figures are there for wheels for LMS numbers 16377-9?
SELECT COUNT("Wheels") FROM table_20063 WHERE "LMS nos." = '16377-9'
wikisql
CREATE TABLE table_name_7 ( matches INTEGER, goals VARCHAR, rank VARCHAR )
Can you tell me the sum of Matches that has the Goals of 103, and the Rank larger than 9?
SELECT SUM(matches) FROM table_name_7 WHERE goals = 103 AND rank > 9
sql_create_context
CREATE TABLE table_10128185_2 ( scotland VARCHAR, total VARCHAR )
What is the total number of votes if Scotland cast 35?
SELECT COUNT(scotland) FROM table_10128185_2 WHERE total = 35
sql_create_context
CREATE TABLE table_45751 ( "SCHOOL" text, "LOCATION" text, "PUBS. 2010" real, "TOTALS 06-10" real, "RANK 06-10" real, "PUBS 2011" real, "TOTALS 07-11" real, "RANK 07-11" real, "WORLD RANKING" text )
What is the lowest 06-10 totals with a pubs 2010 of 68 and a 07-11 totals larger than 305?
SELECT MIN("TOTALS 06-10") FROM table_45751 WHERE "PUBS. 2010" = '68' AND "TOTALS 07-11" > '305'
wikisql
CREATE TABLE table_1974545_3 ( softball_stadium VARCHAR, school VARCHAR )
What is the name of UMass Boston's softball stadium?
SELECT softball_stadium FROM table_1974545_3 WHERE school = "UMass Boston"
sql_create_context
CREATE TABLE table_68748 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the time for Adi Bichman?
SELECT "Time" FROM table_68748 WHERE "Name" = 'adi bichman'
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,...
how many patients whose gender is m and diagnoses long title is incisional ventral hernia with obstruction?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Incisional ventral hernia with obstruction"
mimicsql_data
CREATE TABLE table_name_65 ( pick__number VARCHAR, round VARCHAR, college VARCHAR )
What pick number was from the college of maryland and was picked in a round larger than 7?
SELECT pick__number FROM table_name_65 WHERE round > 7 AND college = "maryland"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Give the number of patients whose ethnicity is White that have a main drug type.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_35 ( tyre VARCHAR, driver VARCHAR )
Which tyre is on the car driven by Pedro de la Rosa?
SELECT tyre FROM table_name_35 WHERE driver = "pedro de la rosa"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose admission type is urgent and diagnoses long title is diabetes mellitus without mention of complication, type ii or unspecified type, uncontrolled?
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 = "Diabetes mellitus without mention of complication, type II or unspecified type, uncontrolled"
mimicsql_data
CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Video_Games ( Ga...
Show all sport name and the number of students Show bar chart, and list in desc by the Y.
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Tit...
Finding Potential Posts To Be Closed.
SELECT Id AS "post_link", OwnerUserId AS "user_link", Score, Tags FROM Posts WHERE Score <= 0 AND ClosedDate IS NULL AND (LOWER(Title) LIKE '%broken%' OR LOWER(Title) LIKE '%fixing' OR LOWER(Title) LIKE '%debug my code%' OR LOWER(Title) LIKE '%help me fix%' OR LOWER(Title) LIKE '%debugging my code%')
sede
CREATE TABLE table_72810 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text )
At a longitude of 109.9e, how many features were found?
SELECT COUNT("Diameter (km)") FROM table_72810 WHERE "Longitude" = '109.9E'
wikisql
CREATE TABLE table_31078 ( "Week of" text, "Tournament" text, "Champion" text, "Runner-up" text, "Semifinalists" text, "Quarterfinalists" text )
Who was the champion in the tournament where Scott Davis Chris Dunk was the runner up?
SELECT "Champion" FROM table_31078 WHERE "Runner-up" = 'Scott Davis Chris Dunk'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId ...
Top n Python questions since x.
SELECT p.Id, p.Title, p.CreationDate, p.Score, p.AnswerCount FROM Posts AS p JOIN PostTags AS ptags ON p.Id = ptags.PostId JOIN Tags AS tags ON Tags.Id = ptags.TagId WHERE Tags.TagName = 'python' AND p.PostTypeId = 1 AND p.Score > 1 AND p.CreationDate >= '##since:string##' ORDER BY p.Score DESC, p.CreationDate DESC LIM...
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
How many patients discharged to skilled nursing facility have aortic insufficiency/re-do sternotomy aortic valve replacement as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
mimicsql_data
CREATE TABLE table_19809 ( "Software" text, "Version" text, "Operating systems" text, "Developer" text, "License" text )
How many licenses have version 1.2.2.0?
SELECT COUNT("License") FROM table_19809 WHERE "Version" = '1.2.2.0'
wikisql
CREATE TABLE table_name_13 ( date VARCHAR, course VARCHAR )
What date was moena to aprica the course?
SELECT date FROM table_name_13 WHERE course = "moena to aprica"
sql_create_context
CREATE TABLE table_name_82 ( bronze INTEGER, silver INTEGER )
with silver count at 0, what is the lowest bronze count?
SELECT MIN(bronze) FROM table_name_82 WHERE silver < 0
sql_create_context
CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE songs ( songid number, title text ) CREAT...
Find the number of vocal types used in song 'Demon Kitty Rag'?
SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Demon Kitty Rag"
spider
CREATE TABLE table_name_21 ( date VARCHAR, away_team VARCHAR )
What day is south melbourne the away side?
SELECT date FROM table_name_21 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_name_51 ( office VARCHAR, law_preservation_ticket VARCHAR )
What office was law preservation ticket holder William E. Barron running for?
SELECT office FROM table_name_51 WHERE law_preservation_ticket = "william e. barron"
sql_create_context