context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_54408 ( "Year" real, "Title" text, "Publisher" text, "Release Date" text, "Copyright Information" text, "ISBN" real )
What was Random House's copyright information?
SELECT "Copyright Information" FROM table_54408 WHERE "Publisher" = 'random house'
wikisql
CREATE TABLE table_name_67 ( date VARCHAR, latin_commander VARCHAR, battle VARCHAR )
On what Date was Henry I Latin Commander of the Battle of Boruy?
SELECT date FROM table_name_67 WHERE latin_commander = "henry i" AND battle = "battle of boruy"
sql_create_context
CREATE TABLE table_51151 ( "Tribunal" text, "Number of autos da f\u00e9 with known sentences" text, "Executions in persona" text, "Executions in effigie" text, "Penanced" text, "Total" text )
How man executions in effigie took place at the Lamego tribunal?
SELECT "Executions in effigie" FROM table_51151 WHERE "Tribunal" = 'lamego'
wikisql
CREATE TABLE table_78306 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Which Attendance has an Opponent of green bay packers, and a Week larger than 10?
SELECT MIN("Attendance") FROM table_78306 WHERE "Opponent" = 'green bay packers' AND "Week" > '10'
wikisql
CREATE TABLE table_28406 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
When was the earliest founded university?
SELECT MIN("Founded") FROM table_28406
wikisql
CREATE TABLE department ( dno number, division text, dname text, room text, building text, dphone number ) CREATE TABLE course ( cid text, cname text, credits number, instructor number, days text, hours text, dno number ) CREATE TABLE gradeconversion ( lettergra...
What are the first names of all students that are not enrolled in courses?
SELECT fname FROM student WHERE NOT stuid IN (SELECT stuid FROM enrolled_in)
spider
CREATE TABLE table_204_917 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number )
which date was attended by the most people ?
SELECT "date" FROM table_204_917 ORDER BY "attendance" DESC LIMIT 1
squall
CREATE TABLE table_67573 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which country has the score 70-76-68-214?
SELECT "Country" FROM table_67573 WHERE "Score" = '70-76-68-214'
wikisql
CREATE TABLE table_name_54 ( manufacturer VARCHAR, laps VARCHAR, grid VARCHAR )
What kind of Manufacturer has a Laps smaller than 20 and a Grid of 21
SELECT manufacturer FROM table_name_54 WHERE laps < 20 AND grid = 21
sql_create_context
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
疾病Z83.066的患者在门诊诊断为检测指标549027的参考值范围下限是多少?上限是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'Z83.066' AND jyjgzbb.JCZBDM = '549027' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
Are there any Other classes in the Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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 instructor ( instructo...
What is the easiest courses I can take to complete the PreMajor requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
advising
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, ...
what was the top five most frequent lab tests that patients had within 2 months after receiving a hemodialysis - for chronic renal failure procedure until 2101?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hemodialysis - for chronic renal failure' AND STRFTI...
eicu
CREATE TABLE table_204_813 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
in what cities did the competitor participate in the olympics ?
SELECT "venue" FROM table_204_813 WHERE "competition" = 'olympic games'
squall
CREATE TABLE table_name_51 ( label VARCHAR, date VARCHAR )
What's listed for the Label with a Date of 29 July 1997?
SELECT label FROM table_name_51 WHERE date = "29 july 1997"
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...
what is the number of patients whose admission location is clinic referral/premature and discharge location is home health care?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "HOME HEALTH CARE"
mimicsql_data
CREATE TABLE table_74246 ( "\u2116" real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
What is the season 4 # for the production code of 4abb07?
SELECT "#" FROM table_74246 WHERE "Production code" = '4ABB07'
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what was the first dose of soln on their last hospital encounter, prescribed to patient 94316?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94316 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'soln' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
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...
从13年5月11日到2020年4月11日这段时间,列出患者杨丹红所有检验报告单的审核日期时间吗?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '杨丹红' AND jybg...
css
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...
列出各科室的编码和名称以及平均住院时长在医院0936884是什么,并按平均住院时长升序排序?
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM, AVG(gwyjzb.IN_HOSP_DAYS) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0936884' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY AVG(gwyjzb.IN_HOSP_DAYS) UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM, AVG(fgwyjzb.IN_HOSP_DAYS) FROM fgwyjzb WHERE fgwyjzb.MED_SE...
css
CREATE TABLE table_6193 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 1st leg that has a 2nd leg of 0 0 of olympique khouribga?
SELECT "1st leg" FROM table_6193 WHERE "2nd leg" = '0–0' AND "Team 1" = 'olympique khouribga'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me the comparison about Team_ID over the ACC_Road , and group by attribute All_Home, list in ascending by the Y-axis.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY Team_ID
nvbench
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id ...
Count of posts scored between (10,100), grouped by score.
SELECT Score, COUNT(Score) FROM Posts WHERE 10 < Score AND Score < 100 GROUP BY Score ORDER BY Score
sede
CREATE TABLE table_50159 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
On what Surface was the match with a Score of 6 4, 6 3 and Runner-up Outcome played?
SELECT "Surface" FROM table_50159 WHERE "Outcome" = 'runner-up' AND "Score" = '6–4, 6–3'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, sub...
how many times patient 18237 during this year had visited icu?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18237) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_27606 ( "Team" text, "Played" real, "Won" real, "Lost" real, "No-Result" real, "Abandoned" real, "Bonus Points" real, "Total Points" real, "Net Run Rate" text )
What's the largest number of abandoned games by any of the teams?
SELECT MAX("Abandoned") FROM table_27606
wikisql
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...
count the number of patients who had been discharged until 2100.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2100'
eicu
CREATE TABLE table_24856332_4 ( minutes INTEGER, steals VARCHAR )
What is the lowest number of minutes for a player with 47 steals?
SELECT MIN(minutes) FROM table_24856332_4 WHERE steals = 47
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChang...
All answers with a given tag.
SELECT a.ParentId AS "id", a.Score AS "sc", CONCAT(a.OwnerDisplayName, u.DisplayName) AS "au", a.Body AS "body" FROM Posts AS a LEFT JOIN Users AS u ON a.OwnerUserId = u.Id WHERE EXISTS(SELECT q.Id FROM Posts AS q WHERE q.Id = a.ParentId AND q.Tags LIKE '%<##Tag##>%' AND u.DisplayName = 'Maxim') ORDER BY a.ParentId
sede
CREATE TABLE table_2850912_7 ( nationality VARCHAR, college_junior_club_team VARCHAR )
What nationality is listed when the college/junior/club team is oshawa generals (ohl)?
SELECT nationality FROM table_2850912_7 WHERE college_junior_club_team = "Oshawa Generals (OHL)"
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 gender is f and discharge location is long term care hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and list by the x-axis in desc.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_27 ( grid INTEGER, driver VARCHAR, time_retired VARCHAR, laps VARCHAR )
What is the sum of grids with an engine in Time/Retired with less than 45 laps for Giancarlo Baghetti?
SELECT SUM(grid) FROM table_name_27 WHERE time_retired = "engine" AND laps < 45 AND driver = "giancarlo baghetti"
sql_create_context
CREATE TABLE table_72610 ( "Episode #" text, "Country" text, "City" text, "Martial Art/Style" text, "Masters" text, "Original Airdate" text )
When did the episode featuring a master using Brazilian jiu-jitsu air?
SELECT "Original Airdate" FROM table_72610 WHERE "Martial Art/Style" = 'Brazilian Jiu-Jitsu'
wikisql
CREATE TABLE table_76006 ( "Rank" real, "Republic" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of silvers for teams with ranks over 3 and totals under 2?
SELECT SUM("Silver") FROM table_76006 WHERE "Rank" > '3' AND "Total" < '2'
wikisql
CREATE TABLE table_name_25 ( founded VARCHAR, city VARCHAR, capacity VARCHAR )
How many foundeds have sousse as the city, with a capacity greater than 25,000?
SELECT COUNT(founded) FROM table_name_25 WHERE city = "sousse" AND capacity > 25 OFFSET 000
sql_create_context
CREATE TABLE table_40759 ( "Date" text, "Event" text, "Winner" text, "Team" text, "Series leader" text )
What is the Series leader with a Date that is october 9?
SELECT "Series leader" FROM table_40759 WHERE "Date" = 'october 9'
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, ...
what are the top three most common procedures that followed in the same hospital encounter for patients who received anticonvulsant - gabapentin since 2105?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antic...
eicu
CREATE TABLE table_24572 ( "Train No." text, "Train Name" text, "Destination" text, "Category" text, "Frequency" text )
What trains have a category of express and a weekly frequency?
SELECT "Train Name" FROM table_24572 WHERE "Category" = 'Express' AND "Frequency" = 'Weekly'
wikisql
CREATE TABLE table_19753079_8 ( first_elected VARCHAR, district VARCHAR )
How many were first elected in California 7?
SELECT first_elected FROM table_19753079_8 WHERE district = "California 7"
sql_create_context
CREATE TABLE table_name_49 ( bronze INTEGER, silver VARCHAR, total VARCHAR, rank VARCHAR )
What is the sum of the bronze medals when there were less than 8 total medals, 0 silver medals and a rank of 9?
SELECT SUM(bronze) FROM table_name_49 WHERE total < 8 AND rank = 9 AND silver < 0
sql_create_context
CREATE TABLE table_19556 ( "Station (and code)" text, "Managed by" text, "Lines served" text, "Station users 2007/8" real, "Station users 2008/9" text, "Year opened" text, "Platforms" text, "Borough" text )
what are the lines served where station users is 210076?
SELECT "Lines served" FROM table_19556 WHERE "Station users 2008/9" = '210076'
wikisql
CREATE TABLE table_23619212_1 ( _percentage_of_all_immigrants_2007 VARCHAR, _percentage_of_all_immigrants_2005 VARCHAR )
How many different percentages of immigrants are there for the year of 2007 in the countries with 1.2% of the immigrants in the year of 2005?
SELECT COUNT(_percentage_of_all_immigrants_2007) FROM table_23619212_1 WHERE _percentage_of_all_immigrants_2005 = "1.2%"
sql_create_context
CREATE TABLE table_17368 ( "Year" real, "Division" text, "League" text, "Reg. Season" text, "Playoffs" text, "Open Cup" text )
What playoff result happened during the season in which they finished 1st, southern?
SELECT "Playoffs" FROM table_17368 WHERE "Reg. Season" = '1st, Southern'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
how many patients were given a methemoglobin lab test in the previous year?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'methemoglobin' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
eicu
CREATE TABLE table_46639 ( "Tournament" text, "Surface" text, "Week" text, "Winners" text, "Finalists" text, "Semifinalists" text )
What is Finalists, when Tournament is Miami?
SELECT "Finalists" FROM table_46639 WHERE "Tournament" = 'miami'
wikisql
CREATE TABLE table_26247 ( "No" real, "Player" text, "Height (m)" text, "Height (f)" text, "Position" text, "Year born" real, "Current Club" text )
How many players have a height of 2.07?
SELECT COUNT("Player") FROM table_26247 WHERE "Height (m)" = '2.07'
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...
能知道患者16019866之前看病的医院吗
SELECT hz_info_mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz...
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ...
when did until 13 months ago patient 86206 last receive a microbiology test?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86206) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-13 month') ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_31 ( record VARCHAR, opponent VARCHAR )
For the game where the opponent is listed as @ Indiana Pacers, what was the end record?
SELECT record FROM table_name_31 WHERE opponent = "@ indiana pacers"
sql_create_context
CREATE TABLE procedures ( 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 ) ...
specify birthdate of patient shawn green
SELECT demographic.dob FROM demographic WHERE demographic.name = "Shawn Green"
mimicsql_data
CREATE TABLE table_25999087_2 ( young_rider_classification VARCHAR, combativity_award VARCHAR )
Who is every young rider classification if combativity award is Yannick Talabardon?
SELECT young_rider_classification FROM table_25999087_2 WHERE combativity_award = "Yannick Talabardon"
sql_create_context
CREATE TABLE table_27455867_1 ( callback_audition_date VARCHAR, callback_venue VARCHAR )
When were the callback auditions at Hilton Riverside Hotel held?
SELECT callback_audition_date FROM table_27455867_1 WHERE callback_venue = "Hilton Riverside Hotel"
sql_create_context
CREATE TABLE table_name_38 ( bit_depth INTEGER, color_sampling VARCHAR )
What bit depth has 4:1:1 as the color sampling?
SELECT SUM(bit_depth) FROM table_name_38 WHERE color_sampling = "4:1:1"
sql_create_context
CREATE TABLE table_63253 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
Who was the opponent on April 21?
SELECT "Opponent" FROM table_63253 WHERE "Date" = 'april 21'
wikisql
CREATE TABLE table_19264 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many extra points did Paul Jones score?
SELECT COUNT("Extra points") FROM table_19264 WHERE "Player" = 'Paul Jones'
wikisql
CREATE TABLE table_52770 ( "Name" text, "Pennant" text, "Builder" text, "Laid Down" text, "Launched" text, "Commissioned" text )
when was the launched date when the laid down date is 14 august 1942?
SELECT "Launched" FROM table_52770 WHERE "Laid Down" = '14 august 1942'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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,...
把在门诊被诊断为慢性咽炎的病人的检测指标491442数值的平均值以及最值查看一下
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 = '慢性咽炎' AND jyjgzbb.JCZBDM = '491442'
css
CREATE TABLE table_204_357 ( id number, "year" number, "div." text, "pos." text, "cup" text, "top scorer (league)" text, "score" number )
who was the top scorer after sukhrob nematov ?
SELECT "top scorer (league)" FROM table_204_357 WHERE "year" > (SELECT "year" FROM table_204_357 WHERE "top scorer (league)" = 'sukhrob nematov') ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_26013618_1 ( nsg_nr VARCHAR, district___town VARCHAR, area__ha_ VARCHAR )
How many reserves are in Herzogtum Lauenburg with an area of 123,14?
SELECT COUNT(nsg_nr) FROM table_26013618_1 WHERE district___town = "Herzogtum Lauenburg" AND area__ha_ = "123,14"
sql_create_context
CREATE TABLE table_name_95 ( date VARCHAR, against VARCHAR )
What date has an against of 7?
SELECT date FROM table_name_95 WHERE against = 7
sql_create_context
CREATE TABLE table_name_93 ( character VARCHAR, duration VARCHAR, actor VARCHAR )
What character did Vicky Versavel play for 13 years?
SELECT character FROM table_name_93 WHERE duration = "13 years" AND actor = "vicky versavel"
sql_create_context
CREATE TABLE table_name_50 ( weight VARCHAR, name VARCHAR )
What was the weight of Serhiy Alfyorov?
SELECT weight FROM table_name_50 WHERE name = "serhiy alfyorov"
sql_create_context
CREATE TABLE table_22050544_4 ( elapsed_time VARCHAR, prize VARCHAR )
What was the elapsed time for the championship that had $9,377.42 in prize money?
SELECT elapsed_time FROM table_22050544_4 WHERE prize = "$9,377.42"
sql_create_context
CREATE TABLE table_204_769 ( id number, "full name" text, "nickname" text, "gender" text, "weight at birth" text, "meaning" text )
how many girls were heavier at birth than chimaijem otto ?
SELECT COUNT(*) FROM table_204_769 WHERE "gender" = 'girl' AND "weight at birth" > (SELECT "weight at birth" FROM table_204_769 WHERE "full name" = 'chimaijem otto')
squall
CREATE TABLE table_57435 ( "Tournament" text, "1984" text, "1985" text, "1986" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text )
What is the 1989 result of the tournament in which Katerina finished nh in 1986?
SELECT "1989" FROM table_57435 WHERE "1986" = 'nh'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
See post history types, post types, and vote types.
SELECT 'post history' AS type, * FROM PostHistoryTypes UNION SELECT 'post type' AS type, * FROM PostTypes UNION SELECT 'vote type' AS type, * FROM VoteTypes
sede
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 microlab ( microlabid number, ...
until 2 years ago, was patient 031-22988 at the emergency room?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '031-22988' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_train_58 ( "id" int, "pregnancy_or_lactation" bool, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "temperature" float, "surgery" bool, "antibiotic_treatment" bool, "heart_rate" int, "allergy_to_vitamin_c" bool, "paco2" float, "immatur...
acute increase in qsofa score of 2 points or more. 1 point each is assigned for: 1 ) systolic blood pressure below 100 , 2 ) respiratory rate greater than 22 , and 3 ) mental status not at baseline.
SELECT * FROM table_train_58 WHERE (CASE WHEN systolic_blood_pressure_sbp < 100 THEN 1 ELSE 0 END + CASE WHEN respiratory_rate > 22 THEN 1 ELSE 0 END + CASE WHEN mental_status = 0 THEN 1 ELSE 0 END) >= 2
criteria2sql
CREATE TABLE table_name_71 ( country VARCHAR, name VARCHAR )
What country has the SBA Towers Tower Hayneville?
SELECT country FROM table_name_71 WHERE name = "sba towers tower hayneville"
sql_create_context
CREATE TABLE table_name_44 ( date VARCHAR, type_of_game VARCHAR, opponent VARCHAR )
What date had an opponent of Sweden and a friendly type game?
SELECT date FROM table_name_44 WHERE type_of_game = "friendly" AND opponent = "sweden"
sql_create_context
CREATE TABLE table_8432 ( "Number" text, "Builder" text, "Type" text, "Date" real, "Length" text, "Capacity" text )
Which Date has a Length of feet 9inches (m), and a Builder of portland terminal company?
SELECT AVG("Date") FROM table_8432 WHERE "Length" = 'feet 9inches (m)' AND "Builder" = 'portland terminal company'
wikisql
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, ...
在09年7月5日到17年7月6日这段时间,患者卫逸明一共有多少检验报告单,把这些检验报告单的标本采集部位列出来
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '卫逸明' AND jy...
css
CREATE TABLE table_16751 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
What circuit did Clay Regazzoni win?
SELECT "Circuit" FROM table_16751 WHERE "Winning driver" = 'Clay Regazzoni'
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...
有多少病人被门诊诊断为阿尔茨海默病?列出他们的籍贯代码、名称以及相应人数
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE table_203_529 ( id number, "fin" number, "st" number, "driver" text, "car #" number, "make" text, "points" number, "bonus" number, "laps" number, "winnings" text )
how many drivers earned no bonus for this race ?
SELECT COUNT("driver") FROM table_203_529 WHERE "bonus" IS NULL
squall
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,...
按照科室的名字不同、入院诊断的疾病编码不同看看医院5031026所有的就诊记录里患者平均是多大年纪
SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5031026' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_CD
css
CREATE TABLE table_204_131 ( id number, "tops design code" text, "electrical system" text, "max speed" text, "weight" text, "brakes" text, "route availability" number, "notes" text )
what 's the total design variations with vacuum brakes ?
SELECT COUNT("tops design code") FROM table_204_131 WHERE "brakes" = 'vacuum'
squall
CREATE TABLE table_59226 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the Statue, when Venue is 'Stadio Flaminio , Rome'?
SELECT "Status" FROM table_59226 WHERE "Venue" = 'stadio flaminio , rome'
wikisql
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperda...
what are most cited papers of tom mitchell and oren etzioni ?
SELECT DISTINCT author.authorname, cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname IN ('tom mitchell', 'oren etzioni') AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid, author.au...
scholar
CREATE TABLE invoices ( invoice_id number, order_id number, payment_method_code text, product_id number, order_quantity text, other_item_details text, order_item_id number ) CREATE TABLE performers ( performer_id number, address_id number, customer_name text, customer_phone ...
List the description, code and the number of services for each service type.
SELECT T1.service_type_description, T2.service_type_code, COUNT(*) FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code GROUP BY T2.service_type_code
spider
CREATE TABLE table_name_82 ( published_as_serial VARCHAR, published_as_novel VARCHAR )
Which Published as serial has a Published as novel of october 1917, mcclurg?
SELECT published_as_serial FROM table_name_82 WHERE published_as_novel = "october 1917, mcclurg"
sql_create_context
CREATE TABLE table_36672 ( "Pos." real, "Matches" real, "Wins" real, "Loses" real, "Results" text, "Points" real, "Diff." text )
What's the highest Loses, with Wins that's larger than 3 and a Pos. Larger than 3?
SELECT MAX("Loses") FROM table_36672 WHERE "Wins" > '3' AND "Pos." > '3'
wikisql
CREATE TABLE table_name_71 ( circuit VARCHAR, series VARCHAR )
Which circuit was the atcc round 7 at?
SELECT circuit FROM table_name_71 WHERE series = "atcc round 7"
sql_create_context
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
Bar chart of the total number from each origin, I want to rank bars in asc order please.
SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY origin
nvbench
CREATE TABLE table_name_44 ( location VARCHAR, date VARCHAR )
Which Location has a Date of 1931-02-02?
SELECT location FROM table_name_44 WHERE date = "1931-02-02"
sql_create_context
CREATE TABLE table_name_64 ( home_team VARCHAR, venue VARCHAR )
Which Home team has a Venue of arden street oval?
SELECT home_team FROM table_name_64 WHERE venue = "arden street oval"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
What is the proportion of job titles for employees in department 80? You can give me a pie chart.
SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the founder , and group by attribute founder by a bar chart, I want to sort from low to high by the Y please.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_38384 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
Which Incumbent has a First elected larger than 1884?
SELECT "Incumbent" FROM table_38384 WHERE "First elected" > '1884'
wikisql
CREATE TABLE table_name_55 ( win_percentage INTEGER, name VARCHAR )
Which Win percentage has a Name of red kelly?
SELECT SUM(win_percentage) FROM table_name_55 WHERE name = "red kelly"
sql_create_context
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what are the four most frequently prescribed medications for patients who had previously received spinal tap within 2 months, until 2104?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
mimic_iii
CREATE TABLE table_4497 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
Who is the winning driver of Penske Racing, and what was Rick Mears' pole position?
SELECT "Winning driver" FROM table_4497 WHERE "Winning team" = 'penske racing' AND "Pole Position" = 'rick mears'
wikisql
CREATE TABLE table_204_10 ( id number, "ecclesiastical jurisdictions" text, "latin name" text, "type" text, "rite" text, "ecclesiastical province" text, "established" text, "area (km2)" number )
which was the first diocese to be formed ?
SELECT "latin name" FROM table_204_10 ORDER BY "established" LIMIT 1
squall
CREATE TABLE table_name_83 ( remarks VARCHAR, destination_number VARCHAR, rank VARCHAR )
What were the remarks for a destination under 19 and rank less than 5?
SELECT remarks FROM table_name_83 WHERE destination_number < 19 AND rank < 5
sql_create_context
CREATE TABLE table_name_11 ( year INTEGER, version VARCHAR )
What year had a version called Wolf Mix?
SELECT AVG(year) FROM table_name_11 WHERE version = "wolf mix"
sql_create_context
CREATE TABLE table_69347 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the date of the game when the record was 70-74?
SELECT "Date" FROM table_69347 WHERE "Record" = '70-74'
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...
count the number of patients whose primary disease is atrial septal defect\mitral valve replacement;repair atrial-septal defect/sda and admission year is less than 2145?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND demographic.admityear < "2145"
mimicsql_data
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...
What are the courses of The Literature of American History that have 5 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%The Literature of American History%' OR name LIKE '%The Literature of American History%') AND credits = 5
advising
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE course ( course_id va...
Find the minimum salary for the departments whose average salary is above the average payment of all instructors. Plot them as bar chart.
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name
nvbench