context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 marital status is divorced and drug route is td? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "TD" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | what was the five most frequent drugs that were prescribed to the septic shock - cultures pending male patients aged in the 60 or above within the same month after they had been diagnosed with septic shock - cultures pending in 2103? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock - cultures pending' AND STRFTIME('%y'... | eicu |
CREATE TABLE table_name_77 (
ifls___uifls VARCHAR,
model VARCHAR
) | For Model e12 what is the IFLs/uIFLs? | SELECT ifls___uifls FROM table_name_77 WHERE model = "e12" | sql_create_context |
CREATE TABLE table_name_95 (
points INTEGER,
year INTEGER
) | Name the sum of points for 1984 | SELECT SUM(points) FROM table_name_95 WHERE year < 1984 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
... | just show me the top five most common diagnoses until 2103? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2103' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_22905641_2 (
race_3_winner VARCHAR,
race_2_winner VARCHAR
) | How many race 3 winners were there when Mitch Evans won race 2? | SELECT COUNT(race_3_winner) FROM table_22905641_2 WHERE race_2_winner = "Mitch Evans" | sql_create_context |
CREATE TABLE table_76705 (
"Year" real,
"Artist" text,
"Title" text,
"Label" text,
"Type" text
) | which Type has a Title of so alive? | SELECT "Type" FROM table_76705 WHERE "Title" = 'so alive' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the number of patients whose admission location is phys referral/normal deli and drug name is bupropion (sustained release)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "BuPROPion (Sustained Release)" | mimicsql_data |
CREATE TABLE table_20745444_1 (
game INTEGER,
opponent VARCHAR
) | How many games were against Furman? | SELECT MAX(game) FROM table_20745444_1 WHERE opponent = "Furman" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart, could you order in ascending by the X-axis please? | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_204_926 (
id number,
"#" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | which player comes below murle breer | SELECT "player" FROM table_204_926 WHERE "#" = (SELECT "#" FROM table_204_926 WHERE "player" = 'murle breer') + 1 | squall |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 在01-12-24到12-01-09期间内,把患者奚欣嘉所有检验结果指标记录中的检测方法给列出来 | (SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_name_80 (
attendance INTEGER,
date VARCHAR
) | What was the highest attendance on November 12, 1989? | SELECT MAX(attendance) FROM table_name_80 WHERE date = "november 12, 1989" | sql_create_context |
CREATE TABLE table_name_51 (
original_nfl_team VARCHAR,
college VARCHAR,
pos VARCHAR
) | What is the original NFL team of the College of Oregon DT Player? | SELECT original_nfl_team FROM table_name_51 WHERE college = "oregon" AND pos = "dt" | sql_create_context |
CREATE TABLE table_10256 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
) | What is the sum of the lowest in attendance when the most attendance was 4,914 for the Livingston team? | SELECT SUM("Lowest") FROM table_10256 WHERE "Highest" < '4,914' AND "Team" = 'livingston' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | how many patients was given glucose - d50 until 3 years ago for two times? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'glucose - d50' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year')) GROUP BY pati... | eicu |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
... | People who I've accepted the most answers from. | SELECT a.OwnerUserId AS "user_link", COUNT(*) AS "answers_accepted" FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.OwnerUserId = 1238040 GROUP BY a.OwnerUserId ORDER BY 'answers_accepted' DESC | sede |
CREATE TABLE table_name_22 (
population INTEGER,
rank VARCHAR,
altitude__mslm_ VARCHAR,
density__inhabitants_km_2__ VARCHAR
) | Which Population has an Altitude (mslm) larger than 98, and a Density (inhabitants/km 2) larger than 5869, and a Rank of 1st? | SELECT SUM(population) FROM table_name_22 WHERE altitude__mslm_ > 98 AND density__inhabitants_km_2__ > 5869 AND rank = "1st" | sql_create_context |
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
... | Give me line charts of worldwide gross the number of season over year season by major genres Away_team | SELECT Season, COUNT(Season) FROM game GROUP BY Away_team, Season | nvbench |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TA... | Response Average First Answer Time. | WITH firstquery AS (SELECT t.TagName, p.Id, MIN(CAST((JULIANDAY(CreationDate) - JULIANDAY(p.CreationDate)) * 1440.0 AS INT)) AS TimeTakenPerPost FROM Posts AS p JOIN Posts AS p2 ON p2.ParentId = p.Id JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE p.PostTypeId = 1 AND p2.PostTypeId = 2 A... | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
... | what difference in weight was there in patient 25461 last measured on the first hospital visit compared to the first value measured on the first hospital visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25461 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev... | mimic_iii |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 在医院3985817全部医疗记录中参照科室的不同与出院诊断的差异算出患者年龄的平均数,把里面平均值超过23岁的记录留下来 | SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '3985817' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM HAVING AVG(PERSON_AGE) > 23 | css |
CREATE TABLE table_29295463_9 (
semifinalists VARCHAR,
champion VARCHAR
) | Who were the semifinalists in the tournament where Mats Wilander 7-6, 6-3 was declared the champion? | SELECT semifinalists FROM table_29295463_9 WHERE champion = "Mats Wilander 7-6, 6-3" | sql_create_context |
CREATE TABLE table_train_129 (
"id" int,
"cerebral_neoplasia" bool,
"gender" string,
"mini_mental_state_examination_mmse" int,
"multiple_lacunar_infarcts" bool,
"neurodegenerative_disease" bool,
"mri_abnormality" bool,
"nervous_system_functioning" bool,
"head_injury" bool,
"serio... | history of seizure or head trauma with disturbance of consciousness within the past two years | SELECT * FROM table_train_129 WHERE seizure_disorder = 1 OR head_injury = 1 OR disturbance_of_consciousness = 1 | criteria2sql |
CREATE TABLE table_47191 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is Competition, when Date is '1999-08-07'? | SELECT "Competition" FROM table_47191 WHERE "Date" = '1999-08-07' | wikisql |
CREATE TABLE table_name_82 (
losses INTEGER,
wins VARCHAR,
win__percentage VARCHAR
) | What is the high loss total for players with zero wins and a win % greater than 0? | SELECT MAX(losses) FROM table_name_82 WHERE wins = 0 AND win__percentage > 0 | sql_create_context |
CREATE TABLE table_32235 (
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text,
"Tenant" text,
"Opening" real
) | Timsah arena is in what country? | SELECT "Country" FROM table_32235 WHERE "Stadium" = 'timsah arena' | wikisql |
CREATE TABLE table_train_54 (
"id" int,
"organ_transplantation" bool,
"severe_sepsis" bool,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"thrombocytopenia" float,
"sepsis" bool,
"hypotension" bool,
"burn_injury" int,
"septic_shock" bool,
"age" float,
"NOUSE" f... | all patients age greater than 18 years who meet criteria of sepsis. septic shock will be defined as those patients with severe sepsis and persistent hypotension ( < 90 mmhg systolic blood pressure ) despite a fluid challenge of at least 20 cc / kg | SELECT * FROM table_train_54 WHERE age > 18 AND (sepsis = 1 OR septic_shock = 1 OR (severe_sepsis = 1 AND (hypotension = 1 OR systolic_blood_pressure_sbp < 90))) | criteria2sql |
CREATE TABLE table_23635 (
"Rank by time in office" real,
"Order in office" real,
"Vice President" text,
"Length of term in days" real,
"Explanation" text
) | Name the order in office for spiro agnew | SELECT "Order in office" FROM table_23635 WHERE "Vice President" = 'Spiro Agnew' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 从2007年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来 | SELECT jybgb.SHSJ 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 = '47198797' AND jybgb.BGRQ BETWEEN '2007-11-06' AND '2012-05-08' UNION... | css |
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,
... | 列出在2006-11-17到2020-11-06内,所有非异地结算的医疗就诊在医院4525816有哪些记录? | SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4525816' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-11-17' AND '2020-11-06' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4525816' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2006-11-17' AND '2020-11-06' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '452581... | css |
CREATE TABLE table_name_57 (
result VARCHAR,
distance VARCHAR
) | What was the result of the race that was a 2000m distance? | SELECT result FROM table_name_57 WHERE distance = "2000m" | sql_create_context |
CREATE TABLE table_name_40 (
pick__number INTEGER,
round VARCHAR,
college VARCHAR
) | What is the pick number average for the player who was drafted before round 7, and went to college at Tennessee? | SELECT AVG(pick__number) FROM table_name_40 WHERE round < 7 AND college = "tennessee" | sql_create_context |
CREATE TABLE table_name_99 (
country VARCHAR,
score VARCHAR
) | Which country has the score of 71-71-68=210? | SELECT country FROM table_name_99 WHERE score = 71 - 71 - 68 = 210 | 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
)
... | what is the average age of male patients who are 30 years or above? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.age >= "30" | mimicsql_data |
CREATE TABLE table_name_89 (
year INTEGER,
rank VARCHAR
) | which year holds rank 2? | SELECT MAX(year) FROM table_name_89 WHERE rank = "2" | sql_create_context |
CREATE TABLE table_25042332_31 (
incarceration_rate_male INTEGER,
region VARCHAR
) | What is the male incarceration rate of maule? | SELECT MAX(incarceration_rate_male) FROM table_25042332_31 WHERE region = "Maule" | sql_create_context |
CREATE TABLE table_43927 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the smallest bronze value associated with golds over 0, silvers over 11, and totals of 36? | SELECT MIN("Bronze") FROM table_43927 WHERE "Gold" > '0' AND "Total" = '36' AND "Silver" > '11' | wikisql |
CREATE TABLE table_18293 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | who is the the incumbent with dbeingtrict being massachusetts 2 | SELECT "Incumbent" FROM table_18293 WHERE "District" = 'Massachusetts 2' | wikisql |
CREATE TABLE table_78069 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings( $ )" real,
"Wins" real
) | In total, how much did the United States player George Archer earn with Wins lower than 24 and a rank that was higher than 5? | SELECT COUNT("Earnings( $ )") FROM table_78069 WHERE "Country" = 'united states' AND "Wins" < '24' AND "Player" = 'george archer' AND "Rank" > '5' | wikisql |
CREATE TABLE table_name_65 (
type VARCHAR,
project VARCHAR,
weight__kg_ VARCHAR
) | Name the typ for project of igmdp and weight of 16,000 | SELECT type FROM table_name_65 WHERE project = "igmdp" AND weight__kg_ = "16,000" | sql_create_context |
CREATE TABLE table_name_45 (
away_team VARCHAR,
venue VARCHAR
) | Who was the away team at the game held at Brunswick Street Oval? | SELECT away_team FROM table_name_45 WHERE venue = "brunswick street oval" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | what are the four intakes that are the most frequent since 2100? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) >= '2100' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4 | eicu |
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... | 苗湛英患者的医保个人账户去里有多少钱是在2001年7月5日到2010年6月12日内支出的? | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '苗湛英' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-07-05' AND '2010-06-12' | css |
CREATE TABLE table_47650 (
"Year" real,
"Publication" text,
"Country" text,
"Accolade" text,
"Rank" real
) | What country got accolades in 2002? | SELECT "Country" FROM table_47650 WHERE "Year" = '2002' | 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,
... | 列出按平均住院时长升序排序各科室在医院3701034的名称、编码以及平均住院时长都是什么? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM, AVG(gwyjzb.IN_HOSP_DAYS) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3701034' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY AVG(gwyjzb.IN_HOSP_DAYS) UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM, AVG(fgwyjzb.IN_HOSP_DAYS) FROM fgwyjzb WHERE fgwyjzb.MED_SE... | css |
CREATE TABLE table_23903 (
"Central-Southern Calabrian" text,
"Phonetic Greek" text,
"Italian" text,
"French" text,
"English" text
) | What does the word 'frog'in English translate to in Italian? | SELECT "Italian" FROM table_23903 WHERE "English" = 'frog' | wikisql |
CREATE TABLE table_26335 (
"Player" text,
"GP-GS" text,
"Min Avg" text,
"FG-FGA" text,
"FG Pct" text,
"3FG-FGA" text,
"3FG Pct" text,
"FT-FTA" text,
"FT Pct" text,
"Reb" real,
"Ast" real,
"Blk" real,
"Stl" real,
"Pts" real,
"Avg Pts" text
) | what is the score in fg-fga if in ft-fta is 16-21 | SELECT "FG-FGA" FROM table_26335 WHERE "FT-FTA" = '16-21' | wikisql |
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
S... | Please use a bar chart to show the total amount of payment by each payment method code, and I want to display by the Y-axis from high to low. | SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY SUM(Amount_Payment) DESC | nvbench |
CREATE TABLE bookings_services (
order_id number,
product_id number
)
CREATE TABLE stores (
store_id text,
address_id number,
marketing_region_code text,
store_name text,
store_phone text,
store_email_address text,
other_details text
)
CREATE TABLE invoice_items (
invoice_item_... | What are the names of the clients who do not have any booking? | SELECT customer_name FROM clients EXCEPT SELECT T2.customer_name FROM bookings AS T1 JOIN clients AS T2 ON T1.customer_id = T2.client_id | spider |
CREATE TABLE table_18016 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | Who did the Seahawks play when the listed attendance was 61615? | SELECT "Opponent" FROM table_18016 WHERE "Attendance" = '61615' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight i... | show me the flights from MONTREAL to CHICAGO | 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 = 'MONTREAL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICA... | atis |
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition (
competition_id number,
year number,
competition_type text,
country text
)
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
apps ... | List the types of competition and the number of competitions of each type. | SELECT competition_type, COUNT(*) FROM competition GROUP BY competition_type | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is the number of patients whose lab test name is protein, total? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Protein, Total" | mimicsql_data |
CREATE TABLE table_31032 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | On how many different dates was the episode written by Charlie Day aired for the first time? | SELECT COUNT("Original air date") FROM table_31032 WHERE "Written by" = 'Charlie Day' | wikisql |
CREATE TABLE table_14937957_1 (
country VARCHAR,
city VARCHAR
) | In which country is the city of Netanya? | SELECT country FROM table_14937957_1 WHERE city = "Netanya" | 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... | how many patients had candidiasis of mouth as their diagnosis long title? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Candidiasis of mouth" | mimicsql_data |
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... | 根据患者周和美医疗费总额不少于九千七百七十一块七毛四的医疗记录,把去出院诊断出疾病的编码和名称都列出来? | SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '周和美' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9771.74) | css |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Show me about the distribution of All_Home and School_ID , and group by attribute ACC_Home in a bar chart, sort by the X from low to high. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home | nvbench |
CREATE TABLE table_27409644_1 (
ground VARCHAR,
club VARCHAR
) | What is the home location for team flora tallinn? | SELECT ground FROM table_27409644_1 WHERE club = "Flora Tallinn" | sql_create_context |
CREATE TABLE products (
product_type_code VARCHAR,
product_price INTEGER
) | What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type? | SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code | sql_create_context |
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | Compute the total the total number across party as a pie chart. | SELECT Party, COUNT(*) FROM people GROUP BY Party | nvbench |
CREATE TABLE table_name_68 (
attendance INTEGER,
week VARCHAR
) | What is the highest attendance of the game on week 9? | SELECT MAX(attendance) FROM table_name_68 WHERE week = 9 | sql_create_context |
CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE re... | What are the ids of documents which don't have expense budgets? | SELECT document_id FROM documents EXCEPT SELECT document_id FROM documents_with_expenses | spider |
CREATE TABLE table_name_91 (
crowd INTEGER,
venue VARCHAR
) | What is the lowest crowd size at MCG? | SELECT MIN(crowd) FROM table_name_91 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_name_92 (
winner VARCHAR,
name VARCHAR
) | Who is the Winner, when the Name is Ouninpohja 1? | SELECT winner FROM table_name_92 WHERE name = "ouninpohja 1" | sql_create_context |
CREATE TABLE table_79384 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What game was in 2011? | SELECT "Game" FROM table_79384 WHERE "Year" = '2011' | wikisql |
CREATE TABLE table_65829 (
"Internet Explorer" text,
"Firefox , Other Mozilla" text,
"Chrome" text,
"Safari" text,
"Opera" text
) | What percentage of browsers were using Chrome during the period in which 72.03% were using Internet Explorer? | SELECT "Chrome" FROM table_65829 WHERE "Internet Explorer" = '72.03%' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId nu... | Users with a Website or AboutMe IDs 248532 to 497677. | SELECT * FROM Users WHERE (LENGTH(WebsiteUrl) > 0 OR LENGTH(AboutMe) > 0) AND Id >= 248532 AND Id < 497677 ORDER BY Id | sede |
CREATE TABLE table_2073 (
"#" real,
"Volume line" text,
"Volume title" text,
"Creators" text,
"Material collected" text,
"Publication date" text,
"ISBN" text
) | Name the total number of material collected for justice league of america by george p rez, vol. 2 | SELECT COUNT("Material collected") FROM table_2073 WHERE "Volume title" = 'Justice League of America by George Pérez, Vol. 2' | wikisql |
CREATE TABLE table_name_44 (
model VARCHAR,
graphics VARCHAR,
fsb__mhz_ VARCHAR
) | Which model(s) has AGP graphics and 400 FSB (MHz)? | SELECT model FROM table_name_44 WHERE graphics = "agp" AND fsb__mhz_ = "400" | sql_create_context |
CREATE TABLE table_80118 (
"Team" text,
"Manager" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
) | Which captain is managed by gianluca vialli? | SELECT "Captain" FROM table_80118 WHERE "Manager" = 'gianluca vialli' | wikisql |
CREATE TABLE table_12032893_1 (
year VARCHAR,
home_town VARCHAR
) | How many years have the home town of Baton Rouge, LA? | SELECT COUNT(year) FROM table_12032893_1 WHERE home_town = "Baton Rouge, LA" | sql_create_context |
CREATE TABLE table_name_61 (
league_cup_goals VARCHAR,
fa_cup_goals VARCHAR,
total VARCHAR,
league_goals VARCHAR
) | Which League Cup goals have a Total larger than 14, and a League goals of 14, and a FA Cup goals of 0? | SELECT league_cup_goals FROM table_name_61 WHERE total > "14" AND league_goals = "14" AND fa_cup_goals = "0" | sql_create_context |
CREATE TABLE table_40216 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | Which Administrative Panel has a Nominated by the Taoiseach smaller than 0? | SELECT MIN("Administrative Panel") FROM table_40216 WHERE "Nominated by the Taoiseach" < '0' | wikisql |
CREATE TABLE table_71317 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | On the Date of 15 June 1992 what is the Score that is listed? | SELECT "Score" FROM table_71317 WHERE "Date" = '15 june 1992' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
... | tell me the name of the drug that patient 10431 was prescribed with during the same hospital visit after being diagnosed until 05/2101 with neutropenia nos? | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 10431 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s... | mimic_iii |
CREATE TABLE table_38255 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | Who was the opponent at the game attended by 62,657? | SELECT "Opponent" FROM table_38255 WHERE "Attendance" = '62,657' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId n... | People who answered my questions. | SELECT OwnerUserId, DisplayName, Location, COUNT(*) AS Answers FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Id WHERE ParentId IN (SELECT Id FROM Posts WHERE OwnerUserId = @UserId AND PostTypeId = 1) GROUP BY OwnerUserId, DisplayName, Location ORDER BY Answers DESC | sede |
CREATE TABLE table_28179 (
"Institution" text,
"Seniors" text,
"Juniors" text,
"Women" text,
"Status" text,
"Founded" real,
"Affiliation (Population)" text,
"Color" text,
"Location" text
) | What institution is represented by the lady saints? | SELECT "Institution" FROM table_28179 WHERE "Women" = 'Lady Saints' | wikisql |
CREATE TABLE table_46476 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the highest amount of money a player with a score of 69-71-71-73=284 has? | SELECT MAX("Money ( $ )") FROM table_46476 WHERE "Score" = '69-71-71-73=284' | wikisql |
CREATE TABLE table_10715 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the home team of South Melbourne? | SELECT "Away team" FROM table_10715 WHERE "Home team" = 'south melbourne' | wikisql |
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... | 列出患者74086370医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额超过4198.44元的 | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '74086370' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4198.44) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '74086370' AND gyb.MED_CLINIC_ID IN (SELECT t... | css |
CREATE TABLE table_296 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | What school is he the catcher for? | SELECT "School" FROM table_296 WHERE "Position" = 'Catcher' | wikisql |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
) | Visualize a bar chart to show editors' names and their ages, and sort Y-axis in desc order. | SELECT Name, Age FROM editor ORDER BY Age DESC | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | tell me the number of times patient 006-129568 had received a mode lab test since 5 years ago. | 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 = '006-129568')) AND lab.labname = 'mode' AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_T... | eicu |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the average of manufacturer over the name , and group by attribute name by a bar chart, and order by the y axis in desc. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_name_97 (
nosawa_rongai VARCHAR,
block_a VARCHAR
) | Name the NOSAWA Rongai for petey williams | SELECT nosawa_rongai FROM table_name_97 WHERE block_a = "petey williams" | 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
)
... | report the number of patients taking drug via nu route who were hospitalized for more than 3 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.route = "NU" | mimicsql_data |
CREATE TABLE table_1245148_1 (
length VARCHAR,
track_name VARCHAR
) | What is the length of the track named michigan international speedway? | SELECT length FROM table_1245148_1 WHERE track_name = "Michigan International Speedway" | sql_create_context |
CREATE TABLE table_38547 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
) | Which event had the opponent of shinya aoki and was at 4:56? | SELECT "Event" FROM table_38547 WHERE "Opponent" = 'shinya aoki' AND "Time" = '4:56' | wikisql |
CREATE TABLE table_80286 (
"Opponent" text,
"Highest ranking" text,
"Matches" real,
"Lost" real,
"Win %" text
) | What is the total number of Lost for the Highest Ranking of ? | SELECT COUNT("Lost") FROM table_80286 WHERE "Highest ranking" = '– –' | wikisql |
CREATE TABLE table_name_37 (
played INTEGER,
points INTEGER
) | What is the average played for less than 8 points? | SELECT AVG(played) FROM table_name_37 WHERE points < 8 | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
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... | What 's the course number for the Scientific Writing and Astronomy class ? | SELECT DISTINCT number FROM course WHERE (description LIKE '%Scientific Writing and Astronomy%' OR name LIKE '%Scientific Writing and Astronomy%') AND department = 'EECS' | advising |
CREATE TABLE table_60182 (
"Week" text,
"Theme" text,
"Song Sung" text,
"Artist" text,
"Status" text
) | Which Song Sung has a Status of Eliminated? | SELECT "Song Sung" FROM table_60182 WHERE "Status" = 'eliminated' | wikisql |
CREATE TABLE table_name_78 (
runner_up VARCHAR,
year VARCHAR
) | Who is the runner-up in 1901? | SELECT runner_up FROM table_name_78 WHERE year = "1901" | sql_create_context |
CREATE TABLE table_name_71 (
japanese VARCHAR,
region VARCHAR
) | What kind of Japanese has a Region of t hoku? | SELECT japanese FROM table_name_71 WHERE region = "tōhoku" | 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 demographic (
subject_id text,
hadm_id t... | how many patients whose admission location is phys referral/normal deli and diagnoses short title is obesity nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "Obesity NOS" | mimicsql_data |
CREATE TABLE table_17521433_1 (
swimsuit VARCHAR,
average VARCHAR
) | What was the swimsuit score for the country with the average score of 8.848? | SELECT swimsuit FROM table_17521433_1 WHERE average = "8.848" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | what is patient 13837's monthly average factor viii level since 2103? | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13837) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'factor viii') AND STRFTIME('%y', labevents.charttime) >= '2103' GROUP BY ST... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.