context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_1850339_2 ( air_force___navy_score VARCHAR, season VARCHAR )
What was the Air Force - Navy score in the 1983 season?
SELECT air_force___navy_score FROM table_1850339_2 WHERE season = 1983
sql_create_context
CREATE TABLE table_name_8 ( label VARCHAR, date VARCHAR )
What label has 22 January 2008 date?
SELECT label FROM table_name_8 WHERE date = "22 january 2008"
sql_create_context
CREATE TABLE table_name_54 ( against VARCHAR, played INTEGER )
How many Against have Played smaller than 18?
SELECT COUNT(against) FROM table_name_54 WHERE played < 18
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, fi...
calculate the number of patients who stayed in ward 40 the previous year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 40 AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
mimic_iii
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 is the minimum mcv value until 28 months ago for patient 027-139111?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-139111')) AND lab.labname = 'mcv' AND DATETIME(lab.labresulttime) <= DATETIME(...
eicu
CREATE TABLE table_name_38 ( goalsfor INTEGER, season VARCHAR, lost VARCHAR )
Season of 2002 03, and a Lost larger than 14, what is the lowest goals?
SELECT MIN(goalsfor) FROM table_name_38 WHERE season = "2002–03" AND lost > 14
sql_create_context
CREATE TABLE table_40633 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
What regular season did the team reach the conference semifinals in the playoffs?
SELECT "Regular Season" FROM table_40633 WHERE "Playoffs" = 'conference semifinals'
wikisql
CREATE TABLE table_28859177_3 ( original_air_date VARCHAR, directed_by VARCHAR )
How many original air dates did the episode directed by Bethany rooney have?
SELECT COUNT(original_air_date) FROM table_28859177_3 WHERE directed_by = "Bethany Rooney"
sql_create_context
CREATE TABLE table_204_673 ( id number, "name" text, "egot completed" text, "emmy" number, "grammy" number, "oscar" number, "tony" number )
who took the least time to complete egot ?
SELECT "name" FROM table_204_673 ORDER BY "egot completed" LIMIT 1
squall
CREATE TABLE table_name_32 ( total INTEGER, nation VARCHAR, bronze VARCHAR )
Tell me the average total for guatemala and bronze less than 2
SELECT AVG(total) FROM table_name_32 WHERE nation = "guatemala" AND bronze < 2
sql_create_context
CREATE TABLE table_30010 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Current Conference" text, "Pac-12 Sports" text )
Which institution was located in bakersfield, california?
SELECT "Institution" FROM table_30010 WHERE "Location" = 'Bakersfield, California'
wikisql
CREATE TABLE table_72467 ( "Name" text, "First operational" text, "Numeral system" text, "Computing mechanism" text, "Programming" text, "Turing complete" text )
what's the computing mechanbeingm with first operational being february 1944
SELECT "Computing mechanism" FROM table_72467 WHERE "First operational" = 'February 1944'
wikisql
CREATE TABLE table_204_246 ( id number, "department" text, "total deputies" number, "uninominal deputies" number, "plurinominal deputies" number, "special indigenous\nor campesino deputies" number, "senators" number )
what is the difference in number between the uninominal deputies from potos and beni ?
SELECT ABS((SELECT "uninominal deputies" FROM table_204_246 WHERE "department" = 'potosi') - (SELECT "uninominal deputies" FROM table_204_246 WHERE "department" = 'beni'))
squall
CREATE TABLE table_71788 ( "Country" text, "2008-list" real, "2009-list" real, "2010-list" real, "2011-list" real, "2012-list" real )
What is the 2012-list rank of a country with the lowest 2012-list rank out of all the countries with a 2010-list rank better than 13, a 2009-list rank of 0, a 2008-list rank lower than 4?
SELECT MAX("2012-list") FROM table_71788 WHERE "2010-list" < '13' AND "2009-list" = '0' AND "2008-list" > '4'
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...
钱梦菲患者金额不低于7537.13元的药品在哪几次医疗记录中被开出过?医疗就诊编号分别是什么?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '钱梦菲' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7537.13)
css
CREATE TABLE table_name_21 ( the_biggest_loser VARCHAR, at_home_winner VARCHAR )
Who won the season when Pete Thomas was the At-Home winner?
SELECT the_biggest_loser FROM table_name_21 WHERE at_home_winner = "pete thomas"
sql_create_context
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
Is there a list of classes that do n't have lab sessions ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
Of the 17 -credit upper classes , is there one in Summer 2018 ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 17 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer' AND s...
advising
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
what was the monthly minimum intake of d5/.45ns that patient 27362 had received since 41 months ago?
SELECT MIN(inputevents_cv.amount) 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 = 27362)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_76616 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
What is the tries against when the points are 475?
SELECT "Tries against" FROM table_76616 WHERE "Points for" = '475'
wikisql
CREATE TABLE table_49318 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
Which Date has a Record of 7 7 1?
SELECT "Date" FROM table_49318 WHERE "Record" = '7–7–1'
wikisql
CREATE TABLE assignedto ( scientist number, project text ) CREATE TABLE scientists ( ssn number, name text ) CREATE TABLE projects ( code text, name text, hours number )
List the name of all projects that are operated longer than the average working hours of all projects.
SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)
spider
CREATE TABLE table_name_64 ( home VARCHAR, visitor VARCHAR )
Who was the home team that the Clippers played?
SELECT home FROM table_name_64 WHERE visitor = "clippers"
sql_create_context
CREATE TABLE table_24729 ( "Date" text, "Event #" text, "Event" text, "Winner" text, "Prize" text, "Entries" text, "Prize Pool" text, "Elapsed Time" text )
Event number 38m was held on which date?
SELECT "Date" FROM table_24729 WHERE "Event #" = '38M'
wikisql
CREATE TABLE table_1998 ( "Season" real, "Timeslot" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank" text, "U.S. viewers (in millions)" text, "Rating (adults 18\u201349)" text )
What time slot had an adult rating of 0.6?
SELECT "Timeslot" FROM table_1998 WHERE "Rating (adults 18\u201349)" = '0.6'
wikisql
CREATE TABLE table_name_57 ( trident VARCHAR, gecko VARCHAR )
Which Trident version has a Gecko value of 19.0?
SELECT trident FROM table_name_57 WHERE gecko = "19.0"
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 demographic (...
what is the number of patients whose marital status is married and lab test name is calculated tbg?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Calculated TBG"
mimicsql_data
CREATE TABLE table_8772 ( "Song" text, "Original Name" text, "Country" text, "Language" text, "Singer(s)" text )
What was the original name for the song performed by Brad Kavanagh?
SELECT "Original Name" FROM table_8772 WHERE "Singer(s)" = 'brad kavanagh'
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...
give me the number of patients whose discharge location is home health care and procedure icd9 code is 5771?
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.icd9_code = "5771"
mimicsql_data
CREATE TABLE table_25927 ( "SF Round" real, "Country" text, "Location" text, "Date" text, "Driver" text, "Race 1(pts)" real, "Race 2(pts)" real, "Race 3" text, "Race Total(pts)" real )
What round does Duncan Tappy drive in?
SELECT MAX("SF Round") FROM table_25927 WHERE "Driver" = 'Duncan Tappy'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
did patient 007-6603 get a diagnosis of brain tumor - cns lymphoma in 2105?
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 = '007-6603')) AND diagnosis.diagnosisname = 'brain tumor - cns lymphoma' AND S...
eicu
CREATE TABLE table_55097 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the away team scored 7.13 (55), who were they playing?
SELECT "Home team score" FROM table_55097 WHERE "Away team score" = '7.13 (55)'
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
what is the maximum hospital cost for a procedure that involves cl reduc disloc-elbow in 2104?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cl reduc disloc-elbow')) AND STRFTIME('%y', cost.chargeti...
mimic_iii
CREATE TABLE table_name_77 ( wins INTEGER, rank VARCHAR )
Which Wins have a Rank of 3?
SELECT AVG(wins) FROM table_name_77 WHERE rank = 3
sql_create_context
CREATE TABLE table_26916717_1 ( height VARCHAR, home_town VARCHAR )
How tall is the player from farmington, ky?
SELECT height FROM table_26916717_1 WHERE home_town = "Farmington, KY"
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...
列出患者37982575门诊诊断名称包含龈炎的在医院3085666中有什么门诊就诊记录?
SELECT * 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_info_mzjzjlb.mzjzjlb...
css
CREATE TABLE table_42580 ( "Ship size" text, "Cargo" text, "2004" text, "2005" text, "2006" text )
What ship size had a cargo value of $46,000 in 2006?
SELECT "Ship size" FROM table_42580 WHERE "2006" = '$46,000'
wikisql
CREATE TABLE table_2226 ( "Year" real, "Fowler" real, "Stanier, 3 cylinder" real, "Stanier, 2 cylinder" real, "Fairburn" real, "BR Standard" real, "Total" real )
where stanier, 2 cylinder is 43, what is the stanier, 3 cylinder
SELECT COUNT("Stanier, 3 cylinder") FROM table_2226 WHERE "Stanier, 2 cylinder" = '43'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
when did patient 27964 get a sputum microbiology test for the last time until 11/2105?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27964) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2105-11' ORDER BY microbiologyevents.ch...
mimic_iii
CREATE TABLE diagnoses ( 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 age is less than 86 and procedure short title is endosc destruc esoph les?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "86" AND procedures.short_title = "Endosc destruc esoph les"
mimicsql_data
CREATE TABLE table_14951643_1 ( record VARCHAR, result VARCHAR )
what's the record with result being w 21 7
SELECT record FROM table_14951643_1 WHERE result = "W 21–7"
sql_create_context
CREATE TABLE table_name_42 ( venue VARCHAR, stage VARCHAR, date VARCHAR )
What venue did group g play at on Mar 8, 1998?
SELECT venue FROM table_name_42 WHERE stage = "group g" AND date = "mar 8, 1998"
sql_create_context
CREATE TABLE table_name_34 ( game VARCHAR, record VARCHAR )
What is the total number of Game, when Record is '11-17-7'?
SELECT COUNT(game) FROM table_name_34 WHERE record = "11-17-7"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
what is the average total cost for the hospital involving a procedure called therapeutic antibacterials - third generation cephalosporin the previous year?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'therapeutic antibacterials - third generatio...
eicu
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, ...
Find Deleted Questions by User. shows all deleted answers for the specified user
SELECT p.Id AS "post_link", * FROM Posts AS p WHERE DeletionDate > 0
sede
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
A bar chart about how many wines are there for each grape?, rank by the bars from high to low.
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape DESC
nvbench
CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text )
How many colleges in total?
SELECT COUNT(*) FROM college
spider
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, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Can you highlight the courses that grant 12 credits upon completion ?
SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS'
advising
CREATE TABLE table_67145 ( "Year" real, "Theme" text, "Artist" text, "Issue price" real, "Special notes" text )
What theme has special notes from calgary flames gift set?
SELECT "Theme" FROM table_67145 WHERE "Special notes" = 'from calgary flames gift set'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
Name the courses in Digital Studio that satisfy the MDE requirement .
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 '%Digital Studio%' OR course.description LIKE '%Digital Studio%' OR course.name LIKE '%Digital Stu...
advising
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, ...
Eclipse vs IntelliJ IDEA by year.
SELECT t.TagName AS Tag, YEAR(p.CreationDate) AS y, COUNT(p.Id) AS NumPosts FROM Tags AS t JOIN PostTags AS pt ON pt.TagId = t.Id JOIN Posts AS p ON p.Id = pt.PostId WHERE (t.TagName = 'eclipse' OR t.TagName = 'intellij-idea') AND YEAR(p.CreationDate) >= 2015 GROUP BY t.TagName, YEAR(p.CreationDate) ORDER BY y, Tag DES...
sede
CREATE TABLE table_name_41 ( home_team VARCHAR, venue VARCHAR )
Who was the home team at Princes Park?
SELECT home_team AS score FROM table_name_41 WHERE venue = "princes park"
sql_create_context
CREATE TABLE diagnoses ( 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, ...
how many patients are born before 2098 and diagnosed with procedure icd9 code 40?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2098" AND procedures.icd9_code = "40"
mimicsql_data
CREATE TABLE table_name_12 ( tries_for VARCHAR, losing_bonus VARCHAR, points VARCHAR )
How many tries for did the club with a 3 losing bonus and 45 points have?
SELECT tries_for FROM table_name_12 WHERE losing_bonus = "3" AND points = "45"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
provide the number of patients whose gender is f and procedure short title is suture bladder lacerat?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Suture bladder lacerat"
mimicsql_data
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
Find meter_200 and the sum of meter_100 , and group by attribute meter_200, and visualize them by a bar chart, and show by the X from low to high.
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200
nvbench
CREATE TABLE table_49167 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which player had a score of 72-69=141?
SELECT "Player" FROM table_49167 WHERE "Score" = '72-69=141'
wikisql
CREATE TABLE table_name_64 ( away_team VARCHAR, date VARCHAR, tie_no VARCHAR )
What is Away Team, when Date is '25 January 1986', and when Tie No is '6'?
SELECT away_team FROM table_name_64 WHERE date = "25 january 1986" AND tie_no = "6"
sql_create_context
CREATE TABLE table_name_9 ( roman_equivalent VARCHAR )
what is the 'normalized' transliteration for Roman i
SELECT "normalised" AS _transliteration FROM table_name_9 WHERE roman_equivalent = "i"
sql_create_context
CREATE TABLE table_8131 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the Record of the Game on January 20 with Visitor Toronto Maple Leafs with a Score of 3 1?
SELECT "Record" FROM table_8131 WHERE "Score" = '3–1' AND "Visitor" = 'toronto maple leafs' AND "Date" = 'january 20'
wikisql
CREATE TABLE table_12113888_1 ( number VARCHAR, rebuilt VARCHAR )
How many times was the rebuilt data cannot handle non-empty timestamp argument! 1934?
SELECT COUNT(number) FROM table_12113888_1 WHERE rebuilt = "Cannot handle non-empty timestamp argument! 1934"
sql_create_context
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), ...
A bar chart shows the distribution of date_address_to and the average of monthly_rental bin date_address_to by time.
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients stayed in hospital for more than 1 day and used the drug name aspirin ec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "1" AND prescriptions.drug = "Aspirin EC"
mimicsql_data
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of employee_id , and group by attribute job_id.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
what are the hospital admission times in the previous year for patient 70473?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 70473 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_56637 ( "Elector" text, "Nationality" text, "Faction" text, "Order and Title" text, "Elevated" text, "Elevator" text )
What is the Elector with a Nationality with roman, and an Elevator of urban iv, and an Elevated with 1261, december 17?
SELECT "Elector" FROM table_56637 WHERE "Nationality" = 'roman' AND "Elevator" = 'urban iv' AND "Elevated" = '1261, december 17'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
姓名叫魏正雅的参保人在2011年2月1日到2018年3月19日内她的门诊检查费用一共有多少?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏正雅' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2011-02-01' AND '2018-03-19' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
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, ...
since 2103, what was the top five most frequent diagnoses patients were diagnosed with within 2 months after receiving opn chest cardiac massag?
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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0...
For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_date bin hire_date by time, display in desc by the the average of employee id.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_name_31 ( _number_of_total_votes INTEGER, _percentage_of_popular_vote VARCHAR, _number_of_seats_won VARCHAR )
Name the most # of total votes with % of popular vote of 32.41% and # of seats won more than 95
SELECT MAX(_number_of_total_votes) FROM table_name_31 WHERE _percentage_of_popular_vote = "32.41%" AND _number_of_seats_won > 95
sql_create_context
CREATE TABLE table_32331 ( "Race Name" text, "Circuit" text, "City/Location" text, "Date" text, "Pole position" text, "Winning driver" text, "Winning team" text, "Report" text )
Where did Rick Mears win, after starting in Pole Position?
SELECT "City/Location" FROM table_32331 WHERE "Pole position" = 'rick mears' AND "Winning driver" = 'rick mears'
wikisql
CREATE TABLE table_name_73 ( points INTEGER, year INTEGER )
What is the average points of the drivers before 1964?
SELECT AVG(points) FROM table_name_73 WHERE year < 1964
sql_create_context
CREATE TABLE table_name_61 ( fleet VARCHAR, number VARCHAR )
what fleet is associated with the number L4?
SELECT fleet FROM table_name_61 WHERE number = "l4"
sql_create_context
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 )
Bar chart x axis nominee y axis the total number, and display from low to high by the x axis.
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY Nominee
nvbench
CREATE TABLE table_204_878 ( id number, "model" text, "release date" text, "sensor\nres., size" text, "lens (35 mm equiv.)\nzoom, aperture" text, "screen\nsize, pixels" text, "dimensions\nw (mm) \u00d7 h (mm) \u00d7 d (mm)" text, "weight" text, "features" text )
which model with a screen size of 3 inches did not weigh less than 210 g ?
SELECT "model" FROM table_204_878 WHERE "screen\nsize, pixels" = 3 AND "weight" >= 210
squall
CREATE TABLE table_name_18 ( grid INTEGER, laps INTEGER )
How many grids correspond to more than 24 laps?
SELECT MAX(grid) FROM table_name_18 WHERE laps > 24
sql_create_context
CREATE TABLE table_9314 ( "Player" text, "Team" text, "Matches" real, "Innings" real, "Runs" real, "Average" real, "Highest Score" text, "100s" real )
What is the average value in the 100s category when the high score is 196?
SELECT AVG("100s") FROM table_9314 WHERE "Highest Score" = '196'
wikisql
CREATE TABLE table_name_95 ( goals_for INTEGER, played INTEGER )
Which lowest goals for number had a played number of less than 34?
SELECT MIN(goals_for) FROM table_name_95 WHERE played < 34
sql_create_context
CREATE TABLE table_76944 ( "Year" real, "Championship" text, "Partner" text, "Opponents in the final" text, "Score" text )
Which Score has Opponents in the final of john bromwich frank sedgman?
SELECT "Score" FROM table_76944 WHERE "Opponents in the final" = 'john bromwich frank sedgman'
wikisql
CREATE TABLE table_52068 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Name the least Laps for accident and gird more than 13
SELECT MIN("Laps") FROM table_52068 WHERE "Time/Retired" = 'accident' AND "Grid" > '13'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Average Score and Close count Percentage By Year, Month.
SELECT AVG(CAST(Score AS FLOAT(10, 5))) AS Avg_Score, CAST(SUM(CASE WHEN NOT ClosedDate IS NULL THEN 1 ELSE 0 END) AS FLOAT(15, 5)) / CAST(COUNT(Id) AS FLOAT(15, 5)) AS CloseCountPercentage, MONTH(CreationDate) AS month, YEAR(CreationDate) AS year FROM Posts AS p WHERE PostTypeId = 1 GROUP BY MONTH(CreationDate), YEAR(...
sede
CREATE TABLE table_name_83 ( area VARCHAR, _percentage_other VARCHAR, _percentage_muslim VARCHAR )
What area has a % Other of , and a % Muslim of 95%?
SELECT area FROM table_name_83 WHERE _percentage_other = "–" AND _percentage_muslim = "95%"
sql_create_context
CREATE TABLE table_28188239_1 ( incumbent VARCHAR, district VARCHAR )
Who is the incumbent of district pa-8?
SELECT incumbent FROM table_28188239_1 WHERE district = "PA-8"
sql_create_context
CREATE TABLE table_name_74 ( events_won_by_kcl VARCHAR, year VARCHAR, winner VARCHAR, events_won_by_kclMS VARCHAR )
Which event won by KCLMS in 2008 has KCLMS as the winner and less than 10 wins by KCL?
SELECT events_won_by_kcl FROM table_name_74 WHERE winner = "kclms" AND events_won_by_kclMS < 10 AND year = 2008
sql_create_context
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, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Which professors , besides Prof. Abraham Acosta teach 470 ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 470 AND NOT instructor.name LIKE '%Abraham Acosta%' AND offering_instructor.instructor_id = instructor.instructor_id AND off...
advising
CREATE TABLE table_1431 ( "Year" text, "Event" text, "Pole position time" text, "107% time" text, "Driver" text, "Team" text, "Time" text, "% of pole" text, "Allowed to race?" text )
Is the team force india allowed to race?
SELECT "Allowed to race?" FROM table_1431 WHERE "Team" = 'Force India'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
find the number of medicare patients who have mechanical complication due to other implant and other device, not elsewhere classified diagnoses.
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 = "Malfunc oth device/graft"
mimicsql_data
CREATE TABLE table_203_677 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how long is anton lyuboslavskiy 's fartherst show in a competition ?
SELECT "notes" FROM table_203_677 ORDER BY "notes" DESC LIMIT 1
squall
CREATE TABLE table_69100 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What is the attendance for august 29?
SELECT "Attendance" FROM table_69100 WHERE "Date" = 'august 29'
wikisql
CREATE TABLE table_dev_39 ( "id" int, "gender" string, "random_serum_glucose" int, "glycated_hemoglobin" bool, "heart_disease" bool, "stroke" bool, "diabetes_mellitus" bool, "hgba1c" float, "diabetic" string, "fasting_blood_glucose_fbg" float, "fasting_plasma_glucose" int, ...
heart attack or heart failure, or a stroke
SELECT * FROM table_dev_39 WHERE heart_disease = 1 OR heart_disease = 1 OR stroke = 1
criteria2sql
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...
Calculate the number of patients admitted on phys referral/normal deli who had aortic insufficiency/re-do sternotomy aortic valve replacement as their primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
mimicsql_data
CREATE TABLE table_name_61 ( metres INTEGER, name VARCHAR )
What is the average number of metres for the Dzelzavas Street 74?
SELECT AVG(metres) FROM table_name_61 WHERE name = "dzelzavas street 74"
sql_create_context
CREATE TABLE table_55371 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which venue was melbourne the away team of?
SELECT "Venue" FROM table_55371 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_name_70 ( episode VARCHAR, performer_3 VARCHAR )
What is the total number of episodes where hugh laurie was the 3rd performer?
SELECT COUNT(episode) FROM table_name_70 WHERE performer_3 = "hugh laurie"
sql_create_context
CREATE TABLE table_72804 ( "Poll Source" text, "Dates administered" text, "Democrat: John Kerry" text, "Republican: Jeff Beatty" text, "Lead Margin" real )
what are the dates where democrat john kerry is 63% and poll source is rasmussen reports?
SELECT "Dates administered" FROM table_72804 WHERE "Democrat: John Kerry" = '63%' AND "Poll Source" = 'Rasmussen Reports'
wikisql
CREATE TABLE table_66168 ( "Rank:" real, "Premier:" text, "Party:" text, "Assumed Office:" text, "Left Office:" text, "TOTAL Time in Office:" text )
what is the rank when assumed office on 12 may 1857?
SELECT SUM("Rank:") FROM table_66168 WHERE "Assumed Office:" = '12 may 1857'
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...
provide the number of patients whose marital status is single and admission year is less than 2176?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2176"
mimicsql_data
CREATE TABLE table_25794532_1 ( points VARCHAR, car_no VARCHAR )
Name the points for car number 4
SELECT points FROM table_25794532_1 WHERE car_no = 4
sql_create_context
CREATE TABLE table_20344 ( "Name" text, "Japanese" text, "Date of designation" text, "Date of reclassification" text, "Region" text, "Prefecture" text )
Name all the date of designations for kurume
SELECT "Date of designation" FROM table_20344 WHERE "Name" = 'Kurume'
wikisql
CREATE TABLE table_name_4 ( against INTEGER, wins VARCHAR, byes VARCHAR )
What is the highest score with 0 wins and more than 2 Byes?
SELECT MAX(against) FROM table_name_4 WHERE wins = 0 AND byes > 2
sql_create_context