context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_2 (
total VARCHAR,
finish VARCHAR
) | What is the Total of the Player with a Finish of 1? | SELECT COUNT(total) FROM table_name_2 WHERE finish = "1" | sql_create_context |
CREATE TABLE table_73280 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | Name the episode for travis brown | SELECT "Episode" FROM table_73280 WHERE "Coach" = 'Travis Brown' | wikisql |
CREATE TABLE table_name_9 (
effic INTEGER,
cmp_att_int VARCHAR,
avg_g VARCHAR,
gp_gs VARCHAR
) | Which Effic is the average one that has an Avg/G larger than 3.7, and a GP-GS of 13, and a Cmp-Att-Int of 318-521-15? | SELECT AVG(effic) FROM table_name_9 WHERE avg_g > 3.7 AND gp_gs = "13" AND cmp_att_int = "318-521-15" | 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... | tell me, what is the top three most common diagnosis until 2100? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2100' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 参保人29762576的门诊检查费在2000年2月5日到2020年9月20日这段期间统共是多少呀? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '29762576' AND t_kc22.STA_DATE BETWEEN '2000-02-05' AND '2020-09-20' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | how much does patient 006-43795 change in weight measured at 2103-12-18 05:43:00 compared to the value measured at 2103-08-01 17:39:00? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-43795') AND NOT patient.admissionweight IS NULL AND patient.unitadmittime = '2103-12-18 05:43:00') - (SELECT patient.admissionweight FROM p... | eicu |
CREATE TABLE table_name_28 (
artist VARCHAR,
weeks_on_top VARCHAR
) | Who was the artist of the single that spent 9 weeks on top? | SELECT artist FROM table_name_28 WHERE weeks_on_top = "9 ¶" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | when was the first time that patient 015-91239 on this month/31 had the minimum heartrate value. | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-91239')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
CREATE TABLE mzb (
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... | 在两千年八月六日到两千零三年十月三十日内参保人80471711门诊手术费是多少? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '80471711' AND t_kc22.STA_DATE BETWEEN '2000-08-06' AND '2003-10-30' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_name_53 (
wins INTEGER,
team VARCHAR,
games_played VARCHAR
) | what is the sum of wins for the ottawa hockey club when the games played is less than 10? | SELECT SUM(wins) FROM table_name_53 WHERE team = "ottawa hockey club" AND games_played < 10 | sql_create_context |
CREATE TABLE table_name_14 (
tenure VARCHAR,
lineage VARCHAR
) | What's the tenure of 3rd son of tadatsune? | SELECT tenure FROM table_name_14 WHERE lineage = "3rd son of tadatsune" | sql_create_context |
CREATE TABLE mzb (
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... | 4213631这个编号的医院在00年4月5日到06年10月29日内总共花费不超过690.96元的医疗费一共有几个科室? | SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4213631' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-05' AND '2006-10-29' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 690.96 UNION SELECT gyb.MED_ORG_DEPT_CD FRO... | css |
CREATE TABLE table_6130 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text,
"Purse" text
) | What was the purse when the trainer was Aidan O'Brien? | SELECT "Purse" FROM table_6130 WHERE "Trainer" = 'aidan o''brien' | wikisql |
CREATE TABLE table_42229 (
"Rank" real,
"Celebrity" text,
"Professional Partner" text,
"Season" real,
"Average" real
) | What is the highest season that had rank under 1? | SELECT MAX("Season") FROM table_42229 WHERE "Rank" < '1' | wikisql |
CREATE TABLE table_name_89 (
capital VARCHAR,
sno VARCHAR,
name_of_janapada VARCHAR
) | What capital has an S.Number under 7, and a Name of janapada of Punia? | SELECT capital FROM table_name_89 WHERE sno < 7 AND name_of_janapada = "punia" | sql_create_context |
CREATE TABLE table_1594772_2 (
team__b_ VARCHAR,
margin VARCHAR,
winner VARCHAR
) | Name the number of team for 35 runs margin and india winner | SELECT COUNT(team__b_) FROM table_1594772_2 WHERE margin = "35 runs" AND winner = "India" | sql_create_context |
CREATE TABLE table_46704 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
) | When the Points 1 were 44 and the Goals For were larger than 65, what was the total number of Goals Against? | SELECT COUNT("Goals Against") FROM table_46704 WHERE "Points 1" = '44' AND "Goals For" > '65' | wikisql |
CREATE TABLE table_203_405 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | which date has the most attendance ? | SELECT "date" FROM table_203_405 ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_name_40 (
power VARCHAR,
years VARCHAR
) | What is the power for the years 1975-84? | SELECT power FROM table_name_40 WHERE years = "1975-84" | sql_create_context |
CREATE TABLE table_42000 (
"District" real,
"Incumbent" text,
"2008 Status" text,
"Democratic" text,
"Republican" text
) | Which incumbent's democratic candidate was mike carroll? | SELECT "Incumbent" FROM table_42000 WHERE "Democratic" = 'mike carroll' | wikisql |
CREATE TABLE table_name_16 (
tries VARCHAR,
date VARCHAR
) | How many tries took place on 06/07/1996? | SELECT tries FROM table_name_16 WHERE date = "06/07/1996" | sql_create_context |
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 all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_26233 (
"No" real,
"Player" text,
"Height (m)" text,
"Height (f)" text,
"Position" text,
"Year born" real,
"Current Club" text
) | What is the date of birth for basket baller called ido kozikaro | SELECT MAX("Year born") FROM table_26233 WHERE "Player" = 'Ido Kozikaro' | wikisql |
CREATE TABLE table_204_227 (
id number,
"week" number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
) | which games did they not score under 30 points ? | SELECT COUNT(*) FROM table_204_227 WHERE "score" >= 30 | squall |
CREATE TABLE table_train_250 (
"id" int,
"gender" string,
"waist_to_hip_ratio" float,
"creatinine_clearance_cl" float,
"panel_reactive_antibodies" int,
"insulin_requirement" float,
"serum_creatinine" float,
"NOUSE" float
) | creatinine clearance < 75 ml / min / 1.73 m2 | SELECT * FROM table_train_250 WHERE creatinine_clearance_cl < 75 | criteria2sql |
CREATE TABLE table_39031 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text
) | What is the average number of wins of the year with less than 5 top 10s, a winning of $39,190 and less than 2 starts? | SELECT AVG("Wins") FROM table_39031 WHERE "Top 10" < '5' AND "Winnings" = '$39,190' AND "Starts" < '2' | wikisql |
CREATE TABLE table_14962287_2 (
name VARCHAR,
league VARCHAR
) | What name is associated with League 142? | SELECT name FROM table_14962287_2 WHERE league = 142 | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the average of department_id bin hire_date by time, and visualize them by a bar chart. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | fraction of negatively-scored Qs per tag. | SELECT Tags.TagName, CAST(SUM(CASE WHEN Posts.Score < 0 THEN 1 ELSE 0 END) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS fraction_of_negative_Qs FROM (PostTags INNER JOIN Tags ON PostTags.TagId = Tags.Id) INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.Count > 9 GROUP BY Tags.TagName ORDER BY fraction_of_negative_Qs... | sede |
CREATE TABLE table_name_47 (
surface VARCHAR,
runner_up VARCHAR
) | What is the surface of the match with Brian Gottfried as the runner-up? | SELECT surface FROM table_name_47 WHERE runner_up = "brian gottfried" | sql_create_context |
CREATE TABLE table_name_90 (
score VARCHAR,
round VARCHAR
) | What was the score of the game that had a round of Rd 26, 2001? | SELECT score FROM table_name_90 WHERE round = "rd 26, 2001" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (... | What are the classes required to declare a major in TURKISH ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%TURKISH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_8 (
points INTEGER,
season VARCHAR,
games VARCHAR
) | What's the sum of points for the 1963 season when there are more than 30 games? | SELECT SUM(points) FROM table_name_8 WHERE season = "1963" AND games > 30 | sql_create_context |
CREATE TABLE table_name_23 (
losses INTEGER,
club VARCHAR,
points VARCHAR
) | What is the top losses that with Club of cd toledo and Points more than 56? | SELECT MAX(losses) FROM table_name_23 WHERE club = "cd toledo" AND points > 56 | sql_create_context |
CREATE TABLE table_42067 (
"Name" text,
"Nationality" text,
"Position" text,
"Appearances" real,
"Goals" real
) | What is the least amount of appearances by new zealand when they scored 4 goals? | SELECT MIN("Appearances") FROM table_42067 WHERE "Goals" = '4' AND "Nationality" = 'new zealand' | wikisql |
CREATE TABLE table_71422 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | In 1962, what was the total number of points, when the Engine was Ferrari v6? | SELECT COUNT("Points") FROM table_71422 WHERE "Engine" = 'ferrari v6' AND "Year" = '1962' | wikisql |
CREATE TABLE table_name_92 (
episode_number VARCHAR,
musical_guest__song_performed_ VARCHAR
) | WHich Coat of Cash' Wearing Celebrity has a Episode Number larger than 1 and with amy macdonald ( mr rock & roll )? | SELECT "coat_of_cash" AS _wearing_celebrity FROM table_name_92 WHERE episode_number > 1 AND musical_guest__song_performed_ = "amy macdonald ( mr rock & roll )" | sql_create_context |
CREATE TABLE table_74173 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (million)" text
) | What is the title of the series # 8? | SELECT "Title" FROM table_74173 WHERE "Series #" = '8' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | what is the maximum hospital cost that includes a procedure known as wound care during the last year? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'wound care')) AND DATETIME(cost.chargetime, ... | eicu |
CREATE TABLE table_name_80 (
high_rebounds VARCHAR,
high_assists VARCHAR
) | What is High Rebounds, when High Assists is 'Rafer Alston , Rashard Lewis , Hedo T rko lu (3)'? | SELECT high_rebounds FROM table_name_80 WHERE high_assists = "rafer alston , rashard lewis , hedo türkoğlu (3)" | sql_create_context |
CREATE TABLE table_name_3 (
release_price___usd__ VARCHAR,
release_date VARCHAR,
part_number_s_ VARCHAR
) | Release date of 2008 q3, and a Part number(s) of nu80579ez009c has what Release price ( USD )? | SELECT release_price___usd__ FROM table_name_3 WHERE release_date = "2008 q3" AND part_number_s_ = "nu80579ez009c" | sql_create_context |
CREATE TABLE table_train_140 (
"id" int,
"gender" string,
"mini_mental_state_examination_mmse" int,
"allergy_to_quinidine" bool,
"systolic_blood_pressure_sbp" int,
"postural_syncope" bool,
"hypotension" bool,
"unexplained_syncope" bool,
"allergy_to_dextromethorphan" bool,
"allerg... | known sensitivity to quinidine or dextromethorphan. | SELECT * FROM table_train_140 WHERE allergy_to_quinidine = 1 OR allergy_to_dextromethorphan = 1 | criteria2sql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what are the three most commonly prescribed medications for patients that have been prescribed with glucagon (human recombinant) 1 mg inj recon soln previously during the same hospital visit in 2104? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'glucagon (human ... | eicu |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Visualize a bar chart for what are the total enrollments of universities of each affiliation type? | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation | nvbench |
CREATE TABLE table_name_43 (
silver VARCHAR,
total VARCHAR,
nation VARCHAR,
gold VARCHAR,
bronze VARCHAR
) | How many silvers have a gold greater than 2, a bronze less than 35, china as the nation, with a total greater than 26? | SELECT COUNT(silver) FROM table_name_43 WHERE gold > 2 AND bronze < 35 AND nation = "china" AND total > 26 | sql_create_context |
CREATE TABLE table_name_13 (
penalty VARCHAR,
average VARCHAR,
total VARCHAR
) | What was the penalty for the gymnast with average above 9.662 and total is more than 9.706? | SELECT penalty FROM table_name_13 WHERE average > 9.662 AND total > 9.706 | 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... | how many patients whose drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug_type = "MAIN" | mimicsql_data |
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,... | 自2014.5.23起,到2016.12.27止,患者29201885被开出药品香砂养胃丸一共有多少次 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '29201885' AND t_kc22.STA_DATE BETWEEN '2014-05-23' AND '2016-12-27' AND t_kc22.SOC_SRT_DIRE_NM = '香砂养胃丸' | css |
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... | 查询6350564医院的科室838涉及的医疗费总额,时间范围是零四年七月十五日到一五年一月二十二日 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6350564' AND t_kc21.MED_ORG_DEPT_CD = '838') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-07-15' AND '2015-01-22' | css |
CREATE TABLE table_26827 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power kW" text,
"Coverage" text
) | When the power kw is 5kw, what is the frequency? | SELECT "Frequency" FROM table_26827 WHERE "Power kW" = '5kW' | 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... | 在43389483198这次医疗就诊中,需要住院的时间如何 | SELECT qtb.IN_HOSP_DAYS FROM qtb WHERE qtb.MED_CLINIC_ID = '43389483198' UNION SELECT gyb.IN_HOSP_DAYS FROM gyb WHERE gyb.MED_CLINIC_ID = '43389483198' UNION SELECT zyb.IN_HOSP_DAYS FROM zyb WHERE zyb.MED_CLINIC_ID = '43389483198' UNION SELECT mzb.IN_HOSP_DAYS FROM mzb WHERE mzb.MED_CLINIC_ID = '43389483198' | css |
CREATE TABLE table_78264 (
"Grade" text,
"Points" real,
"Sit-up (reps)" text,
"Standing Broad Jump (cm)" text,
"Chin-up (reps)" text,
"Shuttle Run (sec)" text,
"2.4km Run (min:sec)" text
) | Tell me the shuttle run with grade c | SELECT "Shuttle Run (sec)" FROM table_78264 WHERE "Grade" = 'c' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the diagnosis of icd9 code 7885? | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "7885" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | How many female patients are diagnosed with ulcer of heel & mid foot? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Ulcer of heel & midfoot" | mimicsql_data |
CREATE TABLE table_203_757 (
id number,
"year" number,
"award ceremony" text,
"category" text,
"film/show" text,
"result" text
) | in which year did she have the least amount of awards or nominations ? | SELECT "year" FROM table_203_757 GROUP BY "year" ORDER BY COUNT(*) LIMIT 1 | squall |
CREATE TABLE table_name_8 (
place VARCHAR,
player VARCHAR
) | What is Peter Jacobsen's Place? | SELECT place FROM table_name_8 WHERE player = "peter jacobsen" | sql_create_context |
CREATE TABLE table_79306 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What Lane has a 0.209 React entered with a Rank entry that is larger than 6? | SELECT "Lane" FROM table_79306 WHERE "React" > '0.209' AND "Rank" > '6' | wikisql |
CREATE TABLE table_11964047_7 (
date VARCHAR,
leading_scorer VARCHAR
) | what is the total number of dates where the scorer is gordon : 32 | SELECT COUNT(date) FROM table_11964047_7 WHERE leading_scorer = "Gordon : 32" | sql_create_context |
CREATE TABLE table_44261 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the rank for the 3 silver medals? | SELECT "Rank" FROM table_44261 WHERE "Silver" = '3' | wikisql |
CREATE TABLE table_203_775 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number
) | who was the only opponent they played which resulted in a tie game ? | SELECT "opponent" FROM table_203_775 WHERE "result" = 't' | squall |
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... | 哪些药品是编号09928457的团伙成员最常开的,依次排序是什么 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '09928457' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_71027 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What Decile has State Authority and Raumati South Area? | SELECT "Decile" FROM table_71027 WHERE "Authority" = 'state' AND "Area" = 'raumati south' | wikisql |
CREATE TABLE table_name_35 (
bronze INTEGER,
gold VARCHAR,
silver VARCHAR
) | Tell me the sum of bronze for gold being 27 and silver more than 30 | SELECT SUM(bronze) FROM table_name_35 WHERE gold = 27 AND silver > 30 | sql_create_context |
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... | count the number of patients whose marital status is single and item id is 51265? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "51265" | mimicsql_data |
CREATE TABLE table_41968 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What is the Order # when the song choice was ' you're so vain '? | SELECT "Order #" FROM table_41968 WHERE "Song choice" = ' you''re so vain ' | 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 hz_info (
KH text,
KLX number... | 名为曹欣德的这位患者被门诊诊断为疾病Y51.041,查一下编号为909845检测指标的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ... | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | what is the maximum total hospital cost that includes the protein c since 4 years ago? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'protein c')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TA... | User avg reputation by year and month. | SELECT AVG(Reputation * 1.0), TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') FROM Users GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') ORDER BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') | sede |
CREATE TABLE table_name_73 (
team VARCHAR,
points VARCHAR
) | Which team has 26 points? | SELECT team FROM table_name_73 WHERE points = "26" | sql_create_context |
CREATE TABLE table_name_24 (
shirt_no INTEGER,
height VARCHAR,
player VARCHAR
) | What is the Shirt No for Henry Bell Cisnero whose height is less than 190? | SELECT MAX(shirt_no) FROM table_name_24 WHERE height < 190 AND player = "henry bell cisnero" | sql_create_context |
CREATE TABLE table_name_69 (
date VARCHAR,
outcome VARCHAR,
score VARCHAR
) | Which Date has an Outcome of winner, and a Score of 7 5, 6 4? | SELECT date FROM table_name_69 WHERE outcome = "winner" AND score = "7–5, 6–4" | sql_create_context |
CREATE TABLE table_21726 (
"Series #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original airdate" text,
"Production Code" text
) | Who wrote the episode 'The Dream Lover', which was viewed by 3.96 million viewers? | SELECT "Written by" FROM table_21726 WHERE "U.S. viewers (million)" = '3.96' | wikisql |
CREATE TABLE table_77775 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the away team score when they were playing collingwood? | SELECT "Away team score" FROM table_77775 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Count the number of people of each sex who have a weight higher than 85 by a bar chart, and list y axis in ascending order. | SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex ORDER BY COUNT(*) | nvbench |
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_code VARCHAR(3)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARC... | Show the number of male and female assistant professors. | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex | nvbench |
CREATE TABLE table_43493 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
) | Which player went to Vanderbilt? | SELECT "Player" FROM table_43493 WHERE "College" = 'vanderbilt' | wikisql |
CREATE TABLE table_28265 (
"AB - Angry boar" text,
"B - Bishop" text,
"BA - Running Bear" text,
"BB - Blind Bear" text,
"BC - Beast Cadet" text
) | what is bb - blind bear where ba - running bear is mf - mountain falcon? | SELECT "BB - Blind Bear" FROM table_28265 WHERE "BA - Running Bear" = 'MF - Mountain Falcon' | wikisql |
CREATE TABLE table_18217753_1 (
original_air_date VARCHAR,
us_viewers__millions_ VARCHAR
) | How many original air dates totaled 26.06 million viewers? | SELECT COUNT(original_air_date) FROM table_18217753_1 WHERE us_viewers__millions_ = "26.06" | sql_create_context |
CREATE TABLE table_76891 (
"Mode" text,
"D\u00e9part de la main gauche" text,
"Accord du 1st string" text,
"2nd string" text,
"3rd string" text
) | For the 2nd string of Ra what is the Depart de la main gauche? | SELECT "D\u00e9part de la main gauche" FROM table_76891 WHERE "2nd string" = 'ra' | wikisql |
CREATE TABLE table_name_70 (
score INTEGER,
champion VARCHAR
) | What is Joanne Carner's average score in Canadian Women's Open games that she has won? | SELECT AVG(score) FROM table_name_70 WHERE champion = "joanne carner" | sql_create_context |
CREATE TABLE table_name_87 (
college VARCHAR,
overall VARCHAR,
name VARCHAR
) | Which college's overall number is more than 158 when Travian Robertson is the name? | SELECT college FROM table_name_87 WHERE overall > 158 AND name = "travian robertson" | 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 admissions (
row_id number,
subject_id number,
hadm... | since 04/2105, when was patient 27172 prescribed for the first time for a drug? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-04' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
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,
... | until 3 years ago how many patients received therapeutic antibacterials - fourth generation cephalosporin during the same month after the diagnosis of hypotension. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypotension' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELEC... | eicu |
CREATE TABLE table_name_64 (
result VARCHAR,
home_team VARCHAR,
date VARCHAR
) | What was the result of the game played on April 16 with Philadelphia as home team? | SELECT result FROM table_name_64 WHERE home_team = "philadelphia" AND date = "april 16" | sql_create_context |
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... | Number (count) of active users by reputation. | SELECT Reputation, COUNT(Id) FROM Users WHERE LastAccessDate > DATEADD(month, '##maxMonthsInactive:int?3##' * -1, CURRENT_TIMESTAMP()) AND Reputation >= '##minReputation:int?2##' GROUP BY Reputation ORDER BY Reputation | sede |
CREATE TABLE table_7332 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest amount of gold medals awarded to a team with more than 9 silver, 7 bronze and more than 13 medals total? | SELECT MAX("Gold") FROM table_7332 WHERE "Total" > '13' AND "Silver" > '9' AND "Bronze" = '7' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | did patient 13528 have osteoarthros nos-unspec diagnosed since 2 years ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'osteoarthros nos-unspec') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13528) AND DATETIME(diagnoses... | mimic_iii |
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... | 在检验报告单20790393793都对应了哪些就诊流水号? | SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '20790393793' | css |
CREATE TABLE table_name_79 (
to_par VARCHAR,
player VARCHAR
) | What is Mike Weir's To par? | SELECT to_par FROM table_name_79 WHERE player = "mike weir" | sql_create_context |
CREATE TABLE table_35757 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) | What 10:00 has party of five as 9:30? | SELECT "10:00" FROM table_35757 WHERE "9:30" = 'party of five' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit te... | what were the three most frequently prescribed drugs since 2105? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE STRFTIME('%y', prescriptions.startdate) >= '2105' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3 | mimic_iii |
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... | 这个名字叫张智渊的团伙成员最常去的医院排序是什么样的? | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '张智渊' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '张智渊' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what are the five most frequently ordered microbiology tests for patients who received insulin earlier in the same hospital visit until 2101? | SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'insulin' ... | eicu |
CREATE TABLE table_name_96 (
founded INTEGER,
team VARCHAR
) | What is the mean Founded number when the team is the Baton Rouge Blaze? | SELECT AVG(founded) FROM table_name_96 WHERE team = "baton rouge blaze" | sql_create_context |
CREATE TABLE table_name_80 (
year INTEGER,
competition VARCHAR,
venue VARCHAR
) | Which Year has a Competition of european indoor championships, and a Venue of budapest , hungary? | SELECT SUM(year) FROM table_name_80 WHERE competition = "european indoor championships" AND venue = "budapest , hungary" | sql_create_context |
CREATE TABLE table_name_16 (
country VARCHAR,
venue VARCHAR,
year VARCHAR,
score VARCHAR
) | Which Country has a Year larger than 1978, and a Score of 295, and a Venue of lindrick golf club? | SELECT country FROM table_name_16 WHERE year > 1978 AND score = "295" AND venue = "lindrick golf club" | sql_create_context |
CREATE TABLE table_name_82 (
males VARCHAR,
percentage___percentage_ VARCHAR
) | How many males have a percentage of 80.62? | SELECT males FROM table_name_82 WHERE percentage___percentage_ = "80.62" | sql_create_context |
CREATE TABLE table_name_1 (
record VARCHAR,
date VARCHAR
) | What was their record on December 4? | SELECT record FROM table_name_1 WHERE date = "december 4" | sql_create_context |
CREATE TABLE table_50386 (
"Tournament" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the result for 2004 when A is the result for 2005, and the result of q1 when 2009? | SELECT "2004" FROM table_50386 WHERE "2005" = 'a' AND "2009" = 'q1' | wikisql |
CREATE TABLE table_78299 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | What is the club or province of Girvan Dempsey, who has 74 caps? | SELECT "Club/province" FROM table_78299 WHERE "Caps" = '74' AND "Player" = 'girvan dempsey' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.