context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_19951 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | In episode 115 what is seen being made before British police helmets? | SELECT "Segment B" FROM table_19951 WHERE "Segment C" = 'British Police Helmets' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | Are all the upper-level classes 3 credits ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 3 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_2208838_4 (
played VARCHAR,
season VARCHAR
) | How many games were played in the 1989 season? | SELECT played FROM table_2208838_4 WHERE season = "1989" | sql_create_context |
CREATE TABLE player (
Id VARCHAR
) | How many players are there? | SELECT COUNT(*) FROM player | sql_create_context |
CREATE TABLE table_name_82 (
away_team VARCHAR,
venue VARCHAR
) | Which Away team score has a Venue of scg? | SELECT away_team AS score FROM table_name_82 WHERE venue = "scg" | sql_create_context |
CREATE TABLE table_name_65 (
representative VARCHAR,
appointed_by VARCHAR,
presentation_of_credentials VARCHAR
) | Name the representative appointed by george w. bush with presentation of credentials 9 november 2007 | SELECT representative FROM table_name_65 WHERE appointed_by = "george w. bush" AND presentation_of_credentials = "9 november 2007" | sql_create_context |
CREATE TABLE people (
Name VARCHAR,
People_ID VARCHAR
)
CREATE TABLE perpetrator (
People_ID VARCHAR
) | What are the names of perpetrators? | SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID | sql_create_context |
CREATE TABLE table_name_49 (
player VARCHAR,
position VARCHAR,
nationality VARCHAR
) | Who has a nationality of Czech Republic and a position of right wing? | SELECT player FROM table_name_49 WHERE position = "right wing" AND nationality = "czech republic" | sql_create_context |
CREATE TABLE table_name_47 (
team__number2 VARCHAR
) | what is the 2nd leg when team #2 is algiris kaunas? | SELECT 2 AS nd_leg FROM table_name_47 WHERE team__number2 = "žalgiris kaunas" | sql_create_context |
CREATE TABLE table_66190 (
"Celestial Stem" text,
"Chinese Mandarin Pinyin" text,
"Cantonese Jyutping" text,
"Wuu Wuupin" text,
"Japanese kunyomi" text,
"Japanese on'yomi" text,
"Korean ( RR )" text,
"Manchu ( M\u00f6llendorff )" text,
"Vietnamese" text,
"Yin and Yang ( \u9670\u9... | What Japanese On'yomi has Catonese Jyutping of jyut6? | SELECT "Japanese on'yomi" FROM table_66190 WHERE "Cantonese Jyutping" = 'jyut6' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid numbe... | tell me how many doses of probalance patient 25733 had consumed today. | SELECT SUM(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 = 25733)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | count the number of patients whose admission year is less than 2112 and procedure long title is suture of laceration of bladder? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2112" AND procedures.long_title = "Suture of laceration of bladder" | mimicsql_data |
CREATE TABLE table_373 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
) | What is the rank of finale 37? | SELECT "Rank" FROM table_373 WHERE "Finale" = '37' | wikisql |
CREATE TABLE table_203_592 (
id number,
"institution" text,
"location" text,
"athletic nickname" text,
"undergraduate enrollment" number,
"graduate enrollment" number,
"total enrollment" number,
"2013 endowment\n(and us rank)" text,
"academic staff" number,
"motto" text
) | which institution has the most undergraduate enrollment ? | SELECT "institution" FROM table_203_592 ORDER BY "undergraduate enrollment" DESC LIMIT 1 | squall |
CREATE TABLE table_46277 (
"Club" text,
"Champions" real,
"Runners-up" real,
"3rd-Place" real,
"4th-Place" real
) | What is the average 4th-Place, when Runners-Up is less than 1, when Club is 'Tanjong Pagar United FC', and when 3rd-Place is greater than 0? | SELECT AVG("4th-Place") FROM table_46277 WHERE "Runners-up" < '1' AND "Club" = 'tanjong pagar united fc' AND "3rd-Place" > '0' | wikisql |
CREATE TABLE table_test_16 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"severe_hypertension" bool,
"adrenaline" bool,
"stroke" bool,
"renal_disease" bool,
"severe_uncontrolled_arterial_hypertension" bool,
"hepatic_disease" bool,
"... | age < 18 years and > 75 years | SELECT * FROM table_test_16 WHERE age < 18 OR age > 75 | criteria2sql |
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 is the name of the intake that patient 006-43795 first had until 01/25/2104? | 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 = '006-43795')) AND intakeoutput.cellpath LIKE '%intake%' AND S... | eicu |
CREATE TABLE table_54286 (
"Name" text,
"Model" text,
"Park" text,
"Country" text,
"Opened" real
) | Which country has a rollercoaster that opened in 2002, is a spinning coaster, and is located in Disney's Animal Kingdom? | SELECT "Country" FROM table_54286 WHERE "Opened" = '2002' AND "Model" = 'spinning coaster' AND "Park" = 'disney''s animal kingdom' | wikisql |
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE degrees (
year number,
campus number,
degrees number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
g... | What is the campus fee in the year 2000 for San Jose State University? | SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Jose State University" AND t1.year = 2000 | spider |
CREATE TABLE table_78892 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | For entries with lost larger than 21 and goals for smaller than 36, what is the average drawn? | SELECT AVG("Drawn") FROM table_78892 WHERE "Goals For" < '36' AND "Lost" > '21' | wikisql |
CREATE TABLE table_5481 (
"# 100" real,
"Season" text,
"Playing For" text,
"Against" text,
"Score" text
) | Which # 100 has a Season of 1991, and an Against of surrey? | SELECT MAX("# 100") FROM table_5481 WHERE "Season" = '1991' AND "Against" = 'surrey' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | did patient 031-3355 have the result of the microbiology tests when they came to the hospital first time? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_name_49 (
game INTEGER,
opponent VARCHAR,
february VARCHAR
) | What is the game number when the Toronto Maple Leafs were the opponent, and the February was less than 17? | SELECT AVG(game) FROM table_name_49 WHERE opponent = "toronto maple leafs" AND february < 17 | sql_create_context |
CREATE TABLE table_name_50 (
year VARCHAR,
tournament VARCHAR
) | What is the total number of Year(s), when Tournament is 'World Championships'? | SELECT COUNT(year) FROM table_name_50 WHERE tournament = "world championships" | sql_create_context |
CREATE TABLE table_name_19 (
yeast_ortholog VARCHAR,
subpathway VARCHAR,
genecards_entry VARCHAR
) | What is the yeast ortholog that has a subpathway of GGR and GeneCards entry CETN2? | SELECT yeast_ortholog FROM table_name_19 WHERE subpathway = "ggr" AND genecards_entry = "cetn2" | sql_create_context |
CREATE TABLE table_name_78 (
year INTEGER,
regular_season VARCHAR,
playoffs VARCHAR,
open_cup VARCHAR
) | What was the average year that the Nashville Metros did not qualify for the Playoffs, did not qualify for the Open Cup, and had the Regular Season 7th, Southeast? | SELECT AVG(year) FROM table_name_78 WHERE playoffs = "did not qualify" AND open_cup = "did not qualify" AND regular_season = "7th, southeast" | sql_create_context |
CREATE TABLE table_30255 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is every position for the CFL Edmonton? | SELECT "Position" FROM table_30255 WHERE "CFL Team" = 'Edmonton' | wikisql |
CREATE TABLE table_train_28 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systemic_antifungal_therapy" bool,
"child_pugh_class" string,
"invasive_candida_infection" bool,
"age" float,
"NOUSE" float
) | ongoing invasive candida infection | SELECT * FROM table_train_28 WHERE invasive_candida_infection = 1 | criteria2sql |
CREATE TABLE table_56769 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
) | What player is a cornerback? | SELECT "Player" FROM table_56769 WHERE "Position" = 'cornerback' | wikisql |
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE author (
aid int,
homepage... | return me the number of the organizations in ' North America ' . | SELECT COUNT(DISTINCT (name)) FROM organization WHERE continent = 'North America' | academic |
CREATE TABLE table_5300 (
"Episode No." text,
"Episode Title" text,
"UK Broadcast Date" text,
"Presenter" text,
"Countries Visited" text
) | Which country did Natalia Makarova visit? | SELECT "Countries Visited" FROM table_5300 WHERE "Presenter" = 'natalia makarova' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | provide the number of patients whose admission year is less than 2174 and diagnoses short title is thrush? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2174" AND diagnoses.short_title = "Thrush" | mimicsql_data |
CREATE TABLE table_204_792 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text
) | what was the difference in runs between the two teams on september 15 ? | SELECT ABS("score" - "score") FROM table_204_792 WHERE "date" = 'september 15' | squall |
CREATE TABLE table_6285 (
"Rank" text,
"Institution" text,
"Gold" real,
"Silver" real,
"Bronze" real
) | What is the average number of silvers for teams ranked 5 with 0 bronze? | SELECT AVG("Silver") FROM table_6285 WHERE "Rank" = '5' AND "Bronze" < '0' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId numbe... | number of active users per week. | SELECT Week, COUNT(n_posts) FROM (SELECT COUNT(Id) AS n_posts, 1.000 * TIME_TO_STR(CreationDate, '%Y') + 1.000 * TIME_TO_STR(CreationDate, '%W') / 52 AS Week, OwnerUserId FROM Posts WHERE PostTypeId IN (1, 2) AND (1.000 * TIME_TO_STR(CreationDate, '%Y') + 1.000 * TIME_TO_STR(CreationDate, '%W') / 52 < 1.000 * TIME_TO_S... | sede |
CREATE TABLE table_69216 (
"Goalkeeper" text,
"Goals" real,
"Matches" real,
"Average" real,
"Team" text
) | How many matches did goalkeeper Wilfredo Caballero have an average less than 1.11? | SELECT SUM("Matches") FROM table_69216 WHERE "Goalkeeper" = 'wilfredo caballero' AND "Average" < '1.11' | wikisql |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE ENROLL (... | Return a histogram on what is the total credit does each department offer?, rank Y-axis from high to low order please. | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT) DESC | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | For those employees who do not work in departments with managers that have ids between 100 and 200, find email and commission_pct , and visualize them by a bar chart. | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_3 (
round INTEGER,
name VARCHAR,
pick__number VARCHAR
) | What is the least round number for Jon Olinger, who was picked before pick # 24? | SELECT MIN(round) FROM table_name_3 WHERE name = "jon olinger" AND pick__number < 24 | sql_create_context |
CREATE TABLE table_61620 (
"Date" text,
"Teams" text,
"Score" text,
"Team" text,
"Venue" text
) | What day did Glentoran play at Windsor Park, Belfast? | SELECT "Date" FROM table_61620 WHERE "Team" = 'glentoran' AND "Venue" = 'windsor park, belfast' | wikisql |
CREATE TABLE table_203_794 (
id number,
"year" number,
"location" text,
"attendance" number,
"theme phrase" text,
"top messages" text,
"host" text,
"opening general session guest(s)" text,
"closing general session guest(s)" text,
"sunday night reception" text,
"wednesday nigh... | how many were attendance at the lotusphere conference in orlando in 1993 ? | SELECT "attendance" FROM table_203_794 WHERE "location" = 'orlando' AND "year" = 1993 | squall |
CREATE TABLE table_24582 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | who directed the production code 2t5710? | SELECT "Directed by" FROM table_24582 WHERE "Production code" = '2T5710' | 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_DIRE_CD text,
MED_DIRE_NM text,... | 从2017年2月25日到2017年11月19日内参保人92950798门诊西药费一共是多少? | SELECT SUM(t_kc22.AMOUNT) 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 = '92950798' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2017-02-25' AND '2017-11-19' AND t_kc22.MED_I... | css |
CREATE TABLE table_name_62 (
myspace INTEGER,
site VARCHAR,
orkut VARCHAR
) | What myspace has linkedin as the site, with an orkit greater than 3? | SELECT AVG(myspace) FROM table_name_62 WHERE site = "linkedin" AND orkut > 3 | sql_create_context |
CREATE TABLE table_16362 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | What is the production code of the episode written by Jos Molina that aired on October 12, 2004? | SELECT "Production code" FROM table_16362 WHERE "Written by" = 'José Molina' AND "Original air date" = 'October 12, 2004' | wikisql |
CREATE TABLE table_204_284 (
id number,
"jurisdiction" text,
"adherents" number,
"bishops" number,
"priests" number,
"monastics" number,
"monasteries" number,
"parishes" number
) | only jurisdiction with more than 550 monasteries | SELECT "jurisdiction" FROM table_204_284 WHERE "monasteries" > 550 | squall |
CREATE TABLE table_13619053_4 (
score VARCHAR,
record VARCHAR
) | How many games did the team play when they were 1-3? | SELECT COUNT(score) FROM table_13619053_4 WHERE record = "1-3" | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | count the number of patients whose diagnosis short title is hyperacusis and drug route is td. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hyperacusis" AND prescriptions.route = "TD" | mimicsql_data |
CREATE TABLE table_65319 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What attendance has October 16, 2005 as the date? | SELECT "Attendance" FROM table_65319 WHERE "Date" = 'october 16, 2005' | wikisql |
CREATE TABLE table_35595 (
"Length of game" text,
"Date" text,
"Away team" text,
"Score" text,
"Home team" text
) | What is the date of the that was played with the Baltimore Colts at home? | SELECT "Date" FROM table_35595 WHERE "Home team" = 'baltimore colts' | wikisql |
CREATE TABLE table_9540 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What 2009 has a 0 in 2008 & 2010? | SELECT "2009" FROM table_9540 WHERE "2010" = '0' AND "2008" = '0' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | Get number of questions for tag [typo3]. | SELECT Count FROM Tags WHERE TagName = 'typo3' | sede |
CREATE TABLE table_52174 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | What was the venue where the away team ended in a score of 6.8 (44)? | SELECT "Venue" FROM table_52174 WHERE "Away team score" = '6.8 (44)' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
... | How effective are we as a room. This query outputs the question and the number of voters that also left at least 10 messages in the SO Close Voters room http://chat.stackoverflow.com/rooms/41570/so-close-vote-reviewers. This excludes off-course now deleted posts but it gives an idea about the impact coordinates close v... | WITH c_user AS (SELECT '%:578411,%%' AS uid UNION SELECT '%:1043380,%' UNION SELECT '%:2756409,%' UNION SELECT '%:2246344,%') SELECT PostId AS "post_link", COUNT(*) FROM PostHistory AS ph INNER JOIN c_user ON ph.Text LIKE uid WHERE ph.PostHistoryTypeId = 10 AND ph.CreationDate > '2013-11-19' GROUP BY ph.PostId ORDER BY... | sede |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 之前患者杨欣荣已经做了哪些检查 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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_NM = '杨欣荣' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在2002年6月28日至2012年4月6日内柏安民患者医保的统筹基金支出总共有多少钱? | SELECT SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '柏安民' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-28' AND '2012-04-06' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '柏安民' AND t_kc2... | css |
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. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road | nvbench |
CREATE TABLE table_name_56 (
name VARCHAR,
authors VARCHAR
) | Who is The Author of zhou clarke zhang? | SELECT name FROM table_name_56 WHERE authors = "zhou clarke zhang" | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | count the number of patients whose death status is 0 and diagnoses short title is ac diastolic hrt failure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Ac diastolic hrt failure" | mimicsql_data |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
val... | Show names of technicians who are assigned to repair machines with value point more than 70, and count them by a bar chart, order by the y-axis in desc. | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_10724 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
) | What is the young rider classification for jesper worre and stage 3 | SELECT "Young rider classification" FROM table_10724 WHERE "Mountains classification" = 'jesper worre' AND "Stage" = '3' | wikisql |
CREATE TABLE table_name_6 (
set_2 VARCHAR,
total VARCHAR,
set_3 VARCHAR
) | What is the Set 2 with a Total of 45 12, and a Set 3 with 15 2? | SELECT set_2 FROM table_name_6 WHERE total = "45–12" AND set_3 = "15–2" | sql_create_context |
CREATE TABLE table_41824 (
"Week" real,
"Date" text,
"Time (CST)" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"NFL Recap" text
) | Which week has giants stadium as the game site? | SELECT "Week" FROM table_41824 WHERE "Game site" = 'giants stadium' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | tell me the age and primary disease of patient with patient id 65652. | SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "65652" | mimicsql_data |
CREATE TABLE table_17032 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | When is the first season there were 14.57 million U.S viewers? | SELECT MIN("No. in season") FROM table_17032 WHERE "U.S. viewers (millions)" = '14.57' | wikisql |
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... | 以前患者34588710是去哪里看病的 | SELECT zzmzjzjlb.YLJGDM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '34588710' UNION SELECT fzzmzjzjlb.YLJGDM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_i... | css |
CREATE TABLE table_name_74 (
density INTEGER,
population_2011_census VARCHAR
) | What is the lowest density of a town with a 13,708 2011 population census ? | SELECT MIN(density) FROM table_name_74 WHERE population_2011_census = 13 OFFSET 708 | sql_create_context |
CREATE TABLE table_28880 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who was the incumbent when the candidate was william drayton (j)? | SELECT "Incumbent" FROM table_28880 WHERE "Candidates" = 'William Drayton (J)' | wikisql |
CREATE TABLE table_name_62 (
silver VARCHAR,
total VARCHAR,
bronze VARCHAR
) | How many silvers for the nation with under 6 total and under 0 bronze? | SELECT COUNT(silver) FROM table_name_62 WHERE total < 6 AND bronze < 0 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is maximum age of patients whose admission location is emergency room admit and days of hospital stay is 11? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay = "11" | mimicsql_data |
CREATE TABLE table_79224 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | How many ranks have 1:01.14.62 as the time, with michael russell as the rider? | SELECT COUNT("Rank") FROM table_79224 WHERE "Time" = '1:01.14.62' AND "Rider" = 'michael russell' | wikisql |
CREATE TABLE table_55386 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which score has a Result of 11 0? | SELECT "Score" FROM table_55386 WHERE "Result" = '11–0' | wikisql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | what is the cheapest fare from BOSTON to SAN FRANCISCO | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_29414 (
"Athlete" text,
"Event" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text
) | What is the round of 32 for fatih kele ? | SELECT "Round of 32" FROM table_29414 WHERE "Athlete" = 'Fatih Keleş' | wikisql |
CREATE TABLE table_25563779_4 (
third VARCHAR,
second VARCHAR
) | If second is Sergey Sirotkin, what is the third name? | SELECT third FROM table_25563779_4 WHERE second = "Sergey Sirotkin" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | retrieve the time of patient 74716's hospial admission until 2 years ago. | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 74716 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose marital status is single and admission year is less than 2177? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2177" | mimicsql_data |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
) | List the first and last name of the students who do not have any food type allergy. | SELECT fname, lname FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food") | spider |
CREATE TABLE table_28985631_1 (
defective_year INTEGER,
regular_year VARCHAR,
month_sequence VARCHAR
) | What is the defective year for the regular year of 29 days and month sequence of 2? | SELECT MAX(defective_year) FROM table_28985631_1 WHERE regular_year = "29 days" AND month_sequence = 2 | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | What are the names and prices of all products in the store Plot them as bar chart, I want to order X in desc order. | SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | ground transportation in PHOENIX | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHOENIX' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_65320 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What result has a week less than 16, and October 31, 2005 as the date? | SELECT "Result" FROM table_65320 WHERE "Week" < '16' AND "Date" = 'october 31, 2005' | wikisql |
CREATE TABLE table_name_88 (
date VARCHAR,
catalog VARCHAR
) | What date has 0-6700-30838-2-9 for a catalog? | SELECT date FROM table_name_88 WHERE catalog = "0-6700-30838-2-9" | sql_create_context |
CREATE TABLE player_college (
player_id TEXT,
college_id TEXT,
year INTEGER
)
CREATE TABLE salary (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
salary INTEGER
)
CREATE TABLE team_half (
year INTEGER,
league_id TEXT,
team_id TEXT,
half INTEGER,
div_id... | What is the number of wins the team Boston Red Stockings got in the postseasons each year in history. Show the tendency. | SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year | nvbench |
CREATE TABLE table_76828 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | WHAT IS THE HOME TEAM, RESULT 99-112? | SELECT "Home Team" FROM table_76828 WHERE "Result" = '99-112' | wikisql |
CREATE TABLE table_1140117_5 (
constructor VARCHAR,
circuit VARCHAR
) | What is the constructor for the Silverstone circuit? | SELECT constructor FROM table_1140117_5 WHERE circuit = "Silverstone" | sql_create_context |
CREATE TABLE table_23592 (
"Season" text,
"Bayernliga" text,
"Landesliga S\u00fcd" text,
"Landesliga Mitte" text,
"Landesliga Nord" text
) | Name the landesliga mitte for fc gundelfingen and vfl frohnlach | SELECT "Landesliga Mitte" FROM table_23592 WHERE "Landesliga S\u00fcd" = 'FC Gundelfingen' AND "Landesliga Nord" = 'VfL Frohnlach' | wikisql |
CREATE TABLE table_59276 (
"Year" real,
"Place" text,
"Gold" text,
"Silver" text,
"Bronze" text
) | In what Place was the Silver won by vladimir vesselov ( urs )? | SELECT "Place" FROM table_59276 WHERE "Silver" = 'vladimir vesselov ( urs )' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare (
fare_id int,
from_... | show me a list of ground transportation at BOSTON airport | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND ground_service.airport_code = airport.airport_code | atis |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt ... | i'd like to arrange for two friends to fly into LOS ANGELES next saturday evening one of the people is coming from KANSAS CITY and the other is coming from LAS VEGAS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > fl... | atis |
CREATE TABLE table_45133 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the lowest laps for rider andrew pitt, with a grid smaller than 18? Wha | SELECT MIN("Laps") FROM table_45133 WHERE "Rider" = 'andrew pitt' AND "Grid" < '18' | wikisql |
CREATE TABLE table_56103 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many golds for uganda with under 3 total medals? | SELECT MAX("Gold") FROM table_56103 WHERE "Nation" = 'uganda' AND "Total" < '3' | wikisql |
CREATE TABLE table_name_51 (
date VARCHAR,
away_team VARCHAR
) | What day is north melbourne the away side? | SELECT date FROM table_name_51 WHERE away_team = "north melbourne" | 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... | provide the number of patients whose death status is 0 and lab test name is cortisol? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Cortisol" | mimicsql_data |
CREATE TABLE table_46357 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Competition" text,
"Match Report" text
) | What is Date, when Competition is 'F', and when Opponents is 'FC Astoria Walldorf'? | SELECT "Date" FROM table_46357 WHERE "Competition" = 'f' AND "Opponents" = 'fc astoria walldorf' | wikisql |
CREATE TABLE table_55485 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people attended the game where the away team scored 16.7 (103) points? | SELECT COUNT("Crowd") FROM table_55485 WHERE "Away team score" = '16.7 (103)' | wikisql |
CREATE TABLE table_17625876_1 (
original_air_date VARCHAR,
no_in_season VARCHAR
) | Name the original air date for number in season being 1 | SELECT original_air_date FROM table_17625876_1 WHERE no_in_season = 1 | 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,
... | 能知道在2004-09-23到2010-08-14内,患者曹婉娜在看病时是哪些工号及姓名的医生给检测指标537012的吗 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 jy... | css |
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,... | 根据不同的科室名字和入院的时候诊断出疾病的编码显示出医院9645673所有就诊记录中病人就诊时的平均年纪 | SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9645673' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_CD | css |
CREATE TABLE table_name_82 (
purse VARCHAR,
year VARCHAR,
winner VARCHAR
) | What is the purse for the year earlier than 2013 and muhannak was the winner? | SELECT purse FROM table_name_82 WHERE year < 2013 AND winner = "muhannak" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.