context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | provide the number of patients whose age is less than 61 and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
... | A bar chart for what are the number of the names of all races held between 2009 and 2011?, and could you show from low to high by the bar? | SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY name | nvbench |
CREATE TABLE table_16437 (
"Pilot car No." real,
"Colour" text,
"Serial No." text,
"Engine No." real,
"Registration No." text
) | What is the number of colour with the regisration number of mg-509? | SELECT COUNT("Colour") FROM table_16437 WHERE "Registration No." = 'MG-509' | wikisql |
CREATE TABLE table_name_44 (
entrant VARCHAR,
engine VARCHAR,
points VARCHAR
) | Which Entrant has an Engine of climax straight-4, and Points larger than 0? | SELECT entrant FROM table_name_44 WHERE engine = "climax straight-4" AND points > 0 | sql_create_context |
CREATE TABLE table_name_14 (
source VARCHAR,
type VARCHAR,
nat VARCHAR
) | WHAT IS THE SOURCE WITH A TYPE OF TRANSFER AND MEX? | SELECT source FROM table_name_14 WHERE type = "transfer" AND nat = "mex" | sql_create_context |
CREATE TABLE table_1342292_2 (
party VARCHAR,
incumbent VARCHAR
) | what's the party with incumbent being john sparkman | SELECT party FROM table_1342292_2 WHERE incumbent = "John Sparkman" | sql_create_context |
CREATE TABLE table_name_19 (
score VARCHAR,
h_a_n VARCHAR,
date VARCHAR
) | What was the score of the game played on December 17, with a H/A/N of H? | SELECT score FROM table_name_19 WHERE h_a_n = "h" AND date = "december 17" | sql_create_context |
CREATE TABLE table_10552 (
"Name" text,
"Number" text,
"Builder" text,
"Date built" text,
"Wheel arrangement" text,
"Driving wheels" text,
"Cylinders" text,
"Boiler pressure" text,
"Notes" text
) | What is the boiler pressure for the Hesperus model? | SELECT "Boiler pressure" FROM table_10552 WHERE "Name" = 'hesperus' | wikisql |
CREATE TABLE table_25042332_26 (
solar_panel VARCHAR,
region VARCHAR
) | What is atacama's percentage of solar panels? | SELECT solar_panel FROM table_25042332_26 WHERE region = "Atacama" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | calculate how many times patient 022-78423 has had a hct test in the lab this month. | 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 = '022-78423')) AND lab.labname = 'hct' AND DATETIME(lab.labresulttime, 'start of month') = DAT... | eicu |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comme... | Comments containing string1 but not string2, string3. | SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##string1?\ve##%' AND NOT (Text LIKE '%##string2?\vec##%') AND NOT (Text LIKE '%##string3?\vert##%') ORDER BY CreationDate DESC | sede |
CREATE TABLE table_49704 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What date was the match where Daniel Gimeno-Traver's partner was pere riba? | SELECT "Date" FROM table_49704 WHERE "Partner" = 'pere riba' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | average first score if body contains ' downvot'. | SELECT SUM(p.Score) AS total, COUNT(p.Score) AS num_questions, (SUM(p.Score) * 1.0) / COUNT(p.Score) AS ave FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id LEFT JOIN (SELECT u.Id AS u_id, MIN(p.Id) AS min_pid FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY u.Id) AS mp ON mp.u_id = u.I... | sede |
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
) | Which company was started by the entrepreneur with the greatest height? | SELECT T1.company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T2.height DESC LIMIT 1 | spider |
CREATE TABLE table_12104 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | What date was the name Coppa Acerbo? | SELECT "Date" FROM table_12104 WHERE "Name" = 'coppa acerbo' | 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 ... | how many days have elapsed since patient 12775 was admitted to hospital for? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE Faculty (
facID VARCHAR,
fname VARCHAR,
lname VARCHAR
)
CREATE TABLE Activity (
activity_name VARCHAR,
actid VARCHAR
)
CREATE TABLE Faculty_participates_in (
facID VARCHAR,
actid VARCHAR
) | Show the names of all the activities Mark Giuliano participates in. | SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" | sql_create_context |
CREATE TABLE table_48057 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Gold has a Nation of india, and a Bronze smaller than 0? | SELECT AVG("Gold") FROM table_48057 WHERE "Nation" = 'india' AND "Bronze" < '0' | wikisql |
CREATE TABLE table_61316 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | WHAT IS THE HOME TEAM WITH AN AWAY OF LEYTON ORIENT? | SELECT "Home team" FROM table_61316 WHERE "Away team" = 'leyton orient' | wikisql |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | What are the dates with a maximum temperature higher than 85, and count them by a bar chart, sort by the the number of date in descending please. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) DESC | nvbench |
CREATE TABLE table_32702 (
"Dance" text,
"Best dancer(s)" text,
"Highest score" real,
"Worst dancer(s)" text,
"Lowest score" real
) | What is the Dance with the Highest score under 30 and Stacy Keibler as the Best dancer(s)? | SELECT "Dance" FROM table_32702 WHERE "Highest score" < '30' AND "Best dancer(s)" = 'stacy keibler' | wikisql |
CREATE TABLE table_15013825_8 (
recopa_sudamericana_1992 VARCHAR,
team VARCHAR,
copa_libertadores_1992 VARCHAR,
copa_conmebol_1992 VARCHAR
) | Name the recopa sudamericana 1992 for did not qualify for libertadores 1992 and round of 16 for bragantino | SELECT recopa_sudamericana_1992 FROM table_15013825_8 WHERE copa_libertadores_1992 = "Did not qualify" AND copa_conmebol_1992 = "Round of 16" AND team = "Bragantino" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give me the number of patients whose year of birth is less than 2056 and drug route is sl? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2056" AND prescriptions.route = "SL" | 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 ... | tell me the total amount of d5w patient 25590 received on 02/12/this year? | 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 = 25590)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE table_57283 (
"Last" text,
"First" text,
"Year" real,
"Sport" text,
"Country" text
) | Name the sport for puerto rico and year of 2000 | SELECT "Sport" FROM table_57283 WHERE "Country" = 'puerto rico' AND "Year" = '2000' | wikisql |
CREATE TABLE table_name_97 (
crowd INTEGER,
venue VARCHAR
) | What is the average crowd size for princes park? | SELECT AVG(crowd) FROM table_name_97 WHERE venue = "princes park" | sql_create_context |
CREATE TABLE table_203_142 (
id number,
"pos" text,
"no" number,
"rider" text,
"bike" text,
"laps" number,
"time" text,
"grid" number,
"points" number
) | who rides a bike that is the same as troy bayliss ' bike ? | SELECT "rider" FROM table_203_142 WHERE "rider" <> 'troy bayliss' AND "bike" = (SELECT "bike" FROM table_203_142 WHERE "rider" = 'troy bayliss') | squall |
CREATE TABLE table_67296 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
) | What is the Name, when the Transfer fee is 'loan'? | SELECT "Name" FROM table_67296 WHERE "Transfer fee" = 'loan' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 参保人02480290的门诊检查在2000年4月19日到2001年4月10日之间一共花了多少钱? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '02480290' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-04-19' AND '2001-04-10' AND t_kc22.MED_I... | css |
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... | 根据科室编码和入院诊断疾病编码的不同看看医院8056118全部诊疗记录中大病支付和全部医疗费用的比值最小有多少 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '8056118' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DI... | css |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | For each room, find its name and the number of times reservations were made for it, you can use the data to draw a bar chart, list by the roomName from low to high. | SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY roomName | nvbench |
CREATE TABLE table_name_8 (
points INTEGER,
entrant VARCHAR
) | What are the highest number of points with an Entrant of warsteiner brewery? | SELECT MAX(points) FROM table_name_8 WHERE entrant = "warsteiner brewery" | sql_create_context |
CREATE TABLE table_204_383 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | only nation to earn exactly five total medals | SELECT "nation" FROM table_204_383 WHERE "total" = 5 | squall |
CREATE TABLE table_204_903 (
id number,
"title" text,
"character" text,
"broadcaster" text,
"episodes" number,
"date" number
) | how many titles only had one episode ? | SELECT COUNT("title") FROM table_204_903 WHERE "episodes" = 1 | squall |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | what was the top three diagnosis with the highest five year mortality rate? | SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 10... | eicu |
CREATE TABLE table_33966 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Oklahoma State produced a player in which position in the draft? | SELECT "Position" FROM table_33966 WHERE "School/Club Team" = 'oklahoma state' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 在10年11月1日开始到2013年3月9日结束小儿皮肤的内厄贝沙坦片(薄膜衣)的开药量是多少? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '小儿皮肤科' AND t_kc22.STA_DATE BETWEEN '2010-11-01' AND '2013-03-09' AND t_kc22.SOC_SRT_DIRE_NM = '厄贝沙坦片(薄膜衣)' | css |
CREATE TABLE table_33327 (
"Country" text,
"Area (km\u00b2) 2010" text,
"Population 2011" text,
"GDP (PPP) ( Intl. $ ) 2011" text,
"GDP (PPP) per capita ( Intl. $ ) 2011" text,
"Income inequality 1994\u20132011 (latest available)" text,
"HDI 2011" text,
"FSI 2012" text,
"CPI 2011" te... | What country has an IEF 2011 of 45.3? | SELECT "Country" FROM table_33327 WHERE "IEF 2011" = '45.3' | wikisql |
CREATE TABLE table_name_5 (
field_stability VARCHAR,
agent VARCHAR,
effectiveness_as_blood_agent VARCHAR
) | What is the field stability of Cyanogen Bromide that has an effectiveness of 9? | SELECT COUNT(field_stability) FROM table_name_5 WHERE agent = "cyanogen bromide" AND effectiveness_as_blood_agent > 9 | sql_create_context |
CREATE TABLE table_name_31 (
team VARCHAR,
location_attendance VARCHAR,
series VARCHAR
) | what is the team when the location attendace is boston garden and the series is 0-1? | SELECT team FROM table_name_31 WHERE location_attendance = "boston garden" AND series = "0-1" | sql_create_context |
CREATE TABLE table_19335 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall WC points (Rank)" text
) | How many full names are provided for the jumper whose 2nd jump was 96.0m? | SELECT COUNT("Name") FROM table_19335 WHERE "2nd (m)" = '96.0' | wikisql |
CREATE TABLE table_46425 (
"Finished" real,
"Time/ Behind" text,
"Post" real,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Owner" text
) | What is the lowest Finished, when Post is less than 2? | SELECT MIN("Finished") FROM table_46425 WHERE "Post" < '2' | 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 ... | what was the total amount of output for patient 25814 since 775 days ago? | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814)) AND DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-775 day') | mimic_iii |
CREATE TABLE table_1140119_5 (
winning_driver VARCHAR,
circuit VARCHAR
) | Who won the race at the Jersey circuit? | SELECT winning_driver FROM table_1140119_5 WHERE circuit = "Jersey" | sql_create_context |
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 hz_info (
KH text,
KLX number... | 门诊诊断为检测指标976714谵妄的病患的数值的平均值是多少?最值是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ... | css |
CREATE TABLE table_name_29 (
position VARCHAR,
notes VARCHAR,
year VARCHAR
) | What position had notes of 20km and a year earlier than 2002? | SELECT position FROM table_name_29 WHERE notes = "20km" AND year < 2002 | sql_create_context |
CREATE TABLE table_name_68 (
country_state VARCHAR,
location VARCHAR,
year VARCHAR
) | Which country had des moines as the location in 2011? | SELECT country_state FROM table_name_68 WHERE location = "des moines" AND year = 2011 | sql_create_context |
CREATE TABLE table_58234 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the Home team at the Western Oval location? | SELECT "Home team" FROM table_58234 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_train_50 (
"id" int,
"raynaud_syndrome" bool,
"active_infection" bool,
"antibiotic_treatment" bool,
"receiving_vasopressor" bool,
"sepsis" bool,
"vasospastic_diathesis" bool,
"organ_failure" bool,
"septic_shock" bool,
"NOUSE" float
) | patient treated with an empirical antibiotic treatment, | SELECT * FROM table_train_50 WHERE antibiotic_treatment = 1 | criteria2sql |
CREATE TABLE all_documents (
document_id number,
date_stored time,
document_type_code text,
document_name text,
document_description text,
other_details text
)
CREATE TABLE document_locations (
document_id number,
location_code text,
date_in_location_from time,
date_in_locaton_t... | Find the name and description of the role with code 'MG'. | SELECT role_name, role_description FROM roles WHERE role_code = "MG" | spider |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 73475341244在医疗就诊期间有哪些异地结算的费用明细项目? | SELECT MED_EXP_DET_ID FROM t_kc22 WHERE MED_CLINIC_ID = '73475341244' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_204_125 (
id number,
"state" text,
"type" text,
"name" text,
"title" text,
"royal house" text,
"from" text,
"to" text
) | how many states are on the chart ? | SELECT COUNT("state") FROM table_204_125 | squall |
CREATE TABLE table_53201 (
"MLB season" text,
"Reds season" real,
"League" text,
"Division" text,
"Finish" text,
"Wins" real,
"Losses" real,
"Win%" real,
"GB [c ]" text
) | How many wins were there in the 2000 season in the central division with less than 81 losses? | SELECT AVG("Wins") FROM table_53201 WHERE "Division" = 'central' AND "Reds season" < '2000' AND "Losses" < '81' | wikisql |
CREATE TABLE table_1965650_4 (
nationality VARCHAR,
college_junior_club_team VARCHAR
) | What's the nationality of the player coming from Edmonton Oil Kings (WCHL)? | SELECT nationality FROM table_1965650_4 WHERE college_junior_club_team = "Edmonton Oil Kings (WCHL)" | sql_create_context |
CREATE TABLE table_19778010_5 (
high_rebounds VARCHAR,
high_assists VARCHAR
) | Who did the high rebounds in the game in which five players (3) did the high assists? | SELECT high_rebounds FROM table_19778010_5 WHERE high_assists = "Five Players (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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | count the number of patients who have received a microbiology test for rapid respiratory viral screen & culture since 2104. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'rapid respiratory viral screen & culture' AND STRFTIME('%y', microbiologyevents.charttime) >= '2104') | mimic_iii |
CREATE TABLE table_21074 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | At what latitude can the name origin of yuzut-arkh fossae be found? | SELECT "Latitude" FROM table_21074 WHERE "Name" = 'Yuzut-Arkh Fossae' | wikisql |
CREATE TABLE ROYAL_FAMILY (
Royal_Family_Details VARCHAR,
Royal_Family_ID VARCHAR
)
CREATE TABLE TOURIST_ATTRACTIONS (
How_to_Get_There VARCHAR,
Tourist_Attraction_ID VARCHAR
) | What are the details and ways to get to tourist attractions related to royal family? | SELECT T1.Royal_Family_Details, T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID | sql_create_context |
CREATE TABLE table_38977 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Game has an Opponent of @ pittsburgh penguins? | SELECT MAX("Game") FROM table_38977 WHERE "Opponent" = '@ pittsburgh penguins' | wikisql |
CREATE TABLE table_13078 (
"Helium" text,
"Neon" text,
"Argon" text,
"Krypton" text,
"Xenon" text,
"Radon" text
) | Wha argon has helium of 1.0000684? | SELECT "Argon" FROM table_13078 WHERE "Helium" = '1.0000684' | wikisql |
CREATE TABLE table_11803648_22 (
position VARCHAR,
player VARCHAR
) | What is the position of player Marcus Hogberg? | SELECT position FROM table_11803648_22 WHERE player = "Marcus Hogberg" | sql_create_context |
CREATE TABLE table_name_74 (
title VARCHAR,
japan VARCHAR
) | Tell me the title of japan january 31, 2008 | SELECT title FROM table_name_74 WHERE japan = "january 31, 2008" | sql_create_context |
CREATE TABLE table_18760137_2 (
_number_s_dam_and_gnis_query_link INTEGER,
borough_or_census_area VARCHAR
) | Name the most numbers dam and gnis query link for borough or census area for fairbanks north star | SELECT MAX(_number_s_dam_and_gnis_query_link) FROM table_18760137_2 WHERE borough_or_census_area = "Fairbanks North Star" | sql_create_context |
CREATE TABLE table_name_14 (
time_retired VARCHAR,
driver VARCHAR
) | What is the Time/Retired for emerson fittipaldi? | SELECT time_retired FROM table_name_14 WHERE driver = "emerson fittipaldi" | sql_create_context |
CREATE TABLE table_11087 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What grid has a Time/Retired of +5 laps? | SELECT "Grid" FROM table_11087 WHERE "Time/Retired" = '+5 laps' | wikisql |
CREATE TABLE table_name_12 (
year INTEGER,
regular_season VARCHAR,
division VARCHAR
) | Which Year is the lowest one that has a Regular Season of 5th, atlantic, and a Division larger than 4? | SELECT MIN(year) FROM table_name_12 WHERE regular_season = "5th, atlantic" AND division > 4 | sql_create_context |
CREATE TABLE table_12983 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | Which 2nd Party has a Election of 1857? | SELECT "2nd Party" FROM table_12983 WHERE "Election" = '1857' | wikisql |
CREATE TABLE table_23465864_5 (
mon_24_aug VARCHAR,
fri_28_aug VARCHAR
) | What is every value for Monday August 24 if Friday August 28 is 23' 22.25 96.864mph? | SELECT mon_24_aug FROM table_23465864_5 WHERE fri_28_aug = "23' 22.25 96.864mph" | 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... | 钱梦菲患者金额不低于7537.13元的药品在哪几次医疗记录中被开出过?医疗就诊编号分别是什么? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '钱梦菲' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7537.13) | css |
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 posses government insurance and are tested for thyroid stimulating hormone in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Thyroid Stimulating Hormone" | mimicsql_data |
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 prescription... | provide the number of patients whose diagnoses short title is anxiety state nos and drug route is dwell? | 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.short_title = "Anxiety state NOS" AND prescriptions.route = "DWELL" | mimicsql_data |
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... | 患者华安然开出的药品在哪几次医疗记录中均超过1404.19元?他的医疗就诊编号都是多少啊? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '华安然' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1404.19) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '华安然' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUN... | css |
CREATE TABLE table_17257687_1 (
episode_number VARCHAR,
event_4 VARCHAR,
event_1 VARCHAR
) | On which episode number is event 4 The Wall and event 1 the Pendulum? | SELECT COUNT(episode_number) FROM table_17257687_1 WHERE event_4 = "The Wall" AND event_1 = "Pendulum" | sql_create_context |
CREATE TABLE table_53316 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team's score when st kilda is away? | SELECT "Home team score" FROM table_53316 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE table_20938922_2 (
touchdowns VARCHAR,
yards VARCHAR
) | The player who had 145 yards had how many touchdowns? | SELECT COUNT(touchdowns) FROM table_20938922_2 WHERE yards = 145 | sql_create_context |
CREATE TABLE table_name_96 (
wins VARCHAR,
ballarat_fl VARCHAR,
against VARCHAR
) | What is the total number of wins for Darley of Ballarat FL against larger than 1055? | SELECT COUNT(wins) FROM table_name_96 WHERE ballarat_fl = "darley" AND against > 1055 | 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,
... | 60676464号病人的检验报告单对应的检验结果指标均异常的检验报告单号有哪些 | SELECT jybgb.BGDH 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 = '60676464' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
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,
... | what was patient 017-73567's weight the last time? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-73567') AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
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... | 自二零一三年十二月二十五日开始,截止到二零二一年十二月十四日,患者严美丽通过医保看病总共花了多少医疗费 | SELECT SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '严美丽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-12-25' AND '2021-12-14' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE... | css |
CREATE TABLE table_203_108 (
id number,
"kilometers" number,
"name" text,
"location" text,
"intersecting routes" text
) | how many sections intersect highway 2 ? | SELECT COUNT("name") FROM table_203_108 WHERE "intersecting routes" = 'highway 2' | squall |
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 ... | until 2103 what were the top three most frequently prescribed medications to patients within 2 months after the prescription of oxacillin? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'oxacillin' AND STRFTIME('%y', prescriptions.startdate) <= '2103')... | mimic_iii |
CREATE TABLE table_204_42 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
) | in what year did ifk receive their best finish ? | SELECT "season" FROM table_204_42 ORDER BY "position" LIMIT 1 | squall |
CREATE TABLE table_name_69 (
points VARCHAR,
rank VARCHAR,
places VARCHAR
) | what is the points when the rank is more than 1 and the places is 33? | SELECT points FROM table_name_69 WHERE rank > 1 AND places = 33 | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when did patient 016-18575 have a urine catheter output for the last time on the current intensive care unit visit? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575') AND patient.unitdischargetime IS NULL) AN... | eicu |
CREATE TABLE table_17427004_7 (
round_of_32 VARCHAR,
athlete VARCHAR
) | Who did Nabil Kassel face in the Round of 32? | SELECT round_of_32 FROM table_17427004_7 WHERE athlete = "Nabil Kassel" | 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... | give me the number of patients whose diagnoses short title is diaphragmatic hernia 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.short_title = "Diaphragmatic hernia" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_27345 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. Viewers (in millions)" text
) | How many directors directed the episode titled 'Incoming'? | SELECT COUNT("Directed by") FROM table_27345 WHERE "Title" = 'Incoming' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose age is less than 20 and lab test name is mchc? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "20" AND lab.label = "MCHC" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | provide the number of patients whose diagnoses long title is shock, unspecified and drug route is buccal? | 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.long_title = "Shock, unspecified" AND prescriptions.route = "BUCCAL" | mimicsql_data |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | For each room, find its name and the number of times reservations were made for it, you can use the data to draw a bar chart, could you display by the the total number in desc please? | SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_77 (
right_ascension___j2000__ VARCHAR,
apparent_magnitude VARCHAR
) | what is the right ascension (j2000) when the apparent magnitude is 13? | SELECT right_ascension___j2000__ FROM table_name_77 WHERE apparent_magnitude = 13 | sql_create_context |
CREATE TABLE table_name_4 (
callsign VARCHAR,
iata VARCHAR
) | Which Callsign has an IATA of tr? | SELECT callsign FROM table_name_4 WHERE iata = "tr" | sql_create_context |
CREATE TABLE table_10991 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which venue had an away team that scored 13.8 (86)? | SELECT "Venue" FROM table_10991 WHERE "Away team score" = '13.8 (86)' | 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... | 在医院3289603出院的病人蒋红叶诊断的病名不包含2的医疗就诊记录编码具体是啥? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '蒋红叶' AND t_kc21.MED_SER_ORG_NO = '3289603' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%2%' | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | how many of the patients with ruq pain had icd9 code 8852? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "RUQ PAIN" AND procedures.icd9_code = "8852" | mimicsql_data |
CREATE TABLE table_71247 (
"Year" text,
"Games Played" real,
"Games Started" real,
"Attempts" real,
"Yards" real,
"Touchdowns" real,
"Receptions" real,
"Rec. Yards" real,
"Rec. Touchdowns" real,
"Fumbles" real
) | What are the highest number of games played that had game starts of 10, receptions of 6 and fumbles smaller than 3? | SELECT MAX("Games Played") FROM table_71247 WHERE "Receptions" = '6' AND "Games Started" = '10' AND "Fumbles" < '3' | wikisql |
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... | Find All_Home and the average of Team_ID , and group by attribute All_Home, and visualize them by a bar chart, I want to display from high to low by the x axis. | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE table_54996 (
"Round" real,
"Race Title" text,
"Grand Prix" text,
"Circuit" text,
"Date" text
) | When did the Grand Prix de Monaco race? | SELECT "Date" FROM table_54996 WHERE "Race Title" = 'grand prix de monaco' | wikisql |
CREATE TABLE table_49329 (
"Name" text,
"Built" text,
"Listed" text,
"Location" text,
"County" text
) | When was la vista built? | SELECT "Built" FROM table_49329 WHERE "Location" = 'la vista' | wikisql |
CREATE TABLE table_2357201_1 (
open_cup VARCHAR,
year VARCHAR
) | How did Cleveland do in the Open Cup in 2009? | SELECT open_cup FROM table_2357201_1 WHERE year = 2009 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.