context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_74824 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the time for Moscow, Russia? | SELECT "Time" FROM table_74824 WHERE "Location" = 'moscow, russia' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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,
insurance text,
lan... | count the number of people diagnosed with anemia-other chronic dis who did not come back to the hospital within the same month during a year before. | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'anemia-oth... | mimic_iii |
CREATE TABLE table_203_212 (
id number,
"#" number,
"district" text,
"land area (km2)" number,
"population\n(2010 census)" number,
"density (persons/km2)" number
) | which district has the most density ? | SELECT "district" FROM table_203_212 ORDER BY "density (persons/km2)" DESC LIMIT 1 | squall |
CREATE TABLE table_36148 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | What is the total number of rebounds values for Ann Wauters? | SELECT COUNT("Rebounds") FROM table_36148 WHERE "Name" = 'ann wauters' | wikisql |
CREATE TABLE table_10919 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | What college did delray brooks go to? | SELECT "College" FROM table_10919 WHERE "Player" = 'delray brooks' | wikisql |
CREATE TABLE table_80102 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What engine was used by Equipe Simca Gordini before 1956 with less than 4 points? | SELECT "Engine" FROM table_80102 WHERE "Year" < '1956' AND "Points" < '4' AND "Entrant" = 'equipe simca gordini' | wikisql |
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... | 在2000年6月7日到2017年4月4日内所有医疗记录在医院2770364的个人账户支出与医疗费总额的平均比值是多少? | SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '2770364' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-07' AND '2017-04-04' | css |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TAB... | Top 200 users from Vietnam. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%vietnam%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 2000 | sede |
CREATE TABLE table_name_10 (
winning_driver VARCHAR,
most_laps_led VARCHAR,
pole_position VARCHAR
) | Who is the Winning Driver, when Most Laps Led is Dario Franchitti, and when Pole Position is H lio Castroneves? | SELECT winning_driver FROM table_name_10 WHERE most_laps_led = "dario franchitti" AND pole_position = "hélio castroneves" | sql_create_context |
CREATE TABLE table_68916 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" text,
"Issue price" real,
"Special notes" text
) | What theme has a mintage of 3527? | SELECT "Theme" FROM table_68916 WHERE "Mintage" = '3527' | wikisql |
CREATE TABLE table_name_6 (
year VARCHAR,
engine_s_ VARCHAR
) | Which year has an Engine(s) of yamaha v8? | SELECT year FROM table_name_6 WHERE engine_s_ = "yamaha v8" | sql_create_context |
CREATE TABLE table_78814 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | Who's the conservative 1st member of the election of 1852? | SELECT "1st Member" FROM table_78814 WHERE "1st Party" = 'conservative' AND "Election" = '1852' | wikisql |
CREATE TABLE table_69351 (
"Episode" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | Which original artist has a Episode of workshop #1? | SELECT "Original artist" FROM table_69351 WHERE "Episode" = 'workshop #1' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patientheal... | when did patient 011-49649 last come into the hospital via the other hospital? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '011-49649' AND patient.hospitaladmitsource = 'other hospital' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_41 (
opponent VARCHAR,
attendance VARCHAR
) | Who is the opponent when the attendance is 57,331? | SELECT opponent FROM table_name_41 WHERE attendance = "57,331" | sql_create_context |
CREATE TABLE table_13552 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | who is the replacement when the date of vacancy is 1 september 2008? | SELECT "Replaced by" FROM table_13552 WHERE "Date of vacancy" = '1 september 2008' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what were the three most frequent prescriptions of medications for patients who were also prescribed diazepam at the same time since 5 years ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'diazepam' AND DATETIME(medication.drugstarttime) >=... | eicu |
CREATE TABLE table_name_33 (
status VARCHAR,
date VARCHAR
) | What is Status, when Date is 10/05/1975? | SELECT status FROM table_name_33 WHERE date = "10/05/1975" | sql_create_context |
CREATE TABLE table_name_25 (
points VARCHAR,
points_for VARCHAR
) | What points has points for as points for? | SELECT points FROM table_name_25 WHERE points_for = "points for" | sql_create_context |
CREATE TABLE table_name_94 (
trainer VARCHAR,
owner VARCHAR
) | Who is the trainer for Cherry Valley Farm? | SELECT trainer FROM table_name_94 WHERE owner = "cherry valley farm" | sql_create_context |
CREATE TABLE table_45845 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What is the nationality of Stromile Swift? | SELECT "Nationality" FROM table_45845 WHERE "Player" = 'stromile swift' | wikisql |
CREATE TABLE table_9037 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
) | What status has an area km 2 greater than 10.9, with 4,674 of 5,008 as the census ranking | SELECT "Status" FROM table_9037 WHERE "Area km 2" > '10.9' AND "Census Ranking" = '4,674 of 5,008' | wikisql |
CREATE TABLE table_980 (
"Year" real,
"Team Name" text,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Where did the team finish in the season when the playoff result was divisional finals. | SELECT "Regular Season" FROM table_980 WHERE "Playoffs" = 'Divisional Finals' | wikisql |
CREATE TABLE table_20684390_1 (
mccain_number INTEGER
) | What is the maximum McCain population turnout number? | SELECT MAX(mccain_number) FROM table_20684390_1 | 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 the insurance and diagnosis icd9 code of subject id 21796? | SELECT demographic.insurance, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "21796" | mimicsql_data |
CREATE TABLE table_48161 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
) | What is Winner, when Year is 2001? | SELECT "Winner" FROM table_48161 WHERE "Year" = '2001' | 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... | 哪几家医院售卖过药品697815093给病号89574743? | SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '89574743' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '697815093') | css |
CREATE TABLE table_54296 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | who is the away team when the tie no is more than 13 and the home team is team bath? | SELECT "Away team" FROM table_54296 WHERE "Tie no" > '13' AND "Home team" = 'team bath' | wikisql |
CREATE TABLE table_name_68 (
Id VARCHAR
) | What is the value for 2007 when 2008 is Q1? | SELECT 2007 FROM table_name_68 WHERE 2008 = "q1" | sql_create_context |
CREATE TABLE table_name_46 (
date VARCHAR,
outcome VARCHAR,
opponents VARCHAR
) | Tell me the date for dinah pfizenmaier anna zaja and winner | SELECT date FROM table_name_46 WHERE outcome = "winner" AND opponents = "dinah pfizenmaier anna zaja" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_... | list flights from CHICAGO to SAN DIEGO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DI... | atis |
CREATE TABLE table_33100 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date was the home team Footscray? | SELECT "Date" FROM table_33100 WHERE "Home team" = 'footscray' | wikisql |
CREATE TABLE table_name_13 (
country VARCHAR,
player VARCHAR
) | The golfer Jeff Sluman golfs for what country? | SELECT country FROM table_name_13 WHERE player = "jeff sluman" | sql_create_context |
CREATE TABLE table_204_603 (
id number,
"pos" text,
"no" number,
"rider" text,
"bike" text,
"laps" number,
"time" text,
"grid" number,
"points" number
) | how many laps were required to successfully complete the 125cc classification of the 2010 catalan motorcycle grand prix ? | SELECT MAX("laps") FROM table_204_603 | squall |
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 with metabolic encephalopathy diagnoses are still alive? | 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 = "Metabolic encephalopathy" | mimicsql_data |
CREATE TABLE table_name_29 (
Giant VARCHAR,
season VARCHAR
) | Which Giant Slalom was obtained in the 1997 season? | SELECT Giant AS slalom FROM table_name_29 WHERE season = 1997 | sql_create_context |
CREATE TABLE table_name_95 (
to_par VARCHAR,
place VARCHAR,
player VARCHAR
) | What is the To par of T9 Place Player Ernie Els? | SELECT to_par FROM table_name_95 WHERE place = "t9" AND player = "ernie els" | sql_create_context |
CREATE TABLE table_38391 (
"Product" text,
"Extensions" text,
"Projects templates" text,
"MSDN integration" text,
"Debugging" text,
"Profiling" text,
"IntelliTrace" text,
"Unit test" text,
"Code coverage" text,
"Test impact analysis" text,
"Load testing" text,
"Lab manage... | Which Projects template has an IntelliTrace of no, and a Windows Phone development of yes, and a Test impact analysis of no? | SELECT "Projects templates" FROM table_38391 WHERE "IntelliTrace" = 'no' AND "Windows Phone development" = 'yes' AND "Test impact analysis" = 'no' | wikisql |
CREATE TABLE table_name_32 (
rank VARCHAR,
total VARCHAR,
silver VARCHAR,
bronze VARCHAR
) | What rank is the team with 1 silver, 3 bronze and a total of less than 8 medals? | SELECT COUNT(rank) FROM table_name_32 WHERE silver = 1 AND bronze = 3 AND total < 8 | sql_create_context |
CREATE TABLE table_31197 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
) | When 36 is the amount of ends won how many sets of pf's are there? | SELECT COUNT("PF") FROM table_31197 WHERE "Ends Won" = '36' | wikisql |
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 p... | how many times patient 017-83061 has received an enteral meds until 07/2105? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-83061')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, and show X-axis in desc order please. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_31 (
area___ha__ VARCHAR,
height__m_ VARCHAR,
island VARCHAR
) | What is the area (ha) of the group on the island of Linga Holm that has a Height (m) larger than 7? | SELECT area___ha__ FROM table_name_31 WHERE height__m_ > 7 AND island = "linga holm" | sql_create_context |
CREATE TABLE table_14821 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Who was team 1 when team 2 was Young Africans? | SELECT "Team 1" FROM table_14821 WHERE "Team 2" = 'young africans' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many patients whose primary disease is left femur fracture? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" | mimicsql_data |
CREATE TABLE table_name_9 (
bronze INTEGER,
silver VARCHAR,
gold VARCHAR
) | Which average bronze had a silver greater than 2 and a gold larger than 7? | SELECT AVG(bronze) FROM table_name_9 WHERE silver > 2 AND gold > 7 | sql_create_context |
CREATE TABLE table_14523485_9 (
channel VARCHAR,
top_prize VARCHAR
) | What channel had the prize of 100,000? | SELECT channel FROM table_14523485_9 WHERE top_prize = "€100,000" | sql_create_context |
CREATE TABLE table_16028479_2 (
game_site VARCHAR,
attendance VARCHAR
) | At which stadiums was attendance total 79176? | SELECT game_site FROM table_16028479_2 WHERE attendance = 79176 | sql_create_context |
CREATE TABLE table_train_229 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"active_metabolic" bool,
"body_weight" float,
"hba1c" float,
"age" float,
"NOUSE" float
) | 18 _ 75 years of age | SELECT * FROM table_train_229 WHERE age >= 18 AND age <= 75 | criteria2sql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutput... | when patient 005-73237 did get a lab test the last time during the previous month? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-73237')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T... | eicu |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Users ranked by number of badges (all kinds). | SELECT UserLink AS "user_link", Rep, NumBadges, COUNT(*) AS "numquestions" FROM (SELECT * FROM (SELECT Users.Id AS "userlink", Users.Reputation AS "rep", COUNT(*) AS "numbadges" FROM Users INNER JOIN Badges ON Users.Id = Badges.UserId WHERE Badges.Class = 1 GROUP BY Users.Id, Users.Reputation) AS UserByBadge ORDER BY N... | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | what is the number of patients whose drug code is norebase and lab test fluid is blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "NOREBASE" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | 在2003-06-23之后医疗机构3461022的住院就诊记录中入院登记的数量一共有多少 | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '3461022' AND zyjzjlb.RYDJSJ > '2003-06-23' | css |
CREATE TABLE table_27722734_11 (
high_points VARCHAR,
date VARCHAR
) | Name the high points for april 8 | SELECT high_points FROM table_27722734_11 WHERE date = "April 8" | sql_create_context |
CREATE TABLE table_30133_1 (
current_account_balance__percent_of_gdp_ VARCHAR,
export_volume_of_goods_and_services__percent_change_ VARCHAR
) | What is the current account balance for an export volume of goods and service value of -4.2? | SELECT current_account_balance__percent_of_gdp_ FROM table_30133_1 WHERE export_volume_of_goods_and_services__percent_change_ = "-4.2" | sql_create_context |
CREATE TABLE table_22050544_3 (
elapsed_time VARCHAR,
event VARCHAR
) | How many categories for elapsed time exist for the $16.50 fixed-limit badugi game? | SELECT COUNT(elapsed_time) FROM table_22050544_3 WHERE event = "$16.50 Fixed-Limit Badugi" | sql_create_context |
CREATE TABLE table_17088705_2 (
swimsuit VARCHAR,
interview VARCHAR
) | What are the swimsuit scores of participants with score 9.366 in interview | SELECT swimsuit FROM table_17088705_2 WHERE interview = "9.366" | sql_create_context |
CREATE TABLE table_name_39 (
pick INTEGER,
position VARCHAR
) | What is the highest Pick, when Position is 'G/F'? | SELECT MAX(pick) FROM table_name_39 WHERE position = "g/f" | sql_create_context |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 自15年7月27日起,截止到16年11月4日,医疗机构6851618的特需门诊有多少就诊记录 | SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZSEBZ = '6851618' AND ftxmzjzjlb.JZKSRQ BETWEEN '2015-07-27' AND '2016-11-04' | 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,... | 在医疗就诊04488736077中有哪些人员?想知道他们的姓名、性别、年龄和公民身份号码 | SELECT PERSON_NM, PERSON_SEX, PERSON_AGE, IDENTITY_CARD FROM t_kc21 WHERE MED_CLINIC_ID = '18019014273' | css |
CREATE TABLE table_18029 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | During what weak of the season was the game played on october 4, 1987? | SELECT MAX("Week") FROM table_18029 WHERE "Date" = 'October 4, 1987' | wikisql |
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 offering_instructor (
offering_instructor_id int,
offering_id int,
ins... | What is the number of classes being offered next semester ? | SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_name_71 (
power VARCHAR,
city_of_license VARCHAR
) | what is the power when the city of license is belleville? | SELECT power FROM table_name_71 WHERE city_of_license = "belleville" | sql_create_context |
CREATE TABLE table_71169 (
"Rider" text,
"Year" real,
"Final Position - Giro" real,
"Final Position - Tour" real,
"Final Position - Vuelta" real
) | What is the final Vuelta position associated with a final Giro position over 39 and a final Tour position of 90? | SELECT "Final Position - Vuelta" FROM table_71169 WHERE "Final Position - Giro" > '39' AND "Final Position - Tour" = '90' | wikisql |
CREATE TABLE table_51178 (
"Name of ground" text,
"Location" text,
"Year" text,
"FC matches" text,
"LA matches" text,
"T20 matches" text,
"Total" text
) | Where was the FC match with a score of 12 played? | SELECT "Location" FROM table_51178 WHERE "FC matches" = '12' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give me the number of patients whose age is less than 80 and drug name is cefpodoxime proxetil? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.drug = "Cefpodoxime Proxetil" | 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... | give me the number of patients whose age is less than 71 and procedure long title is central venous catheter placement with guidance? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "71" AND procedures.long_title = "Central venous catheter placement with guidance" | mimicsql_data |
CREATE TABLE table_19081 (
"Year" real,
"Player Name" text,
"NFL Team" text,
"Position" text,
"Team Defense Rank" real,
"Team Performance" text
) | what the highest number for the opposite of offense for the green bay packers | SELECT MAX("Team Defense Rank") FROM table_19081 WHERE "NFL Team" = 'Green Bay Packers' | wikisql |
CREATE TABLE table_22542 (
"Rank" text,
"Country" text,
"Jerseys" real,
"Vuelta Wins" real,
"Points" real,
"KoM" real,
"Combo" real,
"Most recent cyclist" text,
"Most recent date" text,
"Different holders" real
) | When 3 is the rank what is the highest combo? | SELECT MAX("Combo") FROM table_22542 WHERE "Rank" = '3' | wikisql |
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 hospital stay is more than 5 days and used the drug name syringe | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug = "Syringe" | mimicsql_data |
CREATE TABLE table_20146 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
) | If the partial thromboplastin and bleeding time is prolonged, what is the prothrombin time? | SELECT "Prothrombin time" FROM table_20146 WHERE "Partial thromboplastin time" = 'Prolonged' AND "Bleeding time" = 'Prolonged' | wikisql |
CREATE TABLE table_test_26 (
"id" int,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"left_main_coronary_artery_disease" bool,
"uncontrolled_diabetes" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hepatitis_b_infection" bool,
"renal_disease" bool,
"u... | chronic heavy alcohol use | SELECT * FROM table_test_26 WHERE alcohol_abuse = 1 | criteria2sql |
CREATE TABLE table_77533 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the date of the game when the Canadiens had a record of 31 19 9? | SELECT "Date" FROM table_77533 WHERE "Record" = '31–19–9' | wikisql |
CREATE TABLE table_1847180_3 (
vacator VARCHAR,
date_of_successors_formal_installation VARCHAR
) | Who vacated his post when his successor was formally installed on May 11, 1966? | SELECT vacator FROM table_1847180_3 WHERE date_of_successors_formal_installation = "May 11, 1966" | sql_create_context |
CREATE TABLE table_18253 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's party with district being pennsylvania 21 | SELECT "Party" FROM table_18253 WHERE "District" = 'Pennsylvania 21' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Tit... | Some questions where accepted answer does not have the highest score. | SELECT P2.Id AS "post_link", P.Score AS HighestScore, P3.Score AS AcceptedAnswerScore FROM Posts AS P JOIN Posts AS P2 ON (P2.Id = P.ParentId) JOIN Posts AS P3 ON (P3.ParentId = P2.Id) WHERE P.Score > 2 AND P.PostTypeId = 2 AND P2.PostTypeId = 1 AND P3.PostTypeId = 2 AND P.Score > P3.Score AND P2.AcceptedAnswerId = P3.... | sede |
CREATE TABLE diagnoses (
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 date of birth and diagnoses long title of subject name jerry deberry? | SELECT demographic.dob, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_name_15 (
date VARCHAR,
location_attendance VARCHAR
) | Which Date has a Location/Attendance of verizon center 7,448? | SELECT date FROM table_name_15 WHERE location_attendance = "verizon center 7,448" | 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 who died in or before 2183 have been prescribed the drug with code bupi0.1epd? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2183.0" AND prescriptions.formulary_drug_cd = "BUPI0.1EPD" | mimicsql_data |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 病患50606376在2011-11-27之后做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '50606376' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2011-11-27') | css |
CREATE TABLE table_204_755 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | in how many games was the opponent the green bay packers ? | SELECT COUNT(*) FROM table_204_755 WHERE "opponent" = 'green bay packers' | squall |
CREATE TABLE table_65213 (
"Nat." text,
"Name" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text
) | Willy Sagnol with a type as career end had what has the transfer fee? | SELECT "Transfer fee" FROM table_65213 WHERE "Type" = 'career end' AND "Name" = 'willy sagnol' | wikisql |
CREATE TABLE table_19228 (
"Country/Territory" text,
"Former pageant" text,
"Last competed" real,
"New pageant" text,
"Franchise since" real
) | when did new zealand last compete? | SELECT MAX("Last competed") FROM table_19228 WHERE "Country/Territory" = 'New Zealand' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give me the number of patients with morbid obesity/sda primary disease who were admitted before the year 2119. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.admityear < "2119" | mimicsql_data |
CREATE TABLE table_21563 (
"1391 Carelia" text,
"1398 Donnera" text,
"1405 Sibelius" text,
"1406 Komppa" text,
"1407 Lindel\u00f6f" text
) | how many 1391 carelia where 1398 donnera is 2397 lappaj rvi | SELECT COUNT("1391 Carelia") FROM table_21563 WHERE "1398 Donnera" = '2397 Lappajärvi' | wikisql |
CREATE TABLE table_24747844_2 (
money_list_rank INTEGER,
player VARCHAR
) | What is the maximum money list rank for Matt Hansen? | SELECT MAX(money_list_rank) FROM table_24747844_2 WHERE player = "Matt Hansen" | 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,
... | what is the number of patients whose insurance is private and diagnoses short title is prolif diab retinopathy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.short_title = "Prolif diab retinopathy" | mimicsql_data |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | view list of edited posts for a user. View a list of all edits done on all posts of a site. | SELECT PostTypes.Name AS Type, PostHistory.PostId AS "post_link", PostHistoryTypes.Name AS Modification, Comment FROM PostHistory INNER JOIN PostHistoryTypes ON PostHistoryTypes.Id = PostHistory.PostHistoryTypeId INNER JOIN Posts ON Posts.Id = PostHistory.PostId INNER JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId W... | sede |
CREATE TABLE table_66818 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | How many laps were there when the start was 12? | SELECT COUNT("Laps") FROM table_66818 WHERE "Start" = '12' | wikisql |
CREATE TABLE table_4040 (
"School" text,
"Gender" text,
"Age Range" text,
"Religious Affiliation" text,
"Location" text,
"School website" text
) | What is the gender of the cunningham hill infant school? | SELECT "Gender" FROM table_4040 WHERE "School" = 'Cunningham Hill Infant School' | wikisql |
CREATE TABLE table_72601 (
"Year" text,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | Who are all the womens doubles for the year 2008/2009? | SELECT "Womens doubles" FROM table_72601 WHERE "Year" = '2008/2009' | wikisql |
CREATE TABLE table_8758 (
"Player" text,
"Nationality" text,
"Jersey Number(s)" text,
"Position" text,
"Years" text,
"From" text
) | What is Years, when Postition is PG, and when From is USC? | SELECT "Years" FROM table_8758 WHERE "Position" = 'pg' AND "From" = 'usc' | wikisql |
CREATE TABLE table_1559 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | Name the original air date of 1/2 in season | SELECT "Original air date" FROM table_1559 WHERE "No. in season" = '1/2' | wikisql |
CREATE TABLE table_name_21 (
away_team VARCHAR,
crowd INTEGER
) | Which Away team score has a Crowd larger than 6,000? | SELECT away_team AS score FROM table_name_21 WHERE crowd > 6 OFFSET 000 | sql_create_context |
CREATE TABLE table_44749 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | What is Team, when Circuit is Phillip Island Grand Prix Circuit? | SELECT "Team" FROM table_44749 WHERE "Circuit" = 'phillip island grand prix circuit' | wikisql |
CREATE TABLE table_42979 (
"Name" text,
"Location" text,
"Field" text,
"Capacity (MW)" real,
"Annual Generation (average GWh)" text,
"Commissioned" text
) | What is the Annual Generation at Kawerau (Bope)? | SELECT "Annual Generation (average GWh)" FROM table_42979 WHERE "Name" = 'kawerau (bope)' | wikisql |
CREATE TABLE table_name_95 (
rank INTEGER,
bronze VARCHAR,
gold VARCHAR,
silver VARCHAR
) | What is the lowest rank of a nation with fewer than 3 gold medals, more than 2 bronze medals, and 0 silver medals? | SELECT MIN(rank) FROM table_name_95 WHERE gold < 3 AND silver = 0 AND bronze > 2 | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cine... | For each film, return the number of cinemas showing the fim in a pie chart. | SELECT Title, COUNT(Title) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title | nvbench |
CREATE TABLE table_204_229 (
id number,
"property" text,
"test method" text,
"units" text,
"4275" text,
"4301" text,
"4435" text,
"4630" text,
"4645" text
) | what is the total number of properties on the chart ? | SELECT COUNT("property") FROM table_204_229 | squall |
CREATE TABLE table_203_314 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | after france , who has the next highest amount of silver medals ? | SELECT "nation" FROM table_203_314 WHERE "nation" <> 'france' ORDER BY "silver" DESC LIMIT 1 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.