context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_23486853_8 (
date VARCHAR,
record VARCHAR
) | What is every date with a record of 30 34 12? | SELECT date FROM table_23486853_8 WHERE record = "30–34–12" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
... | on the first icu visit the heartrate of patient 017-59454 had been normal? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-59454') AND NOT patient.unitdischargetime IS NULL ORDER BY patie... | 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... | find the maximum age of patients who had private insurance and their year of expiry is before 2126. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dod_year < "2126.0" | mimicsql_data |
CREATE TABLE table_22951088_3 (
us_viewers__in_millions_ VARCHAR,
written_by VARCHAR
) | How many viewers (in millions) watched the episode written by deidre shaw? | SELECT us_viewers__in_millions_ FROM table_22951088_3 WHERE written_by = "Deidre Shaw" | sql_create_context |
CREATE TABLE table_44656 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" text
) | What's the transfer window that ends in 2012? | SELECT "Transfer window" FROM table_44656 WHERE "Ends" = '2012' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | how many patients died in the same month after being diagnosed in 2105 with nutritional deficiency? | 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 = 'nutritional deficiency') AS t1 GROUP BY t1.uniquepid HAVING MIN(... | eicu |
CREATE TABLE table_17892 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
) | How many clubs does number 6 play for? | SELECT COUNT("Current Club") FROM table_17892 WHERE "No" = '6' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose days of hospital stay is greater than 15 and drug code is imdu30? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "15" AND prescriptions.formulary_drug_cd = "IMDU30" | mimicsql_data |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | show me the cheapest one way flights from ORLANDO to MONTREAL | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ORLANDO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
... | Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE. | SELECT T2.dname, T2.room FROM course AS T1 JOIN department AS T2 ON T1.dno = T2.dno WHERE T1.cname = "INTRODUCTION TO COMPUTER SCIENCE" | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | provide the number of patients whose primary disease is stemi and who have died before or in year 2183. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STEMI" AND demographic.dod_year <= "2183.0" | mimicsql_data |
CREATE TABLE table_204_414 (
id number,
"name" text,
"armenian" text,
"location" text,
"# of prisoners designed for" number,
"notes" text
) | which prison is for former policemen , abovyan or vardashen ? | SELECT "name" FROM table_204_414 WHERE "notes" = 'for former policemen and military officers' AND "name" IN ('abovyan', 'vardashen') | squall |
CREATE TABLE table_name_17 (
away_team VARCHAR
) | What was Melbourne's score as the away team? | SELECT away_team AS score FROM table_name_17 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE table_18166 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | What year was Bob Clement first elected? | SELECT MIN("First elected") FROM table_18166 WHERE "Incumbent" = 'Bob Clement' | wikisql |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
) | Give me a histogram for what are the different parties of representative? Show the party name and the number of representatives in each party, and show total number in asc order please. | SELECT Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | tell me the last procedure patient 006-172277 had in their current hospital encounter? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL)) ORDER BY ... | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 那个做上臂的各项指标检验的患者81668961结果怎么样? | SELECT * 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 = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE table_18483 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | who is the the incumbent with candidates being john m. vorys (r) 61.5% jacob f. myers (d) 38.5% | SELECT "Incumbent" FROM table_18483 WHERE "Candidates" = 'John M. Vorys (R) 61.5% Jacob F. Myers (D) 38.5%' | wikisql |
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 real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Give me the comparison about the sum of Height over the Sex , and group by attribute Sex by a bar chart, show sum height in descending order. | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height) DESC | nvbench |
CREATE TABLE table_203_374 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | germany and the netherlands tied for what rank ? | SELECT "rank" FROM table_203_374 WHERE "nation" = 'germany' | squall |
CREATE TABLE table_79391 (
"Model" text,
"Years" text,
"Engine code" text,
"Power" text,
"Torque" text
) | What is the engine code of the xdrive23d model? | SELECT "Engine code" FROM table_79391 WHERE "Model" = 'xdrive23d' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
... | A bunch of related tags - annual usage over time (union of all these tags). | SELECT YEAR(p.CreationDate) AS "year", COUNT(DISTINCT p.Id) AS "##ColName##" FROM Posts AS p JOIN PostTags AS pTags ON p.Id = pTags.PostId JOIN Tags AS t ON t.Id = pTags.TagId WHERE p.PostTypeId = 1 AND t.TagName IN ('##Tags##') GROUP BY YEAR(p.CreationDate) ORDER BY YEAR(p.CreationDate) | sede |
CREATE TABLE table_204_945 (
id number,
"episode" number,
"name" text,
"synopsis" text,
"sent home" text,
"highest seller" text
) | who was next to be sent home after patrick ? | SELECT "sent home" FROM table_204_945 WHERE "episode" = (SELECT "episode" FROM table_204_945 WHERE "sent home" = 'patrick') + 1 | squall |
CREATE TABLE table_2668420_17 (
first_elected INTEGER
) | When was the earliest person elected? | SELECT MIN(first_elected) FROM table_2668420_17 | sql_create_context |
CREATE TABLE table_74715 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the average week number of all the matches where less than 22,604 people attended? | SELECT AVG("Week") FROM table_74715 WHERE "Attendance" < '22,604' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | select * from Posts where Title like '%deeplearning%'. | SELECT * FROM Posts WHERE Title LIKE '%learn%' | sede |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistoryTypes (
Id number,
... | Rep loss if identification-request questions were to be deleted. Excludes rep changes resulting from suggested edits to identification-request questions. | SELECT u.Id AS "user_link", (CASE WHEN p.PostTypeId = 1 AND v.VoteTypeId = 2 THEN 5 WHEN p.PostTypeId = 2 AND v.VoteTypeId = 2 THEN 10 WHEN p.PostTypeId = 1 AND v.VoteTypeId = 3 THEN -1 WHEN p.PostTypeId = 2 AND v.VoteTypeId = 3 THEN -2 WHEN p.PostTypeId = 2 AND v.VoteTypeId = 1 THEN 15 END) AS "totalscore", p.PostType... | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 tex... | what number of enterostomy nec procedures have been performed since 6 years 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 = 'enterostomy nec') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') | mimic_iii |
CREATE TABLE table_train_39 (
"id" int,
"active_infection" bool,
"sepsis" bool,
"organ_failure" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
) | suspected infection | SELECT * FROM table_train_39 WHERE active_infection = 1 | criteria2sql |
CREATE TABLE table_42366 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What is the name of the airport located in Russia with an IATA of KRR? | SELECT "Airport" FROM table_42366 WHERE "Country" = 'russia' AND "IATA" = 'krr' | wikisql |
CREATE TABLE table_70202 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What points larger than 1950 has a maserati straight-6 engine? | SELECT "Points" FROM table_70202 WHERE "Year" > '1950' AND "Engine" = 'maserati straight-6' | wikisql |
CREATE TABLE table_51487 (
"Year" real,
"Organisation" text,
"Award" text,
"Nominated Work Title" text,
"Result" text
) | what is the lowest year with the result is nominated for the work title is love bites? | SELECT MIN("Year") FROM table_51487 WHERE "Result" = 'nominated' AND "Nominated Work Title" = 'love bites' | wikisql |
CREATE TABLE table_187239_1 (
secondary_sponsor VARCHAR,
main_sponsor VARCHAR
) | When olympikus is the main sponsor who is the secondary sponsor? | SELECT secondary_sponsor FROM table_187239_1 WHERE main_sponsor = "Olympikus" | sql_create_context |
CREATE TABLE table_28059992_1 (
cfl_team VARCHAR,
college VARCHAR
) | What is every CFL team from the Calgary college? | SELECT cfl_team FROM table_28059992_1 WHERE college = "Calgary" | sql_create_context |
CREATE TABLE table_53706 (
"Week" real,
"Partner" text,
"Style" text,
"Choreographer(s)" text,
"Results" text
) | Who was the partner for the jazz piece in the bottom three? | SELECT "Partner" FROM table_53706 WHERE "Style" = 'jazz' AND "Results" = 'bottom three' | wikisql |
CREATE TABLE table_32151 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | Who is Team Suzuki's rider and ranks higher than 6? | SELECT "Rider" FROM table_32151 WHERE "Rank" > '6' AND "Team" = 'suzuki' | wikisql |
CREATE TABLE table_name_87 (
free INTEGER,
athlete VARCHAR,
total VARCHAR
) | What is the free of Apolline Dreyfuss & Lila Meesseman-Bakir, when the total was larger than 90.333? | SELECT MIN(free) FROM table_name_87 WHERE athlete = "apolline dreyfuss & lila meesseman-bakir" AND total > 90.333 | sql_create_context |
CREATE TABLE table_29549 (
"Country" text,
"Name" text,
"Host(s)" text,
"Judges" text,
"Network" text,
"Air dates" text
) | What are the air dates of the show in ABS-CBN? | SELECT "Air dates" FROM table_29549 WHERE "Network" = 'ABS-CBN' | wikisql |
CREATE TABLE table_58819 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which Location has a Method of decision (unanimous), and Res of win x? | SELECT "Location" FROM table_58819 WHERE "Method" = 'decision (unanimous)' AND "Res." = 'win x' | 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 are the three most common procedures given for patients who had previously been diagnosed with mycoses nec & nos within 2 months during a year before? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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 = admissi... | mimic_iii |
CREATE TABLE table_37004 (
"Player" text,
"Sacks" real,
"INT'S" real,
"Yards" real,
"Average" real,
"Long" text
) | What is the sum of average values for 23 yards? | SELECT SUM("Average") FROM table_37004 WHERE "Yards" = '23' | wikisql |
CREATE TABLE table_name_14 (
venue VARCHAR,
date VARCHAR
) | Tell me the venue of 29 april 2007 | SELECT venue FROM table_name_14 WHERE date = "29 april 2007" | sql_create_context |
CREATE TABLE table_32856 (
"Sanctioning" text,
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text
) | Where did the Gould Rex Mays Classic 150 occur? | SELECT "City/Location" FROM table_32856 WHERE "Race Name" = 'gould rex mays classic 150' | wikisql |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 俞玉轩这位参保人住院整数金额有多少次 | SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '俞玉轩' AND MOD(zyb.MED_CLINIC_ID, 1) = 0 | css |
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE instruments (
songid number,
bandmateid number,
instrumen... | Who performed the song named 'Badlands'? Show the first name and the last name. | SELECT T2.firstname, T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.title = "Badlands" | spider |
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 did patient 58932 have a last procedure? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 58932) ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real... | Display a bar chart for what is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos. | SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_61119 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | which Player has a To par of 7, and a Country of spain? | SELECT "Player" FROM table_61119 WHERE "To par" = '–7' AND "Country" = 'spain' | wikisql |
CREATE TABLE table_test_31 (
"id" int,
"ejection_fraction_ef" int,
"macular_disease" bool,
"systemic" bool,
"alt" float,
"iud" bool,
"condom_with_spermicide" bool,
"gender" string,
"meropenem" bool,
"non_q_wave_myocardial_infarction" bool,
"hbcab" bool,
"unstable_angina" ... | diagnosis of any of the following ocular conditions: active scleral disease, glaucoma, retinal disease potentially affecting central vision, macular disease or uveitis, severe dry eyes and dysthyroid eye disease | SELECT * FROM table_test_31 WHERE ocular = 1 OR (active_scleral_disease = 1 OR glaucoma = 1 OR (retinal_disease = 1 AND central_vision = 1) OR macular_disease = 1 OR uveitis_disease = 1 OR severe_dry_eyes = 1 OR dysthyroid_eye_disease = 1) | criteria2sql |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 请列出编码为8114710的医院中根据出院诊断疾病编码不同疾病的平均患者年龄分别是多少吗? | SELECT qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '8114710' GROUP BY qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '8114710' GROUP BY gyb.OUT_DIAG_DIS_CD UNION SELECT zyb.OUT_DIAG_DIS_CD, AVG(zyb.PERSON_AGE) FROM zyb WHERE... | css |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | what is the specimen test that patient 72032 was given for the last time? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72032) ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_84 (
touchdowns VARCHAR,
extra_points VARCHAR,
points VARCHAR
) | How many Touchdowns have Extra points larger than 0, and Points of 48? | SELECT COUNT(touchdowns) FROM table_name_84 WHERE extra_points > 0 AND points = 48 | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute name, order in ascending by the Y. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code | nvbench |
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | Find dates and attendance for exhibitions that happened in 2004, show me the comparison of attendance by date, show by the Y-axis in ascending. | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 ORDER BY Attendance | nvbench |
CREATE TABLE table_204_779 (
id number,
"network name" text,
"flagship" text,
"programming type" text,
"owner" text,
"affiliates" number
) | how many networks does televisa own ? | SELECT COUNT("network name") FROM table_204_779 WHERE "owner" = 'televisa' | squall |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id numbe... | did any organisms be found in the first peripheral blood lymphocytes microbiology test done on patient 10624 in 12/2105? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND microbiologyevents.spec_type_desc = 'peripheral blood lymphocytes' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.char... | mimic_iii |
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 white-russian patients were given the drug metoprolol? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Metoprolol" | 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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures ... | has patient 95892 been diagnosed with a disease in their last hospital visit? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) | mimic_iii |
CREATE TABLE table_23561 (
"#" real,
"Sanskrit" text,
"Malayalam name \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" text,
"Tamil name \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" text,
"Telugu name \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" text,
"Kannada name \u0c95\u0ca8\u0ccd\u0ca8\u0ca1" text,
"Western star name"... | what is the sanskrit of western star name arcturus | SELECT "Sanskrit" FROM table_23561 WHERE "Western star name" = 'Arcturus' | wikisql |
CREATE TABLE table_72806 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | What was the diameter of the feature found in 1997? | SELECT "Diameter (km)" FROM table_72806 WHERE "Year named" = '1997' | wikisql |
CREATE TABLE table_name_13 (
d_42_√ VARCHAR,
d_43_√ VARCHAR
) | What's the D 42 when D 43 is r 5? | SELECT d_42_√ FROM table_name_13 WHERE d_43_√ = "r 5" | sql_create_context |
CREATE TABLE table_name_8 (
region VARCHAR,
state VARCHAR
) | Tell me the region for georgia | SELECT region FROM table_name_8 WHERE state = "georgia" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the maximum age of male patients admitted to emergency? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "EMERGENCY" | mimicsql_data |
CREATE TABLE table_32058 (
"Begin Date" text,
"Representative" text,
"Date of birth" text,
"House term" text,
"State served" text,
"Party" text,
"Age (years, days)" text
) | What was the date of birth of the member of the United States House of Representatives that began their term on April 24, 1902? | SELECT "Date of birth" FROM table_32058 WHERE "Begin Date" = 'april 24, 1902' | wikisql |
CREATE TABLE table_name_43 (
score VARCHAR,
place VARCHAR,
player VARCHAR
) | Which Score has a Place of t6, and a Player of raymond floyd? | SELECT score FROM table_name_43 WHERE place = "t6" AND player = "raymond floyd" | sql_create_context |
CREATE TABLE table_33756 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" real
) | What is the attendance for week 11? | SELECT "Attendance" FROM table_33756 WHERE "Week" = '11' | wikisql |
CREATE TABLE table_33866 (
"Rank" text,
"Player" text,
"Goals" text,
"Assists" text,
"Points" text,
"Years" text
) | What years did the player play when he scored 78 points and 22 goals? | SELECT "Years" FROM table_33866 WHERE "Points" = '78' AND "Goals" = '22' | wikisql |
CREATE TABLE table_51361 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | When the new orleans saints were visiting texas stadium, what was the final score? | SELECT "Final Score" FROM table_51361 WHERE "Stadium" = 'texas stadium' AND "Visiting Team" = 'new orleans saints' | wikisql |
CREATE TABLE table_69705 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Score" text
) | what score is it with tathiana garbin as partner? | SELECT "Score" FROM table_69705 WHERE "Partner" = 'tathiana garbin' | wikisql |
CREATE TABLE table_name_48 (
year VARCHAR,
team VARCHAR,
start VARCHAR
) | When was there a team of Simon and the start was 3? | SELECT year FROM table_name_48 WHERE team = "simon" AND start = "3" | sql_create_context |
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_billion text
)
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
... | Whah are the name of each industry and the number of companies in that industry? | SELECT industry, COUNT(*) FROM companies GROUP BY industry | spider |
CREATE TABLE table_44712 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What is the name of the racer with a best time of 57.546? | SELECT "Name" FROM table_44712 WHERE "Best" = '57.546' | wikisql |
CREATE TABLE table_name_46 (
other_ VARCHAR,
c_ VARCHAR,
fa_cup VARCHAR
) | With a FA Cup of 0 44 0 (0), the other [C] is listed as what? | SELECT other_ AS "c_" FROM table_name_46 WHERE fa_cup = "0 44 0 (0)" | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | what flights are there from PHOENIX 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 = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU... | atis |
CREATE TABLE table_45046 (
"Year" real,
"Top Fuel" text,
"Funny Car" text,
"Pro Stock" text,
"Pro Stock Motorcycle" text
) | Who won Funny Car in 2012? | SELECT "Funny Car" FROM table_45046 WHERE "Year" = '2012' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numbe... | patient 11688 had received a rheumatoid arthritis diagnosis in the last year? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'rheumatoid arthritis') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11688) AND DATETIME(diagnoses_ic... | mimic_iii |
CREATE TABLE table_45386 (
"Stop no." text,
"Platform" text,
"Line" text,
"Stopping pattern" text,
"Destination" text
) | Which Line has a Stopping pattern of all stations, A, b, p? | SELECT "Line" FROM table_45386 WHERE "Stopping pattern" = 'all stations, a, b, p' | wikisql |
CREATE TABLE table_204_608 (
id number,
"name" text,
"elected party" text,
"constituency" text,
"elected date" text,
"military service" text
) | how many members of the canadian house of commons served in the militia ? | SELECT COUNT("name") FROM table_204_608 WHERE "military service" = 'militia' | squall |
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... | 标本采集在检验报告单95769004070上有那些部位? | SELECT zyjybgb.BBCJBW FROM zyjybgb WHERE zyjybgb.BGDH = '95769004070' UNION SELECT mzjybgb.BBCJBW FROM mzjybgb WHERE mzjybgb.BGDH = '95769004070' | css |
CREATE TABLE table_name_61 (
weight VARCHAR,
club VARCHAR,
height VARCHAR
) | What is the Weight of the Spandau 04 Player with a Height of m (ft 5in)? | SELECT weight FROM table_name_61 WHERE club = "spandau 04" AND height = "m (ft 5in)" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ... | count of questions with an accepted answer which is outvoted and not authored by the OP. | SELECT COUNT(q.Id) FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.PostTypeId = 1 AND q.Score > 10 AND (SELECT MAX(Score) FROM Posts AS q2 WHERE q.Id = q2.ParentId) > a.Score AND q.OwnerUserId != a.OwnerUserId | sede |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | during the last hospital encounter, was there any microbiological test record for patient 20165's tissue? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20165 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'tissue' | mimic_iii |
CREATE TABLE table_name_30 (
visitor VARCHAR,
home VARCHAR
) | Who was the visiting team at the Chicago home game? | SELECT visitor FROM table_name_30 WHERE home = "chicago" | sql_create_context |
CREATE TABLE table_53433 (
"Name" text,
"Hanzi" text,
"Hanyu Pinyin" text,
"Uyghur ( UEY )" text,
"Uyghur Latin ( ULY )" text,
"Population (2010 Census)" text,
"Area (km\u00b2)" text,
"Density (/km\u00b2)" text
) | What is the Hanyu Pinyin with a density of 39.63? | SELECT "Hanyu Pinyin" FROM table_53433 WHERE "Density (/km\u00b2)" = '39.63' | wikisql |
CREATE TABLE table_42546 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What is the Score when the opponent in the final is alicia pillay on a hard surface? | SELECT "Score" FROM table_42546 WHERE "Surface" = 'hard' AND "Opponent in the final" = 'alicia pillay' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is minimum age of patients whose admission type is newborn and insurance is medicare? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Medicare" | mimicsql_data |
CREATE TABLE table_name_20 (
win__percentage INTEGER,
opposition VARCHAR
) | What is the lowest win percentage for when Perth Scorchers is the opposition? | SELECT MIN(win__percentage) FROM table_name_20 WHERE opposition = "perth scorchers" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | find the drug type and dose of calcium chloride. | SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Calcium Chloride" | mimicsql_data |
CREATE TABLE table_name_78 (
position VARCHAR,
surname VARCHAR
) | Which Position has a Surname of naylor? | SELECT position FROM table_name_78 WHERE surname = "naylor" | sql_create_context |
CREATE TABLE table_60078 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the team 1 with tikve as team 2? | SELECT "Team 1" FROM table_60078 WHERE "Team 2" = 'tikveš' | wikisql |
CREATE TABLE table_1837 (
"P" real,
"Player" text,
"Position" text,
"SPL" real,
"League Cup" real,
"Scottish Cup" real,
"UEFA Champions League" real,
"Total" real
) | When koki mizuno is the player how man positions are there? | SELECT COUNT("Position") FROM table_1837 WHERE "Player" = 'Koki Mizuno' | wikisql |
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,
... | count the number of patients whose diagnoses icd9 code is 53190 and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "53190" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Tests_Taken (
registration_id IN... | What are the number of the completion dates of all the tests that have result 'Fail'?, rank by the bar in asc. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY date_of_completion | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | what is the average total hospital cost which involves ondansetron 4 mg po tab-disperse this year? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'ondansetron 4 mg po tab-disperse')) AND DATETI... | eicu |
CREATE TABLE table_name_6 (
years_as_tallest VARCHAR,
name VARCHAR
) | How many years as tallest building was Independence Hall? | SELECT years_as_tallest FROM table_name_6 WHERE name = "independence hall" | sql_create_context |
CREATE TABLE table_7698 (
"Material" text,
"Formula" text,
"Refractive index(es) 589.3nm" text,
"Hardness ( Mohs' scale )" text,
"Density (g/cm 3 )" text,
"State of the art" text
) | Which formula has a refractive index 589.3 at 1.97? | SELECT "Formula" FROM table_7698 WHERE "Refractive index(es) 589.3nm" = '1.97' | wikisql |
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... | Show me about the distribution of All_Games and ACC_Percent in a bar chart, could you show in desc by the X-axis? | SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY All_Games DESC | nvbench |
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... | 从2004年9月29日开始到2010年4月29日结束患者28382024共瞧了多少病? | SELECT COUNT(qtb.IN_DIAG_DIS_CD) FROM qtb WHERE qtb.PERSON_ID = '28382024' AND qtb.IN_HOSP_DATE BETWEEN '2004-09-29' AND '2010-04-29' UNION SELECT COUNT(gyb.IN_DIAG_DIS_CD) FROM gyb WHERE gyb.PERSON_ID = '28382024' AND gyb.IN_HOSP_DATE BETWEEN '2004-09-29' AND '2010-04-29' UNION SELECT COUNT(zyb.IN_DIAG_DIS_CD) FROM zy... | css |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResults (
Id number,
Review... | Most popular StackOverflow tags in Jul 2016. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN... | sede |
CREATE TABLE table_name_65 (
city VARCHAR,
year_left VARCHAR
) | In what city was the team that left the conference in 1949 based? | SELECT city FROM table_name_65 WHERE year_left = "1949" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.