context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 68219114345这个门诊就诊的医生有哪些?首诊医生和其他接诊医生的工号是什么 | SELECT txmzjzjlb.ZZYSGH, txmzjzjlb.QTJZYSGH FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '68219114345' UNION SELECT ftxmzjzjlb.ZZYSGH, ftxmzjzjlb.QTJZYSGH FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '68219114345' | css |
CREATE TABLE table_73292 (
"Expression" text,
"Y = 2008" text,
"Y = 2009" text,
"Y = 2010" text,
"Y = 2011" text
) | What is the y = 2011 when the expression is month = floor ((d + e + 114) / 31)? | SELECT "Y = 2011" FROM table_73292 WHERE "Expression" = 'month = floor ((d + e + 114) / 31)' | wikisql |
CREATE TABLE table_1222 (
"Year" real,
"Class" text,
"Team name" text,
"Bike" text,
"Riders" text,
"Races" text,
"Wins" real,
"Podiums" real,
"Poles" real,
"F.laps" real,
"Points" text,
"Pos." text
) | Name the most wins | SELECT MIN("Wins") FROM table_1222 | wikisql |
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, find headquarter and the average of manufacturer , and group by attribute headquarter, and visualize them by a bar chart. | SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | tell me the total of patient 12927's inputs during a day before? | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), ... | mimic_iii |
CREATE TABLE table_16758 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What is the name of the circuit in which the race name is ii danish grand prix? | SELECT "Circuit" FROM table_16758 WHERE "Race Name" = 'II Danish Grand Prix' | wikisql |
CREATE TABLE table_203_603 (
id number,
"service" text,
"service id" text,
"bit rate" text,
"audio channels" text,
"description" text,
"analogue availability" text
) | what is the number of christian radio stations broadcasted by mxr yorkshire ? | SELECT COUNT(*) FROM table_203_603 WHERE "description" = 'christian' | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | How many patients are transferred from hosp/extram for the diagnosis benign neoplasm of spinal meninges? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND diagnoses.long_title = "Benign neoplasm of spinal meninges" | mimicsql_data |
CREATE TABLE table_73170 (
"Season" real,
"Class" text,
"Team" text,
"Motorcycle" text,
"Type" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real,
"Pts" real,
"Position" text
) | How many fastest laps did I.C. Team have? | SELECT COUNT("Fastest Laps") FROM table_73170 WHERE "Team" = 'I.C. Team' | wikisql |
CREATE TABLE table_38726 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in Final" text,
"Score in Final" text
) | What is the final score of the runner-up on 9 February 1992? | SELECT "Score in Final" FROM table_38726 WHERE "Outcome" = 'runner-up' AND "Date" = '9 february 1992' | wikisql |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | Bar chart, the-axis is the state, and the Y axis is each state's the smallest enrollment, show by the X from low to high. | SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY state | nvbench |
CREATE TABLE table_203_449 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | how long did william inge live ? | SELECT "lifetime" - "lifetime" FROM table_203_449 WHERE "name" = 'william inge' | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is discharge location of subject name edward schafer? | SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Edward Schafer" | mimicsql_data |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | What general close reasons exist?. Returns list of top-level possible close reasons | SELECT crt.Id, crt.Name, crt.Description FROM CloseReasonTypes AS crt | sede |
CREATE TABLE table_1849243_1 (
broadcast_date VARCHAR,
archive VARCHAR
) | What is the broadcast date of the 16mm t/r episode? | SELECT broadcast_date FROM table_1849243_1 WHERE archive = "16mm t/r" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
Pos... | All status-completed posts that once were marked status-declined. | SELECT DISTINCT ph.PostId AS "post_link", p.Score, p.CreationDate FROM PostHistory AS ph JOIN Posts AS p ON p.Id = ph.PostId JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'status-completed' AND p.PostTypeId = 1 AND ph.PostHistoryTypeId = 6 AND ph.Text LIKE '%<status-decline... | sede |
CREATE TABLE table_712 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Which candidates are from the Missouri 3 district? | SELECT "Candidates" FROM table_712 WHERE "District" = 'Missouri 3' | wikisql |
CREATE TABLE table_18819 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | how many location attendance with team being charlotte | SELECT COUNT("Location Attendance") FROM table_18819 WHERE "Team" = 'Charlotte' | wikisql |
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_n... | Visualize a bar chart for how many assets can each parts be used in? List the part name and the number, and display X in descending order. | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_name DESC | nvbench |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id I... | What are the number of the enrollment dates of all the tests that have result 'Pass'?, and rank by the X-axis in desc. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment DESC | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | what were the five most common procedures among the patients 20s this year? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE table_74014 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Name the incumbent for matthew lyon (dr) anthony new (dr) | SELECT "Incumbent" FROM table_74014 WHERE "Candidates" = 'Matthew Lyon (DR) Anthony New (DR)' | 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 lab (
labid numbe... | what were the four most frequently given procedures for patients who had already had digoxin within the same month? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'digoxin') AS t1 JOIN (SELECT patient.uni... | eicu |
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,
... | 在10年9月29日到21年10月4日内患者22625548的所有检验结果指标记录的检测人为马皓轩的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A... | css |
CREATE TABLE table_38386 (
"Year" real,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
) | What is the Original title with a Country that is canada? | SELECT "Original title" FROM table_38386 WHERE "Country" = 'canada' | wikisql |
CREATE TABLE gyb (
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... | 编号99383862652的医疗就诊中,患者的病情描述有哪些症状 | SELECT qtb.MAIN_COND_DES FROM qtb WHERE qtb.MED_CLINIC_ID = '99383862652' UNION SELECT gyb.MAIN_COND_DES FROM gyb WHERE gyb.MED_CLINIC_ID = '99383862652' UNION SELECT zyb.MAIN_COND_DES FROM zyb WHERE zyb.MED_CLINIC_ID = '99383862652' UNION SELECT mzb.MAIN_COND_DES FROM mzb WHERE mzb.MED_CLINIC_ID = '99383862652' | css |
CREATE TABLE table_9597 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | What was the method in the fight against Chris Myers? | SELECT "Method" FROM table_9597 WHERE "Opponent" = 'chris myers' | wikisql |
CREATE TABLE table_29601 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"First Star" text,
"Decision" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | Who made the decision in the game played on December 26? | SELECT "Decision" FROM table_29601 WHERE "Date" = 'December 26' | wikisql |
CREATE TABLE table_26658 (
"Province, Community" text,
"Contestant" text,
"Age" real,
"Height" text,
"Hometown" text,
"Geographical Regions" text
) | What geographical region is the province distrito nacional located in? | SELECT "Geographical Regions" FROM table_26658 WHERE "Province, Community" = 'Distrito Nacional' | wikisql |
CREATE TABLE table_19131921_1 (
dma INTEGER
) | What is dma? | SELECT MIN(dma) FROM table_19131921_1 | sql_create_context |
CREATE TABLE table_23285849_8 (
high_points VARCHAR,
location_attendance VARCHAR
) | Name the high points for the staples center 18,997 | SELECT high_points FROM table_23285849_8 WHERE location_attendance = "Staples Center 18,997" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
chartt... | tell me the number of times patient 25461 has got a stool out fecal bag until 05/14/2103. | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25461)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'stool out fecal ba... | mimic_iii |
CREATE TABLE table_17871 (
"No." real,
"Episode" text,
"Writer" text,
"Director" text,
"Viewers(millions)" text,
"Original airdate" text
) | Who directed Episode 5? | SELECT "Director" FROM table_17871 WHERE "Episode" = 'Episode 5' | wikisql |
CREATE TABLE table_56058 (
"\\theta_i" real,
"Simulated datasets (step 2)" text,
"Summary statistic \\omega_{S,i} (step 3)" real,
"Distance \\rho(\\omega_{S,i}, \\omega_E) (step 4)" real,
"Outcome (step 4)" text
) | What is the highest summary statistic of the algorithm with a distance larger than 2 and simulated datasets of aabbababaaabbababbab? | SELECT MAX("Summary statistic \\omega_{S,i} (step 3)") FROM table_56058 WHERE "Distance \\rho(\\omega_{S,i}, \\omega_E) (step 4)" > '2' AND "Simulated datasets (step 2)" = 'aabbababaaabbababbab' | wikisql |
CREATE TABLE table_name_6 (
player VARCHAR,
games VARCHAR,
years_at_club VARCHAR,
debut_year VARCHAR,
goals VARCHAR
) | WhichPlayer has a Debut year larger than 1930, and Goals smaller than 95, and Years at club of 1938, and Games of 6? | SELECT player FROM table_name_6 WHERE debut_year > 1930 AND goals < 95 AND years_at_club = "1938" AND games = 6 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is gender and days of hospital stay of subject id 2560? | SELECT demographic.gender, demographic.days_stay FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_1156428_2 (
worcs_f_c_matches VARCHAR,
name_of_ground VARCHAR
) | There were 68 worcs f-c matches played on Chester Road North Ground. | SELECT worcs_f_c_matches FROM table_1156428_2 WHERE name_of_ground = "Chester Road North Ground" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | what was the name of the last intake that patient 4401 has had on 12/29/2105? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 4401)) AND STRFTIME('%y-%m-%d', inpu... | mimic_iii |
CREATE TABLE table_name_98 (
result VARCHAR,
date VARCHAR
) | Tell me the result for 2007-09-29 | SELECT result FROM table_name_98 WHERE date = "2007-09-29" | sql_create_context |
CREATE TABLE table_18241 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who were the candidates when Jack Fields was the incumbent? | SELECT "Candidates" FROM table_18241 WHERE "Incumbent" = 'Jack Fields' | wikisql |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)... | Show the number of documents created in each day and bin document date by year interval and group by document type description with a group line chart. | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description | nvbench |
CREATE TABLE table_25662434_1 (
title VARCHAR,
production_code VARCHAR
) | How many titles had production code 1040? | SELECT COUNT(title) FROM table_25662434_1 WHERE production_code = 1040 | sql_create_context |
CREATE TABLE table_name_33 (
best VARCHAR,
team VARCHAR,
name VARCHAR
) | What is the best time from patrick carpentier from the forsythe racing team? | SELECT best FROM table_name_33 WHERE team = "forsythe racing" AND name = "patrick carpentier" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
cha... | when was the first time that patient 31300 had gastric meds intake on 02/26/2103? | 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 = 31300)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | mimic_iii |
CREATE TABLE table_name_70 (
host_team VARCHAR,
stadium VARCHAR
) | What is the host team with the stadium Lincoln Financial Field? | SELECT host_team FROM table_name_70 WHERE stadium = "lincoln financial field" | sql_create_context |
CREATE TABLE table_name_21 (
date VARCHAR,
remainder VARCHAR
) | Which Date has a Remainder of 20%? | SELECT date FROM table_name_21 WHERE remainder = "20%" | sql_create_context |
CREATE TABLE table_name_89 (
korean VARCHAR,
city VARCHAR
) | What's the Korean word for Pohang? | SELECT korean FROM table_name_89 WHERE city = "pohang" | sql_create_context |
CREATE TABLE table_name_40 (
k_2_o INTEGER,
al_2_o_3 VARCHAR,
objects VARCHAR,
na_2_o VARCHAR,
fe_2_o_3 VARCHAR
) | What is the highest K 2 O, when Na 2 O is greater than 1.87, when Fe 2 O 3 is greater than 0.07, when Objects is Ritual Disk, and when Al 2 O 3 is less than 0.62? | SELECT MAX(k_2_o) FROM table_name_40 WHERE na_2_o > 1.87 AND fe_2_o_3 > 0.07 AND objects = "ritual disk" AND al_2_o_3 < 0.62 | sql_create_context |
CREATE TABLE table_train_23 (
"id" int,
"in_another_study" bool,
"immune_suppression" bool,
"hiv_infection" bool,
"fio2" float,
"head_injury" bool,
"heart_disease" bool,
"steroid_therapy" bool,
"chemotherapy" bool,
"edema" bool,
"NOUSE" float
) | severe head trauma with edema | SELECT * FROM table_train_23 WHERE head_injury = 1 AND edema = 1 | criteria2sql |
CREATE TABLE table_61317 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | WHAT IS NO TIE FROM brighton & hove albion? | SELECT "Tie no" FROM table_61317 WHERE "Home team" = 'brighton & hove albion' | wikisql |
CREATE TABLE table_204_339 (
id number,
"season" number,
"age" number,
"overall" number,
"slalom" number,
"giant\nslalom" number,
"super g" text,
"downhill" number,
"combined" text
) | what is the average in the ages | SELECT AVG("age") FROM table_204_339 | squall |
CREATE TABLE table_39724 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | How much Overall has a Pick # larger than 2, and a Name of claude humphrey? | SELECT COUNT("Overall") FROM table_39724 WHERE "Pick #" > '2' AND "Name" = 'claude humphrey' | wikisql |
CREATE TABLE table_15420 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the latest year with less than 0 points? | SELECT MAX("Year") FROM table_15420 WHERE "Points" < '0' | wikisql |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grad... | Find the number of courses that have two prerequisites for each title in a bar chart. | SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title | nvbench |
CREATE TABLE Clients (
Client_ID INTEGER,
Address_ID INTEGER,
Customer_Email_Address VARCHAR(255),
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),... | Show all the planned delivery dates and bin by year in a line chart, I want to order in ascending by the x axis. | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date | nvbench |
CREATE TABLE table_23308178_4 (
opponent VARCHAR,
record VARCHAR
) | How many opponents were there with the record of 3-2-2? | SELECT COUNT(opponent) FROM table_23308178_4 WHERE record = "3-2-2" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 列出医院5211360所有医疗就诊记录中患者的平均年龄是多少?保留平均年龄大于10岁的记录并且要根据不同的科室名称和出院诊断疾病名称 | SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5211360' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM HAVING AVG(PERSON_AGE) > 10 | css |
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 sum of price over the founder , and group by attribute founder by a bar chart, order by the x-axis in asc. | SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TAB... | keyphrases used by Magda Balazinska | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Magda Balazinska' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_name_82 (
score VARCHAR,
game VARCHAR,
march VARCHAR
) | what is the score when the game is higher than 66 on march 28? | SELECT score FROM table_name_82 WHERE game > 66 AND march = 28 | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Close votes per PHP tag. | SELECT Posts.Id AS "post_link", COUNT(*) AS "close_votes" FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 6 AND Posts.ClosedDate IS NULL AND Posts.Tags LIKE '%<php>%' GROUP BY Posts.Id ORDER BY 'close_votes' DESC | sede |
CREATE TABLE table_2668243_25 (
result VARCHAR,
candidates VARCHAR
) | What was the result of the election featuring andrew stevenson (j) 100%? | SELECT result FROM table_2668243_25 WHERE candidates = "Andrew Stevenson (J) 100%" | sql_create_context |
CREATE TABLE table_name_98 (
swimsuit VARCHAR,
preliminary VARCHAR,
average VARCHAR
) | What is the swimsuit number when the preliminary is 8.721, and the average is more than 8.781? | SELECT COUNT(swimsuit) FROM table_name_98 WHERE preliminary = 8.721 AND average > 8.781 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | calculate the number of patients who had umbilical vein catheterization and have had more than 26 days of hospital stay. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "26" AND procedures.long_title = "Umbilical vein catheterization" | mimicsql_data |
CREATE TABLE table_22673956_1 (
race_name VARCHAR,
date VARCHAR
) | How many races took place on October 1? | SELECT COUNT(race_name) FROM table_22673956_1 WHERE date = "October 1" | sql_create_context |
CREATE TABLE table_37431 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
) | What is the round of the defense player from the United States? | SELECT "Round" FROM table_37431 WHERE "Position" = 'defense' AND "Nationality" = 'united states' | wikisql |
CREATE TABLE table_204_790 (
id number,
"year" number,
"nw rank" number,
"venue" text,
"opp rank" number,
"opponent" text,
"score" text,
"w/l" text,
"round" text,
"notes" text
) | how many total games were at braly stadium ? | SELECT COUNT(*) FROM table_204_790 WHERE "venue" = 'braly stadium' | squall |
CREATE TABLE table_name_12 (
code_name VARCHAR,
api_level VARCHAR
) | with api level 3, what is the code name? | SELECT code_name FROM table_name_12 WHERE api_level = 3 | sql_create_context |
CREATE TABLE table_name_83 (
result VARCHAR,
date VARCHAR
) | What was the game result on November 16, 1969? | SELECT result FROM table_name_83 WHERE date = "november 16, 1969" | sql_create_context |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | What is the total number of flags of ships that do not have a captain with the rank of Midshipman? Show the result using a bar chart, I want to rank the number of flag from high to low order please. | SELECT Flag, COUNT(Flag) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain WHERE Rank = 'Midshipman') GROUP BY Flag ORDER BY COUNT(Flag) DESC | nvbench |
CREATE TABLE table_39381 (
"Date" text,
"Theatre, Studio, or Network" text,
"Role" text,
"Dance Partner" text,
"Director" text
) | Who was the director where the role was Fred Ayres? | SELECT "Director" FROM table_39381 WHERE "Role" = 'fred ayres' | wikisql |
CREATE TABLE table_59280 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
) | WHAT IS THE 11:00AM WITH LOCAL PROGRAMS AT 1:30PM? | SELECT "11:00 am" FROM table_59280 WHERE "1:30 pm" = 'local programs' | wikisql |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | For each submission, group its acceptance result and count them Visualize them in a bar chart, and I want to sort in ascending by the y axis. | SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY COUNT(Result) | nvbench |
CREATE TABLE table_17234 (
"Disc" real,
"Track" real,
"English title" text,
"Japanese title" text,
"R\u014dmaji title" text,
"Artist" text,
"Track time" text
) | What is the Japanese title for Fantasy? | SELECT "Japanese title" FROM table_17234 WHERE "English title" = 'Fantasy' | wikisql |
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,
... | mention the age and gender of subject named jerry deberry? | SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_train_232 (
"id" int,
"metastatic_cancer" bool,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"short_life_expectancy" bool,
"body_mass_index_bmi" float,
"a1c" float,
"NOUSE" float
) | a known history of type ii diabetes mellitus > 3 months | SELECT * FROM table_train_232 WHERE diabetic = 'ii' | criteria2sql |
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_ID INTEGER,
Order_Item_ID INTEGER,
Product_ID INTEGER,
Order_Quantity INTEGER,
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_Type_Code CHAR... | What are the different product names? What is the average product price for each of them Show bar chart, could you list total number from low to high order? | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY AVG(Product_Price) | nvbench |
CREATE TABLE table_name_48 (
gold INTEGER,
rank VARCHAR,
bronze VARCHAR,
total VARCHAR
) | What is the smallest number of gold medals a country with 1 bronze, and a total of 3 medals which is lower than rank 7? | SELECT MIN(gold) FROM table_name_48 WHERE bronze = 1 AND total = 3 AND rank > 7 | sql_create_context |
CREATE TABLE table_name_62 (
rank INTEGER,
title VARCHAR
) | What is the rank of The Big Doll House? | SELECT MIN(rank) FROM table_name_62 WHERE title = "the big doll house" | sql_create_context |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dat... | papers of ali farhadi in eccv 2016 | SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'ali farhadi' AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'eccv' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_2562572_39 (
population__2011_ VARCHAR,
cyrillic_name_other_names VARCHAR
) | The pooulation of is? | SELECT population__2011_ FROM table_2562572_39 WHERE cyrillic_name_other_names = "Јарковац" | sql_create_context |
CREATE TABLE table_11677691_8 (
hometown VARCHAR,
school VARCHAR
) | Where is longview high school | SELECT hometown FROM table_11677691_8 WHERE school = "Longview High school" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 c... | tell me the variation in the potassium value of patient 12775 measured at 2105-12-31 03:04:00 compared to the value measured at 2105-12-30 03:06:00? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.charttime = '2105-12-31 03:04:00') - (SELECT l... | mimic_iii |
CREATE TABLE table_name_59 (
date VARCHAR,
venue VARCHAR
) | What day did the VFL play Punt Road Oval? | SELECT date FROM table_name_59 WHERE venue = "punt road oval" | sql_create_context |
CREATE TABLE table_71630 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the method of the match after round 1 in the k-1 andy memorial 2001 japan gp final? | SELECT "Method" FROM table_71630 WHERE "Round" > '1' AND "Event" = 'k-1 andy memorial 2001 japan gp final' | wikisql |
CREATE TABLE table_74002 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | What was the result for the candidate first elected in 1820? | SELECT "Result" FROM table_74002 WHERE "First elected" = '1820' | wikisql |
CREATE TABLE table_train_62 (
"id" int,
"do_not_resuscitate_dnr" bool,
"cd4_count" int,
"oxygen_therapy_by_face_mask" bool,
"intention_to_central_venous_catheter" bool,
"blood_transfusion" bool,
"tolerate_microscan_procedure" bool,
"NOUSE" float
) | contraindication to central venous catheterization | SELECT * FROM table_train_62 WHERE intention_to_central_venous_catheter = 1 | criteria2sql |
CREATE TABLE table_21262 (
"Athlete" text,
"Event" text,
"Swim (1.5km)" text,
"Trans 1" text,
"Bike (40km)" text,
"Trans 2" text,
"Run (10km)" text,
"Total Time" text,
"Rank" real
) | What is the trans 2 duration if the biking stage is covered within 58:20? | SELECT "Trans 2" FROM table_21262 WHERE "Bike (40km)" = '58:20' | wikisql |
CREATE TABLE table_name_42 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
) | Who is the player with a +3 to par and a 74-71-68=213 score? | SELECT player FROM table_name_42 WHERE to_par = "+3" AND score = 74 - 71 - 68 = 213 | sql_create_context |
CREATE TABLE table_70785 (
"Lithium" text,
"Sodium" text,
"Potassium" text,
"Rubidium" text,
"Caesium" text
) | what is the properties of potassium when lithium is h a l o g e n s and sodium is bromine? | SELECT "Potassium" FROM table_70785 WHERE "Lithium" = 'h a l o g e n s' AND "Sodium" = 'bromine' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
... | show me the shortest flight from BOSTON to DENVER which arrives in DENVER wednesday before 1200 | 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, date_day, days, flight WHERE ((((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.d... | atis |
CREATE TABLE table_56257 (
"Date" text,
"Round" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the score on 26 July 1930? | SELECT "Score" FROM table_56257 WHERE "Date" = '26 july 1930' | wikisql |
CREATE TABLE table_14618 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What is the value for 2011 when `a` is the value for 2009, and 4r is the value for 2013? | SELECT "2011" FROM table_14618 WHERE "2009" = 'a' AND "2013" = '4r' | wikisql |
CREATE TABLE table_40673 (
"AIRLINES" text,
"IATA" text,
"ICAO" text,
"CALLSIGN" text,
"COMMENCED OPERATIONS" real
) | Who is the commenced operations that has icao of slk? | SELECT "COMMENCED OPERATIONS" FROM table_40673 WHERE "ICAO" = 'slk' | wikisql |
CREATE TABLE table_7867 (
"Year" real,
"Country" text,
"Champion" text,
"Total score" text,
"To Par [a ]" text
) | What was the To Par [a] when Charles Coody Category:Articles with hCards was champion and the year was earlier than 1973? | SELECT "To Par [a ]" FROM table_7867 WHERE "Year" < '1973' AND "Champion" = 'charles coody category:articles with hcards' | wikisql |
CREATE TABLE table_11952 (
"Date" text,
"Opponent" text,
"Winner" text,
"Score" text,
"Result" text
) | Tell me the result for 1979-01-17 | SELECT "Result" FROM table_11952 WHERE "Date" = '1979-01-17' | wikisql |
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 five most frequent medications that patients were prescribed with in the same hospital visit after receiving glucocorticoid administration - parenteral the previous year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucocorticoid ... | eicu |
CREATE TABLE table_27537518_6 (
score VARCHAR,
first_star VARCHAR
) | What was the score of the game whose first star was O. Pavelec? | SELECT score FROM table_27537518_6 WHERE first_star = "O. Pavelec" | sql_create_context |
CREATE TABLE table_24427210_1 (
date VARCHAR,
stadium VARCHAR
) | Name the date for raymond james stadium | SELECT date FROM table_24427210_1 WHERE stadium = "Raymond James stadium" | sql_create_context |
CREATE TABLE table_19896 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Name the segment b for s dress form | SELECT "Segment B" FROM table_19896 WHERE "Segment A" = 's Dress Form' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.