context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_35103 ( "Sanskrit \u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d" text, "Tamil \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" text, "Telugu \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" text, "Kannada \u0c95\u0ca8\u0ccd\u0ca8\u0ca1" text, "Malayalam \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" text, ...
Which Telugu has a Tamil of p sam ?
SELECT "Telugu \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" FROM table_35103 WHERE "Tamil \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" = 'pūsam பூசம்'
wikisql
CREATE TABLE table_70537 ( "Frame size" text, "Width" real, "Height" real, "Mpix" real, "Aspect Ratio" text, "Maximum fps" real, "Maximum fps HDRx" real, "least compression at 24 fps" text, "least compression at maximum fps" text )
What is the sum of Mpix with a maximum fps HDRX of less than 12 with a width larger than 5120?
SELECT SUM("Mpix") FROM table_70537 WHERE "Maximum fps HDRx" < '12' AND "Width" > '5120'
wikisql
CREATE TABLE table_30173 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What number in series was the episode written by Eric Gilliland?
SELECT MAX("No. in series") FROM table_30173 WHERE "Written by" = 'Eric Gilliland'
wikisql
CREATE TABLE table_490 ( "Celebrity" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Charity" text, "Result" text, "Raised" text )
Which celebrity was raised 03?
SELECT "Celebrity" FROM table_490 WHERE "Raised" = '03'
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...
依照科室名字的不同与出院时诊断的疾病编码不同查询一下医院5932040全部诊疗记录中患者就诊时的平均年纪
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5932040' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_15622 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
Which name has a Lane smaller than 3, a Heat larger than 4, and a Time of 2:00.80?
SELECT "Name" FROM table_15622 WHERE "Lane" < '3' AND "Heat" > '4' AND "Time" = '2:00.80'
wikisql
CREATE TABLE table_name_81 ( _number_of_episodes VARCHAR, portrayed_by VARCHAR )
How many episodes were portrayed by Nick Jonas?
SELECT COUNT(_number_of_episodes) FROM table_name_81 WHERE portrayed_by = "nick jonas"
sql_create_context
CREATE TABLE table_15525 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Dave Douglas has what score?
SELECT "Score" FROM table_15525 WHERE "Player" = 'dave douglas'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is admission time and discharge time of subject id 64208?
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "64208"
mimicsql_data
CREATE TABLE table_4770 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what day is geelong the home team?
SELECT "Date" FROM table_4770 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
在编号为74512529856的这次医疗就诊中,查一下给患者袁良哲开的药品名称及每次的用量和使用频次
SELECT SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '74512529856'
css
CREATE TABLE table_14341967_2 ( extra_points INTEGER, player VARCHAR )
Name the most extra points for john heston
SELECT MAX(extra_points) FROM table_14341967_2 WHERE player = "John Heston"
sql_create_context
CREATE TABLE table_10830 ( "Team" text, "Season" text, "Regular Season" real, "Tournament" real, "Total" real )
What season for the team with over 2 tournaments and 13 regular season titles?
SELECT "Season" FROM table_10830 WHERE "Tournament" > '2' AND "Regular Season" = '13'
wikisql
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...
患者66859587在13年8月16日到2014年3月7日内有哪些药品的自费金额比2896.1元高?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '66859587' AND t_kc22.STA_DATE BETWEEN '2013-08-16' AND '2014-03-07' AND t_kc22.SELF_PAY_AMO > 2896.1
css
CREATE TABLE table_name_31 ( round VARCHAR, venue VARCHAR, opponent VARCHAR )
What is the round of the game at venue H and opponent of Derby County?
SELECT round FROM table_name_31 WHERE venue = "h" AND opponent = "derby county"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose admission year is less than 2174 and diagnoses long title is below knee amputation status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2174" AND diagnoses.long_title = "Below knee amputation status"
mimicsql_data
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...
自二零零二年一月十三日开始,截止到二零一八年十月七日,患者46217483通过医疗机构4175604开的西药总数有多少
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '46217483' AND t_kc22.STA_DATE BETWEEN '2002-01-13' AND '2018-10-07' AND qtb.MED_SER_ORG_NO = '4175604' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED...
css
CREATE TABLE table_name_90 ( date VARCHAR, save VARCHAR )
When have a Save of ||20,599||32-37?
SELECT date FROM table_name_90 WHERE save = "||20,599||32-37"
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...
罗列出从05年7月13号到06年2月28号内患者47121310所有检验结果指标记录中的仪器编号以及名称是哪些?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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 = ...
css
CREATE TABLE table_name_6 ( gecko VARCHAR, prince_xml VARCHAR, khtml VARCHAR )
What is the Gecko value for the item that has a Prince XML value of 'no' and a KHTML value of 'yes'?
SELECT gecko FROM table_name_6 WHERE prince_xml = "yes" AND khtml = "yes"
sql_create_context
CREATE TABLE table_203_576 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which nation earned only one silver medal ?
SELECT "nation" FROM table_203_576 WHERE "silver" = 1
squall
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 ReviewTasks ( Id number, ReviewTaskTypeId number, ...
Questions with a specific tag both at first and current revision.
SELECT SUM(CASE WHEN HadTag = 1 AND HasTag = 0 THEN 1 ELSE 0 END) AS TagRemoved, SUM(CASE WHEN HadTag = 0 AND HasTag = 1 THEN 1 ELSE 0 END) AS TagAdded, SUM(CASE WHEN HadTag = 1 AND HasTag = 1 THEN 1 ELSE 0 END) AS TagPersisted, SUM(CASE WHEN HadTag = 1 OR HasTag = 1 THEN 1 ELSE 0 END) AS Total FROM (SELECT CASE WHEN P...
sede
CREATE TABLE table_41415 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real )
What was the ranking of Beirasar Rosal a, the year they played 32 games?
SELECT MAX("Rank") FROM table_41415 WHERE "Team" = 'beirasar rosalía' AND "Games" < '32'
wikisql
CREATE TABLE table_name_1 ( opponent VARCHAR, time VARCHAR )
Which opponent had a time of 1:26?
SELECT opponent FROM table_name_1 WHERE time = "1:26"
sql_create_context
CREATE TABLE table_20229 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
What is the name of the pictorial in the 11-98 issue?
SELECT "Pictorials" FROM table_20229 WHERE "Date" = '11-98'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, ...
information on flights from DENVER to PHILADELPHIA
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE table_name_17 ( date VARCHAR, score VARCHAR, loss VARCHAR )
What date was the score 5-2 with a loss of sele (3-2)?
SELECT date FROM table_name_17 WHERE score = "5-2" AND loss = "sele (3-2)"
sql_create_context
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
Plot the number of county by grouped by county as a bar graph, and list by the y axis in descending.
SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY COUNT(County) DESC
nvbench
CREATE TABLE table_53194 ( "Season" real, "Overall" text, "Slalom" text, "Super G" text, "Downhill" text, "Combined" text )
What year's Season had an Overall of 77?
SELECT "Season" FROM table_53194 WHERE "Overall" = '77'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
what is the daily maximum mch value for patient 006-99708 in this month?
SELECT MAX(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 = '006-99708')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of mon...
eicu
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...
Top 100 answers by score.
SELECT pa.Id AS "post_link", pa.Score, pq.Tags FROM Posts AS pa INNER JOIN Posts AS pq ON pa.ParentId = pq.Id WHERE pa.PostTypeId = 2 ORDER BY Score DESC LIMIT 100
sede
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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolea...
Distribution of HNQs based on minutes until entering.
WITH times_cte AS (SELECT p.Id AS pid, p.CreationDate AS cre, ph.CreationDate AS hot, CAST((JULIANDAY(CreationDate) - JULIANDAY(p.CreationDate)) * 1440.0 AS INT) AS minutes FROM PostHistory AS ph INNER JOIN Posts AS p ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 52) SELECT minutes, COUNT(pid) AS Count FROM times_ct...
sede
CREATE TABLE table_name_40 ( termination_of_mission VARCHAR, appointed_by VARCHAR )
What was the Termination of Mission date for the ambassador who was appointed by Barack Obama?
SELECT termination_of_mission FROM table_name_40 WHERE appointed_by = "barack obama"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeou...
during the previous year, what are the three most frequent interventions that patients were given in the same hospital encounter after receiving endotracheal tube?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'endot...
eicu
CREATE TABLE table_79671 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "County" text, "Year Joined" real, "Previous Conference" text )
What is the IHSAA class for the team located in Middlebury, IN?
SELECT "IHSAA Class" FROM table_79671 WHERE "Location" = 'middlebury, in'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients have stayed in the hospital for more than 27 days and whose discharge location was rehab/distinct part hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.days_stay > "27"
mimicsql_data
CREATE TABLE table_20468206_1 ( obama_number INTEGER, mccain_percentage VARCHAR )
Name the most obama number for mccain being 38.86%
SELECT MAX(obama_number) FROM table_20468206_1 WHERE mccain_percentage = "38.86%"
sql_create_context
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 diagnoses ( ...
what is drug dose of drug name theophylline sr?
SELECT prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Theophylline SR"
mimicsql_data
CREATE TABLE table_26041144_11 ( average VARCHAR, player VARCHAR )
What was kumar sangakkara's average?
SELECT average FROM table_26041144_11 WHERE player = "Kumar Sangakkara"
sql_create_context
CREATE TABLE table_66592 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
What is the lowest pick for the Buffalo Bills?
SELECT MIN("Pick") FROM table_66592 WHERE "Team" = 'buffalo bills'
wikisql
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city...
A bar chart showing the first name of all the faculty members who participated in some activity, together with the number of activities they participated in, display y-axis from low to high order.
SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_4 ( name VARCHAR, nation VARCHAR, points VARCHAR )
what is the name when the nation is soviet union and the points is 185?
SELECT name FROM table_name_4 WHERE nation = "soviet union" AND points = 185
sql_create_context
CREATE TABLE table_63655 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
How many clubs are involved when there are 4 winners from the previous rounds and more than 4 clubs remaining?
SELECT MIN("Clubs involved") FROM table_63655 WHERE "Winners from previous round" = '4' AND "Clubs remaining" > '4'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
when was patient 016-34426 until 2103 admitted for the first time to the hospital?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-34426' AND STRFTIME('%y', patient.hospitaladmittime) <= '2103' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_34052 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What Time/Retired has a Points that's smaller than 11 and has a Laps of 74?
SELECT "Time/Retired" FROM table_34052 WHERE "Points" < '11' AND "Laps" = '74'
wikisql
CREATE TABLE table_name_63 ( opponent VARCHAR, site VARCHAR, result VARCHAR )
What Opponent has a Site of war memorial stadium little rock, ar, and a Result of l6 7?
SELECT opponent FROM table_name_63 WHERE site = "war memorial stadium • little rock, ar" AND result = "l6–7"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
What courses offer 17 credit hours ?
SELECT DISTINCT name, number FROM course WHERE credits = 17 AND department = 'EECS'
advising
CREATE TABLE table_69461 ( "Rider" text, "Year" real, "Final Position - Giro" real, "Final Position - Tour" real, "Final Position - Vuelta" real )
What year was the rider with a final position-tour of 88 and less than 11 final position-giros?
SELECT SUM("Year") FROM table_69461 WHERE "Final Position - Tour" = '88' AND "Final Position - Giro" < '11'
wikisql
CREATE TABLE table_28164986_4 ( date_of_appointment VARCHAR, manner_of_departure VARCHAR, team VARCHAR )
when was the next coach appointed after niger tornadoes fired their coach?
SELECT date_of_appointment FROM table_28164986_4 WHERE manner_of_departure = "fired" AND team = "Niger Tornadoes"
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 ...
医院7488811的门诊就诊中有多少科室在零三年五月七日到零九年四月十二日的这几年开出高25张检验报告单
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_21313498_1 ( written_by VARCHAR, no_in_season VARCHAR )
in the number of episode in season is 11, who was the writer?
SELECT written_by FROM table_21313498_1 WHERE no_in_season = 11
sql_create_context
CREATE TABLE table_46177 ( "Rank" real, "Team" text, "Played" real, "Loss" real, "Last 5" text, "Streak" text, "PF per game" real, "PA per game" real, "PD per game" real, "Winning %" text )
Which Played has a PD per game larger than 6.28, and a Loss smaller than 4?
SELECT MIN("Played") FROM table_46177 WHERE "PD per game" > '6.28' AND "Loss" < '4'
wikisql
CREATE TABLE table_name_13 ( held_every VARCHAR, sport VARCHAR )
How often is the table tennis competition held?
SELECT held_every FROM table_name_13 WHERE sport = "table tennis"
sql_create_context
CREATE TABLE table_name_43 ( draw VARCHAR, televote_points VARCHAR )
Which Draw had 8 Televote Points?
SELECT COUNT(draw) FROM table_name_43 WHERE televote_points = "8"
sql_create_context
CREATE TABLE table_name_87 ( captain_2 VARCHAR, result VARCHAR )
Which Captain 2 has a Result of ireland by 8 runs?
SELECT captain_2 FROM table_name_87 WHERE result = "ireland by 8 runs"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( ...
how many times do patient 030-80604 go to icu in their last hospital visit?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-80604' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)
eicu
CREATE TABLE table_name_44 ( winners INTEGER, rank VARCHAR, third VARCHAR )
Which Winners is the highest one that has a Rank larger than 7, and a Third smaller than 1?
SELECT MAX(winners) FROM table_name_44 WHERE rank > 7 AND third < 1
sql_create_context
CREATE TABLE table_61829 ( "School" text, "Location" text, "Nickname(s)" text, "Colors" text, "Years Member" text )
What Colors has a School of zeigler high school?
SELECT "Colors" FROM table_61829 WHERE "School" = 'zeigler high school'
wikisql
CREATE TABLE table_51222 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" real, "Against Prohibition" real, "Percent Against" real )
What is the lowest percentage opposing prohibition when the number opposing is 9,575 and the percent supporting is less than 72.2?
SELECT MIN("Percent Against") FROM table_51222 WHERE "Against Prohibition" = '9,575' AND "Percent For" < '72.2'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
9925100这个医疗机构在零九年八月二十日到一四年二月十三日期间看过的特需门诊记录有多少
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '9925100' AND JZKSRQ BETWEEN '2009-08-02' AND '2014-02-13' AND TXBZ > 0
css
CREATE TABLE table_name_84 ( opponent_team VARCHAR, scorers VARCHAR )
Who was the opposing team when the scorers were jong-a-pin 19'( o.g. ) , gattuso 23' , inzaghi 69'?
SELECT opponent_team FROM table_name_84 WHERE scorers = "jong-a-pin 19'( o.g. ) , gattuso 23' , inzaghi 69'"
sql_create_context
CREATE TABLE table_33549 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the away team for the game at Victoria Park?
SELECT "Away team" FROM table_33549 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_18666 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
how many district with incumbent being david delano glover
SELECT COUNT("District") FROM table_18666 WHERE "Incumbent" = 'David Delano Glover'
wikisql
CREATE TABLE table_73128 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
How many players have the pick number 166?
SELECT COUNT("Player") FROM table_73128 WHERE "Pick #" = '166'
wikisql
CREATE TABLE table_name_65 ( location_attendance VARCHAR, game VARCHAR )
What is the location and attendance of game 44?
SELECT location_attendance FROM table_name_65 WHERE game = 44
sql_create_context
CREATE TABLE Research_Staff ( employer_organisation_id VARCHAR ) CREATE TABLE Organisations ( organisation_type VARCHAR, organisation_id VARCHAR )
Which organisation type hires most research staff?
SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) DESC LIMIT 1
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...
名字叫郎高义的病患他的身高和体重都是多少?
SELECT txmzjzjlb.SG, txmzjzjlb.TZ FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '郎高义' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ...
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
hmm.. what was patient 49295's last ph until 6 months ago?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49295) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-6 month') O...
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients had atrial septal defect / mitral valve replacement;repair atrial-septal defect/sda as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA"
mimicsql_data
CREATE TABLE table_name_71 ( socialist_workers_ticket VARCHAR, republican_ticket VARCHAR )
What socialist workers ticket has malcolm wilson as the Republican ticket?
SELECT socialist_workers_ticket FROM table_name_71 WHERE republican_ticket = "malcolm wilson"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
tell me the amount of ns that patient 031-24460 has received.
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24460')) AND intakeoutput.celllabel = 'ns' A...
eicu
CREATE TABLE table_64718 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
How many Episodes have a Romaji Title of slow dance?
SELECT SUM("Episodes") FROM table_64718 WHERE "Romaji Title" = 'slow dance'
wikisql
CREATE TABLE table_28805 ( "English" text, "Galician ( Official )" text, "Galician ( Reintegrationist )" text, "Portuguese" text, "Spanish" text )
What is the Portuguese word for the English word 'grandfather'?
SELECT "Portuguese" FROM table_28805 WHERE "English" = 'Grandfather'
wikisql
CREATE TABLE table_64436 ( "Fuel gas" text, "Upper index Kcal/ Nm 3" real, "Lower index Kcal/ Nm 3" real, "Upper index MJ/ Nm 3" real, "Lower index MJ/ Nm 3" real )
What is the entry for Upper index Kcal/ Nm 3 for the row with an entry that has a Lower index MJ/ Nm 3 larger than 47.91, for propylene, and an Upper index MJ/ Nm 3 larger than 77.04?
SELECT SUM("Upper index Kcal/ Nm 3") FROM table_64436 WHERE "Lower index MJ/ Nm 3" > '47.91' AND "Fuel gas" = 'propylene' AND "Upper index MJ/ Nm 3" > '77.04'
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...
Reputation per 1000 characters, for users > 2k..
SELECT u.DisplayName AS "user_link", COUNT(p.Id) AS "post_count", u.Reputation AS "user_reputation", u.Reputation * 1000 / SUM(LENGTH(p.Body)) AS "user_rpc1k" FROM Users AS U JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Reputation > 2000 GROUP BY u.DisplayName, u.Reputation ORDER BY 'user_rpc1k' DESC LIMIT 1000
sede
CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE campuses ( id number, ...
What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county?
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
spider
CREATE TABLE table_20656 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Foursomes W-L-H" text, "Fourballs W-L-H" text, "Points won" text, "Points %" text )
When the foursome was w-l-h is 1 0 0 won w/ p. creamer 3&2, what was the points %?
SELECT "Points %" FROM table_20656 WHERE "Foursomes W-L-H" = '1–0–0 won w/ P. Creamer 3&2'
wikisql
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, Other_Details VARCHAR(255) ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_...
Return a bar chart showing the number of documents stored in each weekday.
SELECT Date_Stored, COUNT(Date_Stored) FROM All_Documents AS T1 JOIN Ref_Calendar AS T2 ON T1.Date_Stored = T2.Calendar_Date
nvbench
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
what was the total of the cerebral drain r ventricular drain output that patient 94937 had on 12/27/last year?
SELECT SUM(outputevents.value) 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 = 94937)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cer...
mimic_iii
CREATE TABLE table_name_96 ( points VARCHAR, losses VARCHAR, draws VARCHAR )
How many points have a loss less than 5, and 0 for draws?
SELECT COUNT(points) FROM table_name_96 WHERE losses < 5 AND draws = 0
sql_create_context
CREATE TABLE table_22265225_1 ( original_air_date VARCHAR, production_code VARCHAR )
What day did the episode with a production code of 218 originally air?
SELECT original_air_date FROM table_22265225_1 WHERE production_code = "218"
sql_create_context
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text )
Visualize a bar chart for what are the names of different tracks, and how many races has each had?, and display y axis from high to low order.
SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_39442 ( "School Name" text, "City" text, "Students" real, "FTE Teachers" real, "Pupil/Teacher Ratio" real )
What is the highest number of students for schools in Campbell with pupil to teacher ratios over 25?
SELECT MAX("Students") FROM table_39442 WHERE "City" = 'campbell' AND "Pupil/Teacher Ratio" > '25'
wikisql
CREATE TABLE table_name_89 ( finish VARCHAR, year VARCHAR )
In 1939, what was the finish?
SELECT finish FROM table_name_89 WHERE year = "1939"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
tell me the five most frequent lab test that was ordered since 2101?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE STRFTIME('%y', lab.labresulttime) >= '2101' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_29770377_1 ( train_number VARCHAR, route_via VARCHAR )
How many trains are there for the route via trivandrum, ernakulam, newdelhi?
SELECT COUNT(train_number) FROM table_29770377_1 WHERE route_via = "Trivandrum, Ernakulam, NewDelhi"
sql_create_context
CREATE TABLE table_64304 ( "Year" real, "Chinese Title" text, "English" text, "Role" text, "Character" text )
What is the English character for Lin Ming Kuan ( )?
SELECT "English" FROM table_64304 WHERE "Character" = 'lin ming kuan (林明寬)'
wikisql
CREATE TABLE table_16774 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
What was the name of the race in Bordeaux?
SELECT "Race Name" FROM table_16774 WHERE "Circuit" = 'Bordeaux'
wikisql
CREATE TABLE table_name_66 ( round INTEGER, loser VARCHAR )
What was the average number of rounds in the fight where Tank Abbott lost?
SELECT AVG(round) FROM table_name_66 WHERE loser = "tank abbott"
sql_create_context
CREATE TABLE table_name_66 ( round INTEGER, pick VARCHAR )
What is the lowest Round, when Pick is 9 (via Hamilton)?
SELECT MIN(round) FROM table_name_66 WHERE pick = "9 (via hamilton)"
sql_create_context
CREATE TABLE table_name_55 ( Id VARCHAR )
What is the 2009 value in the 2011 Grand Slam Tournaments?
SELECT 2009 FROM table_name_55 WHERE 2011 = "grand slam tournaments"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
what were the top three most frequent diagnoses that patients were given within 2 months after being diagnosed with hiccough until 2 years ago?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
CREATE TABLE table_name_80 ( speed VARCHAR, location VARCHAR )
What is the Speed at Lake Mead?
SELECT speed FROM table_name_80 WHERE location = "lake mead"
sql_create_context
CREATE TABLE table_name_20 ( attendance VARCHAR, location VARCHAR, game VARCHAR )
What is the total number of people in attendance when the game was at TD Banknorth Garden, in a game higher than 31?
SELECT COUNT(attendance) FROM table_name_20 WHERE location = "td banknorth garden" AND game > 31
sql_create_context
CREATE TABLE table_29995 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What NHL team picked Ryan Meade for the draft?
SELECT "NHL team" FROM table_29995 WHERE "Player" = 'Ryan Meade'
wikisql
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_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id ...
how many patients had been prescribed albumin 5% during this year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'albumin 5%' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
mimic_iii
CREATE TABLE table_38123 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text )
What location is previous to 1994?
SELECT "Location" FROM table_38123 WHERE "Year" < '1994'
wikisql
CREATE TABLE table_48237 ( "Name" text, "Street address" text, "Years as tallest" text, "# of Years as tallest" text, "Height m / ft" text, "Floors" real )
What is the name of the building that was the tallest for 28 years?
SELECT "Name" FROM table_48237 WHERE "# of Years as tallest" = '28 years'
wikisql
CREATE TABLE table_name_51 ( nationality VARCHAR, position VARCHAR, player VARCHAR )
Which Nationality has a Position of defense, and a Player of nikita korovkin?
SELECT nationality FROM table_name_51 WHERE position = "defense" AND player = "nikita korovkin"
sql_create_context