context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_49796 (
"Province" text,
"South Asians 2001" real,
"% 2001" text,
"South Asians 2011" real,
"% 2011" text
) | How many South Asians on average were in Alberta in 2001 and in 2011 had 159,055? | SELECT AVG("South Asians 2001") FROM table_49796 WHERE "Province" = 'alberta' AND "South Asians 2011" > '159,055' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | Would MODGREEK 305 fit the ULCS requirements ? | SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'MODGREEK' AND course.number = 305 AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | flights from NEW YORK to MONTREAL | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MONTR... | atis |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,... | What time in the morning is the AAS 215 course ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'AAS' AND cour... | advising |
CREATE TABLE table_76194 (
"Team" text,
"Sets+" real,
"Sets\u2013" real,
"Points+" real,
"Points\u2013" real
) | What is the total number of Points- when the Sets- is larger than 51? | SELECT COUNT("Points\u2013") FROM table_76194 WHERE "Sets\u2013" > '51' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | give me the number of patients whose admission location is emergency room admit and days of hospital stay is greater than 4? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay > "4" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | calculate the number of patients admitted to the hospital since 2100. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) >= '2100' | eicu |
CREATE TABLE table_name_50 (
incumbent VARCHAR,
district VARCHAR
) | Who was the incumbent from the Ohio 13 district? | SELECT incumbent FROM table_name_50 WHERE district = "ohio 13" | sql_create_context |
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... | 陶秀竹病患在02年4月20日至03年8月28日内在医疗机构4933509西药共开了多少? | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '陶秀竹' AND t_kc22.STA_DATE BETWEEN '2002-04-20' AND '2003-08-28' AND gwyjzb.MED_SER_ORG_NO = '4933509' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_... | css |
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... | 这个被门诊诊断为脑梗死后遗症的病人朱文彬,查询他做的罗马指数(绝经前)的检测结果定量及单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.J... | css |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | Top 5 Questioners per Tag per Year. | SELECT TIME_TO_STR(p.CreationDate, '%Y') AS YEAR, p.OwnerUserId AS "user_link", que.TagName, SUM(p.Score) AS Score FROM Posts AS p INNER JOIN (SELECT Posts.Id, Tags.TagName FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId INNER JOIN PostTypes ON PostTypes.Id = Pos... | sede |
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
) | What are the number of the names of all products?, I want to sort Name in descending order. | SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_65458 (
"Athlete" text,
"Shooting Score (pts)" text,
"Fencing Victories (pts)" text,
"Swimming Time (pts)" text,
"Equestrian Time (pts)" text,
"Running Time (pts)" text,
"Total" real
) | Which Fencing Victories (pts) has a Total of 5640? | SELECT "Fencing Victories (pts)" FROM table_65458 WHERE "Total" = '5640' | wikisql |
CREATE TABLE table_name_36 (
date VARCHAR,
loss VARCHAR
) | what date did reuschel (12-3) lose? | SELECT date FROM table_name_36 WHERE loss = "reuschel (12-3)" | 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... | 列出编码为在0655501为医院中患者46992824就诊科室名称不包含修复的所有医疗就诊记录是哪些? | SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '46992824' AND gwyjzb.MED_SER_ORG_NO = '0655501' AND NOT gwyjzb.MED_ORG_DEPT_NM LIKE '%修复%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '46992824' AND fgwyjzb.MED_SER_ORG_NO = '0655501' AND NOT fgwyjzb.MED_ORG_DEPT_NM LIKE '%修复%' | css |
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category text,
Result text
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,... | Show all book categories and the number of books in each category, I want to list in desc by the bars. | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category DESC | nvbench |
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... | how many patients whose admission type is urgent and drug name is lactic acid 12% lotion? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Lactic Acid 12% Lotion" | mimicsql_data |
CREATE TABLE table_name_37 (
d_49_√ VARCHAR,
d_47_√ VARCHAR
) | What is the D 49 when D 47 is d 67 +? | SELECT d_49_√ FROM table_name_37 WHERE d_47_√ = "d 67 +" | sql_create_context |
CREATE TABLE table_67699 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | With a record of 48-51 for the team, the lowest 2005 attendance was listed as how many? | SELECT MIN("Attendance") FROM table_67699 WHERE "Record" = '48-51' | wikisql |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | Return the investor who have invested in the greatest number of entrepreneurs. | SELECT investor FROM entrepreneur GROUP BY investor ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TA... | what nonstop flights between BOSTON and WASHINGTON arrive after 1600 o'clock pm | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.arrival_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1.air... | atis |
CREATE TABLE table_80029 (
"Year" real,
"Chassis" text,
"Engine(s)" text,
"Tyres" text,
"Points" text
) | Name the chassis of 1961 | SELECT "Chassis" FROM table_80029 WHERE "Year" = '1961' | wikisql |
CREATE TABLE table_10012 (
"1997\u201398" text,
"1998\u201399" text,
"1999\u201300" text,
"2000\u201301" text,
"2001\u201302" text,
"2002\u201303" text,
"2003\u201304" text,
"2004\u201305" text,
"2005\u201306" text,
"2006\u201307" text,
"2007\u201308" text,
"2008\u201309"... | What is the 2006-07 of the 2012-13 pavlis? | SELECT "2006\u201307" FROM table_10012 WHERE "2012\u201313" = 'pavlis' | wikisql |
CREATE TABLE table_14949 (
"Code Name" text,
"Function (figure)" text,
"Real Name" text,
"Birthplace" text,
"Serial number" text,
"Primary military speciality" text,
"Secondary military speciality" text
) | What is the Code Name for the Space Pilot Function (figure)? | SELECT "Code Name" FROM table_14949 WHERE "Function (figure)" = 'space pilot' | wikisql |
CREATE TABLE table_name_7 (
debt_as__percentage_of_value INTEGER,
_percentage_change_on_year VARCHAR,
operating_income__$m_ VARCHAR
) | Name the average debt as % of value for operating income more than -16 and % change on year being 62 | SELECT AVG(debt_as__percentage_of_value) FROM table_name_7 WHERE _percentage_change_on_year = "62" AND operating_income__$m_ > -16 | sql_create_context |
CREATE TABLE table_name_32 (
votes VARCHAR,
date VARCHAR
) | How many votes were there on November 10? | SELECT votes FROM table_name_32 WHERE date = "november 10" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | count the number of times that until 122 months ago patient 48709 had been prescribed lidocaine 2%/epi 1:100,000. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 48709) AND prescriptions.drug = 'lidocaine 2%/epi 1:100,000' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-122 month') | mimic_iii |
CREATE TABLE table_name_17 (
wins INTEGER,
rank INTEGER
) | What is the low win total for players ranked below 4? | SELECT MIN(wins) FROM table_name_17 WHERE rank > 4 | sql_create_context |
CREATE TABLE table_48883 (
"Team" text,
"Make" text,
"Drivers" text,
"Tyre" text,
"Rounds" text
) | What is the tyre of real racing with leon team member koudai tsukakoshi? | SELECT "Tyre" FROM table_48883 WHERE "Team" = 'real racing with leon' AND "Drivers" = 'koudai tsukakoshi' | wikisql |
CREATE TABLE table_name_98 (
seasons VARCHAR,
name VARCHAR,
lost VARCHAR
) | Which Seasons has a Name of joe grugin, and a Lost larger than 8? | SELECT COUNT(seasons) FROM table_name_98 WHERE name = "joe grugin" AND lost > 8 | sql_create_context |
CREATE TABLE table_27294107_11 (
round_of_32 VARCHAR,
round_of_16 VARCHAR
) | What is the round of 32 if the round of 16 is drenovak ( srb ) w 20 11? | SELECT round_of_32 FROM table_27294107_11 WHERE round_of_16 = "Drenovak ( SRB ) W 20–11" | sql_create_context |
CREATE TABLE table_name_37 (
name VARCHAR,
laid_down VARCHAR
) | what is the name when the laid down is 28 february 1943? | SELECT name FROM table_name_37 WHERE laid_down = "28 february 1943" | sql_create_context |
CREATE TABLE table_76157 (
"Season" text,
"Winner" text,
"Winning Song" text,
"Winning Song (English Title)" text,
"Debut Album" text
) | Who won with the song kemenangan cinta? | SELECT "Winner" FROM table_76157 WHERE "Winning Song" = 'kemenangan cinta' | wikisql |
CREATE TABLE table_18138132_2 (
developer VARCHAR,
title VARCHAR
) | Who is the developer for Windows live messenger? | SELECT developer FROM table_18138132_2 WHERE title = "Windows Live Messenger" | 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... | how many patients whose drug name is aztreonam? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Aztreonam" | mimicsql_data |
CREATE TABLE table_45308 (
"Date" text,
"Ship" text,
"Type" text,
"Nationality" text,
"Tonnage GRT" real,
"Fate" text
) | what is the ship with the date of 28.1.1915? | SELECT "Ship" FROM table_45308 WHERE "Date" = '28.1.1915' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | have patient 022-89058's been prescribed acetaminophen, 50 ml vial : dextrose 50 % iv soln, or acetaminophen (tylenol) tablet 650 mg on the first hospital encounter? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... | eicu |
CREATE TABLE table_43446 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | Which Surface has an Opponent in the final of st phane robert? | SELECT "Surface" FROM table_43446 WHERE "Opponent in the final" = 'stéphane robert' | wikisql |
CREATE TABLE table_name_43 (
incumbent VARCHAR,
first_elected VARCHAR
) | Who was the incumbent who was first elected in 1876? | SELECT incumbent FROM table_name_43 WHERE first_elected = "1876" | sql_create_context |
CREATE TABLE table_4436 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | Tell me the affiliation for diego walsh | SELECT "Affiliation" FROM table_4436 WHERE "Player" = 'diego walsh' | wikisql |
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
) | A bar chart for showing the number of the names of editors that are on the committee of journals with sales bigger than 3000, and could you list from high to low by the Name? | SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_name_32 (
pada_4 VARCHAR,
pada_2 VARCHAR
) | which Pada 4 has a Pada 2 of tha? | SELECT pada_4 FROM table_name_32 WHERE pada_2 = "थ tha" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose death status is 1 and diagnoses icd9 code is 53550? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "53550" | mimicsql_data |
CREATE TABLE table_74486 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Tell me the lowest gold for rank of 6 and total less than 2 | SELECT MIN("Gold") FROM table_74486 WHERE "Rank" = '6' AND "Total" < '2' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | when patient 10266 was receiving a lab test for the first time when they visited the hospital first time? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_48 (
venue VARCHAR,
home_team VARCHAR
) | Where does St Kilda play? | SELECT venue FROM table_name_48 WHERE home_team = "st kilda" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | what are the five most frequent laboratory tests taken since 2103? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE STRFTIME('%y', lab.labresulttime) >= '2103' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_name_36 (
being__qualities_ VARCHAR,
having__things_ VARCHAR
) | Name the being qualities for having things of language, religions, work, customs, values, norms | SELECT being__qualities_ FROM table_name_36 WHERE having__things_ = "language, religions, work, customs, values, norms" | sql_create_context |
CREATE TABLE table_58974 (
"Provider" text,
"Years" text,
"Free or pay" text,
"No. of channels" text,
"Colour" text,
"Digital" text,
"Transmission" text
) | How many analogue satellite channels does Sky [Analogue] have? | SELECT "No. of channels" FROM table_58974 WHERE "Transmission" = 'analogue satellite' AND "Provider" = 'sky [analogue]' | wikisql |
CREATE TABLE table_1515346_2 (
player VARCHAR,
country VARCHAR,
honoree_s_ VARCHAR
) | Who won the tournament for Australia in the year when Byron Nelson was Honoree? | SELECT player FROM table_1515346_2 WHERE country = "Australia" AND honoree_s_ = "Byron Nelson" | 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,
... | what is the date of birth and admission time of subject name jerry deberry? | SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_name_98 (
driver VARCHAR,
date VARCHAR
) | Who is the Driver, when the Date is October 6? | SELECT driver FROM table_name_98 WHERE date = "october 6" | sql_create_context |
CREATE TABLE table_62872 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
) | What is the name of the 2008 club for Istres Volleyball? | SELECT "Name" FROM table_62872 WHERE "2008 club" = 'istres volleyball' | wikisql |
CREATE TABLE table_name_81 (
team VARCHAR,
country VARCHAR,
uci_points VARCHAR
) | What team in France had 15 UCi points? | SELECT team FROM table_name_81 WHERE country = "france" AND uci_points = "15" | 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... | 依照科室的不同编码以及入院诊断疾病编码的区别算算医院1120246所有的记录里有民政补助的部分与总的医疗费用之比的最大值并把算出的数值由高到低来排列 | SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1120246' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy... | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiod... | what number of patients were diagnosed with ethanol overdose and did not return to the hospital within 2 months since 2104? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ethanol overdose' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104') AS t1) - (SELECT COUNT(DIST... | eicu |
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,
... | give me the number of patients whose primary disease is newborn and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_name_6 (
population_density VARCHAR,
name VARCHAR,
change___percentage_ VARCHAR
) | What is the population density of Siglunes when the change was smaller than -8.1 percent? | SELECT COUNT(population_density) FROM table_name_6 WHERE name = "siglunes" AND change___percentage_ < -8.1 | sql_create_context |
CREATE TABLE table_1499791_2 (
southern_lakota VARCHAR,
english_gloss VARCHAR
) | Name the southern lakota for morning | SELECT southern_lakota FROM table_1499791_2 WHERE english_gloss = "morning" | sql_create_context |
CREATE TABLE table_52437 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the home team who plays at Glenferrie Oval? | SELECT "Home team" FROM table_52437 WHERE "Venue" = 'glenferrie oval' | wikisql |
CREATE TABLE table_1182314_5 (
norwegian_americans__1980_ INTEGER,
state VARCHAR
) | what is the minimum norwegian americans (1980) where state is rhode island | SELECT MIN(norwegian_americans__1980_) FROM table_1182314_5 WHERE state = "Rhode Island" | sql_create_context |
CREATE TABLE table_8966 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Which player placed t10? | SELECT "Player" FROM table_8966 WHERE "Place" = 't10' | wikisql |
CREATE TABLE table_2509505_1 (
games VARCHAR,
lost VARCHAR
) | Name the total number of games for lost being 41 | SELECT COUNT(games) FROM table_2509505_1 WHERE lost = 41 | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
... | what flights are available from DENVER to PHILADELPHIA on wednesday | 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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4 ... | atis |
CREATE TABLE table_15568886_14 (
proto_oceanic VARCHAR,
proto_polynesian VARCHAR
) | Name the proto oceanic for *fafine | SELECT proto_oceanic FROM table_15568886_14 WHERE proto_polynesian = "*fafine" | sql_create_context |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE section (
course_id varchar(8),
sec_... | Find the names and average salaries of all departments whose average salary is greater than 42000, sort total number in desc order. | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC | nvbench |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | give me all flights from NEW YORK to LAS VEGAS that arrive on a SUNDAY | 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, days, flight WHERE (((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND days.day_name = 'SATURDAY' AND flight.flig... | atis |
CREATE TABLE table_name_23 (
remarks VARCHAR,
rank VARCHAR,
alliance VARCHAR
) | What are the remarks for the entry ranked greater than 2 with a skyteam (2012) alliance? | SELECT remarks FROM table_name_23 WHERE rank > 2 AND alliance = "skyteam (2012)" | sql_create_context |
CREATE TABLE table_name_31 (
days_of_the_week VARCHAR,
time_of_broadcast VARCHAR
) | Which Days of the week has a Time of broadcast in january february, june 2002? | SELECT days_of_the_week FROM table_name_31 WHERE time_of_broadcast = "january–february, june 2002" | sql_create_context |
CREATE TABLE table_64659 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the least amount of silver for Italy with a total less than 5? | SELECT MIN("Silver") FROM table_64659 WHERE "Nation" = 'italy' AND "Total" < '5' | wikisql |
CREATE TABLE table_14960574_6 (
character VARCHAR,
french_voice_actor VARCHAR
) | Name the character for sophie arthuys | SELECT character FROM table_14960574_6 WHERE french_voice_actor = "Sophie Arthuys" | sql_create_context |
CREATE TABLE table_11206787_5 (
average INTEGER
) | What is the average? | SELECT MIN(average) FROM table_11206787_5 | sql_create_context |
CREATE TABLE table_204_759 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | in what year did laurens vault higher than in 2006 ? | SELECT "year" FROM table_204_759 WHERE "notes" > (SELECT MAX("notes") FROM table_204_759 WHERE "year" = 2006) | squall |
CREATE TABLE table_name_79 (
score VARCHAR,
date VARCHAR
) | What was the score for the game on February 12? | SELECT score FROM table_name_79 WHERE date = "february 12" | sql_create_context |
CREATE TABLE table_24483 (
"Day" text,
"Stage" text,
"Time (EET)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
) | Which stage has 15:17 as time? | SELECT "Stage" FROM table_24483 WHERE "Time (EET)" = '15:17' | wikisql |
CREATE TABLE table_46838 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the record of Game 43? | SELECT "Record" FROM table_46838 WHERE "Game" = '43' | wikisql |
CREATE TABLE table_name_25 (
race VARCHAR,
pole_position VARCHAR
) | What race has a Pole Position of Jacques Laffite? | SELECT race FROM table_name_25 WHERE pole_position = "jacques laffite" | sql_create_context |
CREATE TABLE table_203_353 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"time" text
) | which songs are produced by pillo jamel or juju . | SELECT "title" FROM table_203_353 WHERE "producer(s)" IN ('pillo jamel', 'juju') | squall |
CREATE TABLE table_58166 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What is the qual 1 for the best of 1:18.067? | SELECT "Qual 1" FROM table_58166 WHERE "Best" = '1:18.067' | wikisql |
CREATE TABLE table_2301 (
"#" text,
"Date" text,
"at/vs." text,
"Opponent" text,
"Score" text,
"Attendance" real,
"Record" text
) | How many games resulted in a loss? | SELECT "#" FROM table_2301 WHERE "Record" = 'Loss' | wikisql |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | Give me a bar chart to visualize the number of the districts of markets they are on, and list by the total number from high to low. | SELECT District, COUNT(District) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY District ORDER BY COUNT(District) DESC | nvbench |
CREATE TABLE table_name_70 (
series VARCHAR,
opponent VARCHAR,
date VARCHAR
) | Which Series has an Opponent of @ new york rangers, and a Date of april 22? | SELECT series FROM table_name_70 WHERE opponent = "@ new york rangers" AND date = "april 22" | sql_create_context |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | Find the name of persons who are friends with Alice for the shortest years. | SELECT name FROM personfriend WHERE friend = 'Alice' AND year = (SELECT MIN(year) FROM personfriend WHERE friend = 'Alice') | spider |
CREATE TABLE table_9030 (
"Date" text,
"Time" text,
"ACC Team" text,
"Big Ten Team" text,
"Location" text,
"Television" text,
"Attendance" real,
"Winner" text,
"Challenge Leader" text
) | What is the name of the Big Ten team who played ACC Team Maryland where 17,472 attended the game? | SELECT "Big Ten Team" FROM table_9030 WHERE "Attendance" > '17,472' AND "ACC Team" = 'maryland' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | 在编号为6439728的医院的入院诊断为颅脑外伤所致的精神障碍的医疗记录中,最少和最多的医疗费总额分别是多少 | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6439728' AND t_kc21.IN_DIAG_DIS_NM = '颅脑外伤所致的精神障碍') | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, and rank by the total number in desc. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart, could you show Y from high to low order please? | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_24039597_26 (
innings VARCHAR,
caught VARCHAR
) | What was the innings when caught was 20? | SELECT innings FROM table_24039597_26 WHERE caught = 20 | 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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | does the temperature c (calc) of patient 25696's body have been normal on 02/25/last year? | 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 = 25696)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (ca... | mimic_iii |
CREATE TABLE table_23286112_8 (
game INTEGER,
date VARCHAR
) | Name the least game for january 29 | SELECT MIN(game) FROM table_23286112_8 WHERE date = "January 29" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body t... | How many accepts have I gotten in a day?. | SELECT 'user_link', MAX(accepts) AS Highest_accepts_in_a_day FROM (SELECT Users.Id AS "user_link", Votes.CreationDate, COUNT(Votes.Id) AS accepts FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id INNER JOIN Votes ON Posts.Id = Votes.PostId AND Votes.VoteTypeId = 1 GROUP BY Users.Id, Votes.CreationDate) AS sq ... | sede |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
... | Show the location codes and the number of documents in each location Visualize by bar chart, and list by the x-axis in asc. | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code | nvbench |
CREATE TABLE table_204_133 (
id number,
"school year" text,
"class a" text,
"class aa" text,
"class aaa" text,
"class aaaa" text,
"class aaaaa" text
) | who is the top -lrb- most wins overall -rrb- winning school in class aaaa ? | SELECT "class aaaa" FROM table_204_133 GROUP BY "class aaaa" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE conference (
cid int,... | return me the total citations of papers in the VLDB conference in each year . | SELECT publication.year, SUM(publication.citation_num) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid GROUP BY publication.year | academic |
CREATE TABLE table_606 (
"Word number" text,
"The Basque of the glossary" text,
"Modern Basque" text,
"The Icelandic of the glossary" text,
"English translation" text
) | Name the english translation of giefdu mier socka bond | SELECT "English translation" FROM table_606 WHERE "The Icelandic of the glossary" = 'giefdu mier socka bond' | wikisql |
CREATE TABLE table_26748314_1 (
original_air_date VARCHAR,
no_in_season VARCHAR
) | What is every original air date for the number in season of 7? | SELECT original_air_date FROM table_26748314_1 WHERE no_in_season = 7 | sql_create_context |
CREATE TABLE table_48426 (
"Name" text,
"Daytime" text,
"Evening" text,
"Saturday" text,
"Sunday" text
) | Which Name has a Yes Saturday and a Yes Evening? | SELECT "Name" FROM table_48426 WHERE "Saturday" = 'yes' AND "Evening" = 'yes' | wikisql |
CREATE TABLE table_65684 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which Opponent has a Record of 2 0? | SELECT "Opponent" FROM table_65684 WHERE "Record" = '2–0' | 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 the total number of patients aged below 20 who had icd9 code v463? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "20" AND diagnoses.icd9_code = "V463" | mimicsql_data |
CREATE TABLE table_70940 (
"Round" real,
"Name" text,
"Position" text,
"School" text,
"Signed" text
) | What is the highest round that has a draftee from Washington State University? | SELECT MAX("Round") FROM table_70940 WHERE "School" = 'washington state university' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.