context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_98 (
genre VARCHAR,
release_year_of_first_charted_record VARCHAR
) | Name the genre for release-year of first charted record of 1988 | SELECT genre FROM table_name_98 WHERE release_year_of_first_charted_record = 1988 | sql_create_context |
CREATE TABLE table_203_645 (
id number,
"lower mississippi periods" text,
"lower yazoo phases" text,
"lower yazoo\ndates" text,
"tensas/natchez phases" text,
"cahokia phases" text,
"cahokia dates" text,
"ohio/miss. river\nconfluence phases" text,
"ohio/miss. dates" text
) | how many cahokia phases were there ? | SELECT COUNT(DISTINCT "cahokia phases") FROM table_203_645 | squall |
CREATE TABLE table_43428 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What date did Week 9 begin? | SELECT "Date" FROM table_43428 WHERE "Week" = '9' | wikisql |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 赵凌春这位患者以前都有做过哪些具体的治疗 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '赵凌春' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P... | css |
CREATE TABLE table_15811 (
"Department" text,
"Head" text,
"Full professors" real,
"Honorary professors" real,
"Lecturers" real
) | How many full professors work under Hartmut Kliemt with more than 0 lecturers? | SELECT COUNT("Full professors") FROM table_15811 WHERE "Head" = 'hartmut kliemt' AND "Lecturers" > '0' | wikisql |
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
type text,
built_year int,
notes text
)
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location t... | What are the ids and names of the architects who built at least 3 bridges . Show the proportion. | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id | nvbench |
CREATE TABLE table_name_33 (
average INTEGER,
start_value VARCHAR,
total VARCHAR
) | What is the average for the gymnast with a 9.9 start value and a total of 9.612? | SELECT AVG(average) FROM table_name_33 WHERE start_value = 9.9 AND total = 9.612 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 在11-12-13到19-01-19期间内,患者凤飞尘被开出的所有检验报告单中的标本采集部位需要列出来 | SELECT zyjybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤飞尘... | css |
CREATE TABLE table_76080 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of Total when rank is 2? | SELECT SUM("Total") FROM table_76080 WHERE "Rank" = '2' | wikisql |
CREATE TABLE table_name_27 (
articulatory_class VARCHAR,
non__stop VARCHAR
) | If the Non- stop is ( ), what is the Articulatory Class? | SELECT articulatory_class FROM table_name_27 WHERE non__stop = "(ㆁ)" | sql_create_context |
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... | what was the name of the output which patient 035-17122 had for the first time? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-17122')) AND intakeoutput.cellpath LIKE '%output%' ORDER... | eicu |
CREATE TABLE table_34615 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"TV Time" text,
"Attendance" text
) | what is the date on week 6 | SELECT "Date" FROM table_34615 WHERE "Week" = '6' | wikisql |
CREATE TABLE table_name_66 (
college_junior_club_team__league_ VARCHAR,
player VARCHAR
) | What college did Louis LeBlanc attend? | SELECT college_junior_club_team__league_ FROM table_name_66 WHERE player = "louis leblanc" | sql_create_context |
CREATE TABLE table_1473672_2 (
nhl_team VARCHAR,
college_junior_club_team VARCHAR
) | Jack Lynch played for the oshawa generals (omjhl) before playing for what nhl team? | SELECT nhl_team FROM table_1473672_2 WHERE college_junior_club_team = "Oshawa Generals (OMJHL)" | sql_create_context |
CREATE TABLE table_name_43 (
stadium VARCHAR,
club VARCHAR
) | In which stadium does Club Pro Patria play? | SELECT stadium FROM table_name_43 WHERE club = "pro patria" | sql_create_context |
CREATE TABLE table_name_52 (
away_team VARCHAR,
venue VARCHAR
) | Who was the away team at Western Oval? | SELECT away_team FROM table_name_52 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | what are the four most frequent procedures performed since 3 years ago? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | is the heartrate of patient 011-23193 last measured on the first icu visit less than the value second to last measured on the first icu visit? | SELECT (SELECT 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 = '011-23193') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_67702 (
"Week" real,
"Date" text,
"Visiting Team" text,
"Host Team" text,
"Stadium" text
) | How many weeks in total were games played at Cleveland Browns Stadium? | SELECT COUNT("Week") FROM table_67702 WHERE "Stadium" = 'cleveland browns stadium' | wikisql |
CREATE TABLE table_21100348_10 (
innings VARCHAR,
average VARCHAR
) | How man innings were there during the period with a career average of 41.43? | SELECT innings FROM table_21100348_10 WHERE average = "41.43" | sql_create_context |
CREATE TABLE table_25995 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Orangemen points" real,
"Opponents" real,
"Record" text
) | Who did the Orangemen play against when their record was 5-1? | SELECT "Opponent" FROM table_25995 WHERE "Record" = '5-1' | wikisql |
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
... | Bar chart x axis date in location from y axis the number of date in location from | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations | nvbench |
CREATE TABLE table_53818 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
) | What is the smallest population in a region greater than 9? | SELECT MIN("Population") FROM table_53818 WHERE "Region" > '9' | wikisql |
CREATE TABLE table_30588 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text
) | What is the name of the young rider classification when Paolo Tiralongo won? | SELECT "Young rider classification" FROM table_30588 WHERE "Winner" = 'Paolo Tiralongo' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar... | show me all flights from SAN DIEGO to NEW YORK using DC10 | SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (aircraft.basic_type = 'DC10' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND equipment_se... | atis |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | what are the five most frequent drugs that were prescribed in the same hospital visit to cardiomyopathy male patient, age 40s after they have been diagnosed with cardiomyopathy? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiomyopathy'... | eicu |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Meta posts with more than one required tag. | SELECT c.PostId AS "post_link", REPLACE(REPLACE(REPLACE(p.Tags, ' ', ' '), '><', ' '), '!= ', '') AS "tags" FROM (SELECT PostId, COUNT(*) AS "count" FROM PostTags WHERE TagId = @TagId1 OR TagId = @TagId2 OR TagId = @TagId3 OR TagId = @TagId4 GROUP BY PostId) AS c LEFT JOIN Posts AS p ON p.Id = c.PostId WHERE c.Count >=... | sede |
CREATE TABLE table_49714 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text
) | What is Socket, when Voltage is 2.0V, and when Model Number is Pentium II 333? | SELECT "Socket" FROM table_49714 WHERE "Voltage" = '2.0v' AND "Model number" = 'pentium ii 333' | wikisql |
CREATE TABLE table_55181 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | Which week had 39,056 people in attendance? | SELECT "Week" FROM table_55181 WHERE "Attendance" = '39,056' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | what is the lab test given to patient 009-12221 for the last time in 10/last year? | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12221')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), ... | eicu |
CREATE TABLE table_name_90 (
overall INTEGER,
name VARCHAR,
pick VARCHAR
) | How many overalls have charley barnes as the name, with a pick less than 3? | SELECT SUM(overall) FROM table_name_90 WHERE name = "charley barnes" AND pick < 3 | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
... | show me the earliest flight on 8 2 from BOSTON to DENVER that serves a meal | 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, date_day, days, flight, food_service WHERE (((date_day.day_number = 2 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.... | atis |
CREATE TABLE table_134987_3 (
frequency VARCHAR,
format VARCHAR
) | What is the frequency for the Christian Kawz-fm Translator station? | SELECT frequency FROM table_134987_3 WHERE format = "Christian KAWZ-FM translator" | sql_create_context |
CREATE TABLE table_name_53 (
genre VARCHAR,
station VARCHAR
) | What genre has a station of Class 95FM? | SELECT genre FROM table_name_53 WHERE station = "class 95fm" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | give me the number of patients whose age is less than 68 and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | For the attribute cName and enr, show their proportion by a pie chart. | SELECT cName, enr FROM College ORDER BY enr | nvbench |
CREATE TABLE table_29340 (
"Genus/Species" text,
"Gene Name" text,
"Accession number" text,
"Sequence Length" text,
"Sequence similarity" real
) | Name the accession number for rhodopseudomonas palustris | SELECT "Accession number" FROM table_29340 WHERE "Genus/Species" = 'Rhodopseudomonas palustris' | wikisql |
CREATE TABLE table_name_33 (
notes VARCHAR,
time VARCHAR
) | What is the notes entry for the row with a Time of 1:42.309? | SELECT notes FROM table_name_33 WHERE time = "1:42.309" | sql_create_context |
CREATE TABLE table_30052 (
"Round" text,
"Main date" text,
"Number of fixtures" real,
"Clubs" text,
"New entries this round" text,
"Prize money" text,
"Player of the Round" text
) | what is the club in the sixth round proper | SELECT "Clubs" FROM table_30052 WHERE "Round" = 'Sixth round proper' | wikisql |
CREATE TABLE table_name_69 (
bronze VARCHAR,
silver VARCHAR,
total VARCHAR
) | How many bronze medals are there when there are fewer than 3 silver medals and 7 medals total? | SELECT bronze FROM table_name_69 WHERE silver < 3 AND total = 7 | sql_create_context |
CREATE TABLE table_name_75 (
power__kw_ VARCHAR,
location VARCHAR
) | Which Power has Location in metro manila | SELECT power__kw_ FROM table_name_75 WHERE location = "metro manila" | sql_create_context |
CREATE TABLE table_204_574 (
id number,
"year" number,
"title" text,
"peak chart positions\nswe" number,
"peak chart positions\nswi" number,
"peak chart positions\nuk" number,
"album" text
) | which year did they release their first album ? | SELECT "year" FROM table_204_574 WHERE id = 1 | squall |
CREATE TABLE table_name_14 (
grid VARCHAR,
rider VARCHAR
) | Tell me the total number of grid for rider of james toseland | SELECT COUNT(grid) FROM table_name_14 WHERE rider = "james toseland" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event... | what are the new prescription drug of patient 808 today compared to that yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE p... | mimic_iii |
CREATE TABLE table_22350 (
"No." real,
"Album" text,
"Artist" text,
"Record label" text,
"Released" text,
"Chart peak" real,
"Number of times certified platinum" text
) | When abba is the artist what is the album? | SELECT "Album" FROM table_22350 WHERE "Artist" = 'ABBA' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | Average score for answers in Java. | SELECT AVG(Score) AS ave FROM Posts WHERE PostTypeId = 2 AND Tags LIKE '%php%' | sede |
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... | 0057514这个医疗机构在零七年四月二十八日到零九年九月八日期间看过新生儿门诊的记录有多少 | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '0057514' AND mzjzjlb.JZKSRQ BETWEEN '2007-04-28' AND '2009-09-08' AND mzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_name_80 (
date VARCHAR,
race_name VARCHAR
) | What date was the xiv international gold cup? | SELECT date FROM table_name_80 WHERE race_name = "xiv international gold cup" | sql_create_context |
CREATE TABLE table_10321124_1 (
shigella VARCHAR,
yersinia VARCHAR
) | what's the shigella with yersinia being yscp | SELECT shigella FROM table_10321124_1 WHERE yersinia = "YscP" | sql_create_context |
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_DIRE_CD text,
MED_DIRE_NM text,... | 4063324这所医疗机构在20零六年九月三十到零九年的六月二十二号所有就诊记录里就诊患者是未就业人员的数目 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4063324' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-09-30' AND '2009-06-22' AND t_kc21.INSURED_STS = '未就业' | css |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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 t... | 患者98927870为检测指标229548从06年10月2日到2011年7月16日之内的医务人员工号与姓名都是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE table_9818 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What bike has an accident time, less than 9 laps, and a 5 grid? | SELECT "Bike" FROM table_9818 WHERE "Time" = 'accident' AND "Laps" < '9' AND "Grid" = '5' | 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 zyjzjlb (
CYBQDM text,
CYBQMC... | 医疗机构5267326超过27天的住院天数的人有多少? | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_in... | css |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | Top Distinct Tag Badge Counts. | SELECT UserId AS "user_link", COUNT(DISTINCT LOWER(Name)) AS NumTagBadges, COUNT(*) AS CountTagBadges FROM Badges WHERE Name IN (SELECT TagName FROM Tags) GROUP BY UserId ORDER BY NumTagBadges DESC LIMIT 10 | sede |
CREATE TABLE table_30111 (
"Player" text,
"Matches" real,
"Overs" text,
"Wickets" real,
"Average" text,
"Economy" text,
"BBI" text,
"4wi" real
) | What was the BBI for the bowler whose average is 24.50? | SELECT "BBI" FROM table_30111 WHERE "Average" = '24.50' | wikisql |
CREATE TABLE table_9652 (
"Season" text,
"Premiere" text,
"Finale" text,
"Episodes" real,
"Timeslot" text,
"Rank" text,
"Viewers (in households)" real
) | When was the finale played when the show premiered on September 24, 2002? | SELECT "Finale" FROM table_9652 WHERE "Premiere" = 'september 24, 2002' | wikisql |
CREATE TABLE table_204_297 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many countries did not earn silver medals ? | SELECT COUNT("nation") FROM table_204_297 WHERE "silver" = 0 | squall |
CREATE TABLE table_name_28 (
average INTEGER,
interview VARCHAR,
evening_gown VARCHAR
) | What is the average when interview is 9.465 and evening gown is less than 9.454? | SELECT SUM(average) FROM table_name_28 WHERE interview = 9.465 AND evening_gown < 9.454 | sql_create_context |
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_DIRE_CD text,
MED_DIRE_NM text,... | 二零零七年五月三日到二零一七年八月二十二日的这十年里,查一下医院9214530给异地患者看病的次数 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9214530' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-05-03' AND '2017-08-22' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2' | css |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by time, could you display in ascending by the Y-axis? | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) | nvbench |
CREATE TABLE table_58677 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
) | WHAT IS THE AWAY WITH HOME AT 2-2? | SELECT "Away" FROM table_58677 WHERE "Home" = '2-2' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | What are the first and last name of the president of the club 'Bootup Baltimore'? | SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t2.position = "President" | spider |
CREATE TABLE table_47994 (
"Year" real,
"Network" text,
"Title" text,
"Notes" text,
"Language" text
) | What is the network that aired Star King prior to 2011? | SELECT "Network" FROM table_47994 WHERE "Year" < '2011' AND "Title" = 'star king' | wikisql |
CREATE TABLE table_name_59 (
leading_scorer VARCHAR,
visitor VARCHAR
) | What is the leading scorer of the game with the Celtics as the visiting team? | SELECT leading_scorer FROM table_name_59 WHERE visitor = "celtics" | 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... | what is discharge location of subject id 76508? | SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "76508" | mimicsql_data |
CREATE TABLE table_35422 (
"Name" text,
"Innhabitants" real,
"Area" real,
"Mayor" text,
"Party" text,
"Municipal code" real,
"Language form" text
) | What's the Municipal code of the FRP Party with an area of 100? | SELECT SUM("Municipal code") FROM table_35422 WHERE "Party" = 'frp' AND "Area" = '100' | wikisql |
CREATE TABLE table_71155 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." text
) | What is the entrant that has 0 points? | SELECT "Entrant" FROM table_71155 WHERE "Pts." = '0' | wikisql |
CREATE TABLE table_59543 (
"Total fat" text,
"Saturated fat" text,
"Monounsaturated fat" text,
"Polyunsaturated fat" text,
"Smoke point" text
) | What is the smoke point with a total fat of 100g, and monounsaturated fat of 46g? | SELECT "Smoke point" FROM table_59543 WHERE "Total fat" = '100g' AND "Monounsaturated fat" = '46g' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | had patient 029-16737 receive a surgery consultation procedure until 3 years ago? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND treatment.treatmentname = 'surgery consultation' AND DATETI... | eicu |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Descrip... | When was Jon last seen?. | SELECT LastAccessDate FROM Users WHERE Id = 1438 | sede |
CREATE TABLE table_44590 (
"Season" real,
"Series" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
) | If Podiums is 2 and F/Laps are 2, what are the wins? | SELECT "Wins" FROM table_44590 WHERE "Podiums" = '2' AND "F/Laps" = '2' | wikisql |
CREATE TABLE table_11044765_1 (
school VARCHAR,
mascot VARCHAR
) | Which school has the Raiders as their mascot? | SELECT school FROM table_11044765_1 WHERE mascot = "Raiders" | sql_create_context |
CREATE TABLE table_name_67 (
method VARCHAR,
record VARCHAR,
round VARCHAR,
res VARCHAR
) | What is the method for a match with a Round larger than 2, he took a loss, and 15 3 was the record? | SELECT method FROM table_name_67 WHERE round > 2 AND res = "loss" AND record = "15–3" | 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,
... | what is maximum age of patients whose marital status is single and primary disease is gangrene? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "GANGRENE" | mimicsql_data |
CREATE TABLE table_name_81 (
episode_title VARCHAR,
original_airdate VARCHAR
) | Name the episode that aired october 8, 1988 | SELECT episode_title FROM table_name_81 WHERE original_airdate = "october 8, 1988" | sql_create_context |
CREATE TABLE table_name_44 (
proto_oceanic VARCHAR,
verb VARCHAR
) | What is the Proto-Oceanic verb for to die, be dead? | SELECT proto_oceanic FROM table_name_44 WHERE verb = "to die, be dead" | sql_create_context |
CREATE TABLE table_75883 (
"Name" text,
"GP-GS" text,
"Year" text,
"Att-Cmp-Int" text,
"Avg/G" real
) | Which quarterback had an Avg/G of 195.8? | SELECT "Name" FROM table_75883 WHERE "Avg/G" = '195.8' | 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,
... | 从07年8月11日到18年7月17日,患者马芳蕙在470787上的检测记录详情 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id... | what was the amount of total output that patient 25312 had received on the first intensive care unit visit? | 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 = 25312) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) | mimic_iii |
CREATE TABLE table_name_12 (
nation_of_citizenship VARCHAR,
year_of_award INTEGER
) | What is the nation of citizenship for athletes later than 2011 year of award? | SELECT nation_of_citizenship FROM table_name_12 WHERE year_of_award > 2011 | sql_create_context |
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... | 5148275这个医疗机构在04年5月16日到2018年7月7日这个时间段内处理了几次异地就诊? | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '5148275' AND IN_HOSP_DATE BETWEEN '2004-05-16' AND '2018-07-07' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_27257896_2 (
salary_range VARCHAR,
indians VARCHAR
) | If the Indians are 8.2%, what is the salary range? | SELECT salary_range FROM table_27257896_2 WHERE indians = "8.2%" | sql_create_context |
CREATE TABLE table_2527 (
"Rank" real,
"School" text,
"Basic Elements" real,
"Tumbling" real,
"Stunts" text,
"Pyramids" text,
"Tosses" text,
"Deductions" text,
"Total" text
) | What is every deduction for pyramids of 49? | SELECT "Deductions" FROM table_2527 WHERE "Pyramids" = '49' | wikisql |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
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... | Give me a bar chart for the number of year of each year, order by the how many year in ascending. | SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) | nvbench |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Users With the Highest Quality Posts (filter reputation). Enter the minimum reputation that a user must have, and this will show the
users who have the highest reputation per post in that group. | SELECT Id AS "user_link", Reputation, (SELECT COUNT(*) FROM Posts WHERE Posts.OwnerUserId = Users.Id) AS "#_posts", Reputation / (SELECT COUNT(*) FROM Posts WHERE Posts.OwnerUserId = Users.Id) AS "rep_per_post" FROM Users WHERE Reputation > @MinRep ORDER BY 'rep_per_post' DESC | sede |
CREATE TABLE table_204_395 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | in what year did ken harnden participate in more than one competition ? | SELECT "year" FROM table_204_395 GROUP BY "year" HAVING COUNT("competition") > 1 | squall |
CREATE TABLE table_name_28 (
score VARCHAR,
decision VARCHAR,
date VARCHAR
) | What's the score on january 5 with a hasek decision? | SELECT score FROM table_name_28 WHERE decision = "hasek" AND date = "january 5" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
... | Show the name of each party and the corresponding number of delegates from that party in a bar chart, rank by the bar in asc. | SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party | nvbench |
CREATE TABLE table_name_86 (
away_team VARCHAR,
venue VARCHAR
) | Who was the away team that played Fitzroy on May 13, 1950 at Brunswick Street Oval. | SELECT away_team FROM table_name_86 WHERE venue = "brunswick street oval" | sql_create_context |
CREATE TABLE table_21124 (
"Rank" real,
"Company" text,
"Country" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
) | Name the country for 188.77 market value | SELECT "Country" FROM table_21124 WHERE "Market Value (billion $)" = '188.77' | wikisql |
CREATE TABLE table_name_40 (
gold VARCHAR,
silver VARCHAR,
rank VARCHAR,
nation VARCHAR
) | Which Gold has a Rank of 7, a Nation of italy, and a Silver smaller than 0? | SELECT COUNT(gold) FROM table_name_40 WHERE rank = "7" AND nation = "italy" AND silver < 0 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insuranc... | until 1071 days ago, what was the daily maximum intake of gt flush of patient 3516? | SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... | mimic_iii |
CREATE TABLE table_name_70 (
status_of_match VARCHAR,
fixture VARCHAR
) | What is the status of the match between Scotland v Northern Ireland? | SELECT status_of_match FROM table_name_70 WHERE fixture = "scotland v northern ireland" | sql_create_context |
CREATE TABLE table_name_88 (
works_number VARCHAR,
type VARCHAR,
builder VARCHAR
) | Builder H. K. Porter, inc who had a type of 0-4-4 Forney locomotive, has what works number? | SELECT works_number FROM table_name_88 WHERE type = "0-4-4 forney locomotive" AND builder = "h. k. porter, inc" | sql_create_context |
CREATE TABLE AssignedTo (
ssn VARCHAR,
scientist VARCHAR
)
CREATE TABLE scientists (
ssn VARCHAR,
scientist VARCHAR
) | Find the number of scientists who are not assigned to any project. | SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) | sql_create_context |
CREATE TABLE table_name_95 (
ihsaa_class VARCHAR,
location VARCHAR
) | What is the IHSAA class for the team located in Middlebury, IN? | SELECT ihsaa_class FROM table_name_95 WHERE location = "middlebury, in" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose insurance is medicare and diagnosis short title is ben neo spinal meninges. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Ben neo spinal meninges" | mimicsql_data |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course (
course_id int,
na... | What area do I get B 's in the most ? | SELECT DISTINCT DERIVED_TABLEalias0.DERIVED_FIELDalias1 FROM (SELECT AREAalias0.area, COUNT(*) INNER JOIN student_record ON student_record.course_id = AREAalias0.course_id WHERE student_record.grade LIKE 'B' AND student_record.student_id = 1 GROUP BY AREAalias0.area) AS DERIVED_TABLEalias0 WHERE DERIVED_TABLEalias0.DER... | advising |
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room INTEGER,
StayStart DATETIME,
StayEnd DATETIME
)
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patient INTEGER,
PrepNurse INTEGER,
Physician INTEGER,
Start DATETIME,
End DATETIME,
ExaminationRoom TEXT
)
CREATE... | A bar chart for finding the number of the physicians who are trained in a procedure that costs more than 5000, and order in descending by the y-axis. | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC | nvbench |
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 ... | 从08年7月20日到13年10月17日这段时间里,患者38917711所有检验结果指标记录中的检测方法都有什么啊? | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.