context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_30459 (
"Series #" real,
"Title" text,
"Written by" text,
"Directed by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | What date did 'The runner' originally air on? | SELECT "Original air date" FROM table_30459 WHERE "Title" = 'The Runner' | wikisql |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | Bar graph to show how many year from different year, and rank y-axis from low to high order. | SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) | nvbench |
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 minimum age of patients whose gender is f and primary disease is congestive heart failure? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE" | mimicsql_data |
CREATE TABLE table_255205_1 (
joined VARCHAR,
type VARCHAR
) | How many joined this Private/Church of God institution? | SELECT joined FROM table_255205_1 WHERE type = "Private/Church of God" | sql_create_context |
CREATE TABLE table_name_34 (
nickname VARCHAR,
division VARCHAR
) | What is the nickname of the team in division 2? | SELECT nickname FROM table_name_34 WHERE division = "division 2" | sql_create_context |
CREATE TABLE table_name_22 (
performer VARCHAR,
points VARCHAR
) | Who scored 57 points? | SELECT performer FROM table_name_22 WHERE points = 57 | sql_create_context |
CREATE TABLE table_28291 (
"Rank" real,
"Average" text,
"Player" text,
"Matches" real,
"Innings" real,
"Period" text
) | What is the lowest number of matches for a record holder? | SELECT MIN("Matches") FROM table_28291 | wikisql |
CREATE TABLE table_69389 (
"Year" text,
"Champion" text,
"Runner-Up" text,
"3rd Place" text,
"Location" text
) | Name the champion for 2000 | SELECT "Champion" FROM table_69389 WHERE "Year" = '2000' | wikisql |
CREATE TABLE table_71708 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the Manufacturer for simone corsi? | SELECT "Manufacturer" FROM table_71708 WHERE "Rider" = 'simone corsi' | wikisql |
CREATE TABLE table_21070 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | If team two is San Lorenzo, how many were on team one? | SELECT COUNT("Team #1") FROM table_21070 WHERE "Team #2" = 'San Lorenzo' | wikisql |
CREATE TABLE table_203_142 (
id number,
"pos" text,
"no" number,
"rider" text,
"bike" text,
"laps" number,
"time" text,
"grid" number,
"points" number
) | in the 2007 phillip island superbike world championship round superbike race 1 classification what was the point difference between position 1 and 2 ? | SELECT (SELECT "points" FROM table_203_142 WHERE "pos" = 1) - (SELECT "points" FROM table_203_142 WHERE "pos" = 2) | squall |
CREATE TABLE table_name_62 (
attendance INTEGER,
opponent VARCHAR,
record VARCHAR
) | What was the attendance when the Braves were the opponent and the record was 56-53? | SELECT AVG(attendance) FROM table_name_62 WHERE opponent = "braves" AND record = "56-53" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Please show me the list of Dr. Daniel Brickman 's courses next semester . | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Daniel Brickman%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... | advising |
CREATE TABLE table_46755 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What was the manner of departure for the vacancy date of 20 September 2009? | SELECT "Manner of departure" FROM table_46755 WHERE "Date of vacancy" = '20 september 2009' | wikisql |
CREATE TABLE table_name_47 (
top_5 INTEGER,
wins VARCHAR,
events VARCHAR
) | Which Top-5 is the highest one that has Wins of 0, and Events larger than 6? | SELECT MAX(top_5) FROM table_name_47 WHERE wins = 0 AND events > 6 | sql_create_context |
CREATE TABLE table_1636 (
"Period" text,
"% trains arriving within 5 mins of scheduled time (over three months)" text,
"Change over same quarter the previous year" text,
"% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text,
"Change over previous year as a whole" text
... | What's the change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of scheduled time (over three months)? | SELECT "Change over same quarter the previous year" FROM table_1636 WHERE "% trains arriving within 5 mins of scheduled time (over three months)" = '89.6%' | wikisql |
CREATE TABLE table_name_2 (
roll VARCHAR,
area VARCHAR
) | Which roll has an Area of mahia? | SELECT roll FROM table_name_2 WHERE area = "mahia" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | had patient 035-17122 been prescribed since 154 months ago furosemide inj, vitamins/minerals po tabs, or ecotrin? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-17122')) AND medication.drugname IN ('furosemide inj', 'vitamins/miner... | eicu |
CREATE TABLE table_78457 (
"League" text,
"Sport" text,
"Season" text,
"Total attendance" text,
"Average attendance" real
) | What's the average attendance of the league with a total attendance of 2268508? | SELECT "Average attendance" FROM table_78457 WHERE "Total attendance" = '2268508' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | Users having Stack Exchange Inc. emails on their 'About me'. Email domains included: stackexchange.com and stackoverflow.com | SELECT Id AS "user_link", AboutMe, WebsiteUrl FROM Users WHERE (AboutMe LIKE '%@stackexchange.com%' OR AboutMe LIKE '%@stackoverflow.com%' OR AboutMe LIKE '%valued associate%') | sede |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 医疗就诊68258054270与医疗就诊61652781791中开出了哪些药品名称相同?列出有哪些药品的名称? | (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '61652781791') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '68258054270') | css |
CREATE TABLE table_204_385 (
id number,
"round" number,
"pick" number,
"player" text,
"nationality" text,
"college/junior/club team" text
) | are more of the amateur draft picks from canada or the united states ? | SELECT "nationality" FROM table_204_385 WHERE "nationality" IN ('canada', 'united states') GROUP BY "nationality" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_35471 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
) | what week number was at memorial stadium? | SELECT AVG("Week") FROM table_35471 WHERE "Game site" = 'memorial stadium' | wikisql |
CREATE TABLE table_53447 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people were in the crowd when the home team scored 31.9 (195)? | SELECT COUNT("Crowd") FROM table_53447 WHERE "Home team score" = '31.9 (195)' | wikisql |
CREATE TABLE table_17001658_6 (
team VARCHAR,
game VARCHAR
) | Against which team was game 21? | SELECT team FROM table_17001658_6 WHERE game = 21 | sql_create_context |
CREATE TABLE table_73266 (
"Gas name" text,
"Chemical formula" text,
"Lifetime (years)" text,
"20-yr" text,
"100-yr" text,
"500-yr" text
) | What is the lifetime (years) for chemical formula ch 4? | SELECT "Lifetime (years)" FROM table_73266 WHERE "Chemical formula" = 'CH 4' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and I want to display total number from low to high order please. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_... | For those dates with a max temperature greater than or equal to 80, I want to see the number of days for each year using a bar chart. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 | nvbench |
CREATE TABLE table_43678 (
"Player" text,
"Nationality" text,
"Jersey Number(s)" text,
"Position" text,
"Years" text,
"From" text
) | What is the nationality of the person with number 27? | SELECT "Nationality" FROM table_43678 WHERE "Jersey Number(s)" = '27' | wikisql |
CREATE TABLE table_36847 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
) | What is the year that there were 0 wins, team AJS, and under 12 points? | SELECT COUNT("Year") FROM table_36847 WHERE "Wins" = '0' AND "Team" = 'ajs' AND "Points" < '12' | wikisql |
CREATE TABLE table_41510 (
"Player" text,
"Country" text,
"Year won" real,
"Total" real,
"To par" real
) | What is the Total of the player who won before 1983 with a smaller than 4 To par? | SELECT COUNT("Total") FROM table_41510 WHERE "To par" < '4' AND "Year won" < '1983' | wikisql |
CREATE TABLE table_25548505_1 (
original_air_date VARCHAR,
us_viewers__millions_ VARCHAR
) | What was the original air date of the episode that had 5.30 million U.S. viewers? | SELECT original_air_date FROM table_25548505_1 WHERE us_viewers__millions_ = "5.30" | sql_create_context |
CREATE TABLE table_65771 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | what is the venue when the competition is asian games, the event is 4x400 m relay and the year is 2002? | SELECT "Venue" FROM table_65771 WHERE "Competition" = 'asian games' AND "Event" = '4x400 m relay' AND "Year" = '2002' | wikisql |
CREATE TABLE table_name_82 (
save VARCHAR,
opponent VARCHAR,
date VARCHAR
) | What is the save when Yankees are the opponents on July 25? | SELECT save FROM table_name_82 WHERE opponent = "yankees" AND date = "july 25" | sql_create_context |
CREATE TABLE table_5246 (
"Years" text,
"Building" text,
"City" text,
"Height" text,
"Storeys" real
) | Which city contains Telus Plaza South? | SELECT "City" FROM table_5246 WHERE "Building" = 'telus plaza south' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | count the number of patients who are diagnosed with gi obstruction / ileus - small bowel obstruction since 2 years ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'gi obstruction / ileus - small bowel obstruction' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 year')) | eicu |
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... | 自二零一零年六月十日到二零一八年五月四日,名叫韦烨烨的病人在医院9170359开过哪些药?列出编码和名称 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '韦烨烨' AND t_kc21.MED_SER_ORG_NO = '9170359' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-06-10' AND '2018-05-04') | css |
CREATE TABLE table_name_90 (
total INTEGER,
year_of_census VARCHAR,
serbs VARCHAR
) | What is the average total of the census after 1971 with 10,412 (32.88%) Serbs? | SELECT AVG(total) FROM table_name_90 WHERE year_of_census > 1971 AND serbs = "10,412 (32.88%)" | sql_create_context |
CREATE TABLE table_48553 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
) | WHAT PLAYER HAS A PICK SMALLER THAN 110, AND DUKE AS COLLEGE? | SELECT "Player" FROM table_48553 WHERE "Pick" < '110' AND "College" = 'duke' | wikisql |
CREATE TABLE table_73016 (
"Year" real,
"Illinois" text,
"Indiana" text,
"Kentucky" text,
"Michigan" text,
"Ohio" text,
"Wisconsin" text
) | What was the little league team from Kentucky when the little league team from Michigan was Grosse Pointe Farms-City LL Grosse Pointe Farms? | SELECT "Kentucky" FROM table_73016 WHERE "Michigan" = 'Grosse Pointe Farms-City LL Grosse Pointe Farms' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE... | what airlines are there | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANC... | atis |
CREATE TABLE table_10706961_2 (
report VARCHAR,
winning_team VARCHAR,
pole_position VARCHAR
) | How many reports are there in the race that Forsythe Racing won and Teo Fabi had the pole position in? | SELECT COUNT(report) FROM table_10706961_2 WHERE winning_team = "Forsythe Racing" AND pole_position = "Teo Fabi" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | how many patients were diagnosed with respiratory acidosis - chronic and did not come to the hospital in the same month? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'respiratory acidosis - chronic') AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.... | eicu |
CREATE TABLE table_32243 (
"Rank" real,
"Name" text,
"Years" text,
"Goals" real,
"Apps" real
) | What is the sum of rank with years 1996 2012 and apps greater than 340? | SELECT SUM("Rank") FROM table_32243 WHERE "Years" = '1996–2012' AND "Apps" > '340' | wikisql |
CREATE TABLE table_44558 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Carl Levin" text,
"Republican: Jack Hoogendyk" text,
"Lead Margin" real
) | What is Poll Source, when Democrat: Carl Levin is 61%? | SELECT "Poll Source" FROM table_44558 WHERE "Democrat: Carl Levin" = '61%' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | indicate the daily minimum arterial bp mean of patient 13622 in 08/last year. | SELECT MIN(chartevents.valuenum) 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 = 13622)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE Tasks (
task_id INTEGER,
project_id INTEGER,
task_details VARCHAR(255),
"eg Agree Objectives" VARCHAR(1)
)
CREATE TABLE Projects (
project_id INTEGER,
organisation_id INTEGER,
project_details VARCHAR(255)
)
CREATE TABLE Organisations (
organisation_id INTEGER,
organisa... | Find the organisation ids and details of the organisations which are involved i Plot them as bar chart, show bars from low to high order please. | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details | nvbench |
CREATE TABLE table_201_13 (
id number,
"city" text,
"county(ies)" text,
"population\n(2000 census)" number,
"population\n(2010 census)" number,
"class" text,
"incorporation\ndate" number
) | county has altoona and augusta ? | SELECT "county(ies)" FROM table_201_13 WHERE "city" = 'altoona' | squall |
CREATE TABLE table_17661 (
"Strongs #" text,
"Hebrew word" text,
"Strongs Transliteration" text,
"Strongs Words Compounded" text,
"English Spelling" text
) | What is the hebrew word listed for strongs # 5418? | SELECT "Hebrew word" FROM table_17661 WHERE "Strongs #" = '5418' | wikisql |
CREATE TABLE table_57131 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the match as corio oval, who was the away team? | SELECT "Away team" FROM table_57131 WHERE "Venue" = 'corio oval' | wikisql |
CREATE TABLE table_45298 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What methos did Keith Wisniewski use in the ufc fight night: teixeira vs. bader? | SELECT "Method" FROM table_45298 WHERE "Event" = 'ufc fight night: teixeira vs. bader' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
... | show flights from DENVER to OAKLAND | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND... | atis |
CREATE TABLE table_name_8 (
report VARCHAR,
date VARCHAR
) | What Report has the Date September 3, 2005? | SELECT report FROM table_name_8 WHERE date = "september 3, 2005" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 22021171患者被门诊诊断为混合性焦虑障碍,查看他的检测指标074536的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE table_name_80 (
director VARCHAR,
role VARCHAR
) | Which Director has a Role of melissa? | SELECT director FROM table_name_80 WHERE role = "melissa" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose age is less than 70 and lab test fluid is cerebrospinal fluid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "70" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_name_54 (
silver INTEGER,
total VARCHAR,
bronze VARCHAR
) | what is the highest silver when the total is 4 and bronze is less than 1? | SELECT MAX(silver) FROM table_name_54 WHERE total = "4" AND bronze < 1 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients under the age of 71 underwent procedure under icd9 code 5732? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "71" AND procedures.icd9_code = "5732" | mimicsql_data |
CREATE TABLE table_67383 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"10:00" text
) | What 7:00 has a 7:30 of w-five? | SELECT "7:00" FROM table_67383 WHERE "7:30" = 'w-five' | wikisql |
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,... | 在医疗就诊49113523818中,给患者俞雪卉开的药有哪些?每次的用量是多少?使用频次是怎样的 | SELECT SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '49113523818' | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | what was the organism name found in this hospital encounter in patient 031-3355's last other microbiology test? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.cultur... | eicu |
CREATE TABLE table_2409041_3 (
production_code VARCHAR,
original_air_date VARCHAR
) | How many production codes have an original airdate of November 16, 1990? | SELECT COUNT(production_code) FROM table_2409041_3 WHERE original_air_date = "November 16, 1990" | sql_create_context |
CREATE TABLE table_67134 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the score of the game when the record was 58 47? | SELECT "Score" FROM table_67134 WHERE "Record" = '58–47' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | For those employees who was hired before 2002-06-21, give me the comparison about the sum of salary over the job_id , and group by attribute job_id, and list bar from low to high order. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_203_161 (
id number,
"pos." text,
"div." number,
"no." number,
"team" text,
"drivers" text,
"car" text,
"laps" number,
"qual.\npos." number
) | who was phil ward racing 's other driver ? | SELECT "drivers" FROM table_203_161 WHERE "team" = 'phil ward racing' AND "drivers" <> 'phil ward' | squall |
CREATE TABLE table_48544 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"Career SR" text,
"Career W\u2013L" text
) | What is the 2007 value for the 2006 wta premier tournaments? | SELECT "2007" FROM table_48544 WHERE "2006" = 'wta premier tournaments' | wikisql |
CREATE TABLE table_894 (
"District" real,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text,
"Opponent" text
) | what was the lowest numbers for the winner gregory w. meeks | SELECT MIN("Elected") FROM table_894 WHERE "Incumbent" = 'Gregory W. Meeks' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diag... | when was the first time that patient 85895 had the maximum chloride in a month before? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRE... | mimic_iii |
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 demographic (... | Among patients admitted before 2114, for how many of them have a death status unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear < "2114" | mimicsql_data |
CREATE TABLE table_name_72 (
area__km_2__ INTEGER,
population__2000_ VARCHAR
) | What is the smallest area with 45 population? | SELECT MIN(area__km_2__) FROM table_name_72 WHERE population__2000_ = "45" | sql_create_context |
CREATE TABLE table_name_37 (
object_type VARCHAR,
ngc_number VARCHAR
) | Which Object type has an NGC number of 2171? | SELECT object_type FROM table_name_37 WHERE ngc_number = 2171 | sql_create_context |
CREATE TABLE table_name_24 (
Id VARCHAR
) | what is 2010 when 2006 is 3r? | SELECT 2010 FROM table_name_24 WHERE 2006 = "3r" | sql_create_context |
CREATE TABLE table_name_35 (
tournament VARCHAR
) | What is the 1976 value of the Australian Open? | SELECT 1976 FROM table_name_35 WHERE tournament = "australian open" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
Dele... | test query for empty rows. | SELECT Posts.Id AS "post_link" FROM Posts WHERE Posts.OwnerUserId = @UserId | sede |
CREATE TABLE table_24765815_1 (
team VARCHAR,
rank VARCHAR
) | What team was ranked in 7th? | SELECT team FROM table_24765815_1 WHERE rank = "7th" | sql_create_context |
CREATE TABLE table_49985 (
"Draw" real,
"Song" text,
"Artist" text,
"Televotes" real,
"Place" real
) | What is the total number of Draw(s), when Televotes is greater than 1761, when Song is 'Ils Sont L ', and when Place is less than 2? | SELECT COUNT("Draw") FROM table_49985 WHERE "Televotes" > '1761' AND "Song" = 'ils sont là' AND "Place" < '2' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | count the number of patients that died in the same month after having been diagnosed with bronchitis until 2104. | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bronchitis') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosis... | eicu |
CREATE TABLE table_name_99 (
Id VARCHAR
) | Who came in 3rd at Venue? | SELECT 3 AS rd_place FROM table_name_99 WHERE "venue" = "venue" | sql_create_context |
CREATE TABLE Addresses (
city VARCHAR,
address_id VARCHAR
)
CREATE TABLE Staff (
staff_address_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR
) | Which city does staff with first name as Janessa and last name as Sawayn live? | SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" | sql_create_context |
CREATE TABLE table_36098 (
"Tournament" text,
"1998" text,
"1999" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Career SR" text,
"Caree... | Which 2007 has a 2008 of 0 / 4? | SELECT "2007" FROM table_36098 WHERE "2008" = '0 / 4' | wikisql |
CREATE TABLE table_name_85 (
datacenter VARCHAR,
features VARCHAR
) | What Datacenter is listed against the network access connections: rras Feature? | SELECT datacenter FROM table_name_85 WHERE features = "network access connections: rras" | sql_create_context |
CREATE TABLE table_name_12 (
average_attendance INTEGER,
_number_of_home_games VARCHAR
) | What was the Average Attendance during the Year in which there were 9 Home Games? | SELECT MAX(average_attendance) FROM table_name_12 WHERE _number_of_home_games = 9 | 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 number of urgent hospital admission patients who had closed biopsy of bronchus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Closed bronchial biopsy" | mimicsql_data |
CREATE TABLE table_63127 (
"Player" text,
"Int'l Debut" text,
"Year" real,
"Cross Code Debut" text,
"Date" text,
"Position" text
) | What date was the Cross Code Debut of rl 1st test great britain v australia, and the Int'l Debut was RU Five Nations v Ireland? | SELECT "Date" FROM table_63127 WHERE "Cross Code Debut" = 'rl 1st test great britain v australia' AND "Int'l Debut" = 'ru five nations v ireland' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and sort by the Y from high to low. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_name_83 (
ihsaa_class VARCHAR,
location VARCHAR
) | Which IHSAA Class has a Location of linton? | SELECT ihsaa_class FROM table_name_83 WHERE location = "linton" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | 在00年6月14日到2015年5月27日之内名叫沈景辉的患者被开出的所有检验报告单的检验报告单号都有什么? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '沈景辉' AND jybg... | css |
CREATE TABLE table_204_323 (
id number,
"year" number,
"film" text,
"function" text,
"notes" text
) | how many films did ms. starfelt produce after 2010 ? | SELECT COUNT("film") FROM table_204_323 WHERE "year" > 2010 | squall |
CREATE TABLE table_64575 (
"County" text,
"Location" text,
"Distance" real,
"Total" real,
"Notes" text
) | How much Distance has Notes of north end terminus of ar 155? | SELECT SUM("Distance") FROM table_64575 WHERE "Notes" = 'north end terminus of ar 155' | wikisql |
CREATE TABLE table_75448 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
) | What celebrity is famous for being an actor? | SELECT "Celebrity" FROM table_75448 WHERE "Famous for" = 'actor' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the number of patients whose drug type is additive and lab test name is calculated thyroxine (t4) index? | 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.drug_type = "ADDITIVE" AND lab.label = "Calculated Thyroxine (T4) Index" | mimicsql_data |
CREATE TABLE table_39313 (
"Name" text,
"GP-GS" text,
"Effic" real,
"Att-Cmp-Int" text,
"Avg/G" real
) | What is the Att-Cmp-Int for the player with a efficiency of 117.4? | SELECT "Att-Cmp-Int" FROM table_39313 WHERE "Effic" = '117.4' | wikisql |
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... | provide the admission time and procedure icd9 code for chandra schulman. | SELECT demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Chandra Schulman" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give the number of patients whose admission type is urgent and procedure icd9 code is 8968? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "8968" | mimicsql_data |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, and show by the y-axis in desc. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_name_91 (
music_video VARCHAR,
album VARCHAR,
length VARCHAR
) | What was the music video that was from the album High Society, with a length of 3:50? | SELECT music_video FROM table_name_91 WHERE album = "high society" AND length = "3:50" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what's first systemicsystolic value of patient 004-4326 since 2080 days ago? | SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-4326')) AND NOT vitalperiodic.systemicsystolic... | eicu |
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... | What are the total enrollments of universities of each affiliation type Plot them as bar chart, and I want to show by the sum enrollment in desc. | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment) DESC | nvbench |
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 widowed patients had the procedure extracorporeal circulation auxiliary to open heart surgery? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Extracorporeal circulation auxiliary to open heart surgery" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | count the number of patients who have been diagnosed since 2104 with acute lung injury - pulmonary etiology. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute lung injury - pulmonary etiology' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104') | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.