context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_2113 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real
) | Where is the Eastern Nazarene College located? | SELECT "Location" FROM table_2113 WHERE "Institution" = 'Eastern Nazarene College' | wikisql |
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id in... | A bar chart about what are the ids and names of the medicine that can interact with two or more enzymes?, could you order by the X in ascending? | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY name | nvbench |
CREATE TABLE table_36754 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How many Lost have Points larger than 40, and a Position of 11, and a Played smaller than 38? | SELECT SUM("Lost") FROM table_36754 WHERE "Points" > '40' AND "Position" = '11' AND "Played" < '38' | wikisql |
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, draw a scatter chart about the correlation between price and manufacturer , and group by attribute founder. | SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
... | How many students are from each city, and which cities have more than one cities Plot them as bar chart, and display by the the total number in desc. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_19 (
laps INTEGER,
driver VARCHAR,
grid VARCHAR,
time_retired VARCHAR
) | What was the highest lap for Luigi Piotti with more than 13 grid and a time/retired engine? | SELECT MAX(laps) FROM table_name_19 WHERE grid > 13 AND time_retired = "engine" AND driver = "luigi piotti" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For those employees who was hired before 2002-06-21, for employee_id, hire_date, visualize the trend. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_47 (
team VARCHAR,
last_match VARCHAR
) | What is the name of team with Palmeiras 4-2 portuguesa as the last match? | SELECT team FROM table_name_47 WHERE last_match = "palmeiras 4-2 portuguesa" | sql_create_context |
CREATE TABLE table_26263322_1 (
candidate VARCHAR,
background VARCHAR
) | How many times was the background self-employed - media agency? | SELECT COUNT(candidate) FROM table_26263322_1 WHERE background = "Self-employed - media agency" | sql_create_context |
CREATE TABLE table_41061 (
"Date" text,
"Title" text,
"Director" text,
"Production Cost" text,
"Singapore Gross" text
) | When was the film directed by Pen-Ek Ratanaruang released? | SELECT "Date" FROM table_41061 WHERE "Director" = 'pen-ek ratanaruang' | wikisql |
CREATE TABLE table_name_99 (
part_1 VARCHAR,
part_2 VARCHAR
) | What is Part 1, when Part 2 is 'fraus'? | SELECT part_1 FROM table_name_99 WHERE part_2 = "fraus" | sql_create_context |
CREATE TABLE Products (
Product_Type_Code VARCHAR
) | Show the product type codes that have at least two products. | SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_213088_1 (
location_chernobyl_1_chernobyl_2_chernobyl_3_chernobyl_4_chernobyl_5_ignalina_1_ignalina_2_ignalina_3_kursk_1_kursk_2_kursk_3_kursk_4_kursk_5_kursk_6_leningrad_1_leningrad_2_leningrad_3_leningrad_4_smolensk_1_smolensk_2_smolensk_3_smolensk_4_directorate_for_construction_of_kostoma_npp_... | List all the locations with a RBMK-1000 reactor. | SELECT location_chernobyl_1_chernobyl_2_chernobyl_3_chernobyl_4_chernobyl_5_ignalina_1_ignalina_2_ignalina_3_kursk_1_kursk_2_kursk_3_kursk_4_kursk_5_kursk_6_leningrad_1_leningrad_2_leningrad_3_leningrad_4_smolensk_1_smolensk_2_smolensk_3_smolensk_4_directorate_for_construction_of_kostoma_npp__for_kostroma_1_and_2__tabl... | 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... | 编号为6716051的医疗机构在2004年12月11日到2008年12月18日内的总检查费用如何 | SELECT SUM(t_kc22.AMOUNT) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6716051' AND t_kc22.STA_DATE BETWEEN '2004-12-11' AND '2008-12-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID ... | css |
CREATE TABLE table_name_80 (
game VARCHAR,
home_team VARCHAR,
date VARCHAR
) | Which Game has a Home Team of san francisco, and a Date of april 22? | SELECT game FROM table_name_80 WHERE home_team = "san francisco" AND date = "april 22" | sql_create_context |
CREATE TABLE artwork (
Name VARCHAR,
TYPE VARCHAR
) | List the name of artworks whose type is not 'Program Talent Show'. | SELECT Name FROM artwork WHERE TYPE <> "Program Talent Show" | sql_create_context |
CREATE TABLE table_73772 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
) | What is the number for march 27-29 whern november 3 is 153? | SELECT "March 27-29" FROM table_73772 WHERE "November 3" = '153' | wikisql |
CREATE TABLE table_name_11 (
division INTEGER,
reg_season VARCHAR
) | Who was the lowest division in the 7th season? | SELECT MIN(division) FROM table_name_11 WHERE reg_season = "7th" | sql_create_context |
CREATE TABLE table_63962 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | what is the highest top-5 when wins is more than 1? | SELECT MAX("Top-5") FROM table_63962 WHERE "Wins" > '1' | wikisql |
CREATE TABLE table_name_40 (
away_team VARCHAR,
home_team VARCHAR
) | What was Essendon's opponents away score? | SELECT away_team AS score FROM table_name_40 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id ... | had docusate sodium, potassium chloride or spironolactone been prescribed the last year to patient 61527? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61527) AND prescriptions.drug IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 's... | mimic_iii |
CREATE TABLE table_28138035_33 (
year_location VARCHAR,
womens_doubles VARCHAR
) | What is the place and when was the year when the women's doubles womens were Bai yang Niu Jianfeng? | SELECT year_location FROM table_28138035_33 WHERE womens_doubles = "Bai Yang Niu Jianfeng" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | What 12 -credit courses are available ? | SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS' | advising |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 列出患者奚经略所有检验结果指标记录中的检测方法在2007-09-21到2008-12-08内有什么? | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb... | css |
CREATE TABLE table_64527 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | what is the date of vacancy when the position in table is 10th and the team is balboa? | SELECT "Date of vacancy" FROM table_64527 WHERE "Position in table" = '10th' AND "Team" = 'balboa' | wikisql |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | Show the race class and number of races in each class. | SELECT Class, COUNT(*) FROM race GROUP BY Class | nvbench |
CREATE TABLE table_204_585 (
id number,
"year" text,
"player" text,
"high school" text,
"college" text,
"nba/aba draft" text
) | who was the last player who went to indiana to win an award ? | SELECT "player" FROM table_204_585 WHERE "college" = 'indiana' ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_64805 (
"Date" text,
"Venue" text,
"Opponents" text,
"Competition" text,
"Match Report" text
) | What is the match report from the game played on 25 april 2009? | SELECT "Match Report" FROM table_64805 WHERE "Date" = '25 april 2009' | wikisql |
CREATE TABLE table_71857 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the score of the game that had a loss of Cerutti (0-1)? | SELECT "Score" FROM table_71857 WHERE "Loss" = 'cerutti (0-1)' | wikisql |
CREATE TABLE table_49830 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which Time/Retired has a Rider of daijiro kato? | SELECT "Time/Retired" FROM table_49830 WHERE "Rider" = 'daijiro kato' | wikisql |
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... | 对于奚映寒患者医疗记录里医疗费总额高于2623.6元的入院诊断编码什么?疾病名称叫什么? | SELECT t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_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 > 2623.6) | 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 is the minimum hospital cost when it involves lung abscess in 2100? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'lung abscess')) AND STRFTIME('%y', cost.char... | eicu |
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 are the three frequent diagnoses until 2 years ago? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE airports (
name VARCHAR,
city VARCHAR,
apid VARCHAR
)
CREATE TABLE routes (
src_apid VARCHAR
) | Find the name and city of the airport which is the source for the most number of flight routes. | SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_18502 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the result of the election when Tic Forrester ran as an incumbent? | SELECT "Result" FROM table_18502 WHERE "Incumbent" = 'Tic Forrester' | wikisql |
CREATE TABLE table_name_8 (
club VARCHAR,
lost VARCHAR,
tries_for VARCHAR
) | What is the Club, when the value for Lost is 9, and when the value for Tries is 55? | SELECT club FROM table_name_8 WHERE lost = "9" AND tries_for = "55" | sql_create_context |
CREATE TABLE table_204_708 (
id number,
"victim(s)" text,
"age" number,
"gender" text,
"date" text,
"type of attack" text,
"location" text,
"details" text,
"source(s)" text
) | how many total non fatal attacks by wolves have been recorded ? | SELECT COUNT(*) FROM table_204_708 | squall |
CREATE TABLE table_1445 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | Where did the team play when the home team score was 12.9 (81)? | SELECT "Ground" FROM table_1445 WHERE "Home team score" = '12.9 (81)' | wikisql |
CREATE TABLE table_name_53 (
points INTEGER,
assists VARCHAR
) | What are the most Points with an Assist of 46? | SELECT MAX(points) FROM table_name_53 WHERE assists = 46 | sql_create_context |
CREATE TABLE table_38066 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which championship has Roger Federer as an opponent on a clay surface in a year earlier than 2007? | SELECT "Championship" FROM table_38066 WHERE "Opponent" = 'roger federer' AND "Surface" = 'clay' AND "Year" < '2007' | wikisql |
CREATE TABLE table_13218 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Country of the T8 Place Player with a Score of 70-67-71=208? | SELECT "Country" FROM table_13218 WHERE "Place" = 't8' AND "Score" = '70-67-71=208' | wikisql |
CREATE TABLE table_60668 (
"State" text,
"GR\u00dcNE" text,
"FRITZ" text,
"RETT\u00d6" text,
"LINKE" text,
"STARK" text
) | What percent did GR NE get in the state where FRITZ got 1.3%? | SELECT "GR\u00dcNE" FROM table_60668 WHERE "FRITZ" = '1.3%' | wikisql |
CREATE TABLE table_name_89 (
time_retired VARCHAR,
constructor VARCHAR,
grid VARCHAR
) | What is the Time/Retired for brabham - climax, on Grid of 10? | SELECT time_retired FROM table_name_89 WHERE constructor = "brabham - climax" AND grid = 10 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | count the number of patients whose primary disease is st elevated myocardial infarction/cardiac ccath and procedure icd9 code is 9465. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.icd9_code = "9465" | mimicsql_data |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | did there exist any organism found in the first peripheral blood lymphocytes microbiology test of patient 2957 during this hospital visit? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2957 AND admissions.dischtime IS NULL) AND microbiologyevents.spec_type_desc = 'peripheral blood lymphocytes' AND NOT microbiologyevents.org_name IS NULL ORDER BY micr... | 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... | Count the number of patients discharged to a skilled nursing facility who had procedure icd9 code 3491. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.icd9_code = "3491" | mimicsql_data |
CREATE TABLE table_22386 (
"Season" real,
"Trophy Winner" text,
"Air Force \u2013 Navy score" text,
"Air Force \u2013 Army score" text,
"Army \u2013 Navy score" text
) | What was the Air Force - Navy score in the 1983 season? | SELECT "Air Force \u2013 Navy score" FROM table_22386 WHERE "Season" = '1983' | wikisql |
CREATE TABLE table_name_21 (
ship_types_delivered VARCHAR,
total_vessels_built_for_usmc VARCHAR
) | what is the ship types delivered when the total vessels built for usmc is 13 ships for usmc (plus 37 more for usn)? | SELECT ship_types_delivered FROM table_name_21 WHERE total_vessels_built_for_usmc = "13 ships for usmc (plus 37 more for usn)" | sql_create_context |
CREATE TABLE table_name_31 (
qual_2 VARCHAR,
team VARCHAR,
qual_1 VARCHAR
) | What is the second qualifying time for the dale coyne racing team with a first qualifying time of 1:00.081? | SELECT qual_2 FROM table_name_31 WHERE team = "dale coyne racing" AND qual_1 = "1:00.081" | sql_create_context |
CREATE TABLE table_40138 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Socialist Labor ticket" text,
"Prohibition ticket" text,
"Independent Citizens' ticket" text
) | Which Prohibition ticket has a Socialist Labor ticket of joseph smith? | SELECT "Prohibition ticket" FROM table_40138 WHERE "Socialist Labor ticket" = 'joseph smith' | wikisql |
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... | What is the average base price of different bed type? List bed type and average base price. Visualize by pie chart. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE table_203_391 (
id number,
"season" text,
"greek league" text,
"greek cup" text,
"europe" text,
"coach" text,
"roster" text
) | after the 1928-29 championship , how many times was the panellinios basket named champions of the panhellenic championship ? | SELECT COUNT(*) FROM table_203_391 WHERE "season" > '1928-29' AND "greek league" = 'champion' | squall |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is maximum age of patients whose marital status is married and admission year is greater than or equal to 2190? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2190" | mimicsql_data |
CREATE TABLE table_2374338_2 (
croats VARCHAR,
roma VARCHAR
) | What is every value for Croats if the value of Roma is 3.1%? | SELECT croats FROM table_2374338_2 WHERE roma = "3.1%" | sql_create_context |
CREATE TABLE table_14651 (
"City" text,
"Province/Region" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Which airport is in Tokyo and has an ICAO of rjtt? | SELECT "Airport" FROM table_14651 WHERE "City" = 'tokyo' AND "ICAO" = 'rjtt' | wikisql |
CREATE TABLE table_41563 (
"Branch" text,
"Address" text,
"Neighborhood" text,
"First branch opened" real,
"Current branch opened" real
) | What is Neighborhood, when Branch is Hollywood Library? | SELECT "Neighborhood" FROM table_41563 WHERE "Branch" = 'hollywood library' | wikisql |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
... | What are the names of all employees who have a salary higher than average? | SELECT name FROM employee WHERE salary > (SELECT AVG(salary) FROM employee) | spider |
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... | what is maximum age of patients whose marital status is single and admission type is elective? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_type = "ELECTIVE" | mimicsql_data |
CREATE TABLE table_name_60 (
driver VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Name the driver for Laps less than 9 and a grid of 13 | SELECT driver FROM table_name_60 WHERE laps < 9 AND grid = 13 | sql_create_context |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
) | What is the height of the mountain climbined by the climbing who had the most points? | SELECT T2.height FROM climber AS T1 JOIN mountain AS T2 ON T1.mountain_id = T2.mountain_id ORDER BY T1.points DESC LIMIT 1 | spider |
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... | what is the number of elective type hospital admission patients who have asian ethnic background? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "ASIAN" | mimicsql_data |
CREATE TABLE table_37357 (
"Date" text,
"Time" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | what team lost on july 30 | SELECT "Loss" FROM table_37357 WHERE "Date" = 'july 30' | wikisql |
CREATE TABLE stock (
Device_ID VARCHAR
)
CREATE TABLE device (
Carrier VARCHAR,
Device_ID VARCHAR
) | Show the carriers of devices in stock at more than one shop. | SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_52835 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the home team score in the game where the away team scored 8.14 (62)? | SELECT "Home team score" FROM table_52835 WHERE "Away team score" = '8.14 (62)' | wikisql |
CREATE TABLE festival_detail (
Festival_Name VARCHAR,
LOCATION VARCHAR
) | What are the names and locations of festivals? | SELECT Festival_Name, LOCATION FROM festival_detail | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | On what days of the week are the SWC 300 classes ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... | advising |
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
address_type VARCHAR(10),
date_to DATETIME
)
CREATE TABLE Delivery_Route_Locations (
location_code VARCHAR(10),
route_id INTEGER,
location_address_id INTEGER,
location_name VARCHAR(50)
)
... | List the state names and the number of customers living in each state with a bar chart. | SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county | nvbench |
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 of the patients treated with theophylline sr were aged below 67? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "67" AND prescriptions.drug = "Theophylline SR" | mimicsql_data |
CREATE TABLE table_48605 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | What place did Jerry Barber of the United States come in at? | SELECT "Place" FROM table_48605 WHERE "Country" = 'united states' AND "Player" = 'jerry barber' | wikisql |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CH... | Return a bar chart showing the minimum room count of apartments in different type, and show by the total number from low to high. | SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code ORDER BY MIN(room_count) | nvbench |
CREATE TABLE table_30934 (
"Series #" real,
"Production Code" real,
"Title" text,
"Directed by" text,
"Written by" text,
"United States Original Airdate" text,
"Canada Original Airdate" text
) | Who were the writers of episode/s first aired in the US on June 9, 2012? | SELECT "Written by" FROM table_30934 WHERE "United States Original Airdate" = 'June 9, 2012' | wikisql |
CREATE TABLE table_1506950_9 (
player VARCHAR,
us_open VARCHAR,
pga_ch VARCHAR,
masters VARCHAR
) | Which player's results were T6 in the PGA Ch., T4 in the Masters and T8 at the U.S. Open? | SELECT player FROM table_1506950_9 WHERE pga_ch = "T6" AND masters = "T4" AND us_open = "T8" | sql_create_context |
CREATE TABLE table_name_52 (
loss VARCHAR,
date VARCHAR
) | Who did the team lose to on September 8? | SELECT loss FROM table_name_52 WHERE date = "september 8" | sql_create_context |
CREATE TABLE table_204_236 (
id number,
"title" text,
"release date" text,
"developer(s)" text,
"publisher(s)" text,
"genre(s)" text
) | what was the first game released ? | SELECT "title" FROM table_204_236 ORDER BY "release date" LIMIT 1 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | count the number of patients whose admission locations is phys referral/normal deli and diagnosis long title is diverticulitis of colon (without mention of hemorrhage). | 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.long_title = "Diverticulitis of colon (without mention of hemorrhage)" | mimicsql_data |
CREATE TABLE table_20799587_1 (
obama_number INTEGER,
mccain_percentage VARCHAR
) | How many people voted for Obama in the county where McCain got 72.75% of the votes? | SELECT MIN(obama_number) FROM table_20799587_1 WHERE mccain_percentage = "72.75%" | sql_create_context |
CREATE TABLE table_204_503 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | how long was her was her champoinship and olympice career ? | SELECT MAX("year") - MIN("year") FROM table_204_503 | squall |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
... | is normal for patient 4401's sao2 on the last icu visit? | SELECT COUNT(*) > 0 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 = 4401) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELEC... | mimic_iii |
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
) | What are the names and locations of all tracks? | SELECT name, location FROM track | spider |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_... | The times that International Security , Norms and Cooperation will be offered are what ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | advising |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is procedure short title of subject id 21796? | SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "21796" | mimicsql_data |
CREATE TABLE table_41790 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
) | Which Matches have a Rank smaller than 5, a Years of 1995 2003, and a Goals smaller than 104? | SELECT AVG("Matches") FROM table_41790 WHERE "Rank" < '5' AND "Years" = '1995–2003' AND "Goals" < '104' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid... | was there a phosphate test done on patient 9833 until 73 months ago? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9833) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-73 month') | mimic_iii |
CREATE TABLE gwyjzb (
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,
... | 在整个医疗记录中医院编号3850390的住院诊断为躁狂抑郁性精神病当前为抑郁相的人花的最低和最高医疗费总额是多少元? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3850390' AND gwyjzb.IN_DIAG_DIS_NM = '躁狂抑郁性精神病当前为抑郁相' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3850390' AND fgwyjzb... | css |
CREATE TABLE table_name_98 (
format VARCHAR,
code VARCHAR
) | What is the format of code pro-cd-4662? | SELECT format FROM table_name_98 WHERE code = "pro-cd-4662" | sql_create_context |
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 ... | when is patient 31473's po intake the first time on the first intensive care unit visit? | SELECT inputevents_cv.charttime 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 = 31473) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_cv... | mimic_iii |
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, give me the comparison about the average of code over the headquarter , and group by attribute headquarter, order in ascending by the y axis. | 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_name_75 (
home_team VARCHAR,
away_team VARCHAR
) | What home team played the away team of Richmond? | SELECT home_team FROM table_name_75 WHERE away_team = "richmond" | sql_create_context |
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... | what are the three most frequently prescribed medications for patients who have had entral infus nutrit sub previously in the same hospital visit, the previous year? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_22270 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
) | What is the calling at for the 09.50 departure? | SELECT "Calling at" FROM table_22270 WHERE "Departure" = '09.50' | wikisql |
CREATE TABLE table_name_82 (
performer_3 VARCHAR,
episode VARCHAR
) | Episode of 9 in which performer 3 had? | SELECT performer_3 FROM table_name_82 WHERE episode = 9 | 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,
... | what was the name of the drug that patient 006-76924 was prescribed within 2 days after having been diagnosed with a acute respiratory failure - drug related during this month? | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924') AND diagnosis.diagnos... | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC te... | 病患华文康做的检查里哪些编号检验报告单对应的检验结果的全部指标都是正常的?上面的单号具体是多少? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl... | css |
CREATE TABLE table_name_93 (
date VARCHAR,
competition VARCHAR,
venue VARCHAR,
goals VARCHAR
) | What is the date of the k-league cup, which has less than 28 goals, at the jeonju venue? | SELECT date FROM table_name_93 WHERE venue = "jeonju" AND goals < 28 AND competition = "k-league cup" | sql_create_context |
CREATE TABLE table_name_86 (
latitude VARCHAR,
year_named VARCHAR,
name VARCHAR
) | What is the Latitude of the Alajen Vallis named after 1997? | SELECT latitude FROM table_name_86 WHERE year_named > 1997 AND name = "alajen vallis" | sql_create_context |
CREATE TABLE table_name_79 (
grid INTEGER,
driver VARCHAR,
laps VARCHAR
) | What is the average grid of driver Christian Vietoris who has less than 12 laps? | SELECT AVG(grid) FROM table_name_79 WHERE driver = "christian vietoris" AND laps < 12 | sql_create_context |
CREATE TABLE table_69036 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
) | How many people went to the game that lasted 2:37 after game 2? | SELECT SUM("Attendance") FROM table_69036 WHERE "Game" > '2' AND "Time" = '2:37' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | Top 10 SO Users from Mysore. Top 10 SO Users from Mysore, Karnataka, India | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%mysore%' OR UPPER(Location) LIKE '%MYSORE%' OR Location LIKE '%mysore%' AND Reputation >= 1000 ORDER BY Reputation DESC LIMIT 10 | sede |
CREATE TABLE table_name_96 (
release_price___usd__ VARCHAR,
gpu_frequency VARCHAR
) | What is the release price for the GPU frequency of standard power, embedded? | SELECT release_price___usd__ FROM table_name_96 WHERE gpu_frequency = "standard power, embedded" | sql_create_context |
CREATE TABLE table_10706879_3 (
winning_driver VARCHAR,
name VARCHAR
) | How many winning drivers in the kraco twin 125 (r2) race were there? | SELECT COUNT(winning_driver) FROM table_10706879_3 WHERE name = "Kraco Twin 125 (R2)" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.