context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | give me the number of patients whose procedure long title is initial insertion of transvenous leads [electrodes] into atrium and ventricle and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Initial insertion of transvenous leads [electrodes] into atrium and ventricle" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_16161 (
"Season" text,
"Team" text,
"League Apps" real,
"League Goals" real,
"Cup Apps" real,
"Cup Goals" real
) | What is the most cup goals for seasson 1911-12? | SELECT MAX("Cup Goals") FROM table_16161 WHERE "Season" = '1911-12' | wikisql |
CREATE TABLE table_48769 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the record of game 33? | SELECT "Record" FROM table_48769 WHERE "Game" = '33' | wikisql |
CREATE TABLE table_test_3 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"severe_hemodynamic_instability" bool,
"consent" bool,
"hemoglobin_a1c_hba1c" float,
"metallic_implants" bool,
"allergy_to_aspirin" bool,
"creatinine_clearance_cl" float,
"post_menopausal" bool,... | > 18 years of age, male or female , capable of giving an informed consent. | SELECT * FROM table_test_3 WHERE age > 18 AND (gender = 'male' OR gender = 'female') AND consent = 1 | criteria2sql |
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,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 在1934902医院就诊的病人78419637所就诊的科室名字里没有检查的所有门诊就诊记录的流水号分别是啥? | SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '78419637' AND hz_info.YLJGDM = '1934902' AND NOT zzmzjzjlb.JZKSMC LIKE '%检查%' UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOIN fzzmzjzjlb ON hz_info.... | css |
CREATE TABLE people (
Hometown VARCHAR
) | How many distinct hometowns did these people have? | SELECT COUNT(DISTINCT Hometown) FROM people | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is procedure long title and drug route of subject name marilyn norvell? | SELECT procedures.long_title, prescriptions.route FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell" | mimicsql_data |
CREATE TABLE table_45463 (
"Year" real,
"Seed" real,
"Round" text,
"Opponent" text,
"Result/Score" text
) | What is the highest Year, when Opponent is #2 Syracuse? | SELECT MAX("Year") FROM table_45463 WHERE "Opponent" = '#2 syracuse' | wikisql |
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year number
)
CREATE TABLE event (
id number,
name text,
stadium_id number,
year text
)
CREATE TABLE record (
id number,
result text,
swimmer_id number,
event_id numbe... | Find the names of stadiums which have never had any event. | SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event) | spider |
CREATE TABLE table_name_87 (
attendance VARCHAR,
opponent VARCHAR
) | What is the Attendance of the game against Minnesota Vikings? | SELECT COUNT(attendance) FROM table_name_87 WHERE opponent = "minnesota vikings" | sql_create_context |
CREATE TABLE basketball_match (
acc_percent VARCHAR
) | What is the highest acc percent score in the competition? | SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_53463 (
"Date" text,
"Opponent" text,
"Home/Away" text,
"Field" text,
"Result" text
) | Name the opponent when the field is mitchel athletic complex | SELECT "Opponent" FROM table_53463 WHERE "Field" = 'mitchel athletic complex' | wikisql |
CREATE TABLE table_25730209_2 (
field_goals VARCHAR,
player VARCHAR
) | How many field goals did Donald Green score? | SELECT COUNT(field_goals) FROM table_25730209_2 WHERE player = "Donald Green" | sql_create_context |
CREATE TABLE table_2037 (
"Province" text,
"Arabs 2001" real,
"% 2001" text,
"Arabs 2011" real,
"% 2011" text
) | If the province is Manitoba, what is the Arabs 2001 number? | SELECT MAX("Arabs 2001") FROM table_2037 WHERE "Province" = 'Manitoba' | wikisql |
CREATE TABLE table_20066 (
"Name" text,
"Year" real,
"Landfall" text,
"NHC Advisory Number" text,
"V(mph)" real,
"R(miles)" real,
"Saffir-Simpson Category" real,
"CHI" text
) | What is the maximum miles per hour recorded when the CHI (Carvill Hurricane Index) is equal to 13.5 | SELECT MAX("V(mph)") FROM table_20066 WHERE "CHI" = '13.5' | wikisql |
CREATE TABLE table_3946 (
"Represent Province" text,
"Contestant" text,
"Age" real,
"Height (ft.)" text,
"Height (mtr.)" text,
"Hometown" text
) | What is the represent province for the contestant whose hometown is Woerden? | SELECT "Represent Province" FROM table_3946 WHERE "Hometown" = 'Woerden' | wikisql |
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... | 患者66859587在13年8月16日到2014年3月7日内有哪些药品的自费金额比2896.1元高? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '66859587' AND t_kc22.STA_DATE BETWEEN '2013-08-16' AND '2014-03-07' AND t_kc22.SELF_PAY_AMO > 2896.1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '66859... | css |
CREATE TABLE table_23670057_7 (
year_born INTEGER,
current_club VARCHAR
) | What is the latest year born when the current club is Barons LMT? | SELECT MAX(year_born) FROM table_23670057_7 WHERE current_club = "Barons LMT" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
U... | Comparison of ID requests for books vs films. | SELECT 'Books' AS id_type, ROUND(AVG(CAST(Score AS FLOAT)), 2) AS score FROM Posts AS p WHERE p.Tags LIKE '%identification%' AND (p.Tags + p.Body LIKE '%book%' OR p.Tags + p.Body LIKE '%story%') UNION SELECT 'Films' AS id_type, ROUND(AVG(CAST(Score AS FLOAT)), 2) AS score FROM Posts AS p WHERE p.Tags LIKE '%identificat... | sede |
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
)
... | count the number of patients whose discharge location is disc-tran cancer/chldrn h and procedure icd9 code is 8841? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "8841" | mimicsql_data |
CREATE TABLE table_53168 (
"Year" real,
"Championship" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What Championship has Scores of 6 3, 2 6, 3 6, 6 3, 3 6? | SELECT "Championship" FROM table_53168 WHERE "Score" = '6–3, 2–6, 3–6, 6–3, 3–6' | wikisql |
CREATE TABLE table_62026 (
"Year" real,
"Average" text,
"High" real,
"Sellouts" real,
"Total for year" real,
"WNBA game average" real
) | What is the total of the year that more than 13,142 is the high, and 10,387 (2nd) is the average, and there was less than 0 sellouts? | SELECT SUM("Year") FROM table_62026 WHERE "High" > '13,142' AND "Average" = '10,387 (2nd)' AND "Sellouts" < '0' | wikisql |
CREATE TABLE table_80174 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | What was the 2nd Party when its 2nd Member was George Rushout-Bowes, and the 1st Party was Liberal? | SELECT "2nd Party" FROM table_80174 WHERE "2nd Member" = 'george rushout-bowes' AND "1st Party" = 'liberal' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients younger than age of 85 years had the procedure icd9 code 4131? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "85" AND procedures.icd9_code = "4131" | mimicsql_data |
CREATE TABLE table_48942 (
"Buffalo" text,
"Rochester" text,
"Syracuse" text,
"Utica" text,
"Albany" text
) | What is Syracuse, when Buffalo is Oatka Creek Shale, and when Albany is Berne? | SELECT "Syracuse" FROM table_48942 WHERE "Buffalo" = 'oatka creek shale' AND "Albany" = 'berne' | wikisql |
CREATE TABLE table_73076 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text,
"Leagues entering this round" text
) | Name the least clubs involved for leagues being none for semi finals | SELECT MIN("Clubs involved") FROM table_73076 WHERE "Leagues entering this round" = 'none' AND "Round" = 'Semi finals' | wikisql |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Count the number of captains younger than 50 of each rank by a bar chart, show in descending by the y-axis. | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_39 (
result VARCHAR,
opponent VARCHAR
) | what is the result when the opponent is blackburn rovers? | SELECT result FROM table_name_39 WHERE opponent = "blackburn rovers" | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | show me all flights from PITTSBURGH to BALTIMORE | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL... | atis |
CREATE TABLE table_name_23 (
record VARCHAR,
date VARCHAR,
home VARCHAR,
score VARCHAR
) | What is the Record that has a Home of detroit red wings, and a Score of 1 2 on december 29? | SELECT record FROM table_name_23 WHERE home = "detroit red wings" AND score = "1–2" AND date = "december 29" | sql_create_context |
CREATE TABLE table_65217 (
"Nat." text,
"Name" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text
) | Which player from GER has a transfer window of summer, and a transfer fee of n/a? | SELECT "Name" FROM table_65217 WHERE "Transfer window" = 'summer' AND "Nat." = 'ger' AND "Transfer fee" = 'n/a' | wikisql |
CREATE TABLE table_46983 (
"Position" real,
"Pilot" text,
"Glider" text,
"Speed" text,
"Distance" text
) | What is Glider, when Speed is '147.3km/h'? | SELECT "Glider" FROM table_46983 WHERE "Speed" = '147.3km/h' | wikisql |
CREATE TABLE table_name_83 (
us_peak_position VARCHAR,
uk_peak_position VARCHAR
) | What was the US Peak position of the film that peaked at #21 in the UK? | SELECT us_peak_position FROM table_name_83 WHERE uk_peak_position = "21" | sql_create_context |
CREATE TABLE Visits (
Visit_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Tourist_ID INTEGER,
Visit_Date DATETIME,
Visit_Details VARCHAR(40)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(40),
Other_Details VARCHAR(255)
)
CREATE TABLE Tourist_Attr... | List all the possible ways to get to attractions, together with the number of attractions accessible by these methods in a bar chart, and sort names in asc order please. | SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY How_to_Get_There | nvbench |
CREATE TABLE category (
id int,
business_id varchar,
category_name varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rating floa... | How many tips has Michelle written in 2014 | SELECT COUNT(DISTINCT (tip.text)) FROM tip, user WHERE tip.year = 2014 AND user.name = 'Michelle' AND user.user_id = tip.user_id | yelp |
CREATE TABLE table_68870 (
"BR/SR No." text,
"SR Name" text,
"LSWR No." real,
"Builder" text,
"Built" real,
"To IoW" real,
"Withdrawn" real
) | What is the number for year built of W27 that was withdrawn in 1967 with a To LoW year earlier than 1926? | SELECT COUNT("Built") FROM table_68870 WHERE "Withdrawn" = '1967' AND "BR/SR No." = 'w27' AND "To IoW" < '1926' | wikisql |
CREATE TABLE table_50467 (
"Municipality" text,
"Inhabitants" real,
"Mayor" text,
"Party" text,
"Election" real
) | What is the Mayor of Riva del Garda in 2010? | SELECT "Mayor" FROM table_50467 WHERE "Election" = '2010' AND "Municipality" = 'riva del garda' | wikisql |
CREATE TABLE table_24887326_6 (
tie_no INTEGER,
attendance VARCHAR
) | What is the highest tie that had 19129 attendance? | SELECT MAX(tie_no) FROM table_24887326_6 WHERE attendance = 19129 | sql_create_context |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | Please return me a histogram to show the friends, and ages of all people who are older than the average age of a person? | SELECT friend, age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) | nvbench |
CREATE TABLE table_1183842_1 (
joined VARCHAR,
location VARCHAR
) | Boca Raton, Florida had what joined amount? | SELECT joined FROM table_1183842_1 WHERE location = "Boca Raton, Florida" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | among patients aged below 30, calculate the total number of unmarried patients | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.age < "30" | mimicsql_data |
CREATE TABLE table_12825 (
"Rank" real,
"Family" text,
"Abbre\u00adviation" text,
"Constellation" text,
"Area (sq.deg.)" real,
"Area (msr)" real,
"Per\u00adcent\u00adage" text,
"Right ascension (hm)" real,
"Decli\u00adnation (dm)" text,
"Quad" text
) | What is the total sum of Areas (sq.deg) that have an Area (msr) of 43.059 and a Right ascension (hm) larger than 747.73? | SELECT SUM("Area (sq.deg.)") FROM table_12825 WHERE "Area (msr)" = '43.059' AND "Right ascension (hm)" > '747.73' | 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 lab (
labid numbe... | until 4 years ago, what was the first hospital admission time for patient 003-48563? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '003-48563' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
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 whose procedure icd9 code is 3533 had the drug route neb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "3533" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Is there an easy class to take wherein I could fulfill the PreMajor requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra... | advising |
CREATE TABLE table_61160 (
"Lince" text,
"Leopard 2A4" text,
"Leclerc" text,
"M1A1 Abrams" text,
"M60A3 Patton" text
) | What is the M60A3 that has an M1A1 of Km (mi)? | SELECT "M60A3 Patton" FROM table_61160 WHERE "M1A1 Abrams" = 'km (mi)' | wikisql |
CREATE TABLE table_name_27 (
speed VARCHAR,
team VARCHAR,
rank VARCHAR
) | What was #7 BMW's speed? | SELECT speed FROM table_name_27 WHERE team = "bmw" AND rank = 7 | sql_create_context |
CREATE TABLE table_name_87 (
silver INTEGER,
nation VARCHAR,
total VARCHAR
) | What is the fewest number of silver medals won by Canada with fewer than 3 total medals? | SELECT MIN(silver) FROM table_name_87 WHERE nation = "canada" AND total < 3 | sql_create_context |
CREATE TABLE table_name_25 (
symbol VARCHAR,
empirical_† VARCHAR,
calculated VARCHAR
) | What is the symbol of the element with an empirical t of 190 and a calculated value of 135? | SELECT symbol FROM table_name_25 WHERE empirical_† = "190" AND calculated = "135" | sql_create_context |
CREATE TABLE table_33352 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date was fitzroy the home team? | SELECT "Date" FROM table_33352 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | calculate how many times patient 030-56105 since 2104 received a laboratory test for ptt. | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-56105')) AND lab.labname = 'ptt' AND STRFTIME('%y', lab.labresulttime) >= '2104' | eicu |
CREATE TABLE table_name_68 (
team VARCHAR,
school VARCHAR
) | What is the Team for the Milford School? | SELECT team FROM table_name_68 WHERE school = "milford" | sql_create_context |
CREATE TABLE table_name_47 (
date VARCHAR,
result VARCHAR,
score VARCHAR
) | What is the Date of the Competition with a Score of 4-0 and 5-0 Result? | SELECT date FROM table_name_47 WHERE result = "5-0" AND score = "4-0" | sql_create_context |
CREATE TABLE exhibition (
name VARCHAR,
artist_id VARCHAR
)
CREATE TABLE artist (
name VARCHAR,
artist_id VARCHAR
) | Show names for artists without any exhibition. | SELECT name FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM exhibition) | 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,
... | from TORONTO to ATLANTA in the afternoon | 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLAN... | atis |
CREATE TABLE table_name_37 (
navigator VARCHAR,
total_time VARCHAR
) | Which Navigator has a Total Time of 08:29? | SELECT navigator FROM table_name_37 WHERE total_time = "08:29" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is age and admission time of subject name jerry deberry? | SELECT demographic.age, demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_44468 (
"Rank" text,
"s Wicket" text,
"Player" text,
"Matches" text,
"Average" text
) | Which rank is 40 for s Wicket with a player of Daniel Marsh? | SELECT "Rank" FROM table_44468 WHERE "s Wicket" = '40' AND "Player" = 'daniel marsh' | wikisql |
CREATE TABLE table_name_19 (
capacity INTEGER,
club VARCHAR
) | What is the highest capacity for the venue of the club, vihren? | SELECT MAX(capacity) FROM table_name_19 WHERE club = "vihren" | sql_create_context |
CREATE TABLE table_name_27 (
position VARCHAR,
round VARCHAR
) | Which position is round 7? | SELECT position FROM table_name_27 WHERE round = 7 | sql_create_context |
CREATE TABLE table_48242 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is Label, when Region is Japan? | SELECT "Label" FROM table_48242 WHERE "Region" = 'japan' | wikisql |
CREATE TABLE table_11964047_7 (
visitor VARCHAR,
record VARCHAR
) | who are all the visitor with a record of 25 18 | SELECT visitor FROM table_11964047_7 WHERE record = "25–18" | sql_create_context |
CREATE TABLE table_12161822_5 (
report VARCHAR,
fastest_lap VARCHAR,
winning_driver VARCHAR
) | what's the report with fastest lap being felipe massa and winning driver being jenson button | SELECT report FROM table_12161822_5 WHERE fastest_lap = "Felipe Massa" AND winning_driver = "Jenson Button" | sql_create_context |
CREATE TABLE table_23926 (
"Name" text,
"#" real,
"Height" text,
"Weight" real,
"Position" text,
"Year" text,
"Home Town" text,
"High School" text
) | What is the position of the player who's hometown is North Babylon, NY? | SELECT "Position" FROM table_23926 WHERE "Home Town" = 'North Babylon, NY' | wikisql |
CREATE TABLE table_31856 (
"2nd component" text,
"b.p. 2nd comp. (\u02daC)" real,
"3rd component" text,
"b.p. 3rd comp. (\u02daC)" real,
"b.p. azeo. (\u02daC)" real
) | Tell me the sum of bp 2nd comp with bp azeo of 57.5 | SELECT SUM("b.p. 2nd comp. (\u02daC)") FROM table_31856 WHERE "b.p. azeo. (\u02daC)" = '57.5' | wikisql |
CREATE TABLE table_68429 (
"Episode" text,
"First aired" text,
"Entrepreneur(s)" text,
"Company or product name" text,
"Money requested (\u00a3)" real,
"Investing Dragon(s)" text
) | In episode 7 what was the highest amount of money requested by Jerry Mantalvanos & Paul Merker ? | SELECT MAX("Money requested (\u00a3)") FROM table_68429 WHERE "Episode" = 'episode 7' AND "Entrepreneur(s)" = 'jerry mantalvanos & paul merker' | wikisql |
CREATE TABLE fgwyjzb (
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,
... | 看一下孙祺然这个病人在哪几次医疗记录中被开出的药品均超过9192.27元?医疗就诊编号是啥 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '孙祺然' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 9192.27) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '孙祺然' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FR... | css |
CREATE TABLE table_dev_13 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"heart_disease" bool,
"dyslipidemia" bool,
"allergy_to_egg" bool,
"high_density_lipoprotein_cholesterol_hdl_c" int,
"hba1c" float,
"coronary_artery_disease_cad" bool,
"fasting_triglyceride" int,... | hba1c level < 10.5 % at screening | SELECT * FROM table_dev_13 WHERE hba1c < 10.5 | criteria2sql |
CREATE TABLE table_name_49 (
year_s__of_manufacture VARCHAR,
quantity VARCHAR,
number_s_ VARCHAR
) | Which Year(s) of Manufacture has a Quantity larger than 60, and a Number(s) of 7001 7165? | SELECT year_s__of_manufacture FROM table_name_49 WHERE quantity > 60 AND number_s_ = "7001–7165" | sql_create_context |
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,
... | 询问一下患者98644163往常有过什么异常情况吗? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
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,
... | 哪些药品是苏秀华这位团伙成员最常开的,依次排序是什么 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苏秀华' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_73293 (
"Expression" text,
"Y = 2008" text,
"Y = 2009" text,
"Y = 2010" text,
"Y = 2011" text
) | What is the y = 2011 when the y = 2010 is 22 march 2010? | SELECT "Y = 2011" FROM table_73293 WHERE "Y = 2010" = '22 March 2010' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | list the ids of all those patients diagnosed with thrombocytopenia - suspected since 6 years ago. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'thrombocytopenia - suspected' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-6 year')) | eicu |
CREATE TABLE table_37349 (
"Week" real,
"Date" text,
"Opponent" text,
"Time ( ET )" text,
"Game site" text,
"Result" text,
"Record" text
) | What is the result of the game of heinz field with a record of 2-5? | SELECT "Result" FROM table_37349 WHERE "Game site" = 'heinz field' AND "Record" = '2-5' | wikisql |
CREATE TABLE table_name_60 (
l2_cache VARCHAR,
model_number VARCHAR
) | What is L2 Cache, when Model Number is Atom Z625? | SELECT l2_cache FROM table_name_60 WHERE model_number = "atom z625" | sql_create_context |
CREATE TABLE table_12419515_4 (
title VARCHAR,
written_by VARCHAR
) | What is the total number of titles written by Casey Johnson? | SELECT COUNT(title) FROM table_12419515_4 WHERE written_by = "Casey Johnson" | sql_create_context |
CREATE TABLE table_name_51 (
laps VARCHAR,
driver VARCHAR
) | How many laps does roberto moreno have? | SELECT laps FROM table_name_51 WHERE driver = "roberto moreno" | sql_create_context |
CREATE TABLE Vehicles (
vehicle_id INTEGER,
vehicle_details VARCHAR(255)
)
CREATE TABLE Lessons (
lesson_id INTEGER,
customer_id INTEGER,
lesson_status_code VARCHAR(15),
staff_id INTEGER,
vehicle_id INTEGER,
lesson_date DATETIME,
lesson_time VARCHAR(10),
price DOUBLE
)
CREATE T... | List all customer status codes and the number of customers having each status code in a bar chart, sort from low to high by the X please. | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code | nvbench |
CREATE TABLE table_name_56 (
opponent VARCHAR,
record VARCHAR
) | Which opponent has a 53-24 record? | SELECT opponent FROM table_name_56 WHERE record = "53-24" | sql_create_context |
CREATE TABLE table_23308178_5 (
points INTEGER
) | What's the minimal number of points scored in any game? | SELECT MIN(points) FROM table_23308178_5 | sql_create_context |
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
sequence_identity_to_human_protein text,
Institution_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
... | Please give me a pie chart showing institution types, along with the number of institutions for each type. | SELECT Type, COUNT(*) FROM Institution GROUP BY Type | nvbench |
CREATE TABLE web_client_accelerator (
id VARCHAR,
Name VARCHAR
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id VARCHAR
) | What are the ids and names of the web accelerators that are compatible with two or more browsers? | SELECT T1.id, T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of patients whose diagnoses icd9 code is 42833 and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "42833" AND prescriptions.drug_type = "BASE" | mimicsql_data |
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... | 患有疾病Y43.350的病人被开出的药品的编号是什么?名称是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_CD = 'Y43.350' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_CD = 'Y43.350' UN... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | what is the difference between patient 006-172277's total number of inputs and outputs during the previous day? | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277')) AND intakeoutput.cellpath ... | eicu |
CREATE TABLE table_29162856_1 (
pole_position VARCHAR,
winning_rider VARCHAR,
fastest_lap VARCHAR
) | Who had the pole position(s) when rob guiver won and kyle ryde had the fastest lap? | SELECT pole_position FROM table_29162856_1 WHERE winning_rider = "Rob Guiver" AND fastest_lap = "Kyle Ryde" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | which patients have prescription for iso-osmotic sodium chloride medication? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Iso-Osmotic Sodium Chloride" | mimicsql_data |
CREATE TABLE table_13398 (
"Rank" real,
"Name" text,
"1st run" text,
"2nd run" text,
"3rd run" text,
"Total" real
) | What is the 1st run when 37.496 (4) is the 3rd run? | SELECT "1st run" FROM table_13398 WHERE "3rd run" = '37.496 (4)' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | what is the number of patients who died after diagnosis of secondary malig neo nec during the same month? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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_di... | mimic_iii |
CREATE TABLE table_53559 (
"Year" real,
"Venue" text,
"Location" text,
"Winning team" text,
"Score" text,
"U.S. Captain" text,
"International Captain" text
) | what is the highest year that the U.S. captain is ken venturi? | SELECT MAX("Year") FROM table_53559 WHERE "U.S. Captain" = 'ken venturi' | wikisql |
CREATE TABLE table_30127 (
"Year(s)" real,
"Television commentator" text,
"Dual Television commentator" text,
"Radio commentator" text,
"Spokesperson" text
) | Who was the dual television commentator in 1990? | SELECT "Dual Television commentator" FROM table_30127 WHERE "Year(s)" = '1990' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | tell me the total number of patients who are diagnosed with malign neopl ovary until 2102? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'malign neopl ovary') AND STRFTIME('%y', diagnoses_icd.char... | mimic_iii |
CREATE TABLE table_18143210_2 (
club VARCHAR,
top_division_titles VARCHAR
) | What was the club that won 10 top division titles? | SELECT club FROM table_18143210_2 WHERE top_division_titles = 10 | sql_create_context |
CREATE TABLE table_22610 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Name the total number of written by for original air date for may 8, 2005 | SELECT COUNT("Written by") FROM table_22610 WHERE "Original air date" = 'May 8, 2005' | wikisql |
CREATE TABLE table_6947 (
"Date" text,
"English Name" text,
"Chinese Name" text,
"Tamil Name" text,
"Type" text
) | What is the Tamil Name of ( 2)? | SELECT "Type" FROM table_6947 WHERE "Tamil Name" = 'சந்திர புத்தாண்டு (தினம் 2)' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
sub... | how many patients were diagnosed with esophageal reflux within 2 months after the first diagnosis with mental disor nec oth dis? | 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 = 'esophageal reflux'... | mimic_iii |
CREATE TABLE table_name_85 (
country VARCHAR,
name VARCHAR,
status VARCHAR,
moving_to VARCHAR
) | Which country has the status of transferred, moving to of released, and Solano as the listed name? | SELECT country FROM table_name_85 WHERE status = "transferred" AND moving_to = "released" AND name = "solano" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | How is the workload in EECS 751 ? | SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 751 AND program_course.course_id = course.course_id | advising |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
... | are there any nonstop flights leaving from DENVER arriving in BALTIMORE on 7 7 | 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, flight WHERE (((((flight.arrival_time < flight.departure_time) AND DATE_DAY_0.day_number = 6 A... | atis |
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... | 在病人鲁烨烨的医疗记录中开出了多少次价格不超过809.11元的药品?是多少就诊编号? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '鲁烨烨' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 809.11) | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.