context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_1341472_12 ( candidates VARCHAR, incumbent VARCHAR )
Who were the candidates in the district where Charlie Norwood is the incumbent?
SELECT candidates FROM table_1341472_12 WHERE incumbent = "Charlie Norwood"
sql_create_context
CREATE TABLE table_10047 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which Date has a Score of 0 2?
SELECT "Date" FROM table_10047 WHERE "Score" = '0 – 2'
wikisql
CREATE TABLE table_15574 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
At what stadium was the game with the final score of 9-23 played?
SELECT "Stadium" FROM table_15574 WHERE "Final Score" = '9-23'
wikisql
CREATE TABLE table_76296 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Who were the visitors when the home team were the ny rangers?
SELECT "Visitor" FROM table_76296 WHERE "Home" = 'ny rangers'
wikisql
CREATE TABLE table_8038 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
Who were the opponents in the game that ended in a score of 116-106?
SELECT "Opponent" FROM table_8038 WHERE "Score" = '116-106'
wikisql
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, ...
provide the number of patients whose diagnoses long title is aftercare for healing traumatic fracture of lower leg and lab test fluid is pleural?
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.long_title = "Aftercare for healing traumatic fracture of lower leg" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank i...
List all headquarters and the number of companies in each headquarter with a bar chart, show Headquarters in descending order.
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC
nvbench
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me a bar chart for total number of school id of each all home, and rank by the y axis from high to low.
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) DESC
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 d_icd_procedures ( ...
does lr have been prescribed to patient 88254 in this year?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88254) AND prescriptions.drug = 'lr' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_20119 ( "Rd" real, "Race" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
Did the race get reported where the winning team was Newman Wachs racing and the pole belonged to Carl Skerlong
SELECT "Report" FROM table_20119 WHERE "Pole Position" = 'Carl Skerlong' AND "Winning team" = 'Newman Wachs Racing'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
从2000年12月6日到2013年3月2日期间,列出患者58996582看病时给开出的所有药品的编码、名称、数量、单价、金额
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '58996582' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-12-06' AND '2013-03-02'
css
CREATE TABLE Order_Items ( Order_Item_ID INTEGER, Order_ID INTEGER, Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255) ) CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID IN...
Show the number of services for each service type description with a bar chart, and I want to rank in asc by the bars.
SELECT Service_Type_Description, 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 ORDER BY Service_Type_Description
nvbench
CREATE TABLE zyb ( 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...
以患者看病期间去过的科室名称和出院是查出的病名的区别为前提,列出他们在9073767号医院就诊的所有医疗就诊记录里的平均年龄?
SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9073767' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9073767' GROUP BY gyb.MED_ORG_DEPT_NM, gyb....
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
tell me the first time that patient 64136 has been diagnosed with dermatophytosis of body in their first hospital visit?
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dermatophytosis of body') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64136 AND NOT admi...
mimic_iii
CREATE TABLE table_name_73 ( points_for VARCHAR, played VARCHAR, tries_for VARCHAR )
Nam the points for when tries for is 91 and played of 22
SELECT points_for FROM table_name_73 WHERE played = "22" AND tries_for = "91"
sql_create_context
CREATE TABLE table_name_32 ( record VARCHAR, date VARCHAR )
What is the Record on april 13?
SELECT record FROM table_name_32 WHERE date = "april 13"
sql_create_context
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,...
把在02.8.23到12.10.1这段时间,手术总量名列前五的科室的编码和名称报出来
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2002-08-23' AND '2012-10-01' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 5
css
CREATE TABLE table_1637981_7 ( lansing__lan_ VARCHAR, saginaw__mbs_ VARCHAR )
At a Saginaw fare of $470.47, what is the fare to Lansing?
SELECT lansing__lan_ FROM table_1637981_7 WHERE saginaw__mbs_ = "$470.47"
sql_create_context
CREATE TABLE table_69763 ( "Value" real, "Khmer" real, "Word Form" text, "UNGEGN" text, "ALA-LC" text, "Other" text )
What is smallest Khmer valued less than 90 have a kau sip ALA-LC?
SELECT MIN("Khmer") FROM table_69763 WHERE "ALA-LC" = 'kau sip' AND "Value" < '90'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Reputation between 200 and 300. List of users having reputation between 200 and 300
SELECT Id, Reputation FROM Users WHERE Reputation > 200 AND Reputation < 300
sede
CREATE TABLE table_36031 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Name the total number of pick with round less than 6 and overall of 102
SELECT COUNT("Pick #") FROM table_36031 WHERE "Round" < '6' AND "Overall" = '102'
wikisql
CREATE TABLE table_name_38 ( games INTEGER, name VARCHAR, rebounds VARCHAR )
What is the lowest Games, when Name is Travis Watson, and when Rebounds is less than 136?
SELECT MIN(games) FROM table_name_38 WHERE name = "travis watson" AND rebounds < 136
sql_create_context
CREATE TABLE table_3815 ( "Sd" real, "Rk" real, "Player" text, "Points" real, "Points defending" text, "Points won" real, "New points" real, "Status" text )
What's the status of the player with 3041 points?
SELECT "Status" FROM table_3815 WHERE "Points" = '3041'
wikisql
CREATE TABLE table_37647 ( "Week" real, "Date" text, "Opponent" text, "Time (ET)" text, "Result" text, "Game Site" text, "Record" text, "NFL Recap" text )
Who did they play at lincoln financial field at 8:30 (ET) after week 14?
SELECT "Opponent" FROM table_37647 WHERE "Week" > '14' AND "Game Site" = 'lincoln financial field' AND "Time (ET)" = '8:30'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents...
count the number of times that patient 32168 had been given octreotide mcg/hr during their first hospital encounter.
SELECT COUNT(*) 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 = 32168 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inputevents_cv.itemid...
mimic_iii
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_fro...
show ground transportation in DENVER
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_28606933_7 ( consecutive_starts INTEGER, player VARCHAR )
What is the largest number of consecutive starts for jason gildon?
SELECT MAX(consecutive_starts) FROM table_28606933_7 WHERE player = "Jason Gildon"
sql_create_context
CREATE TABLE table_24681 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
Name the chassis for alta
SELECT "Chassis" FROM table_24681 WHERE "Constructor" = 'Alta'
wikisql
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Products ( product_id INTEGER, parent_product_id I...
What are total transaction amounts for each transaction type, rank transaction_type from high to low order please.
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC
nvbench
CREATE TABLE table_60213 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text )
What is the to par of the player from Argentina with a t8 place?
SELECT "To par" FROM table_60213 WHERE "Place" = 't8' AND "Country" = 'argentina'
wikisql
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
A bar chart about what are the average ages for male and female students?, list by the bars from low to high.
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_80354 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which item resulted in a score of 4-1?
SELECT "Score" FROM table_80354 WHERE "Result" = '4-1'
wikisql
CREATE TABLE table_65172 ( "Eliminated" text, "Tag Team" text, "Entered" real, "Eliminated by" text, "Time" text )
Name the Tag Team with Entered of 6?
SELECT "Tag Team" FROM table_65172 WHERE "Entered" = '6'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diag...
what was the yearly maximum amount of indwelling catheter given to patient 002-16314 until 59 months ago?
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-16314')) AND intakeoutput.celllabel = 'indwe...
eicu
CREATE TABLE table_54744 ( "Father" text, "Birth" text, "Marriage" text, "Became Queen" text, "Ceased to be Queen" text, "Death" text, "Spouse" text )
What is the name of the father who was born in 1204 and married ottokar ii?
SELECT "Father" FROM table_54744 WHERE "Spouse" = 'ottokar ii' AND "Birth" = '1204'
wikisql
CREATE TABLE table_name_6 ( grid VARCHAR, driver VARCHAR )
What is the grid for johnny herbert?
SELECT grid FROM table_name_6 WHERE driver = "johnny herbert"
sql_create_context
CREATE TABLE table_204_592 ( id number, "#" number, "title" text, "type" text, "opening\ndate" text, "closing\ndate" text, "performances" number, "comment" text )
which show had the earliest opening date ?
SELECT "title" FROM table_204_592 ORDER BY "opening\ndate" LIMIT 1
squall
CREATE TABLE scientists ( name VARCHAR )
List the names of all scientists sorted in alphabetical order.
SELECT name FROM scientists ORDER BY name
sql_create_context
CREATE TABLE table_204_835 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text )
which competitor was the last to place ?
SELECT "name" FROM table_204_835 ORDER BY "rank" DESC LIMIT 1
squall
CREATE TABLE table_name_81 ( score VARCHAR, visitor VARCHAR, leading_scorer VARCHAR )
What is the Score with a Visitor of bucks, and a Leading scorer with maurice williams (25)?
SELECT score FROM table_name_81 WHERE visitor = "bucks" AND leading_scorer = "maurice williams (25)"
sql_create_context
CREATE TABLE table_name_86 ( performer_4 VARCHAR, performer_1 VARCHAR, episode VARCHAR )
Who is performer 4 on episode 3, where Jim Sweeney was performer 1?
SELECT performer_4 FROM table_name_86 WHERE performer_1 = "jim sweeney" AND episode = 3
sql_create_context
CREATE TABLE table_name_37 ( original_team VARCHAR, background VARCHAR )
What is the Original Team of the Clothing Company Owner Candidate?
SELECT original_team FROM table_name_37 WHERE background = "clothing company owner"
sql_create_context
CREATE TABLE table_name_75 ( pick VARCHAR, player VARCHAR )
What is Benito Cheng's Pick number?
SELECT pick FROM table_name_75 WHERE player = "benito cheng"
sql_create_context
CREATE TABLE table_11208143_9 ( highest VARCHAR, average VARCHAR )
What are the highest recorded attendance rates of the stadiums with an average attendance of 4752?
SELECT highest FROM table_11208143_9 WHERE average = 4752
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Sc...
Top SO User from Hamburg.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%hamburg%' OR UPPER(Location) LIKE '%HAMBURG%' OR Location LIKE '%Hamburg%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_name_5 ( maximum_download_speed__kbps VARCHAR, technology VARCHAR, plan_name VARCHAR )
What is the maximum download speed for the Internet premium 3G plan?
SELECT maximum_download_speed__kbps FROM table_name_5 WHERE technology = "3g" AND plan_name = "internet premium"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId numb...
Questions which have ever had $$ in their titles.
SELECT PostId AS "post_link" FROM PostHistory WHERE PostHistoryTypeId IN (1, 4) AND Text LIKE '%$$%' COLLATE Latin1_General_BIN2 GROUP BY PostId ORDER BY PostId DESC
sede
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...
what is insurance and diagnoses icd9 code of subject id 21796?
SELECT demographic.insurance, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "21796"
mimicsql_data
CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives" VARCHAR(1) ) CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10), organisation_type_d...
A bar chart for listing the number of the research staff details, and order in ascending order.
SELECT staff_details, COUNT(staff_details) FROM Research_Staff GROUP BY staff_details ORDER BY staff_details
nvbench
CREATE TABLE table_name_62 ( home_team VARCHAR, away_team VARCHAR )
Who played against Carlton as the home team?
SELECT home_team FROM table_name_62 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE table_44560 ( "Poll Source" text, "Dates administered" text, "Democrat: Carl Levin" text, "Republican: Jack Hoogendyk" text, "Lead Margin" real )
What is Dates Administered, when Poll Source is Rasmussen Reports, when Lead Margin is greater than 18, when Republican: Jack Hoogendyk is 36%, and when Democrat: Carl Levin is 59%?
SELECT "Dates administered" FROM table_44560 WHERE "Poll Source" = 'rasmussen reports' AND "Lead Margin" > '18' AND "Republican: Jack Hoogendyk" = '36%' AND "Democrat: Carl Levin" = '59%'
wikisql
CREATE TABLE table_13376 ( "Position" text, "Name" text, "Party" text, "First Election" text, "District" text )
What is Kerry J. Donley's First Election date?
SELECT "First Election" FROM table_13376 WHERE "Name" = 'kerry j. donley'
wikisql
CREATE TABLE table_8440 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Fulham as Team 1 has the 2nd leg score of what?
SELECT "2nd leg" FROM table_8440 WHERE "Team 1" = 'fulham'
wikisql
CREATE TABLE table_54415 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Who was the visiting team at the game where Edmonton was the home team and the decision was Osgood?
SELECT "Visitor" FROM table_54415 WHERE "Decision" = 'osgood' AND "Home" = 'edmonton'
wikisql
CREATE TABLE table_23743 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real )
What was Obama's percentage in the county of Alleghany?
SELECT "Obama%" FROM table_23743 WHERE "County" = 'Alleghany'
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...
A bar chart shows the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road.
SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE table_name_76 ( gold INTEGER, rank VARCHAR, bronze VARCHAR )
How many Golds did the country with a Rank better than 5 and more Bronze than 1 receive?
SELECT SUM(gold) FROM table_name_76 WHERE rank < 5 AND bronze > 1
sql_create_context
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 was the last time that patient 027-141301 had a minimum glucose on their last hospital encounter?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-141301' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital...
eicu
CREATE TABLE table_63829 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" real, "Score-Final" real, "Rank-Qualifying" real, "Score-Qualifying" real )
Name the Year with a Rank-Final smaller than 2, an Apparatus of team, and a Score-Qualifying smaller than 248.275?
SELECT AVG("Year") FROM table_63829 WHERE "Rank-Final" < '2' AND "Apparatus" = 'team' AND "Score-Qualifying" < '248.275'
wikisql
CREATE TABLE author ( aid int, homepage varchar, name varchar, oid int ) CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE publication ( abstract varchar, cid in...
return me the papers of ' H. V. Jagadish ' containing keyword ' User Study ' .
SELECT publication.title FROM author, keyword, publication, publication_keyword, writes WHERE author.name = 'H. V. Jagadish' AND keyword.keyword = 'User Study' AND publication_keyword.kid = keyword.kid AND publication.pid = publication_keyword.pid AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE table_14167 ( "Debut year" real, "Player" text, "Games" real, "Goals" real, "Years at club" text )
WhichPlayer has a Debut year larger than 1930, and Goals smaller than 95, and Years at club of 1938, and Games of 6?
SELECT "Player" FROM table_14167 WHERE "Debut year" > '1930' AND "Goals" < '95' AND "Years at club" = '1938' AND "Games" = '6'
wikisql
CREATE TABLE table_11677691_10 ( hometown VARCHAR, school VARCHAR )
What town is Muscle Shoals High School located in?
SELECT hometown FROM table_11677691_10 WHERE school = "Muscle Shoals High school"
sql_create_context
CREATE TABLE table_name_96 ( seats VARCHAR, share_of_votes VARCHAR )
How many seats had a 41.2% share of votes?
SELECT seats FROM table_name_96 WHERE share_of_votes = "41.2%"
sql_create_context
CREATE TABLE table_name_88 ( uci_rating INTEGER, team VARCHAR )
What is Relax-Gam's average UCI Rating?
SELECT AVG(uci_rating) FROM table_name_88 WHERE team = "relax-gam"
sql_create_context
CREATE TABLE table_22893781_5 ( score VARCHAR, team VARCHAR )
What was the score against houston?
SELECT score FROM table_22893781_5 WHERE team = "Houston"
sql_create_context
CREATE TABLE table_65279 ( "Manufacturer" text, "Model" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combin...
What model has a g green rating, has chrysler jeep as a manufacturer, has an l/100km urban (cold) less than 18, and has an mpg-uk combined of 27.7?
SELECT "Model" FROM table_65279 WHERE "Green Rating" = 'g' AND "Manufacturer" = 'chrysler jeep' AND "L/100km Urban (Cold)" < '18' AND "mpg-UK Combined" = '27.7'
wikisql
CREATE TABLE Team ( id INTEGER, team_api_id INTEGER, team_fifa_api_id INTEGER, team_long_name TEXT, team_short_name TEXT ) CREATE TABLE League ( id INTEGER, country_id INTEGER, name TEXT ) CREATE TABLE Team_Attributes ( id INTEGER, team_fifa_api_id INTEGER, team_api_id INTE...
For the top five players in terms of potential, bin their birthday into weekday interval, and show me the distribution of their birthday.
SELECT birthday, COUNT(birthday) FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5
nvbench
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 varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_I...
For those employees who was hired before 2002-06-21, find job_id and the average of department_id , and group by attribute job_id, and visualize them by a bar chart, display by the JOB_ID in ascending.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_22460085_1 ( character VARCHAR, original_west_end_performer VARCHAR )
What character did Richard Fleeshman portray?
SELECT character FROM table_22460085_1 WHERE original_west_end_performer = "Richard Fleeshman"
sql_create_context
CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
Where is the club 'Hopkins Student Enterprises' located?
SELECT clublocation FROM club WHERE clubname = "Hopkins Student Enterprises"
spider
CREATE TABLE table_3728 ( "#" real, "Matches As Captain" text, "Player" text, "Asian Cup Played As A Captain" text, "Years Active" text, "Caps(Goals)" text )
What were the years active where Asian Cup played as a captain is Iran 1976?
SELECT "Years Active" FROM table_3728 WHERE "Asian Cup Played As A Captain" = 'Iran 1976'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
列出俞阳泽患者在编码0973581的医院中就诊科室名称不包含医学科的所有医疗就诊记录都有哪些?
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '俞阳泽' AND t_kc21.MED_SER_ORG_NO = '0973581' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%医学科%'
css
CREATE TABLE table_9062 ( "Event" text, "Time" text, "Club" text, "Date" text, "Meet" text, "Location" text )
Which Date has a Time of 1:00.59?
SELECT "Date" FROM table_9062 WHERE "Time" = '1:00.59'
wikisql
CREATE TABLE table_204_954 ( id number, "no." number, "country" text, "2009 winter\nuniversiade" number, "2007 wjcc" number, "2007 wwcc" number, "2008 wjcc" number, "2008 wwcc" number, "points" number )
which county had the same number of points as latvia ?
SELECT "country" FROM table_204_954 WHERE "country" <> 'latvia' AND "points" = (SELECT "points" FROM table_204_954 WHERE "country" = 'latvia')
squall
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, ...
when was the first time for patient 23969 procedure in this year?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23969) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE Allergy_type ( allergy VARCHAR, allergytype VARCHAR )
Show all allergies and their types.
SELECT allergy, allergytype FROM Allergy_type
sql_create_context
CREATE TABLE table_44444 ( "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text )
How many points have 88 laps and a grid of 14?
SELECT "Points" FROM table_44444 WHERE "Laps" = '88' AND "Grid" = '14'
wikisql
CREATE TABLE table_name_3 ( name VARCHAR, team VARCHAR, wsu_year_s_ VARCHAR )
What is Name, when Team is Detroit Pistons, and when WSU Year(s) is 1979-82?
SELECT name FROM table_name_3 WHERE team = "detroit pistons" AND wsu_year_s_ = "1979-82"
sql_create_context
CREATE TABLE table_5278 ( "Date" text, "Result" text, "Score" text, "Brazil scorers" text, "Competition" text )
What was the score at Bernardo O'Higgins Cup on May 7, 1961?
SELECT "Score" FROM table_5278 WHERE "Competition" = 'bernardo o''higgins cup' AND "Date" = 'may 7, 1961'
wikisql
CREATE TABLE table_name_96 ( attendance INTEGER, opponent VARCHAR )
What was the attendance when the opponent was virginia?
SELECT SUM(attendance) FROM table_name_96 WHERE opponent = "virginia"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
Are there any courses that I can take that RCARTS 268 is a pre-requisite for ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'RCARTS' AND COURSE_1.numbe...
advising
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
戚阳曜患者在8055901医院入院诊断疾病名称不包含胃溃疡的医疗就诊记录编号是多少?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '戚阳曜' AND MED_SER_ORG_NO = '8055901' AND NOT IN_DIAG_DIS_NM LIKE '%胃溃疡%'
css
CREATE TABLE table_name_70 ( total VARCHAR, nation VARCHAR )
What is the total number of medals by the Czech republic?
SELECT total FROM table_name_70 WHERE nation = "czech republic"
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTME...
For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id, and list Y-axis in desc order.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) 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...
get the number of patients with black/haitian ethnic background who are still single.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "BLACK/HAITIAN"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
在57012186438出院的时候哪个科室为其办理的手续科室的代号是啥?
SELECT CYKSDM, CYKSMC FROM zyjzjlb WHERE JZLSH = '57012186438'
css
CREATE TABLE table_36932 ( "Matches" real, "Innings" real, "Not out" real, "Runs" real, "High Score" real, "Average" real )
How many runs were there when the high score was 55 and there were more than 12 innings?
SELECT SUM("Runs") FROM table_36932 WHERE "High Score" = '55' AND "Innings" > '12'
wikisql
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
had ever been the heart rate of patient 5828 been ever greater than 77.0 since 11/02/2105?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_...
mimic_iii
CREATE TABLE table_63206 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What score has a game greater than 29, with 24-6 as the record?
SELECT "Score" FROM table_63206 WHERE "Game" > '29' AND "Record" = '24-6'
wikisql
CREATE TABLE table_72055 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest total amount of medals from countries with 0 gold medals, more than 2 bronze medals, and more than 1 silver medal?
SELECT MIN("Total") FROM table_72055 WHERE "Gold" = '0' AND "Bronze" > '2' AND "Silver" > '1'
wikisql
CREATE TABLE table_79654 ( "Match" real, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attnd." real, "Report" text )
What is the match number that had a result of 0:5 (0:3)?
SELECT COUNT("Match") FROM table_79654 WHERE "Result" = '0:5 (0:3)'
wikisql
CREATE TABLE table_9133 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who is the away team against the home team Ashington?
SELECT "Away team" FROM table_9133 WHERE "Home team" = 'ashington'
wikisql
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_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
Are there more 400 / 500 -level RACKHAM classes with less workloads ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'RACKHAM' AND program_course.workload = (SELECT MIN(PR...
advising
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
医院1070682给名为卫祺祥的病人开出的单价最高的药品名称、编码和单价分别是什么
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, UNIVALENT FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '卫祺祥' AND MED_SER_ORG_NO = '1070682') ORDER BY UNIVALENT DESC LIMIT 1
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
Find the number of black/haitian ethnic background patients who had a parathyroid hormone lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.label = "Parathyroid Hormone"
mimicsql_data
CREATE TABLE table_7626 ( "Dates" text, "Tournament" text, "Country" text, "Prize fund ( US$ )" real, "Winner" text, "OWGR pts" real )
What is the average Prize fund ( US$ ), when OWGR pts is greater than 20, and when Dates is Nov 6-9?
SELECT AVG("Prize fund ( US$ )") FROM table_7626 WHERE "OWGR pts" > '20' AND "Dates" = 'nov 6-9'
wikisql
CREATE TABLE table_name_48 ( week INTEGER, date VARCHAR )
What is the Week number on September 6, 1946?
SELECT SUM(week) FROM table_name_48 WHERE date = "september 6, 1946"
sql_create_context
CREATE TABLE table_610 ( "Model number" text, "Printer ports" text, "Network ports" text, "Network protocols" text, "Firmware" text, "Notes" text )
What is the number of the model with three parallel printer ports?
SELECT "Model number" FROM table_610 WHERE "Printer ports" = 'Three Parallel'
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, ...
列出患者20499920在10年5月11日到20年4月9日内被开出的所有检验报告单的检验报告单号是多少?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
CREATE TABLE table_28719 ( "Monarch" text, "Heir" text, "Status" text, "Relationship to Monarch" text, "Became heir; reason" text, "Ceased to be heir; reason" text, "Next in succession" text )
When is the became heir; reason when heir is hsinbyushin?
SELECT "Became heir; reason" FROM table_28719 WHERE "Heir" = 'Hsinbyushin'
wikisql