context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_61954 ( "Place" text, "Player" text, "Country" text, "Score" text, "To Par" text, "Money ( $ )" real )
Which To Par has a Money ($) of 350, and a Player of henry picard?
SELECT "To Par" FROM table_61954 WHERE "Money ( $ )" = '350' AND "Player" = 'henry picard'
wikisql
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 aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
i'd like a morning flight from NEWARK to LOS ANGELES
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'NEWARK')) AND to_airport IN (SELECT AIRPORT_S...
atis
CREATE TABLE city ( Name VARCHAR, White VARCHAR )
List the names of the city with the top 5 white percentages.
SELECT Name FROM city ORDER BY White DESC LIMIT 5
sql_create_context
CREATE TABLE table_name_34 ( deaths VARCHAR, name VARCHAR )
How many deaths did eseta cause?
SELECT deaths FROM table_name_34 WHERE name = "eseta"
sql_create_context
CREATE TABLE company ( company_id number, name text, headquarters text, industry text, sales_in_billion number, profits_in_billion number, assets_in_billion number, market_value_in_billion number ) CREATE TABLE employment ( company_id number, people_id number, year_working n...
Show names of companies and that of employees in descending order of number of years working for that employee.
SELECT T3.name, T2.name FROM employment AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id JOIN company AS T3 ON T1.company_id = T3.company_id ORDER BY T1.year_working
spider
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE ...
How many books fall into each category, and could you order by the bars in asc?
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category
nvbench
CREATE TABLE table_204_146 ( id number, "tie" number, "home team" text, "score" text, "away team" text, "attendance" number )
other than in gloucester city , name a game that was attended by more than 1,000 people .
SELECT "home team" FROM table_204_146 WHERE "home team" <> 'gloucester city' AND "attendance" > 1000
squall
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, ...
give me the number of patients whose age is less than 80 and diagnoses short title is hx-ven thrombosis/embols?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.short_title = "Hx-ven thrombosis/embols"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
how many days have passed since first procedure of patient 017-45919 on their current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-45919'...
eicu
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
when was the last time patient 51177 had an maximum chloride in a month before?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRE...
mimic_iii
CREATE TABLE table_54617 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which grid has a Time/Retired of +5.004?
SELECT MIN("Grid") FROM table_54617 WHERE "Time/Retired" = '+5.004'
wikisql
CREATE TABLE table_name_66 ( year_joined VARCHAR, school VARCHAR )
What's the year that Hagerstown joined?
SELECT year_joined FROM table_name_66 WHERE school = "hagerstown"
sql_create_context
CREATE TABLE table_29546030_2 ( stolen_ends INTEGER, w VARCHAR )
What is the most amount of stolen ends for a skip with 1 W?
SELECT MAX(stolen_ends) FROM table_29546030_2 WHERE w = 1
sql_create_context
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
查一下花志专这个患者之前的门诊诊断证明
SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '花志专' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM person_info JO...
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
patient 030-64961 underwent any active warming procedure in a year before?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-64961')) AND treatment.treatmentname = 'active warming' AND DATETIME(tre...
eicu
CREATE TABLE table_52256 ( "Location" text, "Abb." text, "Enzyme" text, "Disorder" text, "Measurements" text )
What is the enzyme involved in the disorder of Ornithine Transcarbamylase deficiency?
SELECT "Enzyme" FROM table_52256 WHERE "Disorder" = 'ornithine transcarbamylase deficiency'
wikisql
CREATE TABLE table_name_77 ( administrative_panel INTEGER, cultural_and_educational_panel VARCHAR, industrial_and_commercial_panel VARCHAR )
What is the administrative panel average when the cultural and educational panel is greater than 1 and the industrial and commercial panel less than 4?
SELECT AVG(administrative_panel) FROM table_name_77 WHERE cultural_and_educational_panel > 1 AND industrial_and_commercial_panel < 4
sql_create_context
CREATE TABLE table_name_96 ( score VARCHAR, date VARCHAR, venue VARCHAR )
Which Score has a Date of october 8, 2005, and a Venue of estadio alfonso lastras, san luis potos , mexico?
SELECT score FROM table_name_96 WHERE date = "october 8, 2005" AND venue = "estadio alfonso lastras, san luis potosí, mexico"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Question and answer counts group by hour. Find the most quiet moment to ask or answer questions
SELECT q.hour AS "utc_hour", CAST(q.questions AS TEXT) + ' (' + CAST(q.percentage AS TEXT) + '%)' AS Questions, CAST(a.answers AS TEXT) + ' (' + CAST(a.percentage AS TEXT) + '%)' AS Answers FROM (SELECT TIME_TO_STR(CreationDate, '%h') AS hour, COUNT(*) AS questions, 100.0 * COUNT(*) / (SELECT COUNT(*) FROM Posts WHERE ...
sede
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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 ...
在患者云乐人的医疗记录中,查一下医疗费总额高过1367.6元的入院诊断疾病编码和名称
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '云乐人' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 1367.6)
css
CREATE TABLE table_27578 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real )
How many values for points have Sophia Witherspoon as the player?
SELECT COUNT("Points") FROM table_27578 WHERE "Player" = 'Sophia Witherspoon'
wikisql
CREATE TABLE table_204_162 ( id number, "team" text, "constructor" text, "motorcycle" text, "tyres" text, "no" number, "rider" text, "rounds" text )
is the ducati marlboro team above or below the team roberts in the team column ?
SELECT (SELECT id FROM table_204_162 WHERE "team" = 'ducati marlboro team') < (SELECT id FROM table_204_162 WHERE "team" = 'team roberts')
squall
CREATE TABLE Player ( pName VARCHAR, yCard VARCHAR, HS VARCHAR )
Find the name of players whose card is yes in the descending order of training hours.
SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC
sql_create_context
CREATE TABLE table_22798 ( "Match no." real, "Match Type" text, "Team Europe" text, "Score" text, "Team USA" text, "Progressive Total" text )
When chris barnes is on team usa how many europe teams are there?
SELECT COUNT("Team Europe") FROM table_22798 WHERE "Team USA" = 'Chris Barnes'
wikisql
CREATE TABLE table_44759 ( "Name" text, "WSU Year(s)" text, "Position" text, "Team" text, "Pro Year(s)" text )
What is Name, when WSU Year(s) is 1981-82?
SELECT "Name" FROM table_44759 WHERE "WSU Year(s)" = '1981-82'
wikisql
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text )
Show the name of track and the number of races in each track Visualize by bar chart, and could you order y-axis from low to high order?
SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
Bar chart x axis minister y axis how many minister, display the number of minister in descending order.
SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister) DESC
nvbench
CREATE TABLE table_71055 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
What was the Event for the prize of 850,000?
SELECT "Event" FROM table_71055 WHERE "Prize" = '€850,000'
wikisql
CREATE TABLE table_39910 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
What ist he Home with a Score that is 42-64?
SELECT "Home" FROM table_39910 WHERE "Score" = '42-64'
wikisql
CREATE TABLE table_name_16 ( years VARCHAR, area VARCHAR )
Which years have an Area of rangitoto?
SELECT years FROM table_name_16 WHERE area = "rangitoto"
sql_create_context
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...
Visualize a bar chart about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home, sort by the total number in descending.
SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(Team_ID) DESC
nvbench
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of salary over the job_id , and group by attribute job_id by a bar chart, I want to rank by the sum salary in descending please.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE table_25102 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
Name the total number of reason for change for not filled this congress
SELECT COUNT("Reason for change") FROM table_25102 WHERE "Date successor seated" = 'Not filled this congress'
wikisql
CREATE TABLE table_8379 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Name the Home with has a Score of 2 7?
SELECT "Home" FROM table_8379 WHERE "Score" = '2–7'
wikisql
CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real ) CREATE TABLE membership_register_branch ( Member_ID int, Branch_ID text, Register_Year text ) CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int...
For each branch id, what are the names of the branches that were registered after 2015. Visualize by bar chart.
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID
nvbench
CREATE TABLE table_36669 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
Which Points have a Score of 3 3, and a Date of november 11?
SELECT "Points" FROM table_36669 WHERE "Score" = '3–3' AND "Date" = 'november 11'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, Rejection...
Number of Compile-to-JS askers by Month.
SELECT Tag, STR(Year) + '-' + REPLACE(STR(Month, 2), SPACE(1), '0') AS Month, COUNT(DISTINCT OwnerUserId) AS Askers FROM (SELECT ViewCount, OwnerUserId, MONTH(CreationDate) AS Month, YEAR(CreationDate) AS Year, CASE WHEN Tags LIKE '%<flowtype>%' THEN 'FlowType' ELSE CASE WHEN Tags LIKE '%<typescript>%' THEN 'TypeScript...
sede
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patie...
how many patients have been prescribed with warfarin sodium 5 mg po tabs until 4 years ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'warfarin sodium 5 mg po tabs' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-4 year'))
eicu
CREATE TABLE table_78416 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team scored 14.11 (95)?
SELECT "Home team" FROM table_78416 WHERE "Home team score" = '14.11 (95)'
wikisql
CREATE TABLE table_73688 ( "Season" real, "MLS Regular Season" text, "MLS Cup Playoffs" text, "Lamar Hunt U.S. Open Cup" text, "CONCACAF Champions Cup / CONCACAF Champions League" text )
What was the mls cup playoffs when the mls regular season was 4th, central (11-16-5)?
SELECT "MLS Cup Playoffs" FROM table_73688 WHERE "MLS Regular Season" = '4th, Central (11-16-5)'
wikisql
CREATE TABLE table_name_5 ( writer_s_ VARCHAR, film VARCHAR )
Who wrote the film Jehovah's Witness?
SELECT writer_s_ FROM table_name_5 WHERE film = "jehovah's witness"
sql_create_context
CREATE TABLE table_34436 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" text, "Date" text, "Time" text, "Report" text )
What is the home team score of the Ghantoot Racing and Polo Club Ground?
SELECT "Home team score" FROM table_34436 WHERE "Ground" = 'ghantoot racing and polo club'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
有哪些人医疗就诊15125060354中报告超过26份检验报告单?列出这些报告人工号和姓名分别是?
SELECT BGRGH, BGRXM FROM jybgb WHERE JZLSH = '15125060354' GROUP BY BGRGH HAVING COUNT(*) > 26
css
CREATE TABLE table_name_84 ( round VARCHAR, overall VARCHAR )
Name the round having an overall of 6
SELECT round FROM table_name_84 WHERE overall = 6
sql_create_context
CREATE TABLE table_56727 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the date of the friendly match, ending in a result of 1-1?
SELECT "Date" FROM table_56727 WHERE "Competition" = 'friendly match' AND "Result" = '1-1'
wikisql
CREATE TABLE table_4360 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Who is the opponent for week 5?
SELECT "Opponent" FROM table_4360 WHERE "Week" = '5'
wikisql
CREATE TABLE table_name_3 ( score VARCHAR, attendance VARCHAR )
What was the Score that has an Attendance of 39,446?
SELECT score FROM table_name_3 WHERE attendance = "39,446"
sql_create_context
CREATE TABLE table_8531 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text )
How many lanes have 2 as the heat, and susanna kallur as the name?
SELECT SUM("Lane") FROM table_8531 WHERE "Heat" = '2' AND "Name" = 'susanna kallur'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
Post length to score ratio.
SELECT Id AS "post_link", Score, LENGTH(Body) AS Length, CAST(Score AS FLOAT) / LENGTH(Body) AS Ratio, OwnerUserId AS "user_link" FROM Posts WHERE Body != '' ORDER BY CAST(Score AS FLOAT) / LENGTH(Body) DESC
sede
CREATE TABLE table_204_263 ( id number, "pick" number, "player" text, "country of origin" text, "pba team" text, "college" text )
was steven smith pick number 5 or number 8 ?
SELECT "pick" FROM table_204_263 WHERE "player" = 'steven smith'
squall
CREATE TABLE table_44810 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the Set 1 when Set 3 was 25 15?
SELECT "Set 1" FROM table_44810 WHERE "Set 3" = '25–15'
wikisql
CREATE TABLE table_67994 ( "Year" text, "Date Final" text, "Venue" text, "Prize Money" text, "Champion" text, "Runner-up" text, "Score in final" text, "Commercial name" text )
What date final has 1989 as the year?
SELECT "Date Final" FROM table_67994 WHERE "Year" = '1989'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and manager_id , list bars in ascending order.
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
nvbench
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 Products ( Product_ID VARCHAR(100), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Product_Description VARCHAR...
What are the descriptions of the service types with product price above 100, and count them by a bar chart, I want to sort by the bars in asc.
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description
nvbench
CREATE TABLE table_57669 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which team has the high points of Raymond Felton (26)?
SELECT "Team" FROM table_57669 WHERE "High points" = 'raymond felton (26)'
wikisql
CREATE TABLE fgwyjzb ( 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, ...
因精神障碍住院在小儿骨科这个科室记录有多少平均费用,时间在二零零二年三月十九日至二零一八年十月十五日
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '小儿骨科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-03-19' AND '2021-03-24' AND gwyjzb.IN_DIAG_DIS_NM = '精神障碍' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '小儿骨科' AND fgwyjzb.IN_HOSP_DATE B...
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row...
how many patients since 6 years ago received a procedure-one vessel after the first circumcision procedure within 2 months?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'circumcisio...
mimic_iii
CREATE TABLE table_24870 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Name the number of number in season for 3.09
SELECT COUNT("No. in season") FROM table_24870 WHERE "Production code" = '3.09'
wikisql
CREATE TABLE table_30143 ( "Institution" text, "City" text, "State" text, "Team Name" text, "Affiliation" text, "Enrollment" real, "Home Conference" text )
What team is in the city of Rock Island?
SELECT "Team Name" FROM table_30143 WHERE "City" = 'Rock Island'
wikisql
CREATE TABLE table_name_69 ( viewers__in_millions_ VARCHAR, season VARCHAR )
How many people watched season 1?
SELECT viewers__in_millions_ FROM table_name_69 WHERE season = "1"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
for how many days was the patient with patient id 6983 admitted in hospital?
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_18666752_3 ( total_penalties VARCHAR, rider VARCHAR )
How many penalties are there when Eric Vigeanel is the rider?
SELECT COUNT(total_penalties) FROM table_18666752_3 WHERE rider = "Eric Vigeanel"
sql_create_context
CREATE TABLE procedures_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 diagnoses_i...
what is the daily average amount of magnesium patient 23070 has in this year?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(C...
mimic_iii
CREATE TABLE table_name_44 ( record VARCHAR, attendance VARCHAR )
What is the record that has the Rose Garden 20,126 as the attendance?
SELECT record FROM table_name_44 WHERE attendance = "rose garden 20,126"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Find ACC_Road and Team_ID , and group by attribute All_Home, and visualize them by a bar chart, list X in asc order.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_11727 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Where has an IATA of BVA?
SELECT "City" FROM table_11727 WHERE "IATA" = 'bva'
wikisql
CREATE TABLE table_33415 ( "Rank" real, "Player" text, "Years" text, "Games" real, "Reb. Avg." real, "Total Rebounds" real )
Which lowest rank(player) has a rebound average larger than 9, out of 920 rebounds, and who played more than 79 games?
SELECT MIN("Rank") FROM table_33415 WHERE "Reb. Avg." > '9' AND "Total Rebounds" = '920' AND "Games" > '79'
wikisql
CREATE TABLE table_name_55 ( role VARCHAR, direction VARCHAR )
Which role had thulasidas direction?
SELECT role FROM table_name_55 WHERE direction = "thulasidas"
sql_create_context
CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_pilot text, winning_aircraft text ) CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE pilot ( pilot_id number, name ...
What are the names of all aircrafts that have won a match at least twice?
SELECT T1.aircraft FROM aircraft AS T1 JOIN match AS T2 ON T1.aircraft_id = T2.winning_aircraft GROUP BY T2.winning_aircraft HAVING COUNT(*) >= 2
spider
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
Number of Stack Overflow users.
SELECT COUNT(*) FROM Users
sede
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, ...
has patient 73913 been diagnosed with hyposmolality?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hyposmolality') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73913)
mimic_iii
CREATE TABLE teaches ( ID VARCHAR, semester VARCHAR, YEAR VARCHAR )
Find the total number of instructors who teach a course in the Spring 2010 semester.
SELECT COUNT(DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
sql_create_context
CREATE TABLE table_29997127_4 ( game INTEGER, location_attendance VARCHAR )
In what game was the attendance at the America West Arena 18,756?
SELECT MAX(game) FROM table_29997127_4 WHERE location_attendance = "America West Arena 18,756"
sql_create_context
CREATE TABLE table_2112 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real )
How many nicknames were associated with Milton, Massachusetts?
SELECT COUNT("Nickname") FROM table_2112 WHERE "Location" = 'Milton, Massachusetts'
wikisql
CREATE TABLE Documents ( document_type_code VARCHAR, document_name VARCHAR, document_description VARCHAR )
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
sql_create_context
CREATE TABLE table_34790 ( "Year" real, "Production" text, "Role" text, "Director" text, "Company" text )
What company does Simon Stone direct earlier than 2011?
SELECT "Company" FROM table_34790 WHERE "Director" = 'simon stone' AND "Year" < '2011'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute name in a bar chart.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
nvbench
CREATE TABLE table_7505 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Location" text, "Record" text, "Attendance" text )
What is the final result of the game that was played on October 8, 2000?
SELECT "Result" FROM table_7505 WHERE "Date" = 'october 8, 2000'
wikisql
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
how many exhibitions has each artist had?, I want to order by the bar in ascending.
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name
nvbench
CREATE TABLE table_31805 ( "Class" text, "Type" text, "No. built (Converted*)" text, "Year built (Converted*)" text, "No. range" text, "Withdrawn" real )
Tell me the number range for 1965-66
SELECT "No. range" FROM table_31805 WHERE "Year built (Converted*)" = '1965-66'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required t...
what flights do you have from MILWAUKEE to TAMPA
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMP...
atis
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...
在医院7400991就诊的病号尤安晏其就诊的科室名称包含肝胆科的全部门诊就诊记录的流水号是什么?
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb 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 WHERE person_info.XM = '尤安晏' AND hz_info.YLJGDM = '7400991' AND txmzjzjlb.JZKSMC LIKE '%肝胆科%' UNION SELECT ftxmzjzjlb...
css
CREATE TABLE table_name_7 ( league INTEGER, total VARCHAR )
What is the sum of the value 'League Cup', when the Total is less than 1, and when the League is less than 0?
SELECT SUM(league) AS Cup FROM table_name_7 WHERE total < 1 AND league < 0
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
in 2105, what was the top five most frequently diagnosed diagnoses that patients were diagnosed with during the same hospital encounter after receiving coronar arteriogr-2 cath?
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, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
从06年1月17日至12年11月19日期间内为28372470患者检测促肾上腺皮质激素的医务人员姓名和工号分别什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE jyjgzbb.JYRQ BETWEEN '2006-01-17' AND '2012-11-1...
css
CREATE TABLE table_name_93 ( surface VARCHAR, date VARCHAR )
What type of surface was used for the game played on September 20, 1993?
SELECT surface FROM table_name_93 WHERE date = "september 20, 1993"
sql_create_context
CREATE TABLE table_name_15 ( school_club_team VARCHAR, round VARCHAR, player VARCHAR )
Which School/Club Team has a Round larger than 3, and a Player of sammy okpro?
SELECT school_club_team FROM table_name_15 WHERE round > 3 AND player = "sammy okpro"
sql_create_context
CREATE TABLE table_57074 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest bronze medal count for Italy with fewer than 6 gold medals and greater than 10 total medals?
SELECT MIN("Bronze") FROM table_57074 WHERE "Gold" < '6' AND "Nation" = 'italy' AND "Total" > '10'
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 All_Neutral and ACC_Percent , and show in desc by the x axis.
SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE table_name_56 ( result VARCHAR, round VARCHAR )
What was the result in round qf?
SELECT result FROM table_name_56 WHERE round = "qf"
sql_create_context
CREATE TABLE table_name_40 ( driver VARCHAR, entrant VARCHAR )
Who drove the Marlboro Mclaren Peugeot?
SELECT driver FROM table_name_40 WHERE entrant = "marlboro mclaren peugeot"
sql_create_context
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, ...
Return a bar chart on how many different professors are there for the different schools?, list by the the total number in desc.
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_1 ( population INTEGER, town VARCHAR )
How many people live in Norton?
SELECT SUM(population) FROM table_name_1 WHERE town = "norton"
sql_create_context
CREATE TABLE table_262560_2 ( type VARCHAR, nickname VARCHAR )
What type of school has the nickname the Oilers?
SELECT type FROM table_262560_2 WHERE nickname = "Oilers"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
what are the four most common procedures that patients received in the same month after being diagnosed with hepatic encephalopathy?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatic encephalopathy') AS t1 JOIN (SEL...
eicu
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate ti...
what was the name of procedure that patient 24894 were first received until 2103?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894) AND STRFTIME('%y', procedures_icd.charttime) <= '2103' ORDER ...
mimic_iii
CREATE TABLE table_55151 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text, "Free Practice driver(s)" text )
who is the constructor when the free practice driver(s) is n/a, the chassis is 005 and the driver is takuma sato?
SELECT "Constructor" FROM table_55151 WHERE "Free Practice driver(s)" = 'n/a' AND "Chassis" = '005' AND "Driver" = 'takuma sato'
wikisql
CREATE TABLE table_6953 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text, "Club" text )
Glenys Bakker was second for which nation?
SELECT "Nation" FROM table_6953 WHERE "Second" = 'glenys bakker'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
What is required for MCDB 680 and 489 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 680 OR COURSE_1.number = 489) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar...
advising
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many of the patients with icd9 code 69514 have an unspecified death status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "69514"
mimicsql_data