context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_43835 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
) | Who was the opponent when they played at the legion field birmingham, al site? | SELECT "Opponent" FROM table_43835 WHERE "Site" = 'legion field • birmingham, al' | wikisql |
CREATE TABLE table_39175 (
"Team" text,
"Copa Libertadores 1999" text,
"Copa Mercosur 1999" text,
"Copa CONMEBOL 1999" text,
"Intercontinental Cup 1999" text
) | What is the Copa Libertadores 1999 result for team vasco, which made the group stage in the Copa Mercosur 1999? | SELECT "Copa Libertadores 1999" FROM table_39175 WHERE "Copa Mercosur 1999" = 'group stage' AND "Team" = 'vasco' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | what are the four most frequent procedures for patients with an age 40s? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_name_74 (
total INTEGER,
rank VARCHAR,
gold VARCHAR
) | What is the sum of Total ranking 9 and a Gold more than 6 | SELECT SUM(total) FROM table_name_74 WHERE rank = "9" AND gold > 6 | sql_create_context |
CREATE TABLE table_7047 (
"English country name" text,
"Arabic romanised country name" text,
"Arabic country name" text,
"English capital name" text,
"Arabic romanised capital name" text,
"Arabic capital name" text
) | What is the English name of the country that has Ramallah as its capital? | SELECT "English country name" FROM table_7047 WHERE "English capital name" = 'ramallah' | wikisql |
CREATE TABLE table_name_86 (
overall VARCHAR,
school_club_team VARCHAR,
round VARCHAR
) | How many times was Arizona the team and the round was bigger than 11? | SELECT COUNT(overall) FROM table_name_86 WHERE school_club_team = "arizona" AND round > 11 | sql_create_context |
CREATE TABLE batting (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
g INTEGER,
ab NUMERIC,
r NUMERIC,
h NUMERIC,
double NUMERIC,
triple NUMERIC,
hr NUMERIC,
rbi NUMERIC,
sb NUMERIC,
cs NUMERIC,
bb NUMERIC,
so NUMERIC,
... | How many home games by each weekday (bin the year attr into weekdays interval)? Give me a bar chart. | SELECT year, COUNT(year) FROM home_game | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
lan... | what is patient 88409's insurance on their last hospital encounter? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 88409 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
... | count the number of times that patient 16572 has taken tpn. | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn' AND d_i... | mimic_iii |
CREATE TABLE table_name_62 (
rally_hq VARCHAR,
rally_name VARCHAR
) | Where was adac rally deutschland's rally HQ? | SELECT rally_hq FROM table_name_62 WHERE rally_name = "adac rally deutschland" | sql_create_context |
CREATE TABLE table_name_98 (
bronze VARCHAR,
silver INTEGER
) | What is the total number of bronze medals for teams with less than 0 silver? | SELECT COUNT(bronze) FROM table_name_98 WHERE silver < 0 | 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,
... | Which headquarter locations are used by more than 2 companies? | SELECT headquarters FROM companies GROUP BY headquarters HAVING COUNT(*) > 2 | spider |
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... | 团伙成员95304552药品排序,最常开的是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '95304552' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
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 Subjects (
subject_id INTEGER,
subje... | Show me about the correlation between author_id and author_tutor_ATB in a scatter chart. | SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_25747 (
"#" text,
"Original title" text,
"Directed by" text,
"Written by" text,
"Original air dates" text,
"Prod. code" real
) | Name the original air date for prod code 201 | SELECT "Original air dates" FROM table_25747 WHERE "Prod. code" = '201' | wikisql |
CREATE TABLE table_name_24 (
points_for VARCHAR,
points VARCHAR,
club VARCHAR
) | What is Points, when Points is 60, and when Club is Bedwas RFC? | SELECT points_for FROM table_name_24 WHERE points = "60" AND club = "bedwas rfc" | sql_create_context |
CREATE TABLE table_name_27 (
year INTEGER,
inglewood INTEGER
) | What is the average year that had a value less than 2,575 in Inglewood? | SELECT AVG(year) FROM table_name_27 WHERE inglewood < 2 OFFSET 575 | sql_create_context |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | A bar chart for what is the number of locations of the wrestlers, and could you order in asc by the Location? | SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the drug name and route for the drug code amid200? | SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "AMID200" | 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 jyjgzbb (
BGDH text,
BGRQ tim... | 查询花英勋病患的检验报告单中结果指标均异常的检验报告单,需要检验报告的单号 | SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info... | css |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Plot the number of county by grouped by county as a bar graph, and I want to list in ascending by the bars. | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY County | nvbench |
CREATE TABLE table_74529 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Time" text,
"Grade" text
) | Which trainer had a time of 1:10.09 with a year less than 2009? | SELECT "Trainer" FROM table_74529 WHERE "Year" < '2009' AND "Time" = '1:10.09' | wikisql |
CREATE TABLE table_name_31 (
games VARCHAR,
points VARCHAR
) | Name the F. Goals for games of 22 22 and points of 012 12 | SELECT F.goals FROM table_name_31 WHERE games = "22 22" AND points = "012 12" | sql_create_context |
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 was the maximum monthly number of patients who had abn find-stool contents this year? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abn find-stool contents') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TI... | mimic_iii |
CREATE TABLE table_name_43 (
points INTEGER,
record VARCHAR,
game__number VARCHAR
) | What is the number of points of the game less than number 17 with an 11-6-0 record? | SELECT SUM(points) FROM table_name_43 WHERE record = "11-6-0" AND game__number < 17 | sql_create_context |
CREATE TABLE table_21415 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
) | Name the number of going to for thurlby, braceborough spa at departure being 16.50 | SELECT COUNT("Going to") FROM table_21415 WHERE "Calling at" = 'Thurlby, Braceborough Spa' AND "Departure" = '16.50' | wikisql |
CREATE TABLE table_72891 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who did the most assists when Matt Barnes (11) got the most rebounds? | SELECT "High assists" FROM table_72891 WHERE "High rebounds" = 'Matt Barnes (11)' | wikisql |
CREATE TABLE table_14137 (
"Date" text,
"Opponent" text,
"Score" text,
"Record" text,
"Arena" text
) | At what arena was the September 21 game? | SELECT "Arena" FROM table_14137 WHERE "Date" = 'september 21' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
pati... | what is the average total hospital cost involving a procedure called a anticonvulsant - lamotrigine until 2104? | 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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'anticonvulsant - lamotrigine')) AND STRFTIME... | eicu |
CREATE TABLE table_10121127_1 (
australian_role VARCHAR,
un_operation_name VARCHAR
) | What is Australia's role in the UN operation Unama? | SELECT australian_role FROM table_10121127_1 WHERE un_operation_name = "UNAMA" | sql_create_context |
CREATE TABLE station (
LOCATION VARCHAR
) | Show the location with most number of train stations. | SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
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... | 患者杨星波被开出过金额不低于3838.71元的药品在哪几次医疗记录中?列出医疗就诊编号有哪些? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '杨星波' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3838.71) | css |
CREATE TABLE table_50505 (
"Year" real,
"Show" text,
"Season" text,
"Episode" text,
"Notes" text
) | What is the Episode number of Ernest Dickerson in 2009 when the show was dexter? | SELECT "Episode" FROM table_50505 WHERE "Year" = '2009' AND "Show" = 'dexter' | wikisql |
CREATE TABLE table_33644 (
"Season" real,
"Series Name" text,
"Champion" text,
"Races \u2020" text,
"Pole Positions" text,
"Wins" text,
"Podiums" text,
"Fastest Laps" text,
"Points" text,
"Margin (pts)" text
) | What is the fastest lap for a season smaller than 1979? | SELECT "Fastest Laps" FROM table_33644 WHERE "Season" < '1979' | wikisql |
CREATE TABLE table_name_27 (
gold INTEGER,
total VARCHAR,
rank VARCHAR,
silver VARCHAR
) | How many gold medals for a nation with rank less than 5, more than 0 silvers and a total of 2 medals? | SELECT AVG(gold) FROM table_name_27 WHERE rank < 5 AND silver > 0 AND total = 2 | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
... | What does Prof. Kristina Daugirdas teach ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kristina Daugirdas%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering... | advising |
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
)
... | what is the name of the diagnosis patient 32606 last was received during this year? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32606) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(C... | mimic_iii |
CREATE TABLE table_27713030_3 (
game INTEGER,
date VARCHAR
) | Which game was played on October 13? | SELECT MAX(game) FROM table_27713030_3 WHERE date = "October 13" | sql_create_context |
CREATE TABLE table_name_89 (
type VARCHAR,
transfer_window VARCHAR,
moving_from VARCHAR
) | What is the type if the transfer window is summer and the moving from category is free agent? | SELECT type FROM table_name_89 WHERE transfer_window = "summer" AND moving_from = "free agent" | sql_create_context |
CREATE TABLE table_name_20 (
games VARCHAR,
goals VARCHAR,
assists VARCHAR
) | How many games have 5 goals and less than 8 assists? | SELECT COUNT(games) FROM table_name_20 WHERE goals = 5 AND assists < 8 | sql_create_context |
CREATE TABLE table_204_838 (
id number,
"year" number,
"award" text,
"category" text,
"nominated work" text,
"result" text
) | what is the total number of awards that he has won ? | SELECT COUNT("award") FROM table_204_838 WHERE "result" = 'won' | squall |
CREATE TABLE table_57589 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | How many points were there in a year earlier than 1977, a Cosworth V8 engine, and an entry from HB Bewaking alarm systems? | SELECT "Points" FROM table_57589 WHERE "Year" < '1977' AND "Engine" = 'cosworth v8' AND "Entrant" = 'hb bewaking alarm systems' | wikisql |
CREATE TABLE table_51110 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Name the Silver which has a Bronze of 19, and a Total larger than 58? | SELECT MIN("Silver") FROM table_51110 WHERE "Bronze" = '19' AND "Total" > '58' | wikisql |
CREATE TABLE table_22801 (
"Year" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Owner(s)" text,
"Avg. Attendance" real
) | in what playoffs the league was in the semifinals | SELECT "League" FROM table_22801 WHERE "Playoffs" = 'Semifinals' | wikisql |
CREATE TABLE table_204_64 (
id number,
"place" text,
"code" number,
"area (km2)" number,
"population" number,
"most spoken language" text
) | what is the least population listed in the table ? | SELECT MIN("population") FROM table_204_64 | squall |
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... | count the number of unmarried patients admitted before the year 2179. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2179" | mimicsql_data |
CREATE TABLE table_203_201 (
id number,
"class" text,
"type" text,
"ships" text,
"displacement" text,
"note" text
) | which weights more a ut507 salvage tug or a ut515 salvage tug ? | SELECT "class" FROM table_203_201 WHERE "class" IN ('ut507 class', 'ut515 class') ORDER BY "displacement" DESC LIMIT 1 | squall |
CREATE TABLE table_name_96 (
location VARCHAR,
year VARCHAR,
competition VARCHAR,
result VARCHAR
) | What location did the team win before 1998 in the europe/africa zone, group i, round robin? | SELECT location FROM table_name_96 WHERE competition = "europe/africa zone, group i, round robin" AND result = "win" AND year < 1998 | sql_create_context |
CREATE TABLE table_2610582_2 (
branding VARCHAR,
power_kw__erp_ VARCHAR
) | How many brandings are there where the Power kW (ERP) is 1kW (29.94kW ERP)? | SELECT COUNT(branding) FROM table_2610582_2 WHERE power_kw__erp_ = "1kW (29.94kW ERP)" | sql_create_context |
CREATE TABLE table_204_979 (
id number,
"place" number,
"nation" text,
"5 hoops" text,
"3 balls,\n2 ribbons" text,
"total" number
) | tell me the only country to schore below 38 total points . | SELECT "nation" FROM table_204_979 WHERE "total" < 38 | squall |
CREATE TABLE table_50814 (
"Edition" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Opponent" text,
"Result" text
) | who is the opponent when norway is against? | SELECT "Opponent" FROM table_50814 WHERE "Against" = 'norway' | wikisql |
CREATE TABLE table_name_67 (
Id VARCHAR
) | What is the 2012 value with a 1.3 in 2010 and a 3.6 in 2008? | SELECT 2012 FROM table_name_67 WHERE 2010 = "1.3" AND 2008 = "3.6" | sql_create_context |
CREATE TABLE table_23441 (
"Episode" text,
"First broadcast" text,
"Rufus guest" text,
"Marcus guest" text,
"Winner" text
) | When was the episode 2x10 aired for the first time? | SELECT "First broadcast" FROM table_23441 WHERE "Episode" = '2x10' | wikisql |
CREATE TABLE table_30961 (
"Episode" text,
"First broadcast" text,
"Andrew and Georgies guest Lee Mack replaced Andrew Flintoff as team captain for one week in series 4, episode 2." text,
"Jamie and Johns guest" text,
"Scores" text
) | When id the episode broadcast with Mark Webber as Jamie and John's guest? | SELECT "First broadcast" FROM table_30961 WHERE "Jamie and Johns guest" = 'Mark Webber' | 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... | Find ACC_Road and the average of Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and order by the y axis in desc. | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) DESC | nvbench |
CREATE TABLE table_77081 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | WHich Score has a To par of 3, and a Country of united states? | SELECT "Score" FROM table_77081 WHERE "To par" = '–3' AND "Country" = 'united states' | wikisql |
CREATE TABLE table_17529 (
"Number" real,
"Name" text,
"Titles" text,
"Date" text,
"Opponent" text,
"Result" text,
"Defenses" real
) | How many times was pernell whitaker an opponent? | SELECT COUNT("Date") FROM table_17529 WHERE "Opponent" = 'Pernell Whitaker' | wikisql |
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 (
... | what is minimum age of patients whose language is cape and primary disease is complete heart block? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.language = "CAPE" AND demographic.diagnosis = "COMPLETE HEART BLOCK" | mimicsql_data |
CREATE TABLE addresses (
address_id number,
address_details text
)
CREATE TABLE documents_mailed (
document_id number,
mailed_to_address_id number,
mailing_date time
)
CREATE TABLE ref_shipping_agents (
shipping_agent_code text,
shipping_agent_name text,
shipping_agent_description text... | What is the shipping agent code of shipping agent UPS? | SELECT shipping_agent_code FROM ref_shipping_agents WHERE shipping_agent_name = "UPS" | spider |
CREATE TABLE table_name_39 (
lost INTEGER,
goals_for INTEGER
) | What was the lowest lost entry for a team with fewer than 21 goals for? | SELECT MIN(lost) FROM table_name_39 WHERE goals_for < 21 | sql_create_context |
CREATE TABLE table_29321 (
"Team" text,
"Outgoing head coach" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" text,
"Incoming head coach" text,
"Date of appointment" text
) | If the position in table is 10th, and the manner of departure was resigned, what was the date of vacancy? | SELECT "Date of vacancy" FROM table_29321 WHERE "Manner of departure" = 'Resigned' AND "Position in table" = '10th' | wikisql |
CREATE TABLE table_11960944_4 (
high_assists VARCHAR,
date VARCHAR
) | Who had the high assists on the date December 12? | SELECT high_assists FROM table_11960944_4 WHERE date = "December 12" | sql_create_context |
CREATE TABLE table_name_82 (
transfer_fee VARCHAR,
name VARCHAR
) | What is Odjidja-Ofoe's transfer fee? | SELECT transfer_fee FROM table_name_82 WHERE name = "odjidja-ofoe" | sql_create_context |
CREATE TABLE table_name_12 (
game INTEGER,
march VARCHAR
) | what is the game when march is 15? | SELECT SUM(game) FROM table_name_12 WHERE march = 15 | sql_create_context |
CREATE TABLE table_train_149 (
"id" int,
"prostate_specific_antigen_psa" float,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"fasting_serum_glucose" int,
"vitamin_d" int,
"NOUSE" float
) | prostate specific antigen > 4 ng / ml | SELECT * FROM table_train_149 WHERE prostate_specific_antigen_psa > 4 | criteria2sql |
CREATE TABLE table_12304 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Tie no of the game with a Score of 1 1? | SELECT "Tie no" FROM table_12304 WHERE "Score" = '1–1' | wikisql |
CREATE TABLE table_train_243 (
"id" int,
"c_peptide_level" float,
"finger_stick_measurements" bool,
"diabetic" string,
"fasting_blood_glucose_fbg" float,
"hypoglycemia" bool,
"insulin_requirement" float,
"triglyceride_tg" float,
"a1c" float,
"age" float,
"NOUSE" float
) | history of severe hypoglycemia | SELECT * FROM table_train_243 WHERE hypoglycemia = 1 | criteria2sql |
CREATE TABLE STUDENT (
Major VARCHAR
) | Report all majors that have less than 3 students. | SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3 | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | when patient 49141 did get a lab test the first time during their first hospital visit? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49141 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Visualize a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, and order by the ACC_Road in asc. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road | nvbench |
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,
... | specify the primary disease and icd9 code of patient id 2110 | SELECT demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2110" | 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 ... | has patient 82132 received an anion gap test during the current hospital encounter? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_63751 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What's Australia's time in the heat more than 4? | SELECT "Time" FROM table_63751 WHERE "Heat" > '4' AND "Nationality" = 'australia' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar... | What classes this semester are a prerequisite to most other classes ? | SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester... | advising |
CREATE TABLE table_79629 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | What is the Loss of the game at Nationwide Arena with a Score of 4 3? | SELECT "Loss" FROM table_79629 WHERE "Score" = '4–3' AND "Arena" = 'nationwide arena' | wikisql |
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 Hispanic or Latino/Puerto Rican patients with the item id 51214? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "51214" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime tim... | how did patient 8204 go into the hospital the first time. | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8204 ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_21 (
date VARCHAR,
status VARCHAR,
against VARCHAR
) | What date has a status of 1995 rugby world cup and an against of 20? | SELECT date FROM table_name_21 WHERE status = "1995 rugby world cup" AND against = 20 | sql_create_context |
CREATE TABLE table_name_98 (
total VARCHAR,
silver VARCHAR,
bronze VARCHAR,
rank VARCHAR
) | What is the total for the team with fewer than 2 bronze, ranked less than 4 and fewer than 1 silver? | SELECT COUNT(total) FROM table_name_98 WHERE bronze < 2 AND rank < 4 AND silver < 1 | sql_create_context |
CREATE TABLE table_53229 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What company built the car driven by Tony Brooks? | SELECT "Constructor" FROM table_53229 WHERE "Driver" = 'tony brooks' | wikisql |
CREATE TABLE table_203_519 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | which canadian driver finished first : alex tagliani or paul tracy ? | SELECT "driver" FROM table_203_519 WHERE "driver" IN ('alex tagliani', 'paul tracy') ORDER BY "pos" LIMIT 1 | squall |
CREATE TABLE table_51657 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text
) | What is the ID of marshall landfill on 09/08/1983? | SELECT "CERCLIS ID" FROM table_51657 WHERE "Listed" = '09/08/1983' AND "Name" = 'marshall landfill' | wikisql |
CREATE TABLE table_204_792 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text
) | what is the total number of dates ? | SELECT COUNT("date") FROM table_204_792 | squall |
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | tell me the difference between the total output of patient 1489 and the total input since 07/28/2102. | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1489)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2102-07-28') - (SELE... | mimic_iii |
CREATE TABLE table_65283 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Total Apps" text,
"Total Goals" real
) | what is the total apps when the league apps is 4 (2)? | SELECT "Total Apps" FROM table_65283 WHERE "League Apps" = '4 (2)' | wikisql |
CREATE TABLE table_14903627_1 (
mixed_doubles VARCHAR,
womens_singles VARCHAR
) | WHAT IS THE NAME OF THE MIXED DOUBLES PLAYER WHEN THE WOMENS SINGLE PLAYER IS KAIRI VIILUP? | SELECT mixed_doubles FROM table_14903627_1 WHERE womens_singles = "Kairi Viilup" | sql_create_context |
CREATE TABLE table_name_71 (
score VARCHAR,
tournament VARCHAR
) | For the gte northwest classic with the score of 207 (-9), what is the average 1st prize ($) | SELECT AVG(1 AS st_prize__) AS $__ FROM table_name_71 WHERE score = "207 (-9)" AND tournament = "gte northwest classic" | sql_create_context |
CREATE TABLE table_name_17 (
csa_4_16_09 VARCHAR,
opinionway_4_17_09 VARCHAR
) | Name the csa 4/16/09 for opinionway being 4/17/09 of 12% | SELECT csa_4_16_09 FROM table_name_17 WHERE opinionway_4_17_09 = "12%" | sql_create_context |
CREATE TABLE table_18095719_2 (
winning_team VARCHAR,
circuit VARCHAR
) | Who was the winning team on the circuit Zolder? | SELECT winning_team FROM table_18095719_2 WHERE circuit = "Zolder" | sql_create_context |
CREATE TABLE table_name_74 (
singapore_gross VARCHAR,
title VARCHAR
) | What is the Singapore Gross with a Title that is 2000? | SELECT singapore_gross FROM table_name_74 WHERE title = "2000" | sql_create_context |
CREATE TABLE table_25342713_5 (
blocks INTEGER,
steals VARCHAR
) | If the Steals are 20, what are the blocks? | SELECT MAX(blocks) FROM table_25342713_5 WHERE steals = 20 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | how many days has it been since the first time ipratropium-albuterol 0.5 mg-3 mg(2.5 mg base)/3 ml inhl neb soln was prescribed during their current hospital encounter to patient 022-6959? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-695... | eicu |
CREATE TABLE WINE (
Name VARCHAR,
YEAR INTEGER,
Winery VARCHAR
) | What are the names of wines whose production year are before the year of all wines by Brander winery? | SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = "Brander") | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varcha... | i want to fly from BOSTON to ATLANTA i would like the cheapest fare please | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
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... | 在18年2月11日至18年6月8日内所有检验报告单中的标本采集部位患者78981064的是都在哪? | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '78981064' AND jybgb.BGRQ BETWEEN '2018-02-11' AND '2018-06-08' UNI... | css |
CREATE TABLE zyb (
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... | 患者苗星河从00年7月11日到17年6月2日这段时间,在医疗机构0680435开的西药为多少? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND qtb.MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN... | css |
CREATE TABLE table_name_31 (
nation VARCHAR,
gold VARCHAR,
total VARCHAR
) | What is the nation that had more than 1 gold medal and a total of 62 medals? | SELECT nation FROM table_name_31 WHERE gold > 1 AND total = 62 | sql_create_context |
CREATE TABLE table_75867 (
"Round" text,
"Opposition" text,
"First leg" text,
"Second leg" text,
"Aggregate score" text
) | Who were the opposition in the quarter-final? | SELECT "Opposition" FROM table_75867 WHERE "Round" = 'quarter-final' | wikisql |
CREATE TABLE table_13805432_2 (
highest_position INTEGER,
artist VARCHAR
) | what is the minimum highest position with artbeingt being paul evans | SELECT MIN(highest_position) FROM table_13805432_2 WHERE artist = "Paul Evans" | sql_create_context |
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... | 罗列出从00年10月18日到2005年2月27日内患者04312120所有检验结果指标记录的检测人为孙幼安的检验指标流水序号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.YLJ... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.