context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_59299 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Transfer fee" text,
"Notes" text
) | What is the Highest Goals for Grella? | SELECT MAX("Goals") FROM table_59299 WHERE "Name" = 'grella' | wikisql |
CREATE TABLE table_20745685_1 (
opponent VARCHAR,
attendance VARCHAR
) | Who was the opponent when the attendance was exactly 16642? | SELECT opponent FROM table_20745685_1 WHERE attendance = 16642 | sql_create_context |
CREATE TABLE table_5261 (
"Name" text,
"Number" real,
"Position" text,
"Weight*" real,
"Year" text,
"Hometown" text
) | What is the total weight in Tulsa, Oklahoma? | SELECT SUM("Weight*") FROM table_5261 WHERE "Hometown" = 'tulsa, oklahoma' | wikisql |
CREATE TABLE table_name_86 (
airport VARCHAR,
iata VARCHAR
) | Which airport has SEB as its IATA code? | SELECT airport FROM table_name_86 WHERE iata = "seb" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
... | Are there any that have not taught CAAS 202 ? | SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERING... | advising |
CREATE TABLE table_45067 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
) | Where is the location where Scott Junk was the opponent? | SELECT "Location" FROM table_45067 WHERE "Opponent" = 'scott junk' | wikisql |
CREATE TABLE table_1165048_1 (
coach VARCHAR,
dudley_tuckey_medal VARCHAR
) | who is the coach where dudley tuckey medal is ben howlett | SELECT coach FROM table_1165048_1 WHERE dudley_tuckey_medal = "Ben Howlett" | sql_create_context |
CREATE TABLE table_name_1 (
construction_completed VARCHAR,
cerclis_id VARCHAR
) | What construction has a CERCLIS ID of ard092916188? | SELECT construction_completed FROM table_name_1 WHERE cerclis_id = "ard092916188" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name tex... | Which ministers are not a part of the Progress Party, and count them by a bar chart, list by the Minister from low to high. | SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY Minister | nvbench |
CREATE TABLE table_24850630_4 (
weight VARCHAR,
venue VARCHAR
) | What was the weight of the jockey at Sandown Park? | SELECT weight FROM table_24850630_4 WHERE venue = "Sandown Park" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | Between ARABIC 202 and ARABIC 401 , how are they different ? | SELECT DISTINCT department, description, number FROM course WHERE (department = 'ARABIC' AND number = 401) OR (department = 'ARABIC' AND number = 202) | advising |
CREATE TABLE table_29996 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What college team did Ryan Golden come from? | SELECT "College/junior/club team" FROM table_29996 WHERE "Player" = 'Ryan Golden' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses... | since 2105 what are the four most common specimen test given to patients in the same month after being diagnosed with candidias urogenital nec? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
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 procedure long title of procedure icd9 code 5187? | SELECT procedures.long_title FROM procedures WHERE procedures.icd9_code = "5187" | mimicsql_data |
CREATE TABLE table_41354 (
"Goal" real,
"Date" text,
"Venue" text,
"Result" text,
"Competition" text
) | What was the date of the game with 6 goals? | SELECT "Date" FROM table_41354 WHERE "Goal" = '6' | wikisql |
CREATE TABLE table_10142 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team score at the game held on 17 August 1935? | SELECT "Away team score" FROM table_10142 WHERE "Date" = '17 august 1935' | wikisql |
CREATE TABLE table_name_73 (
surname VARCHAR,
dob VARCHAR,
bats VARCHAR,
position VARCHAR
) | Which Surname has Bats of r, and a Position of p, and a DOB of 20 may 1989? | SELECT surname FROM table_name_73 WHERE bats = "r" AND position = "p" AND dob = "20 may 1989" | sql_create_context |
CREATE TABLE table_26209 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Which championship had a final score of 6 4, 2 6, 6 4, 7 6(3)? | SELECT "Championship" FROM table_26209 WHERE "Score in the final" = '6–4, 2–6, 6–4, 7–6(3)' | wikisql |
CREATE TABLE table_30618 (
"IME Exchange (Including spot, credit and forward transactions)" text,
"2007/08" text,
"2008/09" text,
"2009/10" text,
"2010/11" text
) | When the ime exchange (including spot, credit and forward transactions) is agricultural - value (billion rials ) what is 2010/11? | SELECT "2010/11" FROM table_30618 WHERE "IME Exchange (Including spot, credit and forward transactions)" = 'Agricultural - Value (billion rials )' | wikisql |
CREATE TABLE table_name_35 (
finish VARCHAR,
qual VARCHAR
) | What was Dick Rathmann's Finish the year he Qualed at 130.928? | SELECT finish FROM table_name_35 WHERE qual = "130.928" | sql_create_context |
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,
... | look for discharge time of patient bryant johnson. | SELECT demographic.dischtime FROM demographic WHERE demographic.name = "Bryant Johnson" | mimicsql_data |
CREATE TABLE table_14831 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | How many points has more than 15 wins and less than 10 losses? | SELECT "Points" FROM table_14831 WHERE "Wins" > '15' AND "Losses" < '10' | wikisql |
CREATE TABLE table_66877 (
"Sunday Sunna/S\u00f3l" text,
"Monday Mona/ M\u00e1ni" text,
"Tuesday Tiw/ Tyr" text,
"Wednesday Woden / Odin" text,
"Thursday Thunor / Thor" text,
"Friday Frige or Freya" text,
"Saturday Saturn" text
) | Which Tuesday Tiw/Tyr has a Sunday Sunna/Sol of sondag? | SELECT "Tuesday Tiw/ Tyr" FROM table_66877 WHERE "Sunday Sunna/S\u00f3l" = 'sondag' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_96 (
away_team VARCHAR,
round VARCHAR,
home_team VARCHAR
) | In the 6th round match with home team Bahia, who was the away team? | SELECT away_team FROM table_name_96 WHERE round = "6th" AND home_team = "bahia" | sql_create_context |
CREATE TABLE table_name_4 (
game INTEGER,
date VARCHAR
) | Which game was played on march 2? | SELECT AVG(game) FROM table_name_4 WHERE date = "march 2" | sql_create_context |
CREATE TABLE table_name_78 (
played VARCHAR,
points_against VARCHAR
) | What is the played number when the points against is 179? | SELECT played FROM table_name_78 WHERE points_against = "179" | sql_create_context |
CREATE TABLE table_11961582_4 (
game VARCHAR,
high_assists VARCHAR
) | What was the total number of games where A. Johnson (6) gave the most high assists? | SELECT COUNT(game) FROM table_11961582_4 WHERE high_assists = "A. Johnson (6)" | sql_create_context |
CREATE TABLE table_17568 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
) | Name the young rider classification with laudelino cubino | SELECT "Young rider classification" FROM table_17568 WHERE "Winner" = 'Laudelino Cubino' | wikisql |
CREATE TABLE table_name_53 (
duration VARCHAR,
character VARCHAR
) | How long did Witold Latoszek character lasted? | SELECT duration FROM table_name_53 WHERE character = "witold latoszek" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of code , and group by attribute headquarter, and rank Y-axis in ascending order. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code | nvbench |
CREATE TABLE table_22815870_1 (
original_air_date VARCHAR,
prod_code VARCHAR
) | What is the original air date of the episode with a production code of 105? | SELECT original_air_date FROM table_22815870_1 WHERE prod_code = 105 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | how many patients aged below 43 year with joint fluid as the lab test fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_name_96 (
visitor VARCHAR,
record VARCHAR
) | Who was the visitor in the game that led to a 39-20-6 record? | SELECT visitor FROM table_name_96 WHERE record = "39-20-6" | sql_create_context |
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 (
... | provide the number of patients whose diagnoses long title is obesity, unspecified and drug route is pr? | 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 = "Obesity, unspecified" AND prescriptions.route = "PR" | mimicsql_data |
CREATE TABLE host (
host_id number,
name text,
nationality text,
age text
)
CREATE TABLE party_host (
party_id number,
host_id number,
is_main_in_charge others
)
CREATE TABLE party (
party_id number,
party_theme text,
location text,
first_year text,
last_year text,
... | What are the name and the nationality of the host of the highest age? | SELECT name, nationality FROM host ORDER BY age DESC LIMIT 1 | spider |
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... | count the number of patients whose death status is 1 and diagnoses long title is tietze's disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Tietze's disease" | mimicsql_data |
CREATE TABLE table_name_67 (
date VARCHAR,
penciller VARCHAR,
title VARCHAR
) | What was the Date of the Cimmeria Issue for which the Penciller was Tom s Giorello? | SELECT date FROM table_name_67 WHERE penciller = "tomás giorello" AND title = "cimmeria" | sql_create_context |
CREATE TABLE table_48584 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | In what Week was the Attendance 43,430? | SELECT MAX("Week") FROM table_48584 WHERE "Attendance" = '43,430' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
N... | Total Closed, Total Questions, ratio. | SELECT COUNT(*) AS TotalQuestions, (SELECT COUNT(*) AS TotalClosed FROM Posts AS C WHERE C.OwnerUserId = P.OwnerUserId AND ClosedDate != '' AND PostTypeId = 1) AS TotalClosed, (SELECT COUNT(*) AS TotalClosed FROM Posts AS C WHERE C.OwnerUserId = P.OwnerUserId AND ClosedDate != '' AND PostTypeId = 1) * 100.0 / COUNT(*) ... | sede |
CREATE TABLE table_2534387_11 (
winner VARCHAR,
event__number VARCHAR
) | If the event number is 5, what is the winner total number? | SELECT COUNT(winner) FROM table_2534387_11 WHERE event__number = 5 | sql_create_context |
CREATE TABLE table_74382 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" text,
"Replaced by" text,
"Date of appointment" text
) | Why did Geninho leave as manager? | SELECT "Manner of departure" FROM table_74382 WHERE "Outgoing manager" = 'Geninho' | wikisql |
CREATE TABLE table_18023 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | What was the date of the game against Kansas City Chiefs? | SELECT "Date" FROM table_18023 WHERE "Opponent" = 'Kansas City Chiefs' | wikisql |
CREATE TABLE table_name_52 (
new_wnba_team VARCHAR,
pick INTEGER
) | What was the new WNBA team of the player selected with a pick over 7? | SELECT new_wnba_team FROM table_name_52 WHERE pick > 7 | sql_create_context |
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... | 手术量排名在2003年5月3日到2017年9月15间是倒数前3的科室的编码和名称都有谁? | SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2003-05-03' AND '2017-09-15' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 3 | css |
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... | count the number of patients whose diagnosis short title is malnutrition mild degree and lab test fluid is urine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Malnutrition mild degree" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_66744 (
"Supplier" text,
"Basic shape" text,
"Keys (x modes)" text,
"Wrist pad" text,
"Thumb stick" text,
"Backlit" text
) | Which Thumb stick has a Wrist pad of no, and a Supplier of sharkoon? | SELECT "Thumb stick" FROM table_66744 WHERE "Wrist pad" = 'no' AND "Supplier" = 'sharkoon' | wikisql |
CREATE TABLE table_52013 (
"D 40 \u221a" text,
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 O" text,
"D 46 O" text,
"R 53 +" text,
"R 52 +" text,
"R 51 +" text
) | Name th D 43 when R 51 + is r 30 | SELECT "D 43 \u221a" FROM table_52013 WHERE "R 51 +" = 'r 30' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose primary disease is sternal wound infection and year of death is less than or equal to 2173? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STERNAL WOUND INFECTION" AND demographic.dod_year <= "2173.0" | mimicsql_data |
CREATE TABLE table_73975 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What number(s) in the series was written by bo crese? | SELECT "No. in series" FROM table_73975 WHERE "Written by" = 'Bo Crese' | wikisql |
CREATE TABLE table_49150 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | How many times is the player scott deibert? | SELECT COUNT("Pick #") FROM table_49150 WHERE "Player" = 'scott deibert' | wikisql |
CREATE TABLE table_56710 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What player had the position guard/forward? | SELECT "Player" FROM table_56710 WHERE "Position" = 'guard/forward' | wikisql |
CREATE TABLE table_72520 (
"School" text,
"Winners" real,
"Finalists" real,
"Total Finals" real,
"Year of last win" text
) | What is the name of the school where the year of last win is 1985-86? | SELECT "School" FROM table_72520 WHERE "Year of last win" = '1985-86' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | Bin the hire date of employees into Month interval and count them for visualizing a bar chart, list by the how many hire date from low to high. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE table_name_62 (
constructor VARCHAR,
driver VARCHAR,
laps VARCHAR,
grid VARCHAR
) | who is the constructor when the laps is less than 68, the grid is more than 20 and the driver is thierry boutsen? | SELECT constructor FROM table_name_62 WHERE laps < 68 AND grid > 20 AND driver = "thierry boutsen" | sql_create_context |
CREATE TABLE table_56289 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the smallest grid for a time/retired of 1:56:18.22? | SELECT MIN("Grid") FROM table_56289 WHERE "Time/Retired" = '1:56:18.22' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | how long was the last of patient 82159's stay in the hospital? | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 82159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 统计入院诊断为H46.282的在医院4458801的医疗记录中有什么最低和最高医疗费总额? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4458801' AND t_kc21.IN_DIAG_DIS_CD = 'H46.282') | css |
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE purchase (
member_id number,
branch_id tex... | What are the cities that do not have any branches with more than 100 members? | SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100 | spider |
CREATE TABLE table_53829 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
) | I want to know the tournament that has a third place of magnus gustafsson | SELECT "Tournament" FROM table_53829 WHERE "Third Place" = 'magnus gustafsson' | wikisql |
CREATE TABLE table_8854 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Former Team" text
) | Which Position has a Player of bernard thompson? | SELECT "Position" FROM table_8854 WHERE "Player" = 'bernard thompson' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients with abnormal lab test status have diagnoses of hypertensive heart disease with heart failure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hyp ht dis NOS w ht fail" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_62 (
crowd INTEGER,
home_team VARCHAR
) | What is the largest crowd with Home team of hawthorn? | SELECT MAX(crowd) FROM table_name_62 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_test_10 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"immunosuppressive_disease" bool,
"systolic_arterial_pressure_sap" int,
"lymphomas" bool,
"left_ventricular_dysfunction" bool,
"tissue_hypoperfusion" bool,
"heart_... | heart rate > 100 / minute | SELECT * FROM table_test_10 WHERE heart_rate > 100 | criteria2sql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what were the new drugs prescribed to patient 006-2586 today compared to what was prescribed yesterday? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-2586') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicat... | 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 sum of manufacturer over the name , and group by attribute name by a bar chart, could you show in desc by the y-axis? | 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 hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 知道在门诊就诊00282220286的病人的卡号以及卡类型是啥吗 | SELECT mzjzjlb.KH, mzjzjlb.KLX FROM mzjzjlb WHERE mzjzjlb.JZLSH = '00282220286' | css |
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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 从08年10月22日起的2年内,患者66306240的395514指标情况记录 | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Descript... | List document type codes and the number of documents in each code in a pie chart. | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code | nvbench |
CREATE TABLE table_36237 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
) | Which long range AM station has the lowest frequency and includes a webcast of listen live, was licensed in the city of Monterrey, and uses the Callsign of xet? | SELECT MIN("Frequency") FROM table_36237 WHERE "Webcast" = 'listen live' AND "City of License" = 'monterrey' AND "Callsign" = 'xet' | wikisql |
CREATE TABLE table_47885 (
"Name" text,
"Height (m)" real,
"Height (ft)" real,
"Location" text,
"Year built" real
) | What is the lowest height in feet for the building located in platz der einheit 1, gallus, that was built after 1961 with a height less than 130 meters? | SELECT MIN("Height (ft)") FROM table_47885 WHERE "Year built" > '1961' AND "Location" = 'platz der einheit 1, gallus' AND "Height (m)" < '130' | wikisql |
CREATE TABLE table_53823 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Which Tournament was on the Date 6 Sep 2009? | SELECT "Tournament" FROM table_53823 WHERE "Date" = '6 sep 2009' | wikisql |
CREATE TABLE table_name_98 (
report VARCHAR,
date VARCHAR
) | Name the report on 20 may | SELECT report FROM table_name_98 WHERE date = "20 may" | sql_create_context |
CREATE TABLE table_6268 (
"Rank" real,
"Airport" text,
"Total Passengers" real,
"% Change 2005/2006" text,
"International Passengers" real,
"Domestic Passengers" real,
"Transit Passengers" real,
"Aircraft Movements" real,
"Freight (Metric Tonnes)" real
) | What is the sum of all domestic passengers with 10.9% change and less than 4,022 tonnes in freight? | SELECT SUM("Domestic Passengers") FROM table_6268 WHERE "% Change 2005/2006" = '10.9%' AND "Freight (Metric Tonnes)" < '4,022' | wikisql |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCH... | Show the number of courses each instructor taught in a bar chart, and order in descending by the names please. | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY EMP_FNAME DESC | nvbench |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
... | what are the four most frequent procedure that patients have received during the same month after they have received a non-invasive mech vent procedure? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
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... | 华明哲这个病人被门诊诊断为脑梗死后遗症,他做的检测指标097260的结果定量和单位是啥 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | Show how many delegates in each party with a bar chart. | SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party | nvbench |
CREATE TABLE table_name_22 (
date_of_vacancy VARCHAR,
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | I wan the date of vacancy for departure of resigned and outgoing manager of gordon wylde | SELECT date_of_vacancy FROM table_name_22 WHERE manner_of_departure = "resigned" AND outgoing_manager = "gordon wylde" | sql_create_context |
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,
... | give me the number of patients whose marital status is widowed and item id is 50911? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "50911" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | how many hours have passed since patient 012-66291 was last given a endotracheal tube during this hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-66291... | eicu |
CREATE TABLE table_49585 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text,
"Source" text
) | What's the name of MKD? | SELECT "Name" FROM table_49585 WHERE "Nat." = 'mkd' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId num... | Get all your comment with links, texts, dates and scores. | SELECT Score, CreationDate, Id AS "comment_link", Text FROM Comments WHERE UserId = @UserId ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_80 (
loco_nos VARCHAR,
class VARCHAR
) | What is the Loco Nos of the e3 class? | SELECT loco_nos FROM table_name_80 WHERE class = "e3" | sql_create_context |
CREATE TABLE table_49387 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text
) | What is the total number of rounds at 5:36? | SELECT COUNT("Round") FROM table_49387 WHERE "Time" = '5:36' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microl... | tell me the total amount of output amt-blake drain c that patient 002-17348 was producing until 1824 days ago. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-17348')) AND intakeoutput.celllabel = 'outpu... | eicu |
CREATE TABLE checkin (
cid int,
business_id varchar,
count int,
day varchar
)
CREATE TABLE tip (
tip_id int,
business_id varchar,
text longtext,
user_id varchar,
likes int,
year int,
month varchar
)
CREATE TABLE review (
rid int,
business_id varchar,
user_id var... | How many restaurant are there in the Hazelwood district of Dallas ? | SELECT COUNT(DISTINCT (business.name)) FROM business, category, neighborhood WHERE business.city = 'Dallas' AND category.business_id = business.business_id AND category.category_name = 'restaurant' AND neighborhood.business_id = business.business_id AND neighborhood.neighborhood_name = 'Hazelwood' | yelp |
CREATE TABLE table_38413 (
"Character" text,
"Actor" text,
"Years" text,
"Series" text,
"Episode Count" real
) | How many Episode Counts have an Actor of liz carr? | SELECT COUNT("Episode Count") FROM table_38413 WHERE "Actor" = 'liz carr' | wikisql |
CREATE TABLE stadium (
id number,
name text,
home_games number,
average_attendance number,
total_attendance number,
capacity_percentage number
)
CREATE TABLE injury_accident (
game_id number,
id number,
player text,
injury text,
number_of_matches text,
source text
)
CRE... | How many games has each stadium held? | SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id | spider |
CREATE TABLE table_26400 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the highest series number of the episode 'Til Death do us part-and make it soon'? | SELECT MAX("Series #") FROM table_26400 WHERE "Title" = 'Til Death Do Us Part-And Make It Soon' | wikisql |
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... | 列出患者柳阳文所有检验结果指标记录的检测人为61543019的检验指标流水号有多少在在2007-05-14到2020-07-28内? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
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,
... | what were the three most frequent drugs that were prescribed to the patients aged 30s in a year before after they were diagnosed with other pulmonary insuff within 2 months? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE table_name_71 (
date VARCHAR,
away_team VARCHAR
) | What day is richmond the away side? | SELECT date FROM table_name_71 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE table_name_36 (
date VARCHAR,
tie_no VARCHAR
) | On what Date is Tie no 19? | SELECT date FROM table_name_36 WHERE tie_no = "19" | sql_create_context |
CREATE TABLE table_20174050_23 (
notes VARCHAR,
reader VARCHAR
) | how many notes were read by reader varma, idria indira varma? | SELECT COUNT(notes) FROM table_20174050_23 WHERE reader = "Varma, Idria Indira Varma" | sql_create_context |
CREATE TABLE table_23159 (
"Institution" text,
"Nickname" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Left" real,
"Current Conference" text
) | When was the school in Philadelphia, Pennsylvania founded? | SELECT "Founded" FROM table_23159 WHERE "Location" = 'Philadelphia, Pennsylvania' | wikisql |
CREATE TABLE table_name_7 (
place INTEGER,
name VARCHAR,
until VARCHAR
) | What place did R. Wenzel, who was active after 1934, have? | SELECT SUM(place) FROM table_name_7 WHERE name = "r. wenzel" AND until > 1934 | 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... | 给病患63491444开具的都超过3235.03元的药品在哪几次医疗记录中?列出来医疗就诊编号是多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '63491444' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 3235.03) | css |
CREATE TABLE table_name_15 (
average INTEGER,
evening_gown VARCHAR,
swimsuit VARCHAR,
state VARCHAR
) | What is the lowest average that has a swimsuit less than 8.966, for west virginia and an evening gown less than 8.711? | SELECT MIN(average) FROM table_name_15 WHERE swimsuit < 8.966 AND state = "west virginia" AND evening_gown < 8.711 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is primary disease and procedure icd9 code of subject id 18480? | SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18480" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.