context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_16 (
transfer_window VARCHAR,
name VARCHAR
) | What is the transfer period for habarugira? | SELECT transfer_window FROM table_name_16 WHERE name = "habarugira" | 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 price over the name , and group by attribute headquarter by a bar chart, rank by the X in desc. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | Are upper level electives offered before noon ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest... | advising |
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, return a bar chart about the distribution of name and the average of code , and group by attribute name, and could you sort from low to high by the bars? | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_name_42 (
kk___5 VARCHAR,
kk___1 VARCHAR
) | What is KK - 5 if KK - 1 is 1,067? | SELECT kk___5 FROM table_name_42 WHERE kk___1 = "1,067" | 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... | 医疗就诊55518683967中药品679983-a属于三目录的哪个类别 | SELECT DIRE_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '55518683967' AND SOC_SRT_DIRE_CD = '679983-a' | css |
CREATE TABLE table_11460 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2012 value with an A value in 2007 and A value in 2010 in the Canada Masters? | SELECT "2012" FROM table_11460 WHERE "2007" = 'a' AND "2010" = 'a' AND "Tournament" = 'canada masters' | wikisql |
CREATE TABLE table_74260 (
"Year" real,
"Round" real,
"Winner" text,
"Hawthorn score" text,
"St Kilda score" text,
"Attendance" real,
"Venue" text,
"Silk-Miller Medallist" text
) | Who is the winner when the st kilda score is 13.10.88? | SELECT "Winner" FROM table_74260 WHERE "St Kilda score" = '13.10.88' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
... | Which of the NEAREAST classes can be used as MDE ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%NEAREAST%' AND program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
CREATE TABLE table_28201906_1 (
drawn INTEGER
) | What is the lowest number of drawn games by a team? | SELECT MIN(drawn) FROM table_28201906_1 | sql_create_context |
CREATE TABLE table_name_87 (
opponent VARCHAR,
attendance VARCHAR
) | Who was the opponent with attendance at 64,002? | SELECT opponent FROM table_name_87 WHERE attendance = "64,002" | sql_create_context |
CREATE TABLE table_35022 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Points smaller than 96, and a Record of 43 16 8 belongs to what game? | SELECT "Game" FROM table_35022 WHERE "Points" < '96' AND "Record" = '43–16–8' | wikisql |
CREATE TABLE match (
Match_ID int,
Date text,
Venue text,
Score text,
Result text,
Competition text
)
CREATE TABLE hosting_city (
Year int,
Match_ID int,
Host_City text
)
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Populat... | Bar chart x axis competition y axis the total number, could you order by the Y from low to high? | SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_40613 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Location" text
) | What is Name, when Location is Tanzania, and when Novelty is Gen Nov? | SELECT "Name" FROM table_40613 WHERE "Location" = 'tanzania' AND "Novelty" = 'gen nov' | wikisql |
CREATE TABLE table_name_35 (
release_date VARCHAR,
director VARCHAR,
title VARCHAR
) | When was Tree Cornered Tweety, directed by Friz Freleng, released? | SELECT release_date FROM table_name_35 WHERE director = "friz freleng" AND title = "tree cornered tweety" | sql_create_context |
CREATE TABLE table_name_67 (
opponent VARCHAR,
score VARCHAR
) | Who did they lose to 3-17? | SELECT opponent FROM table_name_67 WHERE score = "3-17" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insuranc... | on 12/21/2105, is patient 739's arterial bp mean ever greater than 96.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 = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' A... | mimic_iii |
CREATE TABLE table_40393 (
"Couple" text,
"Style" text,
"Music" text,
"Choreographer(s)" text,
"Results" text
) | Who was the choreographer for the dance style of Jazz? | SELECT "Choreographer(s)" FROM table_40393 WHERE "Style" = 'jazz' | 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 prescriptions... | how many patients born before 2087 were tested for other body flluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_204_448 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years runner-up" text
) | what 's the total of wins does the manchester united have ? | SELECT "winners" FROM table_204_448 WHERE "team" = 'manchester united' | squall |
CREATE TABLE table_2821 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high rebounds for record 10-19 | SELECT "High rebounds" FROM table_2821 WHERE "Record" = '10-19' | wikisql |
CREATE TABLE table_name_26 (
week VARCHAR,
attendance VARCHAR,
opponent VARCHAR
) | What week is the opponent the Indianapolis Colts with an attendance of 68,932? | SELECT COUNT(week) FROM table_name_26 WHERE attendance = "68,932" AND opponent = "indianapolis colts" | sql_create_context |
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 varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Do I need to take any courses before taking BA 499 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Or... | How many transactions correspond to each invoice number. Plot them as scatter chart. | SELECT invoice_number, COUNT(*) FROM Financial_Transactions GROUP BY invoice_number | nvbench |
CREATE TABLE table_9437 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text
) | what is the average enrollment when the team nickname is wolverines and founded is after 1817? | SELECT AVG("Enrollment") FROM table_9437 WHERE "Team Nickname" = 'wolverines' AND "Founded" > '1817' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHi... | Query 1- Viewcount between 1 lac and 5 lac. | SELECT COUNT(*) FROM Posts WHERE Posts.ViewCount > 100000 AND Posts.ViewCount < 500000 | sede |
CREATE TABLE table_44681 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is the total number of Game, when Attendance is '18,568'? | SELECT COUNT("Game") FROM table_44681 WHERE "Attendance" = '18,568' | wikisql |
CREATE TABLE table_27873 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | How many entries are there for type for the cyrillic name other names is (slovak: padina)? | SELECT COUNT("Type") FROM table_27873 WHERE "Cyrillic Name Other Names" = 'Падина (Slovak: Padina)' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | what is the number of times acetaminophen-caff-butalbital was ordered since 5 years ago? | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'acetaminophen-caff-butalbital' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 year') | mimic_iii |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Eve... | what are the event details of the services that have the type code 'Marriage', and count them by a bar chart, show in descending by the Y please. | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage' GROUP BY Event_Details ORDER BY COUNT(Event_Details) DESC | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose diagnoses short title is hematoma complic proc and drug route is buccal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hematoma complic proc" AND prescriptions.route = "BUCCAL" | mimicsql_data |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 2型糖尿病的患者,门诊诊断的游离甲状腺素数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '2型糖尿病' AND jyjgzbb.JCZBMC = '游离甲状腺素' | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | tell me the name of the intake that patient 027-151154 had for the first time on this month/28? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-151154')) AND intakeoutput.cellpath LIKE '%intake%' AND ... | eicu |
CREATE TABLE table_name_70 (
week VARCHAR,
tournament VARCHAR
) | In what Week is the Rome Tournament? | SELECT week FROM table_name_70 WHERE tournament = "rome" | sql_create_context |
CREATE TABLE table_name_42 (
mountains_classification VARCHAR,
general_classification VARCHAR,
stage VARCHAR
) | Which Mountains classification has a General classification of egoi mart nez, and a Stage of 9? | SELECT mountains_classification FROM table_name_42 WHERE general_classification = "egoi martínez" AND stage = "9" | sql_create_context |
CREATE TABLE table_18904831_7 (
high_points VARCHAR,
location VARCHAR
) | What were the high points for the game played at the MCI Center? | SELECT COUNT(high_points) FROM table_18904831_7 WHERE location = "MCI Center" | sql_create_context |
CREATE TABLE table_61968 (
"Position" real,
"Number" real,
"Name" text,
"Team" text,
"Points" real
) | Who had 1344 points? | SELECT "Name" FROM table_61968 WHERE "Points" = '1344' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 检测在检验结果指标记录79035647042的项目名称、指标代码以及名称、方法均为? | SELECT JCXMMC, JCZBDM, JCZBMC, JCFF FROM jyjgzbb WHERE JYZBLSH = '79035647042' | css |
CREATE TABLE table_52512 (
"MLB season" text,
"Team season" text,
"League" text,
"Division" text,
"Finish" text,
"Wins" text,
"Losses" text,
"Win %" text
) | Which division of the Brewers had a 5th place ranking and a loss record of 87? | SELECT "Division" FROM table_52512 WHERE "Finish" = '5th' AND "Losses" = '87' | wikisql |
CREATE TABLE table_33694 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" real
) | What was the average attendance when the opponent was at Philadelphia Eagles and the week was later than week 6? | SELECT AVG("Attendance") FROM table_33694 WHERE "Week" > '6' AND "Opponent" = 'at philadelphia eagles' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 编号为19416849的患者在门诊诊断为慢性阻塞性肺病伴有急性加重的白蛋白的时候其结果定量是什么及其单位是什么呢? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_28857 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who was the incumbent when the candidates were John banks (am) 52.2% samuel power (j) 47.8%? | SELECT "Incumbent" FROM table_28857 WHERE "Candidates" = 'John Banks (AM) 52.2% Samuel Power (J) 47.8%' | wikisql |
CREATE TABLE table_name_62 (
score VARCHAR,
money___$__ VARCHAR
) | What's the score for $22,500? | SELECT score FROM table_name_62 WHERE money___$__ = "22,500" | sql_create_context |
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 ... | 沈玉堂这个患者所有检验报告单中的标本在2002年6月12日到2006年8月24日期间内采集的都是啥呀? | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJL... | css |
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
CREATE TABLE category (
id int,
business_id varchar,
category_name varchar
)
CREATE TABLE tip (
tip_id int,
business_id varchar... | List all the neighborhoods with Italian restaurant rated less than 2.5 in Madison | SELECT neighborhood.neighborhood_name FROM business, category AS CATEGORY_0, category AS CATEGORY_1, neighborhood WHERE business.city = 'Madison' AND business.rating < 2.5 AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Italian' AND CATEGORY_1.business_id = business.business_id AND CAT... | yelp |
CREATE TABLE table_70105 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Who won Mixed Doubles the year that Marija Ulitina won the Women's Singles? | SELECT "Mixed doubles" FROM table_70105 WHERE "Women's singles" = 'marija ulitina' | wikisql |
CREATE TABLE table_name_33 (
lineup VARCHAR,
match VARCHAR
) | What was her place in the lineup on match 2? | SELECT lineup FROM table_name_33 WHERE match = "2" | sql_create_context |
CREATE TABLE table_42642 (
"Date" text,
"Tournament" text,
"Location" text,
"Home team" text,
"Score" text,
"Away team" text
) | What was the location of the home game for Japan? | SELECT "Location" FROM table_42642 WHERE "Home team" = 'japan' | wikisql |
CREATE TABLE table_204_652 (
id number,
"title" text,
"year" number,
"director" text,
"country" text,
"genre" text,
"notes" text
) | how many crime thrillers were released in this category in this year ? | SELECT COUNT(*) FROM table_204_652 WHERE "genre" = 'crime thriller' | squall |
CREATE TABLE table_26218 (
"Song 1 title" text,
"Artist 1" text,
"Song 2 title" text,
"Artist 2" text,
"Mix artist" text,
"Guitar part?" text,
"Level" text
) | Which level has wale as artist 1? | SELECT "Level" FROM table_26218 WHERE "Artist 1" = 'Wale' | wikisql |
CREATE TABLE table_1341453_32 (
party VARCHAR,
incumbent VARCHAR
) | What is the party of the district incumbent Jim Saxton? | SELECT party FROM table_1341453_32 WHERE incumbent = "Jim Saxton" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | what number of patients who underwent hemodialysis were discharged at home health care? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Hemodialysis" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose admission location is transfer from hosp/extram and procedure long title is excision or destruction of other lesion or tissue of heart, endovascular approach? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Excision or destruction of other lesion or tissue of heart, endovascular approach" | mimicsql_data |
CREATE TABLE table_name_58 (
grid INTEGER,
constructor VARCHAR,
laps VARCHAR
) | When the laps are 31 and the constructor was honda, what's the sum of all grid values? | SELECT SUM(grid) FROM table_name_58 WHERE constructor = "honda" AND laps = 31 | sql_create_context |
CREATE TABLE table_name_6 (
score VARCHAR,
tie_no VARCHAR
) | What was the score for a no. 21 tie? | SELECT score FROM table_name_6 WHERE tie_no = "21" | sql_create_context |
CREATE TABLE table_41122 (
"Stage (Winner)" text,
"General Classification" text,
"Young Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Team Classification" text
) | Who was the winner for a Sprint Classification and Young Classification to Mark Cavendish and Garmin-Chipotle-H30 for team? | SELECT "Stage (Winner)" FROM table_41122 WHERE "Sprint Classification" = 'mark cavendish' AND "Team Classification" = 'garmin-chipotle-h30' AND "Young Classification" = 'mark cavendish' | wikisql |
CREATE TABLE table_12043148_2 (
glos_ VARCHAR,
_wilts VARCHAR,
bristol_ VARCHAR,
_somerset VARCHAR
) | what is the glos & wilts where the bristol & somerset is lansdown? | SELECT glos_ & _wilts FROM table_12043148_2 WHERE bristol_ & _somerset = "Lansdown" | sql_create_context |
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... | Visualize a pie chart about the proportion of Team_Name and Team_ID. | SELECT Team_Name, Team_ID FROM basketball_match | nvbench |
CREATE TABLE table_19061741_1 (
status VARCHAR,
name VARCHAR
) | When nel rapiz is the name what is the status? | SELECT status FROM table_19061741_1 WHERE name = "Nel Rapiz" | sql_create_context |
CREATE TABLE table_54806 (
"Frequency" text,
"Call sign" text,
"Name" text,
"Format" text,
"Owner" text
) | Which owner has the call sign of KDSU? | SELECT "Name" FROM table_54806 WHERE "Call sign" = 'kdsu' | wikisql |
CREATE TABLE table_69936 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
) | Which record has tko (strikes) as the method, and daan kooiman as the opponent? | SELECT "Record" FROM table_69936 WHERE "Method" = 'tko (strikes)' AND "Opponent" = 'daan kooiman' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | during the previous year was patient 011-20295 diagnosed with seizures - new onset? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-20295')) AND diagnosis.diagnosisname = 'seizures - new onset' AND DATETI... | eicu |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 在2012年3月10日到2019年8月21日期间在医疗机构6403042有多少住院时长超过20天的住院就诊记录? | SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '64... | css |
CREATE TABLE table_28348757_6 (
written_by VARCHAR,
production_code VARCHAR
) | Who wrote the episode with the code xle05012? | SELECT written_by FROM table_28348757_6 WHERE production_code = "XLE05012" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose religion is christian scientist and item id is 50811 | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CHRISTIAN SCIENTIST" AND lab.itemid = "50811" | mimicsql_data |
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
) | Group and count the durations for each actor with a bar graph, sort from low to high by the bar please. | SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration ORDER BY Duration | nvbench |
CREATE TABLE table_17246160_1 (
wins VARCHAR,
series VARCHAR
) | How many wins did the player have in the Formula BMW World Final? | SELECT wins FROM table_17246160_1 WHERE series = "Formula BMW World Final" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | What is the section after 11:00 A.M. that is in ECON 183 ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '11:00' AND course.course_id = course_offering.course_id AND course.department = 'ECON' AND course.number = 183 AND semester.semester = 'WN' AND ... | advising |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid numb... | when did patient 035-2205 last have a minimum value of sao2 since 03/20/2102? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205')) AND NOT vitalperiodic.sao2 IS NULL AND ... | eicu |
CREATE TABLE table_23871 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Tar Heels points" real,
"Opponents" real,
"Record" text
) | How many results finished in a loss? | SELECT COUNT("Tar Heels points") FROM table_23871 WHERE "Result" = 'Loss' | wikisql |
CREATE TABLE table_204_173 (
id number,
"rank" number,
"group" text,
"name" text,
"nationality" text,
"2.05" text,
"2.15" text,
"2.19" text,
"2.23" text,
"2.26" text,
"result" text,
"notes" text
) | which name is listed below niki palli ? | SELECT "name" FROM table_204_173 WHERE id = (SELECT id FROM table_204_173 WHERE "name" = 'niki palli') + 1 | squall |
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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numb... | what were the five most commonly given diagnoses for patients who had been previously diagnosed with left bb block nec in the same month? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | 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... | give me the number of patients whose year of birth is less than 2056 and procedure icd9 code is 8321? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2056" AND procedures.icd9_code = "8321" | mimicsql_data |
CREATE TABLE table_31983 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Tell me the date with week of 13 | SELECT "Date" FROM table_31983 WHERE "Week" = '13' | wikisql |
CREATE TABLE table_19120 (
"#" real,
"Sanskrit \u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d" text,
"Tamil \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" text,
"Telugu \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" text,
"Kannada \u0c95\u0ca8\u0ccd\u0ca8\u0ca1" text,
"Malayalam \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u... | What is the Malayalam word that is listed as #10 in the table? | SELECT "Malayalam \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" FROM table_19120 WHERE "#" = '10' | wikisql |
CREATE TABLE table_45576 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | What is Score, when To Par is greater than 7, when Place is 'T4', and when Player is 'Bob Rosburg'? | SELECT "Score" FROM table_45576 WHERE "To par" > '7' AND "Place" = 't4' AND "Player" = 'bob rosburg' | wikisql |
CREATE TABLE table_80342 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the region of the Alfa Records release with catalog ALCA-282? | SELECT "Region" FROM table_80342 WHERE "Label" = 'alfa records' AND "Catalog" = 'alca-282' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | count the number of patients less than 49 years who stayed in the hospital for more than 3 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "49" AND demographic.days_stay > "3" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of emergency hospital admitted patients who were diagnosed with accidental fall on or from other stairs or steps. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Accidental fall on or from other stairs or steps" | mimicsql_data |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | What are the names of the different bank branches, and what are their total loan amounts Show bar chart, and I want to sort by the Y-axis from low to high. | SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY SUM(amount) | nvbench |
CREATE TABLE table_23268 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
) | What's Babson College's enrollment? | SELECT MAX("Enrollment") FROM table_23268 WHERE "Institution" = 'Babson College' | 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... | 查询5586017这个医疗机构在07年12月26到14年5月19日内的医疗费总额 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '5586017' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-12-26' AND '2014-05-19' | css |
CREATE TABLE table_19366 (
"Application" text,
"Version" text,
"Cmdlets" text,
"Provider" text,
"Management GUI" text
) | Which providers don't use exchange server? | SELECT "Provider" FROM table_19366 WHERE "Application" = 'Exchange Server' | wikisql |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For all employees who have the letters D or S in their first name, find hire_date and the amount of hire_date bin hire_date by weekday, and visualize them by a bar chart, and could you show in descending by the how many hire date? | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
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... | how many patients admission location is trsf within this facility and item id is 50801? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.itemid = "50801" | mimicsql_data |
CREATE TABLE table_36283 (
"Males Rank" real,
"Females Rank" real,
"State" text,
"HIV awareness (males%)" real,
"Females (%)" real
) | Which Males Rank is the highest one that has Females (%) smaller than 40, and Females Rank smaller than 22? | SELECT MAX("Males Rank") FROM table_36283 WHERE "Females (%)" < '40' AND "Females Rank" < '22' | wikisql |
CREATE TABLE table_33719 (
"Coach" text,
"Years" text,
"Record" text,
"Conference Record" text,
"Overall Win Percentage" text
) | In what years was the conference record 18-15? | SELECT "Years" FROM table_33719 WHERE "Conference Record" = '18-15' | wikisql |
CREATE TABLE table_65748 (
"Sunrayia FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the losses when Sunrayia FL is Red Cliffs, and the against is more than 2294? | SELECT AVG("Losses") FROM table_65748 WHERE "Sunrayia FL" = 'red cliffs' AND "Against" > '2294' | wikisql |
CREATE TABLE table_32673 (
"Orchestra" text,
"Conductor" text,
"Record Company" text,
"Year of Recording" real,
"Format" text
) | What record company has robert craft conducting? | SELECT "Record Company" FROM table_32673 WHERE "Conductor" = 'robert craft' | wikisql |
CREATE TABLE table_203_639 (
id number,
"year" text,
"number" text,
"name" text
) | count how many people were club president and give the total . | SELECT COUNT("name") FROM table_203_639 | squall |
CREATE TABLE table_10800 (
"Poll source" text,
"Date(s) administered" text,
"Sample size" text,
"Margin of error" text,
"Barbara Boxer (D)" text,
"Carly Fiorina (R)" text,
"Other" text,
"Undecided" text
) | what is the margin of error when the undicided is 8% and other is 4%? | SELECT "Margin of error" FROM table_10800 WHERE "Undecided" = '8%' AND "Other" = '4%' | wikisql |
CREATE TABLE county (
County_name VARCHAR,
County_id VARCHAR
)
CREATE TABLE election (
District VARCHAR,
Committee VARCHAR
) | What are the names of the county that the delegates on 'Appropriations' committee belong to? | SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = "Appropriations" | sql_create_context |
CREATE TABLE table_11512 (
"State" text,
"Swimsuit" real,
"Evening gown" real,
"Interview" real,
"Average" real
) | Name the least evening gown for interview more than 7.97 and swimsui of 7.24 | SELECT MIN("Evening gown") FROM table_11512 WHERE "Swimsuit" = '7.24' AND "Interview" > '7.97' | wikisql |
CREATE TABLE table_65897 (
"Airing date" text,
"English title (Chinese title)" text,
"Number of episodes" real,
"Genre" text,
"Official website" text
) | What is the lowest number of episodes in a series with an airing date of 12 jan- 6 feb? | SELECT MIN("Number of episodes") FROM table_65897 WHERE "Airing date" = '12 jan- 6 feb' | wikisql |
CREATE TABLE table_43851 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | On which Surface will Estrella Cabeza Candela play? | SELECT "Surface" FROM table_43851 WHERE "Opponent" = 'estrella cabeza candela' | wikisql |
CREATE TABLE table_1346137_4 (
candidates VARCHAR,
district VARCHAR
) | Who were the candidates in the district of South Carolina 5? | SELECT candidates FROM table_1346137_4 WHERE district = "South Carolina 5" | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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 t... | 从00年2月1日开始06年5月3日结束患者89244700所有检验结果指标记录中的仪器编号以及名称都是啥吗? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgz... | css |
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... | give me the number of patients whose days of hospital stay is greater than 7 and diagnoses short title is single lb in-hosp w cs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.short_title = "Single lb in-hosp w cs" | mimicsql_data |
CREATE TABLE table_45190 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What date was the set 1 25 23, and a Set 3 of 25 14? | SELECT "Date" FROM table_45190 WHERE "Set 1" = '25–23' AND "Set 3" = '25–14' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | ROOMBA > year old questions that have active close votes. http://meta.stackexchange.com/questions/78048/enable-automatic-deletion-of-old-unanswered-zero-score-questions-after-a-year/92006#92006 No need to vote to close these as 1 downvote should delete them anytime within the next 7 days. | SELECT q.Id AS "post_link", COUNT(pf.FlagTypeId) AS CVs, q.ViewCount FROM Posts AS q INNER JOIN Users AS u ON u.Id = q.OwnerUserId INNER JOIN PostHistory AS ph ON ph.Id = q.Id INNER JOIN PendingFlags AS pf ON pf.PostId = q.Id WHERE q.PostTypeId = 1 AND DATEDIFF(DAY, q.CreationDate, GETDATE()) > 365 AND q.Score = 0 AND ... | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.