context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_66139 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | what is the notes for the time 6:05.21? | SELECT "Notes" FROM table_66139 WHERE "Time" = '6:05.21' | wikisql |
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 diagnosis (
diagn... | what was patient 029-584's last id of the ward when they came to the hospital first time? | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-584' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_12792876_4 (
tries_against VARCHAR,
points VARCHAR
) | Name the tries against for 87 points | SELECT tries_against FROM table_12792876_4 WHERE points = "87" | sql_create_context |
CREATE TABLE table_15879 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | How many players were with the school or club team La Salle? | SELECT COUNT("Player") FROM table_15879 WHERE "School/Club Team" = 'La Salle' | wikisql |
CREATE TABLE table_name_7 (
points INTEGER,
entrant VARCHAR
) | Name the lowest points for officine alfieri maserati | SELECT MIN(points) FROM table_name_7 WHERE entrant = "officine alfieri maserati" | sql_create_context |
CREATE TABLE table_38337 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
) | What was the position of terry jones whose pick number was after 256? | SELECT "Position" FROM table_38337 WHERE "Pick" > '256' AND "Player" = 'terry jones' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 患者76964700从2011年3月25日至2021年5月9日之内共去了哪些医院? | SELECT COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_ID = '76964700' AND qtb.IN_HOSP_DATE BETWEEN '2011-03-25' AND '2021-05-09' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_ID = '76964700' AND gyb.IN_HOSP_DATE BETWEEN '2011-03-25' AND '2021-05-09' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zy... | css |
CREATE TABLE table_78831 (
"Country" text,
"Career" text,
"Victories" real,
"Super G" text,
"Giant Slalom" text,
"Slalom" text,
"Combined" text,
"Parallel" text
) | What Super G has a Career of 1980 1996? | SELECT "Super G" FROM table_78831 WHERE "Career" = '1980–1996' | wikisql |
CREATE TABLE table_19473 (
"No. in series" real,
"Title" text,
"Written by" text,
"Directed by" text,
"Original air date" text,
"TV broadcast" text
) | who directed with original air date being november18,1995 | SELECT "Directed by" FROM table_19473 WHERE "Original air date" = 'November18,1995' | wikisql |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | what are the flights from ATLANTA to BALTIMORE which arrive in BALTIMORE at 1900 o'clock pm | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.arrival_time = 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airpo... | atis |
CREATE TABLE table_name_73 (
rank INTEGER,
candidate_name VARCHAR,
votes VARCHAR
) | What rank is aliyya qadi with less than 1421 votes? | SELECT MIN(rank) FROM table_name_73 WHERE candidate_name = "aliyya qadi" AND votes < 1421 | sql_create_context |
CREATE TABLE table_16729063_1 (
nfl_team VARCHAR,
college VARCHAR
) | What team has draft picks from Mississippi? | SELECT nfl_team FROM table_16729063_1 WHERE college = "Mississippi" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | give me the number of patients whose primary disease is mesenteric ischemia and year of birth is less than 2180? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND demographic.dob_year < "2180" | mimicsql_data |
CREATE TABLE table_64145 (
"Channel" real,
"Video" text,
"Aspect" text,
"PSIP Short Name" text,
"Programming" text
) | Which Video has a Channel smaller than 35.66, and a Programming of nhk world? | SELECT "Video" FROM table_64145 WHERE "Channel" < '35.66' AND "Programming" = 'nhk world' | wikisql |
CREATE TABLE table_name_96 (
country VARCHAR,
builder VARCHAR
) | What is the country of Palmers Shipbuilding and Iron Company? | SELECT country FROM table_name_96 WHERE builder = "palmers shipbuilding and iron company" | sql_create_context |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | What is the name of the school that has the smallest enrollment in each state?, and show from high to low by the X-axis. | SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName DESC | nvbench |
CREATE TABLE table_name_48 (
competition VARCHAR,
date VARCHAR
) | Name the competition that was on august 25, 2007 | SELECT competition FROM table_name_48 WHERE date = "august 25, 2007" | sql_create_context |
CREATE TABLE table_name_45 (
score VARCHAR,
country VARCHAR,
to_par VARCHAR
) | Can you tell me the Score that has the Country of united states, and the To par of 8? | SELECT score FROM table_name_45 WHERE country = "united states" AND to_par = 8 | sql_create_context |
CREATE TABLE table_58668 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What is Surface, when Tournament is 'Sunderland , United Kingdom'? | SELECT "Surface" FROM table_58668 WHERE "Tournament" = 'sunderland , united kingdom' | wikisql |
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 CloseReasonTypes (
Id number,
Name text,
Description... | Why are certain questions redirecting to tag wikis?. | SELECT q.Id AS "post_link", a.Id AS "post_link" FROM Posts AS a LEFT JOIN Posts AS q ON a.PostTypeId = 2 AND q.PostTypeId = 1 AND q.AcceptedAnswerId = a.Id WHERE a.Score = 0 | sede |
CREATE TABLE table_name_97 (
position INTEGER,
drawn VARCHAR,
against VARCHAR,
difference VARCHAR
) | Which Position has an Against of 32, and a Difference of 18, and a Drawn larger than 4? | SELECT SUM(position) FROM table_name_97 WHERE against = 32 AND difference = "18" AND drawn > 4 | sql_create_context |
CREATE TABLE table_12962773_2 (
player VARCHAR,
height VARCHAR
) | What player is 2.01 m tall? | SELECT player FROM table_12962773_2 WHERE height = "2.01" | sql_create_context |
CREATE TABLE table_77339 (
"Call sign" text,
"Frequency" text,
"City of license" text,
"State" text,
"FCC info" text
) | What is the FCC info for the radio station in West Lafayette, Indiana? | SELECT "FCC info" FROM table_77339 WHERE "State" = 'indiana' AND "City of license" = 'west lafayette' | wikisql |
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... | 在编号为3373155的医院中,55748768病患在科室名有推拿的科室的就诊记录流水号有哪些 | SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '55748768' AND hz_info.YLJGDM = '3373155' AND txmzjzjlb.JZKSMC LIKE '%推拿%' UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJG... | css |
CREATE TABLE table_15161170_1 (
champion_score VARCHAR,
division VARCHAR
) | When the division is Division 2 men what is the champion score? | SELECT champion_score FROM table_15161170_1 WHERE division = "division 2 Men" | sql_create_context |
CREATE TABLE table_25829 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers (in millions)" text
) | How many original air dates did episode 12 have?h | SELECT COUNT("Original air date") FROM table_25829 WHERE "Episode #" = '12' | wikisql |
CREATE TABLE table_name_58 (
player VARCHAR,
position VARCHAR,
team VARCHAR
) | What is the name of the player with position of G and the team was the Washington Capitols? | SELECT player FROM table_name_58 WHERE position = "g" AND team = "washington capitols" | sql_create_context |
CREATE TABLE table_41686 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries For" text,
"Tries Against" text,
"Try Bonus" text,
"Losing Bonus" text,
"Points" text
) | How many pints does the Cambrian Welfare RFC have? | SELECT "Points for" FROM table_41686 WHERE "Club" = 'cambrian welfare rfc' | wikisql |
CREATE TABLE table_name_82 (
total INTEGER,
tournament INTEGER
) | Name the average total for tournament less than 0 | SELECT AVG(total) FROM table_name_82 WHERE tournament < 0 | sql_create_context |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname va... | How many paper has Ed Desmond written about Semantic Parsing ? | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'Ed Desmond' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid | scholar |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
... | how many hours have it been since the last time that patient 17667 stayed in careunit micu during their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of medicaid patients who had procedure icd9 code 403. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "403" | mimicsql_data |
CREATE TABLE table_1502 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Eagles points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | What record was reached when the Eagles played the Phoenix Cardinals? | SELECT "Record" FROM table_1502 WHERE "Opponent" = 'Phoenix Cardinals' | wikisql |
CREATE TABLE table_name_23 (
july VARCHAR,
annual_precipitation VARCHAR
) | What is the July temperature where the annual precipitation is 514mm (20.2in)? | SELECT july FROM table_name_23 WHERE annual_precipitation = "514mm (20.2in)" | sql_create_context |
CREATE TABLE table_76222 (
"Date" text,
"Opponent" text,
"Score" text,
"Leading Scorer" text,
"Attendance" text,
"Series" text
) | Who is the leading scorer of the wnba finals series? | SELECT "Leading Scorer" FROM table_76222 WHERE "Series" = 'wnba finals' | wikisql |
CREATE TABLE table_name_59 (
overall INTEGER,
college VARCHAR,
pick__number VARCHAR
) | What is the overall number for Louisiana Tech college, and a pick more than 10? | SELECT SUM(overall) FROM table_name_59 WHERE college = "louisiana tech" AND pick__number > 10 | sql_create_context |
CREATE TABLE table_2305948_1 (
other_placings VARCHAR,
federation VARCHAR
) | How many times has a wrestler whose federation was roh, wwe competed in this event? | SELECT COUNT(other_placings) FROM table_2305948_1 WHERE federation = "ROH, WWE" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 text,
route text
)
... | how many patients have had cont inv mec ven 96+ hrs within 2 months after the diagnosis of thoracic aortic aneurysm this year? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'thoracic aortic an... | mimic_iii |
CREATE TABLE table_17375 (
"Finish" real,
"Start" real,
"Car No." real,
"Driver" text,
"Car Name" text,
"Car Make" text,
"Entrant" text,
"Laps" real,
"Status" text
) | What is the status of joe gibbs racing? | SELECT "Status" FROM table_17375 WHERE "Entrant" = 'Joe Gibbs Racing' | wikisql |
CREATE TABLE table_29296103_10 (
tournament VARCHAR,
runner_up VARCHAR
) | Which tournament was runner-up paul annacone eric korita? | SELECT tournament FROM table_29296103_10 WHERE runner_up = "Paul Annacone Eric Korita" | sql_create_context |
CREATE TABLE table_12570207_1 (
rockhampton INTEGER
) | what is the minimum rockhampton | SELECT MIN(rockhampton) FROM table_12570207_1 | sql_create_context |
CREATE TABLE tweets (
id bigint(20),
uid int(11),
text char(140),
createdate datetime
)
CREATE TABLE follows (
f1 int(11),
f2 int(11)
)
CREATE TABLE user_profiles (
uid int(11),
name varchar(255),
email varchar(255),
partitionid int(11),
followers int(11)
) | Find the name of each user and number of tweets tweeted by each of them Visualize by bar chart, and I want to list by the total number in desc. | SELECT name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_1307572_1 (
first_minting VARCHAR,
mass VARCHAR
) | When was the coin with the mass of 3.7 g first minted? | SELECT first_minting FROM table_1307572_1 WHERE mass = "3.7 g" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | How many days did the patient Jerry Deberry stay in the hospital? | SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 门诊诊断为嗜眠症的患者的籍贯代码是什么?名称是什么?相应人数是多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.JZZDSM = '嗜眠症' GROUP BY person_info.JGDM UNION SELECT per... | 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... | give me the number of patients who are divorced and had the lab test named vancomycin. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Vancomycin" | mimicsql_data |
CREATE TABLE table_48300 (
"Outcome" text,
"Date" text,
"Location" text,
"Surface" text,
"Opponent in final" text,
"Score" text
) | What is Surface, when Date is 2 May 1999? | SELECT "Surface" FROM table_48300 WHERE "Date" = '2 may 1999' | wikisql |
CREATE TABLE gwyjzb (
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,
... | 5908957这个医院的患者杨雅彤,列出其出院诊断医生是水医生的那次出院诊断的结果 | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '杨雅彤' AND gwyjzb.MED_SER_ORG_NO = '5908957' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '水%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '杨雅彤' AND fgwyjzb.MED_SER_ORG_NO = '5908957' AN... | css |
CREATE TABLE table_70047 (
"Rank" real,
"Mountain Peak" text,
"Province" text,
"Mountain Range" text,
"Location" text
) | Name the province with rank more than 49 | SELECT "Province" FROM table_70047 WHERE "Rank" > '49' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_des... | i would like to fly to SAN FRANCISCO from 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... | atis |
CREATE TABLE checkin (
cid int,
business_id varchar,
count int,
day varchar
)
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE category (
id int,
business_id v... | find the total checkins in Moroccan restaurant in ' Los Angeles ' per day | SELECT checkin.day, SUM(checkin.count) FROM business, category AS CATEGORY_0, category AS CATEGORY_1, checkin WHERE business.city = 'Los Angeles' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Moroccan' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = '... | yelp |
CREATE TABLE table_name_12 (
place INTEGER,
lost VARCHAR,
points VARCHAR
) | what is the place when losses is less than 12 and points is less than 19? | SELECT SUM(place) FROM table_name_12 WHERE lost < 12 AND points < 19 | sql_create_context |
CREATE TABLE table_204_159 (
id number,
"name" text,
"nation" text,
"position" text,
"league apps" number,
"league goals" number,
"fa cup apps" number,
"fa cup goals" number,
"total apps" number,
"total goals" number
) | which position is listed the least amount of times on this chart ? | SELECT "position" FROM table_204_159 GROUP BY "position" ORDER BY COUNT(*) LIMIT 1 | squall |
CREATE TABLE table_204_270 (
id number,
"transmitter" text,
"kw" number,
"bbca" number,
"bbcb" number,
"d3&4" number,
"sdn" number,
"arqa" number,
"arqb" number,
"pol." text,
"a.g." text
) | name the only relay with a bbcb over 55 ? | SELECT "transmitter" FROM table_204_270 WHERE "bbcb" > 55 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | specify the discharge location and insurance details of patients id 15898 | SELECT demographic.insurance, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "15898" | mimicsql_data |
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 ... | on the first hospital encounter, did patient 18866 go to an er? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 18866 AND admissions.admission_location = 'emergency room admit' AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_24827 (
"Institution" text,
"Location" text,
"Enrollment" text,
"Athletic nickname" text,
"School Colors" text,
"Founded" real
) | How many entries are shown for school colors for the location of naga , camarines sur? | SELECT COUNT("School Colors") FROM table_24827 WHERE "Location" = 'Naga , Camarines Sur' | wikisql |
CREATE TABLE table_name_7 (
rating VARCHAR,
weekly_rank VARCHAR
) | What is the total number of Rating(s), when Weekly Rank is 76/88? | SELECT COUNT(rating) FROM table_name_7 WHERE weekly_rank = "76/88" | sql_create_context |
CREATE TABLE table_52157 (
"Rank" real,
"List" text,
"Candidate name" text,
"Gender" text,
"Religion" text,
"Votes" real
) | Khalil chawka has a gender of , a religion of , and how many votes? | SELECT "Votes" FROM table_52157 WHERE "Gender" = '♂' AND "Religion" = '☪' AND "Candidate name" = 'khalil chawka' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 自二零一八年十月一日开始,截止到二零二零年八月二十三日,看看病人韦英秀到医院看病的次数是多少 | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韦英秀' AND mzjzjlb.JZKSRQ BETWEEN '2018-10-01' AND '2020-08-23') + (SELECT COUNT(*) FROM person_info J... | 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... | find the religion of subject id 2560. | SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "2560" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | count the number of patients whose admission type is elective and procedure icd9 code is 17? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "17" | mimicsql_data |
CREATE TABLE table_79873 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which player has a Position of defence, and a Pick # of 6? | SELECT "Player" FROM table_79873 WHERE "Position" = 'defence' AND "Pick #" = '6' | 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 white patients were born before the year 2056? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2056" | mimicsql_data |
CREATE TABLE table_23631 (
"Candidate" text,
"Office" text,
"Home state" text,
"Popular vote" real,
"States \u2013 first place" real,
"States \u2013 second place" real,
"States \u2013 third place" text
) | What office is Jon Huntsman a candidate for? | SELECT "Office" FROM table_23631 WHERE "Candidate" = 'Jon Huntsman' | wikisql |
CREATE TABLE table_name_70 (
total INTEGER,
silver INTEGER
) | Name the Total which has a Silver larger than 19? | SELECT MAX(total) FROM table_name_70 WHERE silver > 19 | sql_create_context |
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,
... | 在医疗诊断43267723179就诊期间其就诊的定点医疗机构编码是多少? | SELECT t_kc21.FLX_MED_ORG_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '43267723179' | css |
CREATE TABLE Person (
age INTEGER,
name VARCHAR
)
CREATE TABLE PersonFriend (
name VARCHAR,
friend VARCHAR
) | Which person whose friends have the oldest average age? | SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_22402438_7 (
position VARCHAR,
player VARCHAR
) | Which position is player bernie doan? | SELECT position FROM table_22402438_7 WHERE player = "Bernie Doan" | sql_create_context |
CREATE TABLE table_59880 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | Which incumbent was first elected in 1987? | SELECT "Incumbent" FROM table_59880 WHERE "First elected" = '1987' | wikisql |
CREATE TABLE table_name_17 (
competition VARCHAR,
opponents VARCHAR
) | Name the competition for motherwell opponents | SELECT competition FROM table_name_17 WHERE opponents = "motherwell" | sql_create_context |
CREATE TABLE table_22078972_2 (
no_in_series INTEGER,
written_by VARCHAR
) | What's the series number of the episode whose writer is David North? | SELECT MAX(no_in_series) FROM table_22078972_2 WHERE written_by = "David North" | sql_create_context |
CREATE TABLE table_44390 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | From what country did someone score 71? | SELECT "Country" FROM table_44390 WHERE "Score" = '71' | wikisql |
CREATE TABLE table_72033 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the score of the game when the record was 18 43? | SELECT "Score" FROM table_72033 WHERE "Record" = '18–43' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose admission year is less than 2108 and item id is 50998? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2108" AND lab.itemid = "50998" | mimicsql_data |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 有多少检验报告单是病人48698459在00年9月24日到2010年6月21日内开出其科室编码以及名称都是什么? | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH... | css |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | exactly what has the change in the anion gap of patient 26156 last measured on the first hospital visit compared to the value first measured on the first hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26156 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ... | mimic_iii |
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... | how many patients admitted to the hospital before year 2180 had the diagnosis icd9 code 3671? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2180" AND diagnoses.icd9_code = "3671" | mimicsql_data |
CREATE TABLE table_6507 (
"Position" text,
"Player" text,
"Premiership" text,
"Norwegian Cup" text,
"UEFA" text,
"Total" text
) | What is the Total with a Player named robbie winters? | SELECT "Total" FROM table_6507 WHERE "Player" = 'robbie winters' | wikisql |
CREATE TABLE table_name_58 (
region VARCHAR,
date VARCHAR
) | Which region has a date of 1970? | SELECT region FROM table_name_58 WHERE date = "1970" | sql_create_context |
CREATE TABLE table_13194 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
) | What is the sum of the to par with a 76-77-74-75=302 score? | SELECT SUM("To par") FROM table_13194 WHERE "Score" = '76-77-74-75=302' | wikisql |
CREATE TABLE table_name_28 (
away_team VARCHAR,
tie_no VARCHAR
) | Which away team has a tie number of 3? | SELECT away_team FROM table_name_28 WHERE tie_no = "3" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
... | when did patient 51177 receive a test for cholesterol, total for the last time since 02/2103? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'cholesterol, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND STRFTIME('%y-%m', labevents.charttime) >= '2103-02' OR... | mimic_iii |
CREATE TABLE table_26216 (
"Song 1 title" text,
"Artist 1" text,
"Song 2 title" text,
"Artist 2" text,
"Mix artist" text,
"Guitar part?" text,
"Level" text
) | Which level has marvin gaye as artist 1 and david bowie as artist 2? | SELECT "Level" FROM table_26216 WHERE "Artist 1" = 'Marvin Gaye' AND "Artist 2" = 'David Bowie' | wikisql |
CREATE TABLE table_name_50 (
album VARCHAR,
label VARCHAR,
year VARCHAR
) | What's the name of the album from 2012 with a Hammer Music / Nail Records label? | SELECT album FROM table_name_50 WHERE label = "hammer music / nail records" AND year = 2012 | sql_create_context |
CREATE TABLE table_30343 (
"Character" text,
"Game" text,
"Platform" text,
"Status" text,
"Mystic Arte" text,
"Character Voice" text
) | How many platforms have celsius calibur as mystic arte? | SELECT COUNT("Platform") FROM table_30343 WHERE "Mystic Arte" = 'Celsius Calibur' | wikisql |
CREATE TABLE table_name_74 (
position VARCHAR,
nationality VARCHAR,
player VARCHAR
) | What is the position of United States' player Brett Lawrence? | SELECT position FROM table_name_74 WHERE nationality = "united states" AND player = "brett lawrence" | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varcha... | what 's the fare from WASHINGTON to BOSTON | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperw... | What are the student IDs for everybody who worked for more than 10 hours per week on all sports? | SELECT stuid FROM sportsinfo GROUP BY stuid HAVING SUM(hoursperweek) > 10 | spider |
CREATE TABLE table_name_76 (
away_team VARCHAR,
home_team VARCHAR
) | When fitzroy was the home team, how much did the away team score? | SELECT away_team AS score FROM table_name_76 WHERE home_team = "fitzroy" | sql_create_context |
CREATE TABLE table_15412381_5 (
date VARCHAR,
wheels VARCHAR
) | What is the date of the 279 wheels? | SELECT date FROM table_15412381_5 WHERE wheels = 279 | sql_create_context |
CREATE TABLE table_6059 (
"Wicket" text,
"Score" real,
"Batting partners" text,
"Opposition" text,
"Venue" text,
"City" text,
"Year" real
) | In what Venue was Surrey the Opposition in the 2nd Wicket? | SELECT "Venue" FROM table_6059 WHERE "Opposition" = 'surrey' AND "Wicket" = '2nd' | wikisql |
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 average age of patients whose primary disease is squamous cell carcinoma oral tongue/sda and days of hospital stay is 5? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.days_stay = "5" | mimicsql_data |
CREATE TABLE table_17355408_7 (
high_points VARCHAR,
team VARCHAR
) | @ Chicago had a high points of what? | SELECT high_points FROM table_17355408_7 WHERE team = "@ Chicago" | sql_create_context |
CREATE TABLE table_name_99 (
lane INTEGER,
athlete VARCHAR,
time VARCHAR
) | What is the greatest lane that David Payne was in when he ran longer than 13.17? | SELECT MAX(lane) FROM table_name_99 WHERE athlete = "david payne" AND time > 13.17 | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | Most popular StackOverflow tags from 2020-1-18 to 2013-1-18. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInTimePeriod, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostI... | sede |
CREATE TABLE table_204_577 (
id number,
"name" text,
"first operational" text,
"numeral system" text,
"computing mechanism" text,
"programming" text,
"turing complete" text
) | what is the number of names listed ? | SELECT COUNT("name") FROM table_204_577 | squall |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 列出在编码为9652533的医院中施红雪患者门诊诊断名称包含壹期的门诊就诊记录有哪些呀? | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '施红雪' AND hz_info.YLJGDM = '9652533' AND wdmzjzjlb.JZZDSM LIKE '%壹期%' UNION SELECT * FROM person_info JOIN h... | css |
CREATE TABLE table_12337 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text,
"NCAA Team Championships (through July 4, 2012)" real
) | What is the highest enrollment for an unversity whose nickname is the Golden Bears and had fewer than 32 NCAA championships as of July 4, 2012? | SELECT MAX("Enrollment") FROM table_12337 WHERE "Nickname" = 'golden bears' AND "NCAA Team Championships (through July 4, 2012)" < '32' | wikisql |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
... | How many accounts for each customer? Show a bar chart that groups by customer's last name, sort in descending by the customer_last_name please. | SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY customer_last_name DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.