context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_11518 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | Who was the visiting team when the home team was Seattle? | SELECT "Visitor" FROM table_11518 WHERE "Home" = 'seattle' | wikisql |
CREATE TABLE table_12625 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"10: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:30 pm" text,
"4:00 pm" text,
"5:00 pm" text,
"6:30 pm"... | what is at 8:00 am when at 3:30 pm is general hospital? | SELECT "8:00 am" FROM table_12625 WHERE "3:30 pm" = 'general hospital' | wikisql |
CREATE TABLE table_12211 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the record when the time is 1:11? | SELECT "Record" FROM table_12211 WHERE "Time" = '1:11' | wikisql |
CREATE TABLE table_24748 (
"Country" text,
"Area (000s)" text,
"1950 (mil)" text,
"1970 (mil)" text,
"1980 (mil)" text,
"1985 (mil)" text,
"Annual Growth (1950\u20131985)" text,
"Density (1980)" text
) | Name the total number 1980 mil for soviet union | SELECT COUNT("1980 (mil)") FROM table_24748 WHERE "Country" = 'Soviet Union' | wikisql |
CREATE TABLE table_29488 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | How many millions of US viewers were there for the episode 'No Safe Place'? | SELECT "U.S. viewers (millions)" FROM table_29488 WHERE "Title" = 'No Safe Place' | wikisql |
CREATE TABLE table_name_82 (
nation VARCHAR,
silver VARCHAR,
bronze VARCHAR,
total VARCHAR
) | Which Nation has a Bronze smaller than 1, and a Total larger than 1, and a Silver of 1? | SELECT nation FROM table_name_82 WHERE bronze < 1 AND total > 1 AND silver = 1 | sql_create_context |
CREATE TABLE table_51814 (
"Final Rank" real,
"Skater" text,
"Rank in SP" real,
"Rank in FS" real,
"Total Score" text
) | How many skaters have a Rank in FS of 3, and a Rank in SP larger than 4? | SELECT COUNT("Final Rank") FROM table_51814 WHERE "Rank in FS" = '3' AND "Rank in SP" > '4' | wikisql |
CREATE TABLE table_name_70 (
record VARCHAR,
round VARCHAR,
method VARCHAR
) | What is the record in the 2 round fight that ended by submission (injury)? | SELECT record FROM table_name_70 WHERE round = "2" AND method = "submission (injury)" | sql_create_context |
CREATE TABLE table_57884 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text
) | What is the hometown of the player which has a height of 6-0? | SELECT "Hometown" FROM table_57884 WHERE "Height" = '6-0' | wikisql |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
sp... | what was patient 82132's first output time of the foley today? | SELECT outputevents.charttime 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 = 82132)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'fole... | mimic_iii |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
... | what is the seating capacity of the aircraft M80 | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' | atis |
CREATE TABLE table_17039232_3 (
outgoing_manager VARCHAR,
position_in_table VARCHAR
) | Name the outgoing manager for position in table being 11th | SELECT outgoing_manager FROM table_17039232_3 WHERE position_in_table = "11th" | sql_create_context |
CREATE TABLE table_2682 (
"N" real,
"P" text,
"Name" text,
"EU" text,
"Country" text,
"Age" real,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text,
"Source" text
) | Name the total number of eu for quinn | SELECT COUNT("EU") FROM table_2682 WHERE "Name" = 'Quinn' | wikisql |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperfield (
fieldid... | keyphrases used by dan klein in his emnlp papers | SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'dan klein' AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'emnlp' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_70808 (
"Date" text,
"Course" text,
"Distance" text,
"Winner" text,
"Race Leader" text
) | What is the course on 1 June? | SELECT "Course" FROM table_70808 WHERE "Date" = '1 june' | 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... | Return a bar chart about the distribution of ACC_Regular_Season and ACC_Percent , order in asc by the ACC_Regular_Season. | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season | nvbench |
CREATE TABLE table_79562 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the score of the tie that had Tottenham Hotspur as the home team? | SELECT "Score" FROM table_79562 WHERE "Home team" = 'tottenham hotspur' | wikisql |
CREATE TABLE table_name_45 (
draw INTEGER,
season VARCHAR,
points VARCHAR
) | Which Draw has a Season of 2001 02, and Points larger than 47? | SELECT SUM(draw) FROM table_name_45 WHERE season = "2001–02" AND points > 47 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 把2015年1月8日到2021年3月20日期间患者50498130一共在医院看过多少次病查看一下 | SELECT (SELECT COUNT(*) 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 = '50498130' AND wdmzjzjlb.JZKSRQ BETWEEN '2015-01-08' AND '2021-03-20' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjl... | css |
CREATE TABLE table_1850282_5 (
tobago VARCHAR,
species VARCHAR
) | there are in tobago species name helicops angulatus | SELECT tobago FROM table_1850282_5 WHERE species = "Helicops angulatus" | sql_create_context |
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
) | Return a bar chart on what is the total revenue of each manufacturer? | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name | nvbench |
CREATE TABLE table_11391448_2 (
record VARCHAR,
week VARCHAR
) | What was the record at week 7 | SELECT record FROM table_11391448_2 WHERE week = 7 | sql_create_context |
CREATE TABLE table_name_17 (
week_14_dec_3 VARCHAR,
week_11_nov_12 VARCHAR
) | What happened in week 14 when week 11's result was Michigan (7-2)? | SELECT week_14_dec_3 FROM table_name_17 WHERE week_11_nov_12 = "michigan (7-2)" | sql_create_context |
CREATE TABLE table_25642 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"Turbo" text,
"GPU frequency" text,
"Cores" real,
"L2 cache" text,
"L3 cache" text,
"I/O bus" text,
"Mult." text,
"Memory" text,
"Voltage" text,
"TDP" text,
"Socket" text,
"... | What is the model number for part numbers of cm80616003177acbx80616i5660? | SELECT "Model number" FROM table_25642 WHERE "Part number(s)" = 'CM80616003177ACBX80616I5660' | wikisql |
CREATE TABLE table_1841901_1 (
macedonian VARCHAR,
french VARCHAR
) | Name the macedonian for il/elle avait entendu | SELECT macedonian FROM table_1841901_1 WHERE french = "il/elle avait entendu" | sql_create_context |
CREATE TABLE table_44123 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
) | What director ranked higher than 1 from Universal Studios and grossed $201,957,688? | SELECT "Director" FROM table_44123 WHERE "Rank" > '1' AND "Studio" = 'universal' AND "Gross" = '$201,957,688' | wikisql |
CREATE TABLE table_63494 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the total number of draws when there is 1 Win, and less than 1728 against matches? | SELECT COUNT("Draws") FROM table_63494 WHERE "Wins" = '1' AND "Against" < '1728' | wikisql |
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,... | 在医院6234584中,以出院诊断疾病名称为依据,查出不同疾病的患者平均年龄是多少 | SELECT OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '6234584' GROUP BY OUT_DIAG_DIS_NM | css |
CREATE TABLE table_22629 (
"Year" real,
"Champion (average in final)" text,
"Legs" text,
"Runner-up (average in final)" text,
"Sponsor" text,
"Prize Fund" text,
"Champion" text,
"Runner-up" text,
"Venue" text
) | How much does the champion get for stadthalle dinslaken, dinslaken? | SELECT "Champion" FROM table_22629 WHERE "Venue" = 'Stadthalle Dinslaken, Dinslaken' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the sum of salary , and group by attribute job_id in a bar chart, and order from low to high by the y axis please. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For all employees who have the letters D or S in their first name, find job_id and the average of manager_id , and group by attribute job_id, and visualize them by a bar chart, could you order by the bar in desc please? | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_78201 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) | What is the total number of Pl GP when the pick number is 199 and the Reg GP is bigger than 0? | SELECT SUM("Pl GP") FROM table_78201 WHERE "Pick #" = '199' AND "Reg GP" > '0' | wikisql |
CREATE TABLE table_38842 (
"Name" text,
"Type" text,
"Entered service" text,
"Water depth" text,
"Location" text
) | Which type entered service in 1976/1997 and is located in Brazil? | SELECT "Type" FROM table_38842 WHERE "Location" = 'brazil' AND "Entered service" = '1976/1997' | wikisql |
CREATE TABLE MATCH (
venue VARCHAR,
date VARCHAR
) | List venues of all matches in the order of their dates starting from the most recent one. | SELECT venue FROM MATCH ORDER BY date DESC | sql_create_context |
CREATE TABLE table_name_37 (
founded INTEGER,
institution VARCHAR
) | What is independence community college's newest campus? | SELECT MIN(founded) FROM table_name_37 WHERE institution = "independence community college" | sql_create_context |
CREATE TABLE table_203_61 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the difference of silver medals between south africa and kenya ? | SELECT (SELECT "silver" FROM table_203_61 WHERE "nation" = 'south africa') - (SELECT "silver" FROM table_203_61 WHERE "nation" = 'kenya') | squall |
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_desc... | Show the number of projects. | SELECT COUNT(*) FROM projects | spider |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
even... | what are the three drugs most frequently prescribed within the same hospital visit to the patients aged 40s after they had been diagnosed with dysthymic disorder since 2101? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_name_41 (
year_start INTEGER,
number VARCHAR
) | Which Year Start has a Number of 28? | SELECT MAX(year_start) FROM table_name_41 WHERE number = 28 | sql_create_context |
CREATE TABLE table_name_2 (
time_retired VARCHAR,
laps VARCHAR
) | What is the Time/Retired for the car going 42 Laps? | SELECT time_retired FROM table_name_2 WHERE laps = 42 | sql_create_context |
CREATE TABLE table_17431 (
"Model/Engine" text,
"Capacity" text,
"Cylinders/Valves" text,
"Power/rpm" text,
"Torque (Nm)/rpm" text
) | How many capacities are possible for the 1.6 Duratec model/engine? | SELECT COUNT("Capacity") FROM table_17431 WHERE "Model/Engine" = '1.6 Duratec' | wikisql |
CREATE TABLE table_13762472_7 (
score VARCHAR,
location_attendance VARCHAR
) | What was the score when the heat played at charlotte arena? | SELECT score FROM table_13762472_7 WHERE location_attendance = "Charlotte Arena" | sql_create_context |
CREATE TABLE table_name_42 (
gdp_in_$id_b VARCHAR,
city VARCHAR
) | What is the GDP $IDB in Istanbul? | SELECT gdp_in_$id_b FROM table_name_42 WHERE city = "istanbul" | sql_create_context |
CREATE TABLE table_name_92 (
position VARCHAR,
class VARCHAR,
laps VARCHAR
) | The driver in class A with 125 laps is in what position? | SELECT position FROM table_name_92 WHERE class = "a" AND laps = 125 | 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... | 把针灸这个科室从零三年四月六日到零三年十二月二十一日因疾病E76.026需要住院治疗的平均费用给查看一下 | SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '中医针灸科' AND IN_HOSP_DATE BETWEEN '2003-04-06' AND '2003-12-21' AND IN_DIAG_DIS_CD = 'E76.026' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_name_35 (
name VARCHAR,
time VARCHAR
) | Who has a time of 3:50.90? | SELECT name FROM table_name_35 WHERE time = "3:50.90" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | last time, what drug was prescribed for patient 14054 during the previous month? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_51734 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" text
) | What is the street address of Oliver Building? | SELECT "Street address" FROM table_51734 WHERE "Name" = 'oliver building' | 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 lab (
subject_id text,
hadm_id text,
... | give me the number of patients whose year of birth is less than 2110 and lab test name is bands? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2110" AND lab.label = "Bands" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is marital status and ethnicity of subject id 21796? | SELECT demographic.marital_status, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "21796" | mimicsql_data |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | When will 411 be offered during the week ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | advising |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 cost (
row_id nu... | how many patients underwent closed bronchial biopsy during the same hospital encounter after having received closed bronchial biopsy,? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... | mimic_iii |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | tell me the number of married patients who have diagnoses icd9 code 25541. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.icd9_code = "25541" | mimicsql_data |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE T... | show me the flights from SAN DIEGO to NEWARK by way of HOUSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND CITY_2.cit... | atis |
CREATE TABLE table_name_70 (
upper_index_mj__nm_3 INTEGER,
upper_index_kcal__nm_3 VARCHAR
) | What is the average upper index MJ/Nm 3 for the upper index Kcal/Nm 3 entry of 19,376? | SELECT AVG(upper_index_mj__nm_3) FROM table_name_70 WHERE upper_index_kcal__nm_3 = 19 OFFSET 376 | sql_create_context |
CREATE TABLE table_203_679 (
id number,
"part" text,
"number" text,
"first public release date (first edition)" number,
"latest public release date (edition)" number,
"latest amendment" text,
"title" text,
"description" text
) | how many parts where first released to the public in 2003 ? | SELECT COUNT("part") FROM table_203_679 WHERE "first public release date (first edition)" = 2003 | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | what is the difference between weights on patient 006-141797 second measured on the last hospital visit compared to the value first measured on the last hospital visit? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-141797' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N... | eicu |
CREATE TABLE table_name_63 (
nationality VARCHAR,
school_club_team VARCHAR
) | Which Nationality has a School/Club Team of louisiana state? | SELECT nationality FROM table_name_63 WHERE school_club_team = "louisiana state" | sql_create_context |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE ... | How many instructors for every course in 2008? Show me a bar chart grouping by course title, and I want to rank by the y-axis in asc. | SELECT title, COUNT(title) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY title ORDER BY COUNT(title) | nvbench |
CREATE TABLE table_name_18 (
assists INTEGER,
goals VARCHAR,
club VARCHAR,
points VARCHAR
) | What is the average Assists, when Club is Iserlohn Roosters,when Points is 71, and when Goals is greater than 44? | SELECT AVG(assists) FROM table_name_18 WHERE club = "iserlohn roosters" AND points = 71 AND goals > 44 | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | count the number of patients who were given a lithium test until 2104. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'lithium' AND STRFTIME('%y', lab.labresulttime) <= '2104') | eicu |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | show me the cheapest one way flights from DALLAS to SAN FRANCISCO leaving DALLAS after 1600 | 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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1600 AND flight.to_airport... | atis |
CREATE TABLE table_39481 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Who was the runnerup when the margin of victory was 1 stroke on jan 30, 2000? | SELECT "Runner(s)-up" FROM table_39481 WHERE "Margin of victory" = '1 stroke' AND "Date" = 'jan 30, 2000' | wikisql |
CREATE TABLE table_name_28 (
crowd VARCHAR,
home_team VARCHAR
) | What is the size of the crowd for the home team of Footscray? | SELECT crowd FROM table_name_28 WHERE home_team = "footscray" | 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 number of patients whose ethnicity is black/cape verdean and primary disease is sternal wound infection? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "STERNAL WOUND INFECTION" | mimicsql_data |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of department_id bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | Search for potential Link-Only answers. | SELECT Id FROM Posts WHERE (Body LIKE '%http://%' OR Body LIKE 'http://%' OR Body LIKE 'https://%' OR Body LIKE '%https://%') AND PostTypeId = 2 ORDER BY LENGTH(Body) | sede |
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... | how many patients whose year of death is less than or equal to 2165 and item id is 51053? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.itemid = "51053" | mimicsql_data |
CREATE TABLE table_name_28 (
driver VARCHAR,
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
) | What driver has under 53 laps, a grid smaller than 14, and a time/retired of differential? | SELECT driver FROM table_name_28 WHERE laps < 53 AND grid < 14 AND time_retired = "differential" | sql_create_context |
CREATE TABLE table_train_167 (
"id" int,
"alt" float,
"body_weight" float,
"ast" float,
"hematocrit_hct" float,
"thyroid_stimulating_hormone_stsh" int,
"body_mass_index_bmi" float,
"fasting_glucose" int,
"NOUSE" float
) | alt < 60; ast < 60 | SELECT * FROM table_train_167 WHERE alt < 60 OR ast < 60 | criteria2sql |
CREATE TABLE table_63814 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | What is the highest number of losses for Presidente Hayes, when the draws were more than 4? | SELECT MAX("Losses") FROM table_63814 WHERE "Team" = 'presidente hayes' AND "Draws" > '4' | wikisql |
CREATE TABLE operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in text,
Group_Equity_Shareholding real
)
CREATE TABLE flight (
id int,
Vehicle_Flight_number text,
Date text,
Pilot text,
Velocity real,
Altitude real,
airport_id in... | Return a histogram on what are the ids and names of the companies that operated more than one flight? | SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id | nvbench |
CREATE TABLE VoteTypes (
Id number,
Name text
)
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 ReviewT... | Top C# users in the netherlands. | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS "#", Posts.OwnerUserId AS "user_link", COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Posts.OwnerUse... | sede |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
home town text
)
CREATE TABLE perpetrator (
perpetrator_id number,
people_id number,
date text,
year number,
location text,
country text,
killed number,
injured number
) | How many distinct locations of perpetrators are there? | SELECT COUNT(DISTINCT location) FROM perpetrator | spider |
CREATE TABLE table_name_90 (
tournament VARCHAR,
date VARCHAR
) | Name the tournament for may 18, 1997 | SELECT tournament FROM table_name_90 WHERE date = "may 18, 1997" | sql_create_context |
CREATE TABLE table_1130 (
"Administrative county" text,
"Area 1891 (Statute acres)" real,
"Population 1891" real,
"Area 1961 (Statute acres)" real,
"Population 1961" real
) | Name the area for administrative county being flintshire | SELECT "Area 1891 (Statute acres)" FROM table_1130 WHERE "Administrative county" = 'Flintshire' | 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... | 在04年9月13日到2019年10月2日期间叫做褚永昌的病患医保的统筹基金有多少支出? | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '褚永昌' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-09-13' AND '2019-10-02' | css |
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,
... | how may patients below 83 years of age are diagnosed with personal history of malignant neoplasm of gastrointestinal tract, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "83" AND diagnoses.long_title = "Personal history of malignant neoplasm of gastrointestinal tract, unspecified" | mimicsql_data |
CREATE TABLE table_name_69 (
player VARCHAR,
position VARCHAR
) | Which Player is the shooting guard? | SELECT player FROM table_name_69 WHERE position = "shooting guard" | sql_create_context |
CREATE TABLE table_name_1 (
home_team VARCHAR,
venue VARCHAR
) | What home team played at Lake Oval? | SELECT home_team FROM table_name_1 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Posts by Day of Week since Jan. 2020. Number of posts by day of week, since Jan. 1, 2020 | SELECT TIME_TO_STR(CreationDate, '%A') AS dow, pt.Name, COUNT(*) AS cnt FROM Posts AS p INNER JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHERE CreationDate >= '2020-01-01T00:00:00' GROUP BY TIME_TO_STR(CreationDate, '%A'), Name ORDER BY Name, cnt | sede |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | how many actors have appeared in each musical?, order x-axis in ascending order please. | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name | nvbench |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 病患在门诊被诊断为疾病N83.862时,其检测指标258272数值的平均值是多少,最值是多少 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl... | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id nu... | Hidden gems: Lowest viewed questions with score 100 or higher. | SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score > 100 AND PostTypeId = 1 ORDER BY ViewCount LIMIT 1000 | sede |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | Get me the number of white russian patients who were admitted before 2152. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2152" | mimicsql_data |
CREATE TABLE table_name_42 (
season VARCHAR,
skip VARCHAR,
third VARCHAR
) | What is the season with a Skip of Eve Muirhead and a third of Kerry Barr? | SELECT season FROM table_name_42 WHERE skip = "eve muirhead" AND third = "kerry barr" | sql_create_context |
CREATE TABLE table_19327 (
"Episode no." real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Air Date (ATV)" text,
"Production no." real
) | What was the original air date (atv) of episode 1? | SELECT "Original Air Date (ATV)" FROM table_19327 WHERE "Episode no." = '1' | wikisql |
CREATE TABLE table_name_71 (
venue VARCHAR,
year VARCHAR,
outcome VARCHAR
) | What was the Venue in 1986 with an Outcome of 1? | SELECT venue FROM table_name_71 WHERE year = "1986" AND outcome = "1" | 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... | 在医疗就诊52743423301中,列出开的药品名称中包含乳胶的药品及金额 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '52743423301' AND SOC_SRT_DIRE_NM LIKE '%乳胶%' | css |
CREATE TABLE table_77949 (
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Diff" real
) | What is the lowest number of points of any team with less than 6 draws and less than 18 matches played? | SELECT MIN("Points") FROM table_77949 WHERE "Drawn" < '6' AND "Played" < '18' | wikisql |
CREATE TABLE table_name_85 (
award VARCHAR,
result VARCHAR,
year VARCHAR
) | Which Award has a Result of nominated, and a Year of 2003? | SELECT award FROM table_name_85 WHERE result = "nominated" AND year = 2003 | sql_create_context |
CREATE TABLE table_25042332_16 (
region VARCHAR,
below_50_percentage_of_median_income VARCHAR
) | In what region does 17.4% of the population make below 50% of the median income? | SELECT region FROM table_25042332_16 WHERE below_50_percentage_of_median_income = "17.4%" | sql_create_context |
CREATE TABLE table_3945 (
"Finish" real,
"Start" real,
"Car" real,
"Driver" text,
"Make" text,
"Sponsor" text,
"Pts/bns" text,
"Laps" real,
"Status" text,
"Winnings" real
) | What was the greatest number of laps run? | SELECT MAX("Laps") FROM table_3945 | wikisql |
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... | calculate the total number of patients with icd9 code 3782 on medicare insurance | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.icd9_code = "3782" | mimicsql_data |
CREATE TABLE table_name_63 (
country VARCHAR,
place VARCHAR,
points VARCHAR
) | Which country has a place smaller than 8 and points smaller than 5? | SELECT country FROM table_name_63 WHERE place < 8 AND points < 5 | sql_create_context |
CREATE TABLE table_41594 (
"Animal" text,
"Cell type" text,
"Resting potential (mV)" text,
"AP increase (mV)" text,
"AP duration (ms)" text,
"Conduction speed (m/s)" text
) | Which cell type has a conduction speed of 35? | SELECT "Cell type" FROM table_41594 WHERE "Conduction speed (m/s)" = '35' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | Number of questions with 'please' in the title.. | SELECT COUNT(*), COUNT(ClosedDate), AVG(Score) FROM Posts WHERE PostTypeId = 1 AND TIME_TO_STR(CreationDate, '%Y') = 2012 AND (PATINDEX('%please%', LOWER(Title)) > 0 OR PATINDEX('%pls%', LOWER(Title)) > 0 OR PATINDEX('%plz%', LOWER(Title)) > 0) | sede |
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
... | Show different parties of people along with the number of people in each party Plot them as bar chart, rank y-axis from low to high order. | SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_18766 (
"Rank" real,
"Place" text,
"County" text,
"Per Capita Income" text,
"Median House- hold Income" text,
"Population" real,
"Number of Households" real
) | what's the number of households with per capita income being $16,820 | SELECT "Number of Households" FROM table_18766 WHERE "Per Capita Income" = '$16,820' | wikisql |
CREATE TABLE table_899 (
"Region" text,
"Total Population" real,
"Hindus" real,
"% of Hindus" text,
"% of Hindu total" text
) | what portion of the Middle East is Hindu? | SELECT "% of Hindus" FROM table_899 WHERE "Region" = 'Middle East' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.