context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_8173 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is February, when Opponent is 'Montreal Canadiens'? | SELECT "February" FROM table_8173 WHERE "Opponent" = 'montreal canadiens' | wikisql |
CREATE TABLE table_26327 (
"Episode number Production number" text,
"Title" text,
"Original airing" text,
"Rating" text,
"Share" real,
"Rating/share (18\u201349)" text,
"Total viewers (in millions)" text
) | What episode had 10.47 total viewers? | SELECT "Title" FROM table_26327 WHERE "Total viewers (in millions)" = '10.47' | wikisql |
CREATE TABLE table_73780 (
"Song" text,
"Singer" text,
"Co-Singers" text,
"Music Director" text,
"Lyricist" text,
"Co-Stars" text,
"Movie/Album" text,
"Year" real,
"Additional Info" text
) | What movie did Vijayalaxmi Co-star in and Shakeel Badayuni write the lyrics? | SELECT "Movie/Album" FROM table_73780 WHERE "Co-Stars" = 'VijayaLaxmi' AND "Lyricist" = 'Shakeel Badayuni' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name t... | answered question percentage for the last M months. | SELECT 100 * CAST((SELECT COUNT(DISTINCT Q.Id) FROM Posts AS Q, Posts AS A WHERE A.ParentId = Q.Id AND Q.CreationDate > @months_ago AND (A.Score > 0 OR Q.AcceptedAnswerId = A.Id)) AS FLOAT) / (SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND CreationDate > @months_ago) AS "answer_ratio" | sede |
CREATE TABLE table_name_83 (
long INTEGER,
player VARCHAR,
yards VARCHAR
) | What was the highest long of Charles Pauley with fewer than 60 yards? | SELECT MAX(long) FROM table_name_83 WHERE player = "charles pauley" AND yards < 60 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id n... | since 2103, what are the top three most frequent diagnoses that patients were given within the same month after being diagnosed with oth inf vena cava thromb? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE table_3770 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What number in season had 10.18 million US viewers? | SELECT "No. in season" FROM table_3770 WHERE "U.S. viewers (millions)" = '10.18' | wikisql |
CREATE TABLE table_name_74 (
week VARCHAR,
attendance INTEGER
) | How many weeks had an attendance of over 68,000? | SELECT COUNT(week) FROM table_name_74 WHERE attendance > 68 OFFSET 000 | sql_create_context |
CREATE TABLE table_name_57 (
crowd INTEGER,
home_team VARCHAR
) | How many people attended games with st kilda as the home side? | SELECT SUM(crowd) FROM table_name_57 WHERE home_team = "st kilda" | sql_create_context |
CREATE TABLE table_45513 (
"Rank" text,
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | Which Run 4 has a Final of 8:16.28? | SELECT "Run 4" FROM table_45513 WHERE "Final" = '8:16.28' | wikisql |
CREATE TABLE table_16391 (
"Round" real,
"Choice" real,
"Player name" text,
"Position" text,
"Height" text,
"Weight" real,
"College" text
) | Which position does Colt Brennan play? | SELECT "Position" FROM table_16391 WHERE "Player name" = 'Colt Brennan' | wikisql |
CREATE TABLE table_name_46 (
type VARCHAR,
name VARCHAR
) | What is the Type for l. publilius philo vulscus? | SELECT type FROM table_name_46 WHERE name = "l. publilius philo vulscus" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | among total number of patients on elective admission, calculate the average age of those who had government insurance. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Government" | mimicsql_data |
CREATE TABLE accounts (
name VARCHAR,
custid VARCHAR
)
CREATE TABLE checking (
balance VARCHAR,
custid VARCHAR
)
CREATE TABLE savings (
custid VARCHAR,
balance VARCHAR
) | Find the name and checking balance of the account with the lowest savings balance. | SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1 | sql_create_context |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course... | Which professors have never taught INTMED 320 ? | SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERING... | advising |
CREATE TABLE table_2476 (
"Source" text,
"Dates Administered" text,
"Terry McAuliffe" text,
"Brian Moran" text,
"Creigh Deeds" text
) | What source gave 26% of the votes to Brian Moran? | SELECT "Source" FROM table_2476 WHERE "Brian Moran" = '26%' | wikisql |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | Create a bar chart showing how many location across location, and sort by the the number of location from high to low please. | SELECT Location, COUNT(Location) FROM party GROUP BY Location ORDER BY COUNT(Location) DESC | nvbench |
CREATE TABLE table_name_86 (
entrant VARCHAR,
driver VARCHAR,
chassis VARCHAR,
constructor VARCHAR,
tyre VARCHAR
) | Can you say what was the entrant of maserati built item with a Tyre of p with a chassis of 250f a6gcm that was driven by Luigi Villoresi? | SELECT entrant FROM table_name_86 WHERE constructor = "maserati" AND tyre = "p" AND chassis = "250f a6gcm" AND driver = "luigi villoresi" | sql_create_context |
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
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | tell me the number of times a extracorporeal circulat procedure was done until 1 year ago? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'extracorporeal circulat') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_2509505_1 (
goals_for INTEGER,
points VARCHAR
) | Name the most goals for 56 points | SELECT MAX(goals_for) FROM table_2509505_1 WHERE points = 56 | 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,
... | count the number of times that in the previous day patient 006-76924 had taken levophed. | 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 = '006-76924')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_204_282 (
id number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text,
"#" number
) | how many games were played before 2008 ? | SELECT COUNT(*) FROM table_204_282 WHERE "date" < 2008 | squall |
CREATE TABLE table_name_87 (
name VARCHAR,
pada_3 VARCHAR
) | What is the Name of ng/na? | SELECT name FROM table_name_87 WHERE pada_3 = "ङ ng/na" | sql_create_context |
CREATE TABLE table_name_44 (
school_club_team VARCHAR,
position VARCHAR,
pick VARCHAR
) | Which team had a position of linebacker with a pick smaller of 288? | SELECT school_club_team FROM table_name_44 WHERE position = "linebacker" AND pick < 288 | sql_create_context |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
) | What are the different names of all reviewers whose ratings do not have a date field? | SELECT DISTINCT name FROM reviewer AS T1 JOIN rating AS T2 ON T1.rid = T2.rid WHERE ratingdate = "null" | spider |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | tell me how many intensive care unit visits patient 006-141797 has made when they came to the hospital last time. | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-141797' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) | eicu |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
... | How are tags used within another tag?. List all tags which are used in addition to a specific tag. | SELECT t2.TagName, COUNT(*) AS cnt FROM PostTags AS pt INNER JOIN Tags AS t ON t.Id = pt.TagId LEFT OUTER JOIN PostTags AS pt2 ON pt2.PostId = pt.PostId LEFT OUTER JOIN Tags AS t2 ON t2.Id = pt2.TagId WHERE t.TagName = '##tagname##' GROUP BY t2.TagName ORDER BY COUNT(*) DESC | sede |
CREATE TABLE table_name_98 (
platform INTEGER,
frequency__per_hour_ VARCHAR,
destination VARCHAR
) | what is the platform when the frequency (per hour) is 4 and the destination is west croydon? | SELECT SUM(platform) FROM table_name_98 WHERE frequency__per_hour_ = 4 AND destination = "west croydon" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 检测指标816429在被门诊确诊为疾病H11.754的病人身上参考值范围下限和上限是多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'H11.754' AND jyjgzbb.JCZBDM = '816429' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number... | what was the first height of patient 8562 during the previous month? | SELECT 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 = 8562)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ... | mimic_iii |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Pr... | Show the number of companies whose headquarters are not from USA fpr each main industry in a bar chart. | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry | nvbench |
CREATE TABLE table_22603 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What is title of episode 06-02-407? | SELECT "Title" FROM table_22603 WHERE "Production code" = '06-02-407' | wikisql |
CREATE TABLE table_66170 (
"Year" real,
"Award" text,
"Nominee" text,
"Episode" text,
"Result" text
) | What award has a year earlier than 2004 and the episode shows ? | SELECT "Award" FROM table_66170 WHERE "Year" < '2004' AND "Episode" = '—' | wikisql |
CREATE TABLE table_58433 (
"Season" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" real
) | What was the ranking of the season whose finale aired on May 15, 2011? | SELECT "Ranking" FROM table_58433 WHERE "Season finale" = 'may 15, 2011' | wikisql |
CREATE TABLE table_33775 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | What is the pole position for marlboro challenge? | SELECT "Pole position" FROM table_33775 WHERE "Race Name" = 'marlboro challenge' | wikisql |
CREATE TABLE table_57784 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did an away team score 32.16 (208)? | SELECT "Date" FROM table_57784 WHERE "Away team score" = '32.16 (208)' | wikisql |
CREATE TABLE table_name_59 (
round INTEGER,
player VARCHAR
) | What round of the draft was Stan Adams selected? | SELECT AVG(round) FROM table_name_59 WHERE player = "stan adams" | sql_create_context |
CREATE TABLE department (
dno number,
division text,
dname text,
room text,
building text,
dphone number
)
CREATE TABLE gradeconversion (
lettergrade text,
gradepoint number
)
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE course (
cid text,
cname text... | Find the max and min grade point for all letter grade. | SELECT MAX(gradepoint), MIN(gradepoint) FROM gradeconversion | spider |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 患者63660143在二00七年七月二十一日到二0一0年十二月二十四日期间,总共医治过几种病 | SELECT COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_ID = '63660143' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24' | css |
CREATE TABLE table_name_72 (
year VARCHAR,
points INTEGER
) | In which year were the points more than 0? | SELECT year FROM table_name_72 WHERE points > 0 | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is maximum age of patients whose insurance is government and year of death is less than 2138? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.dod_year < "2138.0" | mimicsql_data |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | Show all cities where students live. | SELECT DISTINCT city_code FROM student | spider |
CREATE TABLE table_name_87 (
vehicle VARCHAR,
position VARCHAR,
stages_won VARCHAR,
class VARCHAR,
year VARCHAR
) | Which vehicle had a class of car in years after 2009 with 0 stages won and position of 5? | SELECT vehicle FROM table_name_87 WHERE class = "car" AND year > 2009 AND stages_won = "0" AND position = "5" | sql_create_context |
CREATE TABLE table_name_67 (
model VARCHAR,
years VARCHAR
) | What was the model that had years 2004-? | SELECT model FROM table_name_67 WHERE years = "2004-" | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
... | what is the latest flight from SAN FRANCISCO to WASHINGTON | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_name_36 (
work VARCHAR,
year VARCHAR,
result VARCHAR,
award VARCHAR
) | Which Work has a Result of nominated, and an Award of contigo award, and a Year smaller than 2002? | SELECT work FROM table_name_36 WHERE result = "nominated" AND award = "contigo award" AND year < 2002 | sql_create_context |
CREATE TABLE table_79601 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the Rank of the Rowers with FA as Notes? | SELECT AVG("Rank") FROM table_79601 WHERE "Notes" = 'fa' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Return a bar chart about the distribution of name and meter_100 , and order by the total number in desc. | SELECT name, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE table_name_38 (
result VARCHAR,
opponent VARCHAR
) | Which result has sunderland as opponent? | SELECT result FROM table_name_38 WHERE opponent = "sunderland" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | How many patients admitted in transfer within this facility are primarily diagnosed for copd exacerbation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
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... | 看看之前患者97868786有哪些异常反应 | SELECT * 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 jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | Show different teams in eliminations and the number of eliminations from each team Visualize by bar chart, and order bars from low to high order. | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 查一下在医疗就诊98195604452中给病人金德水做检验的科室名称和编码 | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '98195604452' | css |
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 diagnosed with primary disease left internal jugular vein thrombosis; left arm edema stayed in the hospital for more than 29 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.days_stay > "29" | mimicsql_data |
CREATE TABLE table_203_746 (
id number,
"date" text,
"opponent" text,
"score" text,
"leading scorer" text,
"attendance" number,
"record" text
) | how many points did the washington mystics score against sacramento on june 11 ? | SELECT "score" FROM table_203_746 WHERE "date" = 'june 11' | squall |
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 d_items (
row_id number,
itemid number,
label text,... | until 2100 what is the three most commonly prescribed drug for patients 30s? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND STRFTIME('%y', prescriptions.startdate) <= '2100' GROUP BY prescriptions.drug) AS t1 W... | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | for patients who took anticonvulsant - diazepam this year, what are the five most frequent procedures that were followed within 2 months? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticonvulsant - diazepam' AND DATETIME(... | eicu |
CREATE TABLE table_1137695_3 (
pole_position VARCHAR,
grand_prix VARCHAR
) | Who was on the pole position at the monaco grand prix? | SELECT pole_position FROM table_1137695_3 WHERE grand_prix = "Monaco grand_prix" | sql_create_context |
CREATE TABLE table_train_179 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fasting_plasma_glucose_fpg" float,
"diastolic_blood_pressure_dbp" int,
"diabetes" bool,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"hypertension" bool,
"age" float,
"NOUSE" float
) | for adults: bmi below 18.5 | SELECT * FROM table_train_179 WHERE age >= 18 AND body_mass_index_bmi < 18.5 | criteria2sql |
CREATE TABLE table_name_16 (
team VARCHAR,
points VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Which Team has Laps smaller than 105, and a Grid smaller than 18, and Points of 11? | SELECT team FROM table_name_16 WHERE laps < 105 AND grid < 18 AND points = 11 | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | what are the five most commonly prescribed medications for patients that have been previously prescribed methylprednisolone sod suc(pf) in the same hospital visit, in 2103? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'methylprednisolo... | eicu |
CREATE TABLE table_name_26 (
song_title VARCHAR,
genre VARCHAR
) | what song is a genre of glam | SELECT song_title FROM table_name_26 WHERE genre = "glam" | sql_create_context |
CREATE TABLE table_12064 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which venue does Fitzroy play as an away team? | SELECT "Venue" FROM table_12064 WHERE "Away team" = 'fitzroy' | wikisql |
CREATE TABLE table_name_41 (
player VARCHAR,
to_par VARCHAR,
year_s__won VARCHAR
) | What is Player, when To Par is greater than 6, and when Year(s) Won is '1962 , 1967'? | SELECT player FROM table_name_41 WHERE to_par > 6 AND year_s__won = "1962 , 1967" | sql_create_context |
CREATE TABLE table_name_78 (
year VARCHAR,
start VARCHAR
) | Name the year when start was 32 | SELECT year FROM table_name_78 WHERE start = 32 | sql_create_context |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | For all the CS-LSA courses can I see difficulties ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id | advising |
CREATE TABLE table_204_622 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | how long did it take this competitor to finish the 4x400 meter relay at universiade in 2005 ? | SELECT "notes" FROM table_204_622 WHERE "event" = '4x400 m relay' AND "competition" = 'universiade' AND "year" = 2005 | squall |
CREATE TABLE table_27922491_8 (
average VARCHAR,
bbm VARCHAR
) | What is the average for the player with BBM 5/85? | SELECT average FROM table_27922491_8 WHERE bbm = "5/85" | sql_create_context |
CREATE TABLE table_77485 (
"Actor in London, 2002" text,
"Actor in New York, 2006" text,
"Actor in Moscow, 2007" text,
"Voyage" text,
"Shipwreck" text
) | Who was the 2007 actor from Moscow for the voyage of Varenka Bakunin? | SELECT "Actor in Moscow, 2007" FROM table_77485 WHERE "Voyage" = 'varenka bakunin' | wikisql |
CREATE TABLE table_47459 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What is Curtis Strange's Score? | SELECT "Score" FROM table_47459 WHERE "Player" = 'curtis strange' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId... | Average Votes Count based on Comments Count on Question. | SELECT p.CommentCount, AVG(CAST(p.Score AS FLOAT)) AS AvgScore FROM Posts AS p GROUP BY CommentCount ORDER BY CommentCount | sede |
CREATE TABLE table_77770 (
"Date" text,
"Team 1" text,
"Team 2" text,
"Winner" text,
"Delta" text,
"Score" text
) | On what Date is Delta 0:40? | SELECT "Date" FROM table_77770 WHERE "Delta" = '0:40' | wikisql |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name... | Show me a bar chart for what are the ids and trade names of the medicine that can interact with at least 3 enzymes? | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id | nvbench |
CREATE TABLE table_15277 (
"Japanese Title" text,
"Developer" text,
"Publisher" text,
"Genre" text,
"Console(s)" text,
"Initial Release Date" text
) | When was Ranma : netsuretsu kakutouhen first release by Banpresto? | SELECT "Initial Release Date" FROM table_15277 WHERE "Publisher" = 'banpresto' AND "Japanese Title" = 'ranma ½: netsuretsu kakutouhen' | wikisql |
CREATE TABLE table_204_868 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"opponent" text,
"score" text
) | tell me the number of matches played on clay . | SELECT COUNT(*) FROM table_204_868 WHERE "surface" = 'clay' | squall |
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 is the name of drug patient 002-76990 has been prescribed two or more times since 37 months ago? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002... | eicu |
CREATE TABLE table_name_70 (
score VARCHAR,
team_2 VARCHAR
) | What was the score of the game when team 2 was club valencia? | SELECT score FROM table_name_70 WHERE team_2 = "club valencia" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many patients with squamous cell carcinoma oral tongue/sda were admitted in the emergency room? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" | mimicsql_data |
CREATE TABLE table_25016555_5 (
minutes INTEGER,
player VARCHAR
) | When sandy brondello is the player what is the lowest amount of minutes? | SELECT MIN(minutes) FROM table_25016555_5 WHERE player = "Sandy Brondello" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | get the number of patients less than 43 years who have infected right thigh graft primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT" AND demographic.age < "43" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | in their last hospital visit has patient 012-26564 been diagnosed with tricyclic overdose - with respiratory depression? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-26564' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... | eicu |
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
... | What are the last names for all scholarship students, and count them by a bar chart, and could you sort in descending by the y-axis? | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY COUNT(LName) DESC | nvbench |
CREATE TABLE table_27374004_3 (
replaced_by VARCHAR,
outgoing_manager VARCHAR
) | Who replaced Michel Preud'homme? | SELECT replaced_by FROM table_27374004_3 WHERE outgoing_manager = "Michel Preud'homme" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 看看19年12月9号到20年6月11号9038216这个医疗机构特需门诊的就诊记录 | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '9038216' AND zzmzjzjlb.JZKSRQ BETWEEN '2019-12-09' AND '2020-06-11' AND zzmzjzjlb.TXBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '9038216' AND fzzmzjzjlb.JZKSRQ BETWEEN '2019-12-09' AND '2020-06-11' AND fzzmzjzjlb.TXBZ > 0 | css |
CREATE TABLE table_train_48 (
"id" int,
"in_another_study" bool,
"renal_disease" bool,
"receiving_vasopressor" bool,
"sepsis" bool,
"hypotension" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
) | acute kidney injury receiving intermittent renal replacement therapy | SELECT * FROM table_train_48 WHERE renal_disease = 1 | criteria2sql |
CREATE TABLE table_50571 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What country has a finish of 59? | SELECT "Country" FROM table_50571 WHERE "Finish" = '59' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | Moderator candidates by last access date. All Users which have the necessary reputation and Badges for
the 2011 Stack Overflow Moderator election: http://stackoverflow.com/election/2 | SELECT Id AS "user_link", Reputation, LastAccessDate FROM Users WHERE Reputation >= 90000 ORDER BY LastAccessDate DESC | sede |
CREATE TABLE table_38246 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
) | Name the surface for paul goldstein and date of october 2, 2006 | SELECT "Surface" FROM table_38246 WHERE "Partnering" = 'paul goldstein' AND "Date" = 'october 2, 2006' | wikisql |
CREATE TABLE table_31686 (
"Rank" real,
"Player" text,
"Career" text,
"Caps" real,
"Goals" real
) | What is the maximum cap number where 0 goals were scored with a rank of 15? | SELECT MAX("Caps") FROM table_31686 WHERE "Goals" = '0' AND "Rank" = '15' | wikisql |
CREATE TABLE table_203_716 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many medals did the usa win ? | SELECT "total" FROM table_203_716 WHERE "nation" = 'usa' | squall |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperda... | What papers were published at CVPR '16 about Class consistent multi-modal fusion with binary features applied to RGB-D Object Dataset ? | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset, venue WHERE dataset.datasetname = 'RGB-D Object Dataset' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND paper.title = 'Class consistent multi-modal fusion with binary features' AND paper.year = 2016 AND venue.v... | scholar |
CREATE TABLE table_59655 (
"Year recorded" text,
"Title" text,
"Genre" text,
"Label" text,
"Year inducted" text
) | What label is 'weather bird' under? | SELECT "Label" FROM table_59655 WHERE "Title" = 'weather bird' | wikisql |
CREATE TABLE table_name_33 (
lost VARCHAR
) | Which Lost has a Club of club? | SELECT lost FROM table_name_33 WHERE "club" = "club" | sql_create_context |
CREATE TABLE table_2267465_1 (
laps VARCHAR,
race_time VARCHAR
) | How many laps have a 3:34:26 race time? | SELECT COUNT(laps) FROM table_2267465_1 WHERE race_time = "3:34:26" | sql_create_context |
CREATE TABLE table_name_7 (
engine VARCHAR,
entrant VARCHAR
) | Which engine has daimler benz ag as an entrant? | SELECT engine FROM table_name_7 WHERE entrant = "daimler benz ag" | sql_create_context |
CREATE TABLE table_name_30 (
date VARCHAR,
result VARCHAR
) | Which Date has a Result of w 27 20? | SELECT date FROM table_name_30 WHERE result = "w 27–20" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE compartment_class (
compartment varchar,
... | show me the earliest flight from BOSTON to SAN FRANCISCO | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR... | atis |
CREATE TABLE table_39068 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | On what date was the result w 20-17? | SELECT "Date" FROM table_39068 WHERE "Result" = 'w 20-17' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | How many male patient ihave death status 0? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.expire_flag = "0" | mimicsql_data |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE fare (
fare_id int,
... | i need information on flights from WASHINGTON to BOSTON that leave on a SATURDAY | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND days.day_name = 'SATURDAY' AND flight.flight_days = days.days_code AND ... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.