context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_40178 ( "Name" text, "Pos." text, "Height" text, "Weight" real, "Year" text, "Hometown (Previous school)" text )
What is the Hometown of the person with a height of 5'8'?
SELECT "Hometown (Previous school)" FROM table_40178 WHERE "Height" = '5''8'
wikisql
CREATE TABLE table_1341897_45 ( result VARCHAR, incumbent VARCHAR )
What was the result of the election in which Walter E. Rogers was the incumbent?
SELECT result FROM table_1341897_45 WHERE incumbent = "Walter E. Rogers"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
report the number of patients who had premature admission before the year 2120 via clinic referral.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2120"
mimicsql_data
CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Cust...
Give me a bar chart for mean product price of each product name, show from low to high by the total number.
SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY AVG(Product_Price)
nvbench
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE cate...
Find all users who have written tips about businesses in Dallas
SELECT user.name FROM business, tip, user WHERE business.city = 'Dallas' AND tip.business_id = business.business_id AND user.user_id = tip.user_id
yelp
CREATE TABLE table_203_577 ( id number, "tenure" text, "coach" text, "years" number, "record" text, "pct." number )
what was the average number of years served by a coach ?
SELECT AVG("years") FROM table_203_577
squall
CREATE TABLE table_32631 ( "FAT16" text, "FAT32" text, "HPFS" text, "ISO 9660" text, "NTFS" text, "ReFS" text )
Which NTFS has a yes for FAT32 and a no for ReFS?
SELECT "NTFS" FROM table_32631 WHERE "FAT32" = 'yes' AND "ReFS" = 'no'
wikisql
CREATE TABLE table_10973 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
During footscray's home game, how much did the away team score?
SELECT "Away team score" FROM table_10973 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE authors ( lname VARCHAR )
Retrieve all the last names of authors in alphabetical order.
SELECT lname FROM authors ORDER BY lname
sql_create_context
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...
住院就诊65356783060的住院中医诊断是什么?列出诊断的名称和编号
SELECT wdmzjzjlb.ZYZYZDZZBM, wdmzjzjlb.ZYZYZDZZMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '65356783060' UNION SELECT bdmzjzjlb.ZYZYZDZZBM, bdmzjzjlb.ZYZYZDZZMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '65356783060'
css
CREATE TABLE table_60880 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" text, "Population" text, "Density" text )
What is the pinyin when the simplified shows ?
SELECT "Pinyin" FROM table_60880 WHERE "Simplified" = '南山区'
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...
患者60467779曾经都做过哪些治疗项目
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '60467779' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_31052 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
How many people wrote 'Paddy's Pub: The Worst Bar in Philadelphia'?
SELECT COUNT("Written by") FROM table_31052 WHERE "Title" = 'Paddy''s Pub: The Worst Bar in Philadelphia'
wikisql
CREATE TABLE table_41473 ( "Position" text, "Jersey #" real, "Name" text, "Birthdate" text, "Birthplace" text, "Club/Team" text )
What is the Postion, when the Name is Rod Paavola?
SELECT "Position" FROM table_41473 WHERE "Name" = 'rod paavola'
wikisql
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...
how many patients are diagnosed with a hx-pencillin allergy and have lab tested with joint fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hx-penicillin allergy" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_23765 ( "Year ended" real, "Revenue (\u20acmillion)" real, "Earnings before interest and taxes (\u20acm)" text, "Net profit (\u20acm)" text, "Earnings per share (\u20ac)" text )
Name the net profit for eps beign 1.19
SELECT "Net profit (\u20acm)" FROM table_23765 WHERE "Earnings per share (\u20ac)" = '1.19'
wikisql
CREATE TABLE table_name_28 ( format VARCHAR, country VARCHAR, date VARCHAR )
what is the format for the country united kingdom on 20 october 2008?
SELECT format FROM table_name_28 WHERE country = "united kingdom" AND date = "20 october 2008"
sql_create_context
CREATE TABLE table_name_13 ( height__cm_ INTEGER, weight__kg_ VARCHAR )
What is the sum of Height (cm), when the Weight (kg) is 90?
SELECT SUM(height__cm_) FROM table_name_13 WHERE weight__kg_ = 90
sql_create_context
CREATE TABLE table_name_83 ( place VARCHAR, money___$__ VARCHAR, player VARCHAR )
Which Place that has Money of 150, and a Player of bobby cruickshank?
SELECT place FROM table_name_83 WHERE money___$__ = 150 AND player = "bobby cruickshank"
sql_create_context
CREATE TABLE table_24596664_1 ( season VARCHAR, position VARCHAR )
Name the number of season for 18th position
SELECT COUNT(season) FROM table_24596664_1 WHERE position = "18th"
sql_create_context
CREATE TABLE table_25473 ( "Date" text, "Location" text, "Opponent" text, "Irish Points" real, "Opp. Points" real, "Record" text )
Name the date for irish points being 89
SELECT "Date" FROM table_25473 WHERE "Irish Points" = '89'
wikisql
CREATE TABLE table_name_75 ( weekly_schedule VARCHAR, timeslot VARCHAR )
Which days of the week does the telenovela play that is aired at 11:00?
SELECT weekly_schedule FROM table_name_75 WHERE timeslot = "11:00"
sql_create_context
CREATE TABLE table_56754 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In the Western Oval venue, what is the average crowd?
SELECT AVG("Crowd") FROM table_56754 WHERE "Venue" = 'western oval'
wikisql
CREATE TABLE table_24755 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Languages" text, "Director" text, "Result" text )
What is the result of the 2005 (78th) year ceremony?
SELECT "Result" FROM table_24755 WHERE "Year (Ceremony)" = '2005 (78th)'
wikisql
CREATE TABLE table_test_14 ( "id" int, "bleeding" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "haemoglobin" float, "severe_hypertension" bool, "platelets" int, "neutrophil_count" int, "renal_disease" bool, "severe_thrombocytopenia" bool, "fa...
severe hypertension ( systolic bp > 200 mm hg or diastolic bp > 110 mm hg ) not controlled on antihypertensive therapy
SELECT * FROM table_test_14 WHERE severe_hypertension = 1 OR (systolic_blood_pressure_sbp > 200 OR diastolic_blood_pressure_dbp > 110)
criteria2sql
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 ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
What are the classes that can be used for my MDE ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id
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, show me about the distribution of name and manufacturer , and group by attribute headquarter in a bar chart, and display from high to low by the total number.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, ...
What is the id and salary of the employee named Mark Young?
SELECT eid, salary FROM employee WHERE name = 'Mark Young'
spider
CREATE TABLE table_50625 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
What was the smallest crowd when the away team scored 12.16 (88)?
SELECT MIN("Crowd") FROM table_50625 WHERE "Away team score" = '12.16 (88)'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
when is the first time patient 005-48105 has been prescribed medicine in this hospital encounter?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-48105' AND patient.hospitaldischargetime IS NULL)) ORDER B...
eicu
CREATE TABLE member_of_club ( clubid VARCHAR, stuid VARCHAR ) CREATE TABLE student ( age INTEGER, stuid VARCHAR ) CREATE TABLE club ( clubid VARCHAR, clubname VARCHAR )
Retrieve the average age of members of the club 'Tennis Club'.
SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club"
sql_create_context
CREATE TABLE table_63246 ( "Sunrayia FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What are the total byes for the Red Cliffs with more than 4 losses and more than 2422 against?
SELECT COUNT("Byes") FROM table_63246 WHERE "Losses" > '4' AND "Sunrayia FL" = 'red cliffs' AND "Against" > '2422'
wikisql
CREATE TABLE table_64782 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
What's the reserved number for constituency number 108?
SELECT "Reserved for ( SC / ST /None)" FROM table_64782 WHERE "Constituency number" = '108'
wikisql
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE field ( fieldid int ) CREATE TA...
who published the most papers in ACL 2010
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC
scholar
CREATE TABLE table_name_45 ( record VARCHAR, game VARCHAR, date VARCHAR )
What was the record of the game played on November 7?
SELECT record FROM table_name_45 WHERE game < 7 AND date = "november 7"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, ...
indicate the yearly maximum amount of arterial bp [diastolic] for patient 30763 until 11/2105.
SELECT MAX(chartevents.valuenum) 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 = 30763)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_45579 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text )
What is the nationality of Gavin Rae?
SELECT "Nat." FROM table_45579 WHERE "Name" = 'gavin rae'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment tex...
Edits I approved and that ended up being rejected.
SELECT se.Id AS "suggested_edit_link", p.Id AS "post_link" FROM SuggestedEdits AS se, SuggestedEditVotes AS sev, Posts AS p WHERE se.Id = sev.SuggestedEditId AND se.PostId = p.Id AND sev.UserId = '##UserId##' AND sev.VoteTypeId = 2 AND NOT se.RejectionDate IS NULL ORDER BY sev.CreationDate
sede
CREATE TABLE table_41149 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text )
What was Andretti's finish for the year he had a Buick engine and started 16th?
SELECT "Finish" FROM table_41149 WHERE "Engine" = 'buick' AND "Start" = '16th'
wikisql
CREATE TABLE table_43951 ( "Locale" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" text )
When ends won were below 57 but stolen ends are more than 14, what's the highest blank ends found?
SELECT MAX("Blank Ends") FROM table_43951 WHERE "Stolen Ends" > '14' AND "Ends Won" < '57'
wikisql
CREATE TABLE table_49242 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
Which ERP W has a Frequency MHz larger than 89.1, and a City of license of de queen, arkansas?
SELECT "ERP W" FROM table_49242 WHERE "Frequency MHz" > '89.1' AND "City of license" = 'de queen, arkansas'
wikisql
CREATE TABLE table_59109 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the to par for Scotland?
SELECT "To par" FROM table_59109 WHERE "Country" = 'scotland'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose procedure icd9 code is 8321.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "8321"
mimicsql_data
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE ...
i would like a flight between DENVER and SAN FRANCISCO leaving from DENVER in the afternoon and arriving at 1700
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.arrival_time = 1700 AND flight.to_airport = AIRPORT_SERVICE_1....
atis
CREATE TABLE table_13974 ( "Country" text, "Airport" text, "City" text, "2008" real, "Change (08/07)" text )
Which 2008 has a City of durban?
SELECT AVG("2008") FROM table_13974 WHERE "City" = 'durban'
wikisql
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, ...
How many male and female assistant professors do we have, order by the total number in descending.
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_52802 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
In What Week was the Attendance 75,866?
SELECT "Week" FROM table_52802 WHERE "Attendance" = '75,866'
wikisql
CREATE TABLE table_60170 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is the height for Nikola Frankovi ?
SELECT "Height" FROM table_60170 WHERE "Name" = 'nikola franković'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, could you order X from high to low order?
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
What are the average price and score of wines for each appellation? Show me a scatter plot.
SELECT AVG(Price), AVG(Score) FROM wine GROUP BY AVG(Price)
nvbench
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text )
What are the names of wrestlers who have never been eliminated?
SELECT name FROM wrestler WHERE NOT wrestler_id IN (SELECT wrestler_id FROM elimination)
spider
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
in 2102 what was the four most frequent medications prescribed during the same month to the male patients with age 50s after they were diagnosed with late effect acute polio?
SELECT t3.drug FROM (SELECT t2.drug, 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.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_69833 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Which Chassis did the Entrant clarke-mordaunt-guthrie-durlacher carry?
SELECT "Chassis" FROM table_69833 WHERE "Entrant" = 'clarke-mordaunt-guthrie-durlacher'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
查查患者陶惜雪在医院9853107看病的记录里,出院时候的科室名字里不带有老年病的住院看病记录
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, ...
Measure popularity of python vs Node vs typescript for.
SELECT * FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName IN ('pulumi')
sede
CREATE TABLE table_31446 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Series" text, "Streak" text )
in april 13 what was the streak
SELECT "Streak" FROM table_31446 WHERE "Date" = 'April 13'
wikisql
CREATE TABLE Part_Faults ( part_fault_id INTEGER, part_id INTEGER, fault_short_name VARCHAR(20), fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ) ...
Visualize a bar chart for how many assets can each parts be used in? List the part name and the number, and display by the Y in ascending.
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*)
nvbench
CREATE TABLE table_33332 ( "Player" text, "Nationality" text, "Position" text, "From" text, "School/Country" text )
What position does the player from 2002 play?
SELECT "Position" FROM table_33332 WHERE "From" = '2002'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Count the number of patients with an abnormal lab test status who have diagnoses icd9 code 36202.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "36202" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_6 ( crowd VARCHAR, away_team VARCHAR )
What was away team Geelong's crowd numbers?
SELECT crowd FROM table_name_6 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
依照科室不同以及出院诊断的疾病编号差别,查询一下医院9266257全部医疗就诊的记录里自费的部分与总医疗费的最小比值且按升序顺序来显示
SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '9266257' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_...
css
CREATE TABLE table_72950 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
Who were the candidates when the first elected was a republican in 1998?
SELECT "Candidates" FROM table_72950 WHERE "First elected" = '1998' AND "Party" = 'Republican'
wikisql
CREATE TABLE table_name_64 ( area_province VARCHAR, district VARCHAR )
Name the area for District of c rdoba
SELECT area_province FROM table_name_64 WHERE district = "córdoba"
sql_create_context
CREATE TABLE table_train_209 ( "id" int, "body_weight" float, "diabetic" string, "lactose_intolerance" bool, "galactose_intolerance" bool, "allergy_to_food" bool, "body_mass_index_bmi" float, "a1c" float, "NOUSE" float )
body mass index 25 to 40 kg / m2;
SELECT * FROM table_train_209 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 40
criteria2sql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
列出在2015年5月8日到17年10月15日内病号葛承泽所有检验结果指标记录中的仪器编号以及名称都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
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 prescriptions...
count the number of patients whose death status is 1 and days of hospital stay is greater than 6?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "6"
mimicsql_data
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, show me about the distribution of name and price , and group by attribute founder in a bar chart.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
nvbench
CREATE TABLE table_name_97 ( power_plant VARCHAR, year_of_commission VARCHAR )
What power plant was commissioned in 2008?
SELECT power_plant FROM table_name_97 WHERE year_of_commission = 2008
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE...
Get Synonymous, Unique technology or programming related keywords.
SELECT * FROM TagSynonyms
sede
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
what were the three diagnoses that have the lowest five year survival rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_58461 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people were in attendance at St Kilda's away match?
SELECT "Crowd" FROM table_58461 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE table_67951 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
Name the gold coast which has an auckland of no and melbourne of yes
SELECT "Gold Coast" FROM table_67951 WHERE "Auckland" = 'no' AND "Melbourne" = 'yes'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
在医院6798205的科室名中有手外科几个字的就诊科室的门诊中,有哪些是患者96787952的就诊记录流水号
SELECT mzjzjlb.JZLSH 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_mzj...
css
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int )
Bar chart x axis country y axis the total number, and sort X-axis in asc order.
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE hosting_city ( year number, match_id number, host_city text ) CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regi...
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.mar < T2.dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
spider
CREATE TABLE table_name_52 ( jockey VARCHAR, horse VARCHAR )
Who is the Jockey for guadalcanal?
SELECT jockey FROM table_name_52 WHERE horse = "guadalcanal"
sql_create_context
CREATE TABLE table_name_53 ( population_est__2012_ VARCHAR, capital VARCHAR, house_seat_s_ VARCHAR )
How many populations have a capital of Montpelier and more than 1 House seat?
SELECT COUNT(population_est__2012_) FROM table_name_53 WHERE capital = "montpelier" AND house_seat_s_ > 1
sql_create_context
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rati...
where are some restaurants good for arabic food on buchanan in san francisco ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
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...
give me the number of patients whose item id is 51218?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51218"
mimicsql_data
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Comments ( Id number, PostId number, Score number, ...
Is it possible to search for words/content in an answer given to a favorite question?. http://meta.stackexchange.com/q/246747/158100
SELECT a.Id AS "post_link", a.CreationDate, a.Score, a.OwnerUserId AS "user_link" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id INNER JOIN Votes AS v ON v.PostId = q.Id WHERE v.VoteTypeId = 5 AND v.UserId = '##userid:int?58382##' AND a.Body LIKE '%' + '##search:string##' + '%'
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
从07-7-22到15-4-15,哪几位工号及姓名的医务人员在患者韩嘉玉就诊时为其提供检测指标303131服务的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jy...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
For those employees whose first name does not contain the letter M, display their average salary by binning the hire date into the day of week interval for visualizing a bar chart, and could you list the average of salary in asc order?
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
26603451这名患者之前有哪些住院诊断
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '26603451'
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
医疗记录中年龄低于23岁的患者的医疗费平均金额是多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE < 23)
css
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...
自2004年7月8日起,截止到2004年11月20日,21408957医生的门诊量是多少
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.ZZYSGH = '21408957' AND txmzjzjlb.JZKSRQ BETWEEN '2004-07-08' AND '2004-11-20' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZZYSGH = '21408957' AND ftxmzjzjlb.JZKSRQ BETWEEN '2004-07-08' AND '2004-11-20'
css
CREATE TABLE table_18705 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's the result with incumbent being bill g. lowrey
SELECT "Result" FROM table_18705 WHERE "Incumbent" = 'Bill G. Lowrey'
wikisql
CREATE TABLE table_name_52 ( location VARCHAR, type VARCHAR, years VARCHAR )
What is the location for the club trophy from the year 1867 only?
SELECT location FROM table_name_52 WHERE type = "club trophy" AND years = "1867 only"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many single patients had the procedure long title single internal mammary-coronary artery bypass?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Single internal mammary-coronary artery bypass"
mimicsql_data
CREATE TABLE table_name_58 ( crowd INTEGER, home_team VARCHAR )
How many people were in the crowd when the Home Team was Hawthorn?
SELECT SUM(crowd) FROM table_name_58 WHERE home_team = "hawthorn"
sql_create_context
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_dev_11 ( "id" int, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "diastolic_blood_pressure_dbp" int, "smoking" bool, "donated_plasma" bool, "coronary_artery_disease_cad" bool, "donated_blood" bool, "hypertension" bool, ...
cigarette smoking
SELECT * FROM table_dev_11 WHERE smoking = 1
criteria2sql
CREATE TABLE table_9801 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score for oldsmobile lpga classic?
SELECT "Winning score" FROM table_9801 WHERE "Tournament" = 'oldsmobile lpga classic'
wikisql
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE time_slot (...
How many courses have two prerequisites? Show me a bar chart grouping by title, and display X-axis in desc order.
SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title DESC
nvbench
CREATE TABLE table_name_22 ( votes INTEGER, party VARCHAR )
Name the average votes for one london
SELECT AVG(votes) FROM table_name_22 WHERE party = "one london"
sql_create_context
CREATE TABLE table_name_24 ( entrant VARCHAR, year VARCHAR )
What entrant appeared in 1969?
SELECT entrant FROM table_name_24 WHERE year = 1969
sql_create_context
CREATE TABLE table_name_91 ( date VARCHAR, competition VARCHAR )
Name the date of the uncaf nations cup 2009
SELECT date FROM table_name_91 WHERE competition = "uncaf nations cup 2009"
sql_create_context
CREATE TABLE table_21364 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
If the census ranking is 231 of 5,008, what was the population?
SELECT "Population" FROM table_21364 WHERE "Census Ranking" = '231 of 5,008'
wikisql
CREATE TABLE table_name_91 ( name VARCHAR, floors VARCHAR, year VARCHAR )
What is the name of the building that has more than 31 floors and built prior to 1964?
SELECT name FROM table_name_91 WHERE floors > 31 AND year < 1964
sql_create_context
CREATE TABLE table_name_83 ( film_title_used_in_nomination VARCHAR, original_name VARCHAR )
What was the film title used in nomination for Panny Z Wilka?
SELECT film_title_used_in_nomination FROM table_name_83 WHERE original_name = "panny z wilka"
sql_create_context
CREATE TABLE table_name_37 ( tujunga VARCHAR, pasadena VARCHAR )
What is the percentage of Tujunja when Pasadena is 33%?
SELECT tujunga FROM table_name_37 WHERE pasadena = "33%"
sql_create_context