context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_87 (
round VARCHAR,
position VARCHAR
) | During which round was a Hawkeyes player selected for the defensive back position? | SELECT round FROM table_name_87 WHERE position = "defensive back" | 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
) | For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the founder , and group by attribute founder. | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_name_98 (
rank INTEGER,
react VARCHAR,
time VARCHAR
) | Which Rank has a Reaction time larger than 0.20400000000000001, and a Time larger than 45.56? | SELECT MAX(rank) FROM table_name_98 WHERE react > 0.20400000000000001 AND time > 45.56 | sql_create_context |
CREATE TABLE table_69287 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"D 47" text,
"D 48" text
) | What is the D44 when D43 is R 14? | SELECT "D 44" FROM table_69287 WHERE "D 43" = 'r 14' | wikisql |
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 (
... | how many patients whose admission location is phys referral/normal deli and admission year is less than 2176? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2176" | mimicsql_data |
CREATE TABLE table_24975 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which position is player bernie doan? | SELECT "Position" FROM table_24975 WHERE "Player" = 'Bernie Doan' | wikisql |
CREATE TABLE table_20328 (
"Year" real,
"Matches" real,
"Wins" real,
"Losses" real,
"No Result" real,
"Tied" real,
"Success Rate" text,
"Position" text,
"Summary" text
) | Name the least tied | SELECT MIN("Tied") FROM table_20328 | wikisql |
CREATE TABLE table_name_39 (
position INTEGER,
draws INTEGER
) | What is the sum of the position with less than 0 draws? | SELECT SUM(position) FROM table_name_39 WHERE draws < 0 | sql_create_context |
CREATE TABLE table_name_41 (
loss VARCHAR,
record VARCHAR
) | Who lost the game with a record of 20-13? | SELECT loss FROM table_name_41 WHERE record = "20-13" | sql_create_context |
CREATE TABLE table_71133 (
"Season" text,
"Club" text,
"Country" text,
"Competition" text,
"Apps." real,
"Goals" real
) | What season did he have 7 appearances? | SELECT "Season" FROM table_71133 WHERE "Apps." = '7' | wikisql |
CREATE TABLE table_17304621_14 (
bandwidth VARCHAR,
downstream VARCHAR,
price_tl VARCHAR
) | What is the bandwidth for downstream of 20 mbit/s for 69 tl? | SELECT bandwidth FROM table_17304621_14 WHERE downstream = "20 Mbit/s" AND price_tl = "69 TL" | sql_create_context |
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,
... | 在不同科室编码下,列出统筹基金支出与医疗费总额在医院7883638所有医疗就诊记录中有多大平均比值? | SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '7883638' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
CREATE TABLE table_name_71 (
losses VARCHAR,
goals_for VARCHAR,
points VARCHAR
) | Hiw many losses have 30 for the goals with points greater than 24? | SELECT COUNT(losses) FROM table_name_71 WHERE goals_for = 30 AND points > 24 | sql_create_context |
CREATE TABLE table_53617 (
"Subframe #" real,
"Page #" text,
"Name" text,
"Word #" real,
"Bits" text,
"Scale" text,
"Signed" text
) | What is the scale of sv_health with a word number smaller than 4? | SELECT "Scale" FROM table_53617 WHERE "Word #" < '4' AND "Name" = 'sv_health' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Which courses in Readings meet the MDE need ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Readings%' OR course.description LIKE '%Readings%' OR course.name LIKE '%Readings%') AND program... | advising |
CREATE TABLE table_45975 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What college did the player who had the position of OT come from who was pick number less than 12 and a overall pick number bigger than 226? | SELECT "College" FROM table_45975 WHERE "Overall" > '226' AND "Pick" < '12' AND "Position" = 'ot' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | how many patients whose insurance is medicare and diagnoses short title is preterm nec 2500+g? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Preterm NEC 2500+g" | 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,... | 在2006-11-13到2018-05-18内,2024496这个医疗机构的医疗费总额如何 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2024496' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-13' AND '2018-05-18' | css |
CREATE TABLE table_50693 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | WHAT IS THE 2011 PERFORMANCE AT THE MIAMI MASTERS? | SELECT "2011" FROM table_50693 WHERE "Tournament" = 'miami masters' | wikisql |
CREATE TABLE table_9888 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | What was the date of appointment for Christos Kassianos who belonged to AEK? | SELECT "Date of appointment" FROM table_9888 WHERE "Team" = 'aek' AND "Replaced by" = 'christos kassianos' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_i... | what were the three most frequently prescribed drugs for patients who had also been prescribed paroxetine hcl at the same time? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'paroxetine hcl') AS t1 JOIN (SELECT admissions.subject_id, prescr... | mimic_iii |
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent real,
Rating_in_percen... | Draw a bar chart of owner versus total number of rating in percent, rank X from high to low order. | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner DESC | nvbench |
CREATE TABLE table_9083 (
"City" text,
"Chinese" text,
"Pinyin" text,
"County" text,
"Population (2010)" real
) | What is taipei's lowest 2010 population? | SELECT MIN("Population (2010)") FROM table_9083 WHERE "City" = 'taipei' | wikisql |
CREATE TABLE table_26591434_1 (
original_airdate VARCHAR,
writer VARCHAR
) | What is the original air date for the writer tanaka shinichi? | SELECT original_airdate FROM table_26591434_1 WHERE writer = "Tanaka Shinichi" | sql_create_context |
CREATE TABLE table_25818630_2 (
votes__cast VARCHAR,
constituency VARCHAR
) | How many votes were cast when the constituency was midlothian? | SELECT votes__cast FROM table_25818630_2 WHERE constituency = "Midlothian" | sql_create_context |
CREATE TABLE table_name_52 (
season INTEGER,
score VARCHAR
) | Which Seasonhas a Score of 3 3 aet , 4 3 pen? | SELECT MAX(season) FROM table_name_52 WHERE score = "3 – 3 aet , 4–3 pen" | sql_create_context |
CREATE TABLE table_45960 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
) | What was the tournament for the week of August 4? | SELECT "Tournament" FROM table_45960 WHERE "Week" = 'august 4' | wikisql |
CREATE TABLE table_name_68 (
green_rating VARCHAR,
engine_capacity VARCHAR,
manufacturer VARCHAR,
l_100km_urban__cold_ VARCHAR,
mpg_us_urban VARCHAR
) | What is the green rating for the vehicle with L/100km urban (cold) over 10.9, mpg in the US (urban) over 14.1, manufacturer of Volkswagen, and engine capacity under 3189? | SELECT green_rating FROM table_name_68 WHERE l_100km_urban__cold_ > 10.9 AND mpg_us_urban > 14.1 AND manufacturer = "volkswagen" AND engine_capacity < 3189 | sql_create_context |
CREATE TABLE projects (
project_id number,
project_details text
)
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 (
d... | Show all account ids and account details. | SELECT account_id, account_details FROM accounts | spider |
CREATE TABLE table_name_68 (
division VARCHAR,
team VARCHAR
) | Which division is the Derbyshire Falcons in? | SELECT division FROM table_name_68 WHERE team = "derbyshire falcons" | 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... | 找出患者81164300从零四年六月十二到零八年三月三号在医院3140285被开的所有的药物名字和编号 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '81164300' AND qtb.MED_SER_ORG_NO = '3140285' AND qtb.IN_HOSP_DATE BETWEEN '2004-06-12' AND '2008-03-03' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = ... | css |
CREATE TABLE table_24322 (
"Draw" real,
"Song" text,
"Artist" text,
"Panel Points" real,
"Televotes" real,
"Televote Points" real,
"Score" real,
"Placing" text
) | Name the artist for 1595 televotes | SELECT "Artist" FROM table_24322 WHERE "Televotes" = '1595' | wikisql |
CREATE TABLE table_name_74 (
title VARCHAR,
doctor VARCHAR,
published VARCHAR
) | What is the title of the 8th doctor published in January 2003? | SELECT title FROM table_name_74 WHERE doctor = "8th" AND published = "january 2003" | sql_create_context |
CREATE TABLE table_72477 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
) | What is the PA when the PF is 77? | SELECT "PA" FROM table_72477 WHERE "PF" = '77' | wikisql |
CREATE TABLE table_name_26 (
rank VARCHAR,
nation VARCHAR,
total VARCHAR,
bronze VARCHAR
) | Which rank has a total less than 9, less than 2 bronze, and from France? | SELECT rank FROM table_name_26 WHERE total < 9 AND bronze < 2 AND nation = "france" | sql_create_context |
CREATE TABLE table_name_80 (
branding VARCHAR,
owner VARCHAR,
frequency VARCHAR
) | What is the branding of the FM 97.7 station owned by the Canadian Broadcasting Corporation? | SELECT branding FROM table_name_80 WHERE owner = "canadian broadcasting corporation" AND frequency = "fm 97.7" | sql_create_context |
CREATE TABLE table_name_72 (
country VARCHAR,
to_par VARCHAR
) | What is the Country of the Player with a To par of 4? | SELECT country FROM table_name_72 WHERE to_par = "–4" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 在医疗就诊03617073061中,患者柏妙晴的各检验报告的审核人员工号是什么?姓名是什么? | SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '03617073061' | css |
CREATE TABLE table_204_599 (
id number,
"party" text,
"first duma" text,
"second duma" text,
"third duma" text,
"fourth duma" text
) | how long was the first duma on rigtists | SELECT "first duma" FROM table_204_599 WHERE "party" = 'rightists' | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE 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 admission type is elective and drug name is amiodarone? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Amiodarone" | mimicsql_data |
CREATE TABLE table_name_15 (
draws VARCHAR,
wins VARCHAR,
byes VARCHAR
) | What are the draws when wins are fwewer than 9 and byes fewer than 2? | SELECT COUNT(draws) FROM table_name_15 WHERE wins < 9 AND byes < 2 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | on the first intensive care unit visit the sao2 of patient 022-151182 was ever greater than 97.0? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-151182') AND NOT patient.unitdischargetime IS NULL ORDER BY pati... | eicu |
CREATE TABLE table_1602620_1 (
location VARCHAR,
term_ended VARCHAR
) | What is the location for the office whose term ended December 2, 1976 | SELECT location FROM table_1602620_1 WHERE term_ended = "December 2, 1976" | sql_create_context |
CREATE TABLE table_11656 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What was the original air date of a series number after 78, written by Jenee V. Giles? | SELECT "Original air date" FROM table_11656 WHERE "Series #" > '78' AND "Written by" = 'jenee v. giles' | wikisql |
CREATE TABLE table_73336 (
"Administrative division" text,
"Area (km\u00b2) 2005" text,
"Population 2010 Census" real,
"Population 2011 SIAK Database" text,
"Population density (/km\u00b2 2010)" real
) | What is the population density of the administrative division with a population in 2010 of 264170 according to the census? | SELECT "Population density (/km\u00b2 2010)" FROM table_73336 WHERE "Population 2010 Census" = '264170' | wikisql |
CREATE TABLE table_44778 (
"1950" real,
"General 1950" text,
"Senate 1950" text,
"House 1950" text,
"Governors 1950" text
) | What shows for House 1950 with a 1950 less than 1980, and Governors 1950 of governors 1970? | SELECT "House 1950" FROM table_44778 WHERE "1950" < '1980' AND "Governors 1950" = 'governors 1970' | wikisql |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE STUDENT (
STU_NUM... | Draw a bar chart for how many sections does each course have? | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE | nvbench |
CREATE TABLE trip (
start_station_id VARCHAR
)
CREATE TABLE station (
lat INTEGER,
long INTEGER,
id VARCHAR
) | What is the average latitude and longitude of the starting points of all trips? | SELECT AVG(T1.lat), AVG(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id | sql_create_context |
CREATE TABLE table_73589 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What position did he finish in 1987? | SELECT "Position" FROM table_73589 WHERE "Year" = '1987' | wikisql |
CREATE TABLE table_8971 (
"Name" text,
"Seat" text,
"Population (2011)" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real
) | What is the lowest population (2011) for the community with an Area of 12,241km2 and a Density (inhabitants/km 2) smaller than 21.1? | SELECT MIN("Population (2011)") FROM table_8971 WHERE "Area (km 2 )" = '12,241' AND "Density (inhabitants/km 2 )" < '21.1' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | Find the number of ethnically white russian patients born before the year 1846. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.dob_year < "1846" | mimicsql_data |
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,
... | calculate the average age of male patients who died before 2173. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2173.0" | mimicsql_data |
CREATE TABLE table_78923 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | What is the status when the against is 11? | SELECT "Status" FROM table_78923 WHERE "Against" = '11' | wikisql |
CREATE TABLE table_30590 (
"Version" text,
"Release" text,
"Release date" text,
"End of maintenance" text,
"Requirement" text
) | What's the release date in the 1.1.10 release? | SELECT "Release date" FROM table_30590 WHERE "Release" = '1.1.10' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | had in the first hospital encounter patient 31088's respiratory rate been greater than 23.0? | 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 = 31088 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemid IN (... | mimic_iii |
CREATE TABLE table_51468 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people came to the game at Victoria Park? | SELECT COUNT("Crowd") FROM table_51468 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text... | New comments on old questions. | SELECT Comments.Id AS "comment_link", Comments.Score, Comments.CreationDate AS CommentDate, Posts.CreationDate AS PostDate, DATEDIFF(day, Posts.CreationDate, CreationDate) AS Diff, Comments.Text FROM Comments JOIN Posts ON Comments.PostId = Posts.Id WHERE DATEDIFF(day, Posts.CreationDate, CreationDate) > 365 ORDER BY C... | sede |
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,... | 4050783这个医院的患者78487358,列出其出院诊断医生是韦医生的那次出院诊断的结果 | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '78487358' AND MED_SER_ORG_NO = '4050783' AND OUT_DIAG_DOC_NM LIKE '韦%' | css |
CREATE TABLE table_1342292_45 (
result VARCHAR,
incumbent VARCHAR
) | In how many districts is the incumbent Dave E. Satterfield, Jr. | SELECT COUNT(result) FROM table_1342292_45 WHERE incumbent = "Dave E. Satterfield, Jr." | sql_create_context |
CREATE TABLE table_71948 (
"Rank" real,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
) | What is the greatest rank for Fifth third center? | SELECT MAX("Rank") FROM table_71948 WHERE "Name" = 'fifth third center' | wikisql |
CREATE TABLE table_78839 (
"Outcome" text,
"Year" real,
"Championship" text,
"Opponent in the final" text,
"Score" text
) | What was Shaun Murphy's outcome in the Premier League Snooker championship held before 2010? | SELECT "Outcome" FROM table_78839 WHERE "Championship" = 'premier league snooker' AND "Year" < '2010' | wikisql |
CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
bronze number,
total number
)
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
c... | What are the types of competition and number of competitions for that type? | SELECT competition_type, COUNT(*) FROM competition GROUP BY competition_type | spider |
CREATE TABLE table_27599216_6 (
founded INTEGER,
football_stadium VARCHAR
) | What year was mcmahon stadium founded? | SELECT MAX(founded) FROM table_27599216_6 WHERE football_stadium = "McMahon Stadium" | sql_create_context |
CREATE TABLE table_57082 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening gown" real,
"Average" real
) | Name the total number of swimsuits when evening gown is 8.329 and average is less than 8.497 | SELECT COUNT("Swimsuit") FROM table_57082 WHERE "Evening gown" = '8.329' AND "Average" < '8.497' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | whats the cost to get a metastatic adenocarcinoma - unknown primary diagnosis. | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'metastatic adenocarcinoma - unknown primary') | eicu |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code tex... | when patient 79919 was prescribed 0.9% sodium chloride first time in 06/last year. | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 79919) AND prescriptions.drug = '0.9% sodium chloride' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') A... | mimic_iii |
CREATE TABLE table_name_48 (
penanced VARCHAR,
total VARCHAR
) | How many were penanced for a total of 7666? | SELECT penanced FROM table_name_48 WHERE total = "7666" | sql_create_context |
CREATE TABLE table_77667 (
"Debut year" real,
"Player" text,
"Date of birth" text,
"Games" real,
"Goals" real,
"Years at club" text
) | How many games had 22 goals before 1935? | SELECT SUM("Games") FROM table_77667 WHERE "Goals" = '22' AND "Debut year" < '1935' | wikisql |
CREATE TABLE table_203_344 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text,
"other info" text
) | which team was the opponents of this team the most ? | SELECT "opponent" FROM table_203_344 GROUP BY "opponent" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_name_33 (
province_of_silla VARCHAR,
modern_equivalent VARCHAR,
administrative_district VARCHAR
) | WHich Province of Silla has a Modern equivalent of south jeolla, and a Administrative district of seungju? | SELECT province_of_silla FROM table_name_33 WHERE modern_equivalent = "south jeolla" AND administrative_district = "seungju" | sql_create_context |
CREATE TABLE table_57387 (
"Player" text,
"Date of Birth" text,
"Batting Style" text,
"Bowling Style" text,
"First Class Team" text
) | What is the batting style of Makhaya Ntini? | SELECT "Batting Style" FROM table_57387 WHERE "Player" = 'makhaya ntini' | wikisql |
CREATE TABLE table_203_536 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"crowd" number,
"record" text
) | what is the difference in the crowd population on april 22 and april 29 ? | SELECT ABS((SELECT "crowd" FROM table_203_536 WHERE "date" = 'apr 22') - (SELECT "crowd" FROM table_203_536 WHERE "date" = 'apr 29')) | squall |
CREATE TABLE table_2944 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What was the original airdate for 'Something New'? | SELECT "Original air date" FROM table_2944 WHERE "Title" = 'Something New' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Comments containing string1 but not string2, string3, string4. | SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##string1?\ve##%' AND NOT (Text LIKE '%##string2?\vec##%') AND NOT (Text LIKE '%##string3?\ver##%') AND NOT (Text LIKE '%##string4?\vee##%') ORDER BY CreationDate DESC | sede |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college 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,
additio... | Out of all the upper level classes , what number have labs ? | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_67302 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What company was the constructor when Nick Heidfeld was the driver/ | SELECT "Constructor" FROM table_67302 WHERE "Driver" = 'nick heidfeld' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 患有疾病S71.176的人数总量是多少 | SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.IN_DIAG_DIS_CD = 'S71.176' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.IN_DIAG_DIS_CD = 'S71.176' UNION SELECT COUNT(zyb.PERSON_ID) FROM zyb WHERE zyb.IN_DIAG_DIS_CD = 'S71.176' UNION SELECT COUNT(mzb.PERSON_ID) FROM mzb WHERE mzb.IN_DIAG_DIS_CD = 'S71.176' | css |
CREATE TABLE table_19716903_1 (
isolation VARCHAR,
mountain_peak VARCHAR
) | How many different isolation numbers does the Jack Mountain peak have? | SELECT COUNT(isolation) FROM table_19716903_1 WHERE mountain_peak = "Jack Mountain" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Even our heroes can fail. If you are upset of a few downwote know that even the biggest can fail too. See the most downvoted answers of the top users | SELECT p.Id AS "post_link", Score, u.Id AS "user_link" FROM Posts AS p, Users AS u ORDER BY Score LIMIT 10 | sede |
CREATE TABLE table_10579 (
"Year" real,
"City" text,
"Rider 1" text,
"Rider 2" text,
"Horse 1" text,
"Horse 2" text,
"Association" text
) | Which horse was Horse 1 when ren guzm n raced with the mulch n association? | SELECT "Horse 1" FROM table_10579 WHERE "Rider 1" = 'rené guzmán' AND "Association" = 'mulchén' | wikisql |
CREATE TABLE table_53374 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Turkey scorers" text,
"Match report" text
) | Which venue had a score of 1-1? | SELECT "Venue" FROM table_53374 WHERE "Score" = '1-1' | wikisql |
CREATE TABLE table_38390 (
"Product" text,
"Extensions" text,
"Projects templates" text,
"MSDN integration" text,
"Debugging" text,
"Profiling" text,
"IntelliTrace" text,
"Unit test" text,
"Code coverage" text,
"Test impact analysis" text,
"Load testing" text,
"Lab manage... | Which Intelli Trace has a No Extension and Windows Phone development of no? | SELECT "IntelliTrace" FROM table_38390 WHERE "Extensions" = 'no' AND "Windows Phone development" = 'no' | wikisql |
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE studen... | What are the first name and last name of all the instructors? | SELECT fname, lname FROM faculty WHERE rank = "Instructor" | spider |
CREATE TABLE table_70007 (
"Nat." text,
"Name" text,
"Since" real,
"App(GS/Sub)" text,
"Goals" real,
"Transfer fee" text
) | Name the goals with since less than 2007 and App(GS/Sub) of 97 (69/28) | SELECT "Goals" FROM table_70007 WHERE "Since" < '2007' AND "App(GS/Sub)" = '97 (69/28)' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, what is the relationship between code and code , and group by attribute name? | SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | when did patient 9038 last have an intake since 663 days ago? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9038)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-663 day') ORDER ... | mimic_iii |
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,
... | tell me the number of private insurance patients who had elective hospital admission. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Private" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
Mark... | Number of questions by month between dates. | SELECT TIME_TO_STR(p.CreationDate, '%Y') + (TIME_TO_STR(p.CreationDate, '%m') - 1) / 12.0 AS ddd, COUNT(*) AS N FROM Posts AS p WHERE TIME_TO_STR(p.CreationDate, '%Y') >= '##startYear?2010##' AND TIME_TO_STR(p.CreationDate, '%Y') <= '##endYear?2015##' GROUP BY TIME_TO_STR(p.CreationDate, '%Y') + (TIME_TO_STR(p.Creation... | sede |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
... | Find the number of courses offered by Psychology department in each year with a line chart, could you order by the X-axis from high to low? | SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY year DESC | nvbench |
CREATE TABLE table_56232 (
"Yard Name" text,
"Location (City, State)" text,
"1st Ship Delivery Date" text,
"Ship Types Delivered" text,
"Total Number of Ways" text,
"Total Vessels Built for USMC" text
) | what is the ship types delivered when the total vessels built for usmc is 13 ships for usmc (plus 37 more for usn)? | SELECT "Ship Types Delivered" FROM table_56232 WHERE "Total Vessels Built for USMC" = '13 ships for usmc (plus 37 more for usn)' | wikisql |
CREATE TABLE table_203_274 (
id number,
"church name" text,
"address" text,
"community" text,
"school" text
) | what is the last church located in koreatown ? | SELECT "church name" FROM table_203_274 WHERE "community" = 'koreatown' ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_26610 (
"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
) | What in the series number of the episode written by Lauren Gussis? | SELECT MIN("No. in series") FROM table_26610 WHERE "Written by" = 'Lauren Gussis' | wikisql |
CREATE TABLE table_73540 (
"Horizontal order" real,
"Height order" real,
"Soundfield type" text,
"Number of channels" real,
"Channels" text
) | If the height order is 1 and the soundfield type is mixed-order, what are all the channels? | SELECT "Channels" FROM table_73540 WHERE "Soundfield type" = 'mixed-order' AND "Height order" = '1' | wikisql |
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest text,
Height_feet int,
Floors int
)
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
seq... | Show the names and heights of buildings with at least two institutions founded after 1880. Plot them as bar chart. | SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 | nvbench |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
Post... | Java posts with minimum score of 15. | SELECT Title, Body, CreationDate, Id AS "post_link", Tags, Score FROM Posts WHERE PostTypeId IN (1) AND CreationDate > '2020-01-01' AND CreationDate < '2020-12-31' AND Tags LIKE ('%java%') AND Score >= 15 ORDER BY CreationDate DESC | sede |
CREATE TABLE table_29436238_1 (
no_in_series VARCHAR,
written_by VARCHAR
) | How many episodes were written by Gregg Mettler? | SELECT COUNT(no_in_series) FROM table_29436238_1 WHERE written_by = "Gregg Mettler" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | Top n posters for a given country. Gets the top n poster for a country of your choice | SELECT TOP(@TopCount) AS Id, DisplayName, Reputation, LastAccessDate, Age, Location FROM Users WHERE Location LIKE '##COuntry##%' ORDER BY Reputation DESC | sede |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airline (
airline_code... | i'm requesting flight information on a flight from DENVER to SAN FRANCISCO 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 = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = 4... | atis |
CREATE TABLE table_55570 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the away team that scored 12.17 (89)? | SELECT "Away team" FROM table_55570 WHERE "Away team score" = '12.17 (89)' | wikisql |
CREATE TABLE products (
product_id number,
parent_product_id number,
production_type_code text,
unit_price number,
product_name text,
product_color text,
product_size text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity... | Show all product sizes. | SELECT DISTINCT product_size FROM products | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.