context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Rating (
stars INTEGER,
mID VARCHAR
)
CREATE TABLE Movie (
title VARCHAR,
mID VARCHAR,
year VARCHAR
) | What is the average rating stars and title for the oldest movie? | SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(year) FROM Movie) | sql_create_context |
CREATE TABLE table_name_83 (
date VARCHAR,
away_team VARCHAR
) | When was the game at Essendon? | SELECT date FROM table_name_83 WHERE away_team = "essendon" | sql_create_context |
CREATE TABLE table_name_44 (
actor_in_moscow VARCHAR,
_2007 VARCHAR,
shipwreck VARCHAR
) | Who was the 2007 actor from Moscow for the shipwreck of Leonty Ibayev? | SELECT actor_in_moscow, _2007 FROM table_name_44 WHERE shipwreck = "leonty ibayev" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose age is less than 24 and item id is 50915? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "24" AND lab.itemid = "50915" | mimicsql_data |
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,... | 按照出院诊断出来的疾病编号和科室名称的不相同为条件,把医院1383573全部医疗就诊记录中患者的年龄列出来得到的平均数是多些? | SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '1383573' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD | css |
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,
... | 患者柏泰初经常去哪家医院,在2015-08-27到2016-11-04期间? | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '柏泰初' AND t_kc21.IN_HOSP_DATE BETWEEN '2015-08-27' AND '2016-11-04' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_14041 (
"Rank" real,
"Artist" text,
"Album" text,
"Peak position" text,
"Sales" real,
"Certification" text
) | what is the rank when the album is sean kingston? | SELECT "Rank" FROM table_14041 WHERE "Album" = 'sean kingston' | wikisql |
CREATE TABLE table_77248 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What was the attendance for the home team of Walsall? | SELECT "Attendance" FROM table_77248 WHERE "Home team" = 'walsall' | wikisql |
CREATE TABLE table_30120 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Viewers (millions)" text
) | Who directed the episode with 6.37 million viewers? | SELECT "Directed by" FROM table_30120 WHERE "Viewers (millions)" = '6.37' | wikisql |
CREATE TABLE table_79807 (
"Club" text,
"Manager" text,
"Captain" text,
"Manufacturer" text,
"Sponsor" text
) | Which Manchester United captain is sponsored by Nike? | SELECT "Captain" FROM table_79807 WHERE "Manufacturer" = 'nike' AND "Club" = 'manchester united' | 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
)
... | what is average age of patients whose marital status is divorced and gender is m? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "M" | mimicsql_data |
CREATE TABLE table_63764 (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
) | What play has a base of Athens and was written by Aeschylus? | SELECT "play" FROM table_63764 WHERE "author" = 'aeschylus' AND "base" = 'athens' | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | For those employees who was hired before 2002-06-21, give me the trend about employee_id over hire_date , could you list X-axis from high to low order please? | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_46 (
boiling_point VARCHAR,
density VARCHAR
) | What's the boiling point when the density is 1.092 g/ml? | SELECT boiling_point FROM table_name_46 WHERE density = "1.092 g/ml" | sql_create_context |
CREATE TABLE table_name_74 (
year INTEGER,
location VARCHAR,
result VARCHAR
) | what is the year when the location is yankee stadium and the result is 23-23 | SELECT AVG(year) FROM table_name_74 WHERE location = "yankee stadium" AND result = "23-23" | sql_create_context |
CREATE TABLE table_72982 (
"Outcome" text,
"Edition" real,
"Round" text,
"Opponent Team" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the outcome of the game when the opponent was Magdal na Ryb rikov ? | SELECT "Outcome" FROM table_72982 WHERE "Opponent" = 'Magdaléna Rybáriková' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_... | when did patient 7524 get a norepinephrine bitartrate prescription for the last time until 06/2105? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7524) AND prescriptions.drug = 'norepinephrine bitartrate' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-06' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_24509 (
"Rank" real,
"Rider" text,
"Mon 1 June" text,
"Tue 2 June" text,
"Wed 3 June" text,
"Thurs 4 June" text,
"Fri 5 June" text
) | What were the time and speed for the rider ranked in 12 on Wed, June 3? | SELECT "Wed 3 June" FROM table_24509 WHERE "Rank" = '12' | wikisql |
CREATE TABLE people (
person_id VARCHAR,
email_address VARCHAR
)
CREATE TABLE candidates (
candidate_id VARCHAR
) | Find id of the candidate whose email is stanley.monahan@example.org? | SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "stanley.monahan@example.org" | sql_create_context |
CREATE TABLE table_name_27 (
competition VARCHAR,
date VARCHAR
) | What is the competition on 15 August 2008? | SELECT competition FROM table_name_27 WHERE date = "15 august 2008" | sql_create_context |
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,
... | count the number of patients whose item id is 50824 and lab test abnormal status is abnormal. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50824" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_59693 (
"Election" text,
"First member" text,
"First party" text,
"Second member" text,
"Second party" text
) | Which of the first parties has second member as Charles Robert Colvile, and a liberal second party? | SELECT "First party" FROM table_59693 WHERE "Second member" = 'charles robert colvile' AND "Second party" = 'liberal' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | A bar chart shows the distribution of Team_Name and ACC_Percent . | SELECT Team_Name, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_26240481_1 (
fbs_opponent VARCHAR,
result VARCHAR
) | Who played FBS where the result was L, 62-3? | SELECT fbs_opponent FROM table_26240481_1 WHERE result = "L, 62-3" | sql_create_context |
CREATE TABLE table_24077 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Golden Bears points" real,
"Opponents" real,
"Record" text
) | What was the least amount of points scored by the golden bears when the opponent scored 15 points? | SELECT MIN("Golden Bears points") FROM table_24077 WHERE "Opponents" = '15' | wikisql |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | Show how many installation date from each installation date, and rank by the Y in ascending. | SELECT installation_date, COUNT(installation_date) FROM station ORDER BY COUNT(installation_date) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | how many patients whose age is less than 70 and drug route is ivpca? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "70" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients whose discharge location is snf and primary disease is complete heart block? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "COMPLETE HEART BLOCK" | mimicsql_data |
CREATE TABLE table_50064 (
"Year" real,
"Award giving body" text,
"Category" text,
"Nominated for" text,
"Result" text
) | What's the category for the tween academy: class of 2012 nomination? | SELECT "Category" FROM table_50064 WHERE "Nominated for" = 'tween academy: class of 2012' | wikisql |
CREATE TABLE table_74100 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | What is the enrollment for the Redhawks? | SELECT COUNT("Enrollment") FROM table_74100 WHERE "Team Nickname" = 'RedHawks' | wikisql |
CREATE TABLE table_70902 (
"Year" real,
"Single" text,
"U.S. Hot 100" text,
"U.S. Dance" text,
"U.S. R&B" text,
"Album" text
) | Name the US Hot 100 for album of I like you | SELECT "U.S. Hot 100" FROM table_70902 WHERE "Album" = 'i like you' | wikisql |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_o... | Show me about the distribution of personal_name and author_tutor_ATB in a bar chart. | SELECT personal_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_35544 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What was the D segment for episode 60? | SELECT "Segment D" FROM table_35544 WHERE "Episode" = '60' | wikisql |
CREATE TABLE table_name_9 (
percentage VARCHAR,
draw VARCHAR
) | Which Percentage has a Draw of 6? | SELECT percentage FROM table_name_9 WHERE draw = 6 | sql_create_context |
CREATE TABLE table_17698 (
"Rank in Nyagatare Sectors, 2012" real,
"Sector" text,
"Area in sqkm" real,
"Population August 15, 2012" real,
"Population, August 15, 2002" real,
"Population Change 2002-2012 (%)" text,
"Population Density 2012 (km 2 )" real
) | What is the August 15, 2012 population when the population density of 2012 is 307? | SELECT MAX("Population August 15, 2012") FROM table_17698 WHERE "Population Density 2012 (km 2 )" = '307' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEP... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, show y axis in descending order please. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_18220102_1 (
award_winning_film VARCHAR,
date__closing_ VARCHAR
) | Which award-winning film has a closing date of September 4? | SELECT award_winning_film FROM table_18220102_1 WHERE date__closing_ = "September 4" | sql_create_context |
CREATE TABLE table_59592 (
"Rank" text,
"County" text,
"State" text,
"Land area (km\u00b2)" text,
"Land area (mi\u00b2)" text,
"April 1, 2010 census" text,
"April 1, 2010 density (/km\u00b2)" text,
"April 1, 2010 density (/mi\u00b2)" text,
"July 1, 2010 official estimate" text,
"... | What is the July 1, 2010 density when the April 1, 2010 density is 1,694? | SELECT "July 1, 2010 density (/km\u00b2)" FROM table_59592 WHERE "April 1, 2010 density (/mi\u00b2)" = '1,694' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose admission location is clinic referral/premature and drug code is esmo100i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.formulary_drug_cd = "ESMO100I" | mimicsql_data |
CREATE TABLE table_25760 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | Who wrote the episode that had a production code of 3ajn20? | SELECT "Written by" FROM table_25760 WHERE "Production code" = '3AJN20' | wikisql |
CREATE TABLE table_name_88 (
date VARCHAR,
round__leg_ VARCHAR
) | What date has 3 as the round (leg)? | SELECT date FROM table_name_88 WHERE round__leg_ = "3" | sql_create_context |
CREATE TABLE table_59784 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What place is player Brad Faxon from? | SELECT "Place" FROM table_59784 WHERE "Player" = 'brad faxon' | wikisql |
CREATE TABLE table_5913 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | Who was the winning team at the Homestead-Miami Speedway? | SELECT "Winning team" FROM table_5913 WHERE "Circuit" = 'homestead-miami speedway' | wikisql |
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... | count the number of patients whose procedure long title is cardiopulmonary resuscitation, not otherwise specified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified" | mimicsql_data |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,... | Among all the claims, which claims have a claimed amount larger than the average? Please Bin date the claim was made into week day interval and count them to show a bar chart. | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims) | nvbench |
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... | 在医院3166423就诊的患者77341331其医疗就诊记录里在出院时诊断疾病名称含有含抑郁症的编号都啥? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '77341331' AND qtb.MED_SER_ORG_NO = '3166423' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%抑郁症%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '77341331' AND gyb.MED_SER_ORG_NO = '3166423' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%抑郁症%' UNION SELECT zyb.MED_CLINIC_... | css |
CREATE TABLE table_4925 (
"Player" text,
"Span" text,
"Lost" text,
"Draw" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text
) | What pens have a draw of 0 when the player is sione mafi pahulu? | SELECT "Pens" FROM table_4925 WHERE "Draw" = '0' AND "Player" = 'sione mafi pahulu' | wikisql |
CREATE TABLE table_name_94 (
result VARCHAR,
date VARCHAR
) | What was the result of the April 16 game? | SELECT result FROM table_name_94 WHERE date = "april 16" | sql_create_context |
CREATE TABLE table_203_27 (
id number,
"number" number,
"serial no" number,
"entered service" text,
"withdrawn" text,
"kilometres travelled" number
) | what was the next locomotive to be withdrawn after locomotive 4106 | SELECT "number" FROM table_203_27 WHERE "withdrawn" > (SELECT "withdrawn" FROM table_203_27 WHERE "number" = 4106) ORDER BY "withdrawn" LIMIT 1 | squall |
CREATE TABLE table_56983 (
"Variant (with Niqqud )" text,
"without Niqqud" text,
"Phonemic Value" text,
"Phonetic Realisation" text,
"English example" text
) | What is the variant with niqqud for a phonetic realisation of [[[|v]]]? | SELECT "Variant (with Niqqud )" FROM table_56983 WHERE "Phonetic Realisation" = '[[[|v]]]' | wikisql |
CREATE TABLE table_2607 (
"Rank" real,
"Athlete" text,
"Nation" text,
"Olympics" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total(min. 2 medals)" real
) | How many silver medalist was won? | SELECT MAX("Silver") FROM table_2607 | wikisql |
CREATE TABLE table_203_266 (
id number,
"group" text,
"members" number,
"caucusing" number,
"total" number
) | what group has the same number of caucusing members as rpr group ? | SELECT "group" FROM table_203_266 WHERE "group" <> 'rpr group' AND "caucusing" = (SELECT "caucusing" FROM table_203_266 WHERE "group" = 'rpr group') | squall |
CREATE TABLE competition_record (
competition_id number,
farm_id number,
rank number
)
CREATE TABLE farm (
farm_id number,
year number,
total_horses number,
working_horses number,
total_cattle number,
oxen number,
bulls number,
cows number,
pigs number,
sheep_and_goa... | What are the themes of farm competitions sorted by year in ascending order? | SELECT theme FROM farm_competition ORDER BY year | spider |
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 number of patients diagnosed with gangrene had the drug route as pr? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "GANGRENE" AND prescriptions.route = "PR" | mimicsql_data |
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 admissions (
row_id number,
subject_id number,
hadm... | when did until 58 months ago patient 17505 last get a catheter tip-iv microbiology test? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17505) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-58 month') OR... | mimic_iii |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Has Prof. Eric Calderwood taught 725 many times ? | SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 725 AND instructor.name LIKE '%Eric Calderwood%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.off... | advising |
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
)
CREATE TAB... | Show the different headquarters and number of companies at each headquarter with a bar chart. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters | nvbench |
CREATE TABLE table_name_7 (
capital VARCHAR,
area_in_1000km²__1930_ VARCHAR
) | tell me the name of the capital with an area of 20,4. | SELECT capital FROM table_name_7 WHERE area_in_1000km²__1930_ = "20,4" | sql_create_context |
CREATE TABLE table_name_45 (
first_elected VARCHAR,
result VARCHAR,
district VARCHAR
) | What is the first date of election for the incumbent that was re-elected in the South Carolina 1 district? | SELECT first_elected FROM table_name_45 WHERE result = "re-elected" AND district = "south carolina 1" | sql_create_context |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 检验报告单11288812225的具体日期为何年?何月?何日 | SELECT zyjybgb.BGRQ FROM zyjybgb WHERE zyjybgb.BGDH = '11288812225' UNION SELECT mzjybgb.BGRQ FROM mzjybgb WHERE mzjybgb.BGDH = '11288812225' | css |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
avail... | Show me a bar chart for how many bookings does each booking status have? List the booking status code and the number of corresponding bookings, I want to order total number in desc order. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) DESC | nvbench |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | for the anal fistulotomy what does it cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'anal fistulotomy')) | mimic_iii |
CREATE TABLE table_43634 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | On what Date was the Opponent the Tennessee Titans? | SELECT "Date" FROM table_43634 WHERE "Opponent" = 'tennessee titans' | wikisql |
CREATE TABLE table_2337 (
"School" text,
"Main location" text,
"Control" text,
"Type" text,
"Enrollment (2005)" real,
"Founded" real
) | Name the main location for public and masters university | SELECT "Main location" FROM table_2337 WHERE "Control" = 'Public' AND "Type" = 'Masters university' | wikisql |
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... | 列出医院5003066非科室小儿屈光科负责的在二零一二年十月一号到二零一九年十一月二十四号内全部医疗就诊记录 | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '5003066' AND IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '5003066' AND IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24' AND MED_ORG_DEPT_NM = '小儿屈光科') | css |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | I need a 15 -credit upper level class in Spring-Summer 2003 - is there one ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 15 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring-Summer... | advising |
CREATE TABLE table_name_6 (
first_elected VARCHAR,
party VARCHAR,
member VARCHAR
) | When was Jill Hall of the Labor Party first elected? | SELECT first_elected FROM table_name_6 WHERE party = "labor" AND member = "jill hall" | sql_create_context |
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
) | Show me about the correlation between People_ID and Total in a scatter chart. | SELECT People_ID, Total FROM body_builder | nvbench |
CREATE TABLE table_70595 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What type of engine did the Fuel Injection entrant use? | SELECT "Engine" FROM table_70595 WHERE "Entrant" = 'fuel injection' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | count the number of people that died after being diagnosed with s/p cholecystectomy within the same month this year. | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p cholecystectomy') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.... | eicu |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code v... | show me the flights on DL to ATLANTA in the morning | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.airline_code = 'DL' AND flight.to_airport = airport_service.airport_code) AND flight.departure_time BETWEEN 0 AND 1200 | atis |
CREATE TABLE category (
category_id number,
name text,
last_update time
)
CREATE TABLE film_actor (
actor_id number,
film_id number,
last_update time
)
CREATE TABLE city (
city_id number,
city text,
country_id number,
last_update time
)
CREATE TABLE inventory (
inventory_i... | Return the amount of the largest payment. | SELECT amount FROM payment ORDER BY amount DESC LIMIT 1 | spider |
CREATE TABLE table_46875 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | What is the total number of Total(s), when Finish is 'T21', and when To Par is greater than 23? | SELECT COUNT("Total") FROM table_46875 WHERE "Finish" = 't21' AND "To par" > '23' | wikisql |
CREATE TABLE table_2465 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What is the theme of the song by Soul Brothers Six | SELECT "Theme" FROM table_2465 WHERE "Original artist" = 'Soul Brothers Six' | wikisql |
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Perform... | What are the descriptions of the service types with product price above 100, and count them by a bar chart | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description | nvbench |
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... | 把2002年11月30日到2010年6月8日期间患者96886355一共看过多少种疾病查看一下 | SELECT COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_ID = '96886355' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-11-30' AND '2010-06-08' | css |
CREATE TABLE table_204_786 (
id number,
"riding" text,
"candidate" text,
"gender" text,
"residence" text,
"occupation" text,
"votes" number,
"%" number,
"rank" text,
"biographical notes" text
) | who got a larger number of votes , macneill or olsson ? | SELECT "candidate" FROM table_204_786 WHERE "candidate" IN ('mark macneill', 'karen olsson') ORDER BY "votes" DESC LIMIT 1 | squall |
CREATE TABLE table_10197 (
"Goal" real,
"Date" text,
"Venue" text,
"Result" text,
"Competition" text
) | What day has 34 goals? | SELECT "Date" FROM table_10197 WHERE "Goal" = '34' | wikisql |
CREATE TABLE table_name_15 (
series VARCHAR,
director VARCHAR,
production_number VARCHAR
) | From what series was the title with a production number of 1614 that was directed by Friz Freleng? | SELECT series FROM table_name_15 WHERE director = "friz freleng" AND production_number = 1614 | 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... | 病号卫谷雪在2004年8月7日到2004年8月8日内的住院次数总共有多少次? | SELECT COUNT(*) FROM t_kc21 WHERE PERSON_NM = '卫谷雪' AND IN_HOSP_DATE BETWEEN '2004-08-07' AND '2004-08-08' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_name_66 (
games VARCHAR,
goals INTEGER,
name VARCHAR
) | What is the average Goals/Games for Rummenigge, Karl-Heinz, with Goals less than 162? | SELECT AVG(goals) / games FROM table_name_66 WHERE name = "rummenigge, karl-heinz" AND goals < 162 | sql_create_context |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 查出患者91778499在编号为4450505的医院中门诊诊断名包括牙的门诊就诊记录具体有哪些 | SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '91778499' AND hz_info.YLJGDM = '4450505' AND wdmzjzjlb.JZZDSM LIKE '%牙%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_in... | css |
CREATE TABLE table_19603 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"2nd" real,
"3rd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ( $ )" real,
"Money list rank" text,
"Scoring average" text,
"Scoring rank" text
) | How many total earnings are recorded when her best finish is t2 with a 71.25 scoring average? | SELECT COUNT("Earnings ( $ )") FROM table_19603 WHERE "Best finish" = 'T2' AND "Scoring average" = '71.25' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 尤英秀患者在10年4月29日至15年7月29日之间去的医院总数是多少? | SELECT COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_NM = '尤英秀' AND qtb.IN_HOSP_DATE BETWEEN '2010-04-29' AND '2015-07-29' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_NM = '尤英秀' AND gyb.IN_HOSP_DATE BETWEEN '2010-04-29' AND '2015-07-29' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zyb WHERE zy... | css |
CREATE TABLE table_14312 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the latest year with less than 2 points, a Mclaren m28 chassis and an Entrant of l wenbr u team mclaren? | SELECT MAX("Year") FROM table_14312 WHERE "Points" < '2' AND "Chassis" = 'mclaren m28' AND "Entrant" = 'löwenbräu team mclaren' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the email . | SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_85 (
home_team VARCHAR,
date VARCHAR,
away_team VARCHAR
) | What is Home Team, when Date is '22 Nov 1989', and when Away Team is 'Bath City'? | SELECT home_team FROM table_name_85 WHERE date = "22 nov 1989" AND away_team = "bath city" | sql_create_context |
CREATE TABLE table_10020 (
"Rank" text,
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | What is Run 4, when Run 2 is 1:25.84? | SELECT "Run 4" FROM table_10020 WHERE "Run 2" = '1:25.84' | wikisql |
CREATE TABLE table_name_76 (
cuts_made INTEGER,
events VARCHAR,
wins VARCHAR,
top_25 VARCHAR
) | How man cuts were there of players who had 0 wins but had 1 player in the top 25 with more than 4 events? | SELECT SUM(cuts_made) FROM table_name_76 WHERE wins = 0 AND top_25 = 1 AND events > 4 | sql_create_context |
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connectio... | Draw a bar chart of operating system versus the total number, display from high to low by the names please. | SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system ORDER BY Operating_system DESC | nvbench |
CREATE TABLE table_name_49 (
name VARCHAR,
goals VARCHAR,
transfer_fee VARCHAR
) | What is Name, when Goals is greater than 14, and when Transfer Fee is 'Youth System'? | SELECT name FROM table_name_49 WHERE goals > 14 AND transfer_fee = "youth system" | sql_create_context |
CREATE TABLE table_62777 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | How many people attended the September 14, 1968 game? | SELECT COUNT("Attendance") FROM table_62777 WHERE "Date" = 'september 14, 1968' | wikisql |
CREATE TABLE table_name_23 (
year INTEGER,
moves VARCHAR
) | What year had 32 moves? | SELECT SUM(year) FROM table_name_23 WHERE moves = 32 | sql_create_context |
CREATE TABLE table_name_15 (
gold VARCHAR,
bronze INTEGER
) | What is the total number of Gold medals for the Nation with more than 3 Bronze? | SELECT COUNT(gold) FROM table_name_15 WHERE bronze > 3 | sql_create_context |
CREATE TABLE table_54422 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What Venue had an Away team score of 7.15 (57) on June 4, 1973? | SELECT "Venue" FROM table_54422 WHERE "Away team score" = '7.15 (57)' | wikisql |
CREATE TABLE table_204_542 (
id number,
"season" text,
"competition" text,
"round" text,
"club" text,
"home" text,
"away" text,
"aggregate" text
) | who won by the most points at home ? | SELECT "club" FROM table_204_542 ORDER BY "home" DESC LIMIT 1 | squall |
CREATE TABLE table_name_66 (
tonnage VARCHAR,
date VARCHAR
) | Which Tonnage is on 25 july 1942? | SELECT tonnage FROM table_name_66 WHERE date = "25 july 1942" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
sub... | in a year before how many patients were prescribed phenylephrine in the same month after the procedure of venous cath nec. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath... | mimic_iii |
CREATE TABLE table_name_76 (
time VARCHAR,
rank VARCHAR
) | What is the time of the rider ranked 6? | SELECT time FROM table_name_76 WHERE rank = 6 | sql_create_context |
CREATE TABLE table_name_64 (
lane INTEGER,
mark VARCHAR,
heat VARCHAR
) | What is the total Lane with a Mark of 47.02, and a Heat higher than 5? | SELECT SUM(lane) FROM table_name_64 WHERE mark = "47.02" AND heat > 5 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.