context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_11891 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which team had an away score of 15.14 (104)? | SELECT "Home team" FROM table_11891 WHERE "Away team score" = '15.14 (104)' | wikisql |
CREATE TABLE table_57268 (
"Year" real,
"Network" text,
"Lap-by-lap" text,
"s Color commentator" text,
"Pre-Race Host" text,
"Ratings" text
) | Who was the Pre-Race Host when Mike Joy was the Lap-by-lap in the Year 2005? | SELECT "Pre-Race Host" FROM table_57268 WHERE "Lap-by-lap" = 'mike joy' AND "Year" = '2005' | wikisql |
CREATE TABLE table_66835 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | What is the rank when there are more than 107 laps and the qual is 137.825? | SELECT "Rank" FROM table_66835 WHERE "Laps" > '107' AND "Qual" = '137.825' | wikisql |
CREATE TABLE table_15366849_1 (
zone INTEGER
) | What's the biggest zone? | SELECT MAX(zone) FROM table_15366849_1 | sql_create_context |
CREATE TABLE table_65218 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Year Joined" real,
"Year Left" real,
"Conference Joined" text
) | What's the highest Year Left that's got a Conference Joined of Sagamore with a Year Joined larger than 1942? | SELECT MAX("Year Left") FROM table_65218 WHERE "Conference Joined" = 'sagamore' AND "Year Joined" > '1942' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | how much does it cost to have a calcium lab test. | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'calcium') | eicu |
CREATE TABLE table_11900773_6 (
first_day_cover_cancellation VARCHAR,
date_of_issue VARCHAR,
theme VARCHAR
) | Where is the first day cover cancellation for the 3 April 2008 IIHF World Championships, Quebec City stamp? | SELECT first_day_cover_cancellation FROM table_11900773_6 WHERE date_of_issue = "3 April 2008" AND theme = "IIHF World Championships, Quebec City" | 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 total number of patients treated with mupirocin cream 2%? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Mupirocin Cream 2%" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 在09年3月14日到2019年9月13日内患者周才英花了多少医保金额? | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '周才英' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-03-14' AND '2019-09-13' | css |
CREATE TABLE table_name_42 (
competition VARCHAR,
date VARCHAR
) | Which competition was on August 11, 1996? | SELECT competition FROM table_name_42 WHERE date = "august 11, 1996" | sql_create_context |
CREATE TABLE table_name_24 (
antonio_thomas VARCHAR,
hikaru_sato VARCHAR
) | Name the antonio thomas for Hikaru Sato of tanaka (8:09) | SELECT antonio_thomas FROM table_name_24 WHERE hikaru_sato = "tanaka (8:09)" | sql_create_context |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | give me some good places for arabic in mountain view ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
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 are the top four drugs most often prescribed for patients of the age 40s until 1 year ago? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year') GR... | eicu |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | SELECT TOP 10 * FROM users. | SELECT CommentCount, ClosedDate, LastActivityDate FROM Posts LIMIT 10 | sede |
CREATE TABLE table_2409041_4 (
original_air_date VARCHAR,
no_in_season VARCHAR
) | Name the number of airdates for 14 | SELECT COUNT(original_air_date) FROM table_2409041_4 WHERE no_in_season = 14 | sql_create_context |
CREATE TABLE table_name_88 (
silver INTEGER,
rank VARCHAR,
gold VARCHAR,
total VARCHAR
) | What is the sum of sliver medals when there were 2 gold medals, less than 15 total medals, and the rank is greater than 5? | SELECT SUM(silver) FROM table_name_88 WHERE gold = 2 AND total < 15 AND rank > 5 | sql_create_context |
CREATE TABLE table_34847 (
"Tournament" text,
"1981" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text
) | Which 1988 has a 1985 of 2r? | SELECT "1988" FROM table_34847 WHERE "1985" = '2r' | wikisql |
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 prescriptions (
row_id number,
subject_id number,
h... | is patient 19096's arterial bp [systolic] ever less since 15 months ago than 164.0? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19096)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst... | mimic_iii |
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,
... | tell me the number of inpatient hospital admission patients who have hyperglycemia; hyponatremia primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | how many patients received hypothermia after the first administration of electrolytes - phosphate procedure in the same month until 2104? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'administration of electrolytes - phosphate' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOI... | eicu |
CREATE TABLE table_72371 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text,
"Opponent" text
) | What districts does incumbent Curt Weldon hold? | SELECT "District" FROM table_72371 WHERE "Incumbent" = 'Curt Weldon' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Draw a scatter chart about the correlation between School_ID and All_Games_Percent , and group by attribute All_Neutral. | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Neutral | nvbench |
CREATE TABLE table_9781 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the Attendance after Week 8 with a Result of W 42 0? | SELECT MAX("Attendance") FROM table_9781 WHERE "Week" > '8' AND "Result" = 'w 42–0' | wikisql |
CREATE TABLE table_65356 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What is the pba team for the player who went to santo tomas college? | SELECT "PBA team" FROM table_65356 WHERE "College" = 'santo tomas' | wikisql |
CREATE TABLE table_1342359_15 (
first_elected VARCHAR,
district VARCHAR
) | how many first elected with district is kansas 3 | SELECT COUNT(first_elected) FROM table_1342359_15 WHERE district = "Kansas 3" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | since 1433 days ago, had patient 22782 had any l groin intake? | SELECT COUNT(*) > 0 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 = 22782)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'l groin'... | mimic_iii |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 疾病Z83.066的患者在门诊诊断为检测指标549027的参考值范围下限是多少?上限是多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'Z83.066' AND jyjgzbb.JCZBDM = '549027' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE table_30030477_1 (
title VARCHAR,
original_air_date VARCHAR
) | How many titles are there with the original air date of august3,2010? | SELECT COUNT(title) FROM table_30030477_1 WHERE original_air_date = "August3,2010" | sql_create_context |
CREATE TABLE table_name_15 (
athlete VARCHAR,
time___sec__ VARCHAR,
rank VARCHAR
) | Which athlete is ranked less than 5 with time over 11.22? | SELECT athlete FROM table_name_15 WHERE time___sec__ > 11.22 AND rank < 5 | sql_create_context |
CREATE TABLE table_24399615_3 (
cable_rank VARCHAR,
bbc_three_weekly_ranking VARCHAR
) | What is the cable rank for bbc three weekly ranking of n/a? | SELECT cable_rank FROM table_24399615_3 WHERE bbc_three_weekly_ranking = "N/A" | sql_create_context |
CREATE TABLE table_name_73 (
authors VARCHAR,
location VARCHAR
) | Which author is located in Mexico? | SELECT authors FROM table_name_73 WHERE location = "mexico" | sql_create_context |
CREATE TABLE table_name_91 (
team VARCHAR,
location VARCHAR
) | Which team is located in Lida? | SELECT team FROM table_name_91 WHERE location = "lida" | sql_create_context |
CREATE TABLE table_41287 (
"Team" text,
"City" text,
"State" text,
"Home venue" text,
"Capacity" text
) | What is the name of the city with a capacity of 41,311? | SELECT "City" FROM table_41287 WHERE "Capacity" = '41,311' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | what was the name of the organism found at the last pleural fluid test of patient 23070 since 20 months ago? | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND microbiologyevents.spec_type_desc = 'pleural fluid' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) >=... | mimic_iii |
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 procedures (
... | give me the number of patients whose procedure icd9 code is 5771 and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
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... | Return a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute All_Neutral. | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral | nvbench |
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,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | when was the first hospital admission time of patient 81783 that had been admitted on the clinic referral/premature? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 81783 AND admissions.admission_location = 'clinic referral/premature' ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_68991 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the most points when the chassis was Jaguar R3 later than 2002? | SELECT MAX("Points") FROM table_68991 WHERE "Chassis" = 'jaguar r3' AND "Year" > '2002' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id... | i want a evening flight from DALLAS to MILWAUKEE | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU... | atis |
CREATE TABLE table_73403 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | What is the reason for change when maryland 6th is the district? | SELECT "Reason for change" FROM table_73403 WHERE "District" = 'Maryland 6th' | wikisql |
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 cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | A bar chart showing the sum of capacity of cinemas open for each year, rank by the X from low to high please. | SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY Openning_year | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | give me the number of patients whose diagnoses long title is unspecified hereditary and idiopathic peripheral neuropathy and drug type is base? | 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.long_title = "Unspecified hereditary and idiopathic peripheral neuropathy" AND prescriptions.drug_type = ... | mimicsql_data |
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,
... | show me patient 006-13677's monthly average output (ml)-urethral catheter dr wrenn output amount until 09/2105. | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-13677')) AND intakeoutput.celllabel = 'outpu... | eicu |
CREATE TABLE table_41068 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What is Television Service, when HDTV is No, and when Language is Italian? | SELECT "Television service" FROM table_41068 WHERE "HDTV" = 'no' AND "Language" = 'italian' | wikisql |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
P... | Show all ministers who do not belong to Progress Party, and count them by a bar chart, sort by the x-axis from high to low. | SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY Minister DESC | nvbench |
CREATE TABLE table_name_16 (
opponents VARCHAR,
raiders_points VARCHAR,
attendance VARCHAR
) | What is the total number of Opponents, when Raiders Points is '42', when Attendance is less than 52,505? | SELECT COUNT(opponents) FROM table_name_16 WHERE raiders_points = 42 AND attendance < 52 OFFSET 505 | sql_create_context |
CREATE TABLE table_62699 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Total Apps" text,
"Total Goals" real
) | What is the highest FLT goals with 0 league cup goals, a GK position, and 2 league cup apps? | SELECT MAX("FLT Goals") FROM table_62699 WHERE "League Cup Goals" = '0' AND "Position" = 'gk' AND "League Cup Apps" = '2' | 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,... | 查一下给患者云学博开315832这个药的医院有哪些 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '云学博' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '315832') | css |
CREATE TABLE department (
dname VARCHAR,
mgr_start_date VARCHAR
) | List all department names ordered by their starting date. | SELECT dname FROM department ORDER BY mgr_start_date | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | Does EEB 453 have any prereqs ? | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'EEB' AND COURSE_0.number =... | advising |
CREATE TABLE table_12662 (
"Club" text,
"League" text,
"Sport" text,
"Established" text,
"Championships" real
) | Which Championships have a League of ontario australian football league? | SELECT "Championships" FROM table_12662 WHERE "League" = 'ontario australian football league' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | count the number of patients that have had a blood, venipuncture microbiology test in 2104. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND STRFTIME('%y', microlab.culturetakentime) = '2104') | eicu |
CREATE TABLE table_204_77 (
id number,
"number" text,
"builder" text,
"type" text,
"date" text,
"works number" number,
"notes" text
) | how many total trains were build in 1949 ? | SELECT COUNT("number") FROM table_204_77 WHERE "date" = 1949 | squall |
CREATE TABLE table_30887 (
"Code" text,
"Subdivision name ( be ) (BGN/PCGN)" text,
"Subdivision name ( be ) (GOST)" text,
"Subdivision name ( ru ) (BGN/PCGN)" text,
"Subdivision name ( ru ) (GOST)" text,
"Subdivision category" text
) | What is the subdivision name (BE) where subdivision name (RU) (BGN) is Grodnenskaya Oblast'? | SELECT "Subdivision name ( be ) (BGN/PCGN)" FROM table_30887 WHERE "Subdivision name ( ru ) (BGN/PCGN)" = 'Grodnenskaya oblast' | wikisql |
CREATE TABLE table_32813 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team that played Fitzroy? | SELECT "Away team" FROM table_32813 WHERE "Home team" = 'fitzroy' | 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... | 在医院1789276全部诊疗记录中,把有民政补助的金额与总的医疗花费比值的最大值根据科室的编号和入院诊断疾病编码差别计算一下,然后以降序的顺序排序 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1789276' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_D... | css |
CREATE TABLE table_32135 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Tell me the number of bronze for silver of 0 and total less than 1 | SELECT COUNT("Bronze") FROM table_32135 WHERE "Silver" = '0' AND "Total" < '1' | wikisql |
CREATE TABLE table_35680 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the date of the game where the indians record was 37-44? | SELECT "Date" FROM table_35680 WHERE "Record" = '37-44' | wikisql |
CREATE TABLE table_name_93 (
attendance_g INTEGER,
pos VARCHAR,
season VARCHAR
) | What is the average attendance for seasons before 1999 with pos of 8? | SELECT AVG(attendance_g) FROM table_name_93 WHERE pos = 8 AND season < 1999 | sql_create_context |
CREATE TABLE table_name_44 (
attendance INTEGER,
record VARCHAR
) | What game that had a record of 39-44 had the lowest attendance? | SELECT MIN(attendance) FROM table_name_44 WHERE record = "39-44" | sql_create_context |
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 were the four drugs most often prescribed to the bronchitis - acute male patients aged 40s within 2 months after they had been diagnosed with bronchitis - acute since 6 years ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bronchitis - acute' AND DATETIME(diagnosis.diagnos... | eicu |
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... | Show the average of weight from each sex, display total number from low to high order. | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) | nvbench |
CREATE TABLE table_27537518_6 (
record VARCHAR,
first_star VARCHAR
) | What was the record in the game whose first star was J. Oduya? | SELECT record FROM table_27537518_6 WHERE first_star = "J. Oduya" | sql_create_context |
CREATE TABLE table_11658094_3 (
nickname VARCHAR,
institution VARCHAR
) | What is the nickname of the newberry college? | SELECT nickname FROM table_11658094_3 WHERE institution = "Newberry College" | sql_create_context |
CREATE TABLE table_16545 (
"Season" real,
"Grand FinalDate" text,
"WinningTeam" text,
"Score" text,
"LosingTeam" text,
"Location" text,
"GF Attendance" real,
"Clive Churchill Medal" text
) | Which losing team had a score of 24-12? | SELECT "LosingTeam" FROM table_16545 WHERE "Score" = '24-12' | wikisql |
CREATE TABLE table_name_54 (
state__class_ VARCHAR,
successor VARCHAR
) | Which State (class) has a Successor of harry f. byrd, jr. (d)? Question | SELECT state__class_ FROM table_name_54 WHERE successor = "harry f. byrd, jr. (d)" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | Wilson confidence rating for posts of a user. https://stackapps.com/questions/8555/request-for-user-script-to-calculate-wilson-confidence-ratings-for-posts | SELECT p.Id, p.OwnerUserId, SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) AS upvotes, SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS downvotes FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId IN (2, 3) AND p.OwnerUserId = 2157772 GROUP BY p.Id, p.OwnerUserId | sede |
CREATE TABLE table_name_53 (
top_10s INTEGER,
starts VARCHAR
) | Which of the top-10s has a starts value of 14? | SELECT MAX(top_10s) FROM table_name_53 WHERE starts = 14 | sql_create_context |
CREATE TABLE table_23368 (
"N\u00ba" real,
"Ep" real,
"Huckleberry Hound" text,
"Pixie and Dixie" text,
"Yogi Bear" text,
"Air date" text,
"Credited animators" text
) | What episode includes 'Cop and Saucer'? | SELECT MIN("Ep") FROM table_23368 WHERE "Huckleberry Hound" = 'Cop and Saucer' | 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 admission type is urgent and primary disease is left femur fracture? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "LEFT FEMUR FRACTURE" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
... | what was the name of the first intake that patient 12927 had on this month/28. | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 12927)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE table_58763 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is team 1 if Renova is team 2? | SELECT "Team 1" FROM table_58763 WHERE "Team 2" = 'renova' | wikisql |
CREATE TABLE table_name_17 (
republican_ticket VARCHAR,
socialist_ticket VARCHAR
) | What is the name on the Republican ticket when the Socialist ticket was louis waldman? | SELECT republican_ticket FROM table_name_17 WHERE socialist_ticket = "louis waldman" | sql_create_context |
CREATE TABLE table_63745 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Football Class" text,
"Primary Conference" text,
"County" text
) | What is the Location with a county of 30 Hancock? | SELECT "Location" FROM table_63745 WHERE "County" = '30 hancock' | wikisql |
CREATE TABLE table_26493520_3 (
title VARCHAR,
total_viewers_on_fx VARCHAR
) | Name the title for total viewers on fx+ being 483,000 | SELECT title FROM table_26493520_3 WHERE total_viewers_on_fx = "483,000" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | how many patients whose admission year is less than 2166 and diagnoses long title is pneumococcal pneumonia [streptococcus pneumoniae pneumonia]? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2166" AND diagnoses.long_title = "Pneumococcal pneumonia [Streptococcus pneumoniae pneumonia]" | mimicsql_data |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | Next semester , how many lecture sections are offered for PSYCH 464 ? | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PSYCH' AND course.number = 464 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_name_70 (
name VARCHAR,
authority VARCHAR,
local_board VARCHAR
) | What name shows as private authority and hibiscus and bays local board ? | SELECT name FROM table_name_70 WHERE authority = "private" AND local_board = "hibiscus and bays" | sql_create_context |
CREATE TABLE table_62631 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What was the highest goals with fewer than 16 losses, fewer than 11 wins, and a goal difference greater than -9? | SELECT MAX("Goals for") FROM table_62631 WHERE "Losses" < '16' AND "Wins" < '11' AND "Goal Difference" > '-9' | 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 jyjgzbb (
BGDH text,
BGRQ tim... | 胆囊炎患者46050151被门诊诊断确诊时其检测指标668302的结果定量及其单位分别是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_203_839 (
id number,
"station" text,
"type" text,
"latitude" text,
"longitude" text,
"el. (m)" number,
"opened" number,
"closed" number,
"coordinates" text
) | the top elevation measured for this station is 2591m | SELECT "station" FROM table_203_839 WHERE "el. (m)" = 2591 | squall |
CREATE TABLE table_29945 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who scored the most points when the Bucks played against Houston? | SELECT "High points" FROM table_29945 WHERE "Team" = 'Houston' | wikisql |
CREATE TABLE table_name_71 (
year INTEGER,
australian_open VARCHAR,
french_open VARCHAR,
wimbledon VARCHAR
) | What is the latest year rafael nadal was in the French Open, Roger Federer was in Wimbledon, and Roger Federer was in the Australian Open? | SELECT MAX(year) FROM table_name_71 WHERE french_open = "rafael nadal" AND wimbledon = "roger federer" AND australian_open = "roger federer" | sql_create_context |
CREATE TABLE table_204_808 (
id number,
"team" text,
"no" number,
"driver" text,
"class" text,
"chassis" text,
"engine" text
) | how many teams had at least two drivers this season ? | SELECT COUNT(*) FROM (SELECT "team" FROM table_204_808 GROUP BY "team" HAVING COUNT("driver") >= 2) | squall |
CREATE TABLE table_31467 (
"Rank" real,
"Rider" text,
"Sat 20 Aug" text,
"Mon 22 Aug" text,
"Tues 23 Aug" text,
"Wed 24 Aug" text,
"Thurs 25 Aug" text,
"Fri 26 Aug" text
) | What is the thurs 25 aug when wed 24 aug is 19' 59.73 113.216mph? | SELECT "Thurs 25 Aug" FROM table_31467 WHERE "Wed 24 Aug" = '19'' 59.73 113.216mph' | wikisql |
CREATE TABLE table_11240028_1 (
last_appearance VARCHAR,
portrayed_by VARCHAR
) | Which episode did actor A. J. Buckley last appear in? | SELECT last_appearance FROM table_11240028_1 WHERE portrayed_by = "A. J. Buckley" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is the number of patients who had non-invasive mechanical ventilation procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Non-invasive mechanical ventilation" | mimicsql_data |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | A bar chart about what are the average prices of products, grouped by manufacturer name?, I want to rank by the names in descending. | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_name_44 (
week_8_oct_26 VARCHAR,
week_7_oct_19 VARCHAR
) | What is the Week 8 result of the team that lost to syarcuse (4-2) in Week 7? | SELECT week_8_oct_26 FROM table_name_44 WHERE week_7_oct_19 = "syarcuse (4-2)" | sql_create_context |
CREATE TABLE table_name_20 (
rank VARCHAR,
player VARCHAR,
bb_so VARCHAR
) | What was the rank of tris speaker when BB/SO was 7? | SELECT rank FROM table_name_20 WHERE player = "tris speaker" AND bb_so = 7 | sql_create_context |
CREATE TABLE table_65987 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the notes for the rowers from denmark? | SELECT "Notes" FROM table_65987 WHERE "Country" = 'denmark' | wikisql |
CREATE TABLE table_5161 (
"Round" text,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"Team" text
) | What is the Overall number for pick 17? | SELECT "Overall" FROM table_5161 WHERE "Pick" = '17' | wikisql |
CREATE TABLE table_name_26 (
length VARCHAR,
bullet VARCHAR
) | Which length has a Bullet of 6.5 (.257)? | SELECT length FROM table_name_26 WHERE bullet = "6.5 (.257)" | sql_create_context |
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,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | tell me the price of taking heparin flush (10 units/ml)? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'heparin flush (10 units/ml)') | mimic_iii |
CREATE TABLE table_13614 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"Turbo" text,
"GPU frequency" text,
"Cores" text,
"L2 cache" text,
"L3 cache" text,
"I/O bus" text,
"Mult." text,
"Memory" text,
"Voltage" text,
"Socket" text,
"Release date" te... | What is the frequency for I/O bus of DMI, voltage of 0.725 1.4v and part cn80617004458ab? | SELECT "Frequency" FROM table_13614 WHERE "I/O bus" = 'dmi' AND "Voltage" = '0.725–1.4v' AND "Part number(s)" = 'cn80617004458ab' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | has patient 004-65662 gone through any lab test since 2103? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-65662')) AND STRFTIME('%y', lab.labresulttime) >= '2103' | eicu |
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... | which patients have aztreonam drug prescription? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Aztreonam" | mimicsql_data |
CREATE TABLE table_name_38 (
population VARCHAR,
county VARCHAR
) | What is the Population of Sargent County? | SELECT population FROM table_name_38 WHERE county = "sargent" | sql_create_context |
CREATE TABLE table_57987 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the decision on october 5? | SELECT "Decision" FROM table_57987 WHERE "Date" = 'october 5' | wikisql |
CREATE TABLE table_name_14 (
record VARCHAR,
event VARCHAR
) | What is his record at ufc 115? | SELECT record FROM table_name_14 WHERE event = "ufc 115" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.