context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_57 ( week VARCHAR, tournament VARCHAR )
What week was the tournament at Cincinnati?
SELECT week FROM table_name_57 WHERE tournament = "cincinnati"
sql_create_context
CREATE TABLE table_name_28 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on september 10, 1979?
SELECT opponent FROM table_name_28 WHERE date = "september 10, 1979"
sql_create_context
CREATE TABLE table_name_56 ( home VARCHAR, visitor VARCHAR, date VARCHAR )
Who was the home team on February 18 that had a visitor of the Chicago Black Hawks?
SELECT home FROM table_name_56 WHERE visitor = "chicago black hawks" AND date = "february 18"
sql_create_context
CREATE TABLE table_name_46 ( round INTEGER, team VARCHAR, pick VARCHAR )
What is the top round for the baltimore bullets with a Pick larger than 6?
SELECT MAX(round) FROM table_name_46 WHERE team = "baltimore bullets" AND pick > 6
sql_create_context
CREATE TABLE table_78041 ( "Full Name" text, "Nickname" text, "Gender" text, "Weight at birth" text, "Meaning" text )
Chukwubuikem Maduabuchi is what gender?
SELECT "Gender" FROM table_78041 WHERE "Full Name" = 'chukwubuikem maduabuchi'
wikisql
CREATE TABLE table_name_78 ( career_caps VARCHAR, position VARCHAR, tour_apps VARCHAR )
What is the number of career caps for a full back, when tour Apps is smaller than 29?
SELECT COUNT(career_caps) FROM table_name_78 WHERE position = "full back" AND tour_apps < 29
sql_create_context
CREATE TABLE table_name_50 ( date VARCHAR, winner VARCHAR )
What is the date amer sulaiman won?
SELECT date FROM table_name_50 WHERE winner = "amer sulaiman"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
SO criteria population - review adjustments.
SELECT * FROM Users
sede
CREATE TABLE table_203_509 ( id number, "year" number, "laetare medalist" text, "position" text )
how many times does philanthropist appear in the position column on this chart ?
SELECT COUNT(*) FROM table_203_509 WHERE "position" = 'philanthropist'
squall
CREATE TABLE table_14971788_1 ( date VARCHAR, week VARCHAR )
What date was week 2?
SELECT date FROM table_14971788_1 WHERE week = 2
sql_create_context
CREATE TABLE table_2950964_5 ( read_by VARCHAR, isbn VARCHAR )
THe audio book with ISBN 978-1-4084-6879-1 is read by whom?
SELECT read_by FROM table_2950964_5 WHERE isbn = "isbn 978-1-4084-6879-1"
sql_create_context
CREATE TABLE table_name_55 ( psychological_dependence INTEGER, physical_dependence VARCHAR, pleasure VARCHAR, drug VARCHAR )
What is the highest Psychological Dependence, when Pleasure is less than 2.3, when Drug is 'Cannabis', and when Physical Dependence is less than 0.8?
SELECT MAX(psychological_dependence) FROM table_name_55 WHERE pleasure < 2.3 AND drug = "cannabis" AND physical_dependence < 0.8
sql_create_context
CREATE TABLE table_1545 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" text, "Profits (billion $)" text, "Assets (billion $)" text, "Market Value (billion $)" text )
What are the assets for company who's headquarters are located in Brazil?
SELECT "Assets (billion $)" FROM table_1545 WHERE "Headquarters" = 'Brazil'
wikisql
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...
count the number of patients whose diagnoses long title is morbid obesity and lab test category is chemistry?
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 = "Morbid obesity" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_26614 ( "Date Final" text, "Tournament" text, "Commercial Name" text, "Category" text, "Prize Money/ Surface" text, "Final Match" text, "Semifinal Matches" text )
Who played in the semi finals matches at the Buick WCT finals?
SELECT "Semifinal Matches" FROM table_26614 WHERE "Commercial Name" = 'Buick WCT Finals'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId numb...
Time Series of R highest rated questions.
SELECT Id, Title, Score, creation_year, creation_month FROM (SELECT p.Id, p.Title, p.Score, YEAR(p.CreationDate) AS creation_year, MONTH(p.CreationDate) AS creation_month, RANK() OVER (PARTITION BY YEAR(p.CreationDate), MONTH(p.CreationDate) ORDER BY p.Score DESC) AS rnk FROM Posts AS p JOIN PostTags AS pt ON pt.PostId...
sede
CREATE TABLE table_name_32 ( release_price___usd__ VARCHAR, model_number VARCHAR )
What is the release price (USD) of the microprocessor with a model number pentium dual-core t2330?
SELECT release_price___usd__ FROM table_name_32 WHERE model_number = "pentium dual-core t2330"
sql_create_context
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is average age of patients whose marital status is single and year of birth is greater than 2098?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2098"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, pa...
in 2102, what were the five most often ordered lab tests for patients who had previously been diagnosed with facial bone fracture - nasal fracture within 2 months?
SELECT t3.labname FROM (SELECT t2.labname, 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 = 'facial bone fracture - nasal fracture' AND STRFTIME(...
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
what is the total number of patients who had pneumonitis due to inhalation of food or vomitus and discharged to snf
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.long_title = "Pneumonitis due to inhalation of food or vomitus"
mimicsql_data
CREATE TABLE table_name_32 ( overall INTEGER, position VARCHAR, pick__number VARCHAR )
What is the largest overall where the position was linebacker and the pick number was more than 9?
SELECT MAX(overall) FROM table_name_32 WHERE position = "linebacker" AND pick__number > 9
sql_create_context
CREATE TABLE table_17586 ( "Rank" real, "Peak" text, "Elevation (m)" real, "Prominence (m)" real, "Isolation (km)" real, "Municipality" text, "County" text )
Name the rank where the municipality is sunndal?
SELECT "Rank" FROM table_17586 WHERE "Municipality" = 'Sunndal'
wikisql
CREATE TABLE table_73524 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the score for the date of December 7?
SELECT "Score" FROM table_73524 WHERE "Date" = 'December 7'
wikisql
CREATE TABLE table_13502 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the most silver when bronze is more than 0, total is more than 1, gold is more than 0 and the nation is china (chn)?
SELECT MAX("Silver") FROM table_13502 WHERE "Bronze" > '0' AND "Total" > '1' AND "Gold" > '0' AND "Nation" = 'china (chn)'
wikisql
CREATE TABLE Skills ( skill_id INTEGER, skill_code VARCHAR(20), skill_description VARCHAR(255) ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255), company_address VARCHAR(255), other_company_details VARCHAR(255) ) CREATE TABLE ...
List the number of enginners in a stacked bar chart. The x-axis is last name and group by skill description.
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, last_name
nvbench
CREATE TABLE table_name_86 ( semifinalists VARCHAR, champions VARCHAR )
Which Semifinalists has a Champions of michael chang 6-0 6-4?
SELECT semifinalists FROM table_name_86 WHERE champions = "michael chang 6-0 6-4"
sql_create_context
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...
在2018年9月28日到2020年9月28日这段时间里,医院9936726有多少科室涉及医疗费总额超过7430.83元多哪些?
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9936726' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2018-09-28' AND '2020-09-28' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 7430.83 UNION SELECT fgwyjzb....
css
CREATE TABLE table_name_82 ( location___state VARCHAR, team VARCHAR, winner VARCHAR )
Castrol Perkins Motorsport and the winner Russell Ingall was in what location/state?
SELECT location___state FROM table_name_82 WHERE team = "castrol perkins motorsport" AND winner = "russell ingall"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
针对医疗费总额不少于381.88元病人奚丽珠的治病记载,把出院的确诊疾病的编号和名称列出来?
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '奚丽珠' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 381.88)
css
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...
which language does the patient charles deshay prefer?
SELECT demographic.language FROM demographic WHERE demographic.name = "Charles Deshay"
mimicsql_data
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, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
病人名叫周泰宁在11年11月14日到13年6月11日内什么时间审核检验报告单的具体时间都是什么?
(SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '周泰宁' AND jyb...
css
CREATE TABLE table_52961 ( "Number & Name" text, "Description" text, "Livery" text, "Owner(s)" text, "Date" text )
Which description is dated 1962?
SELECT "Description" FROM table_52961 WHERE "Date" = '1962'
wikisql
CREATE TABLE table_name_55 ( byes VARCHAR, draws INTEGER )
How many byes has a draw larger than 0?
SELECT COUNT(byes) FROM table_name_55 WHERE draws > 0
sql_create_context
CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Staff_De...
Return the names and ids of customers who have TN in their address by a pie chart.
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%"
nvbench
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )...
show me round trip tickets from NEW YORK to MIAMI
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit...
atis
CREATE TABLE table_45480 ( "Competition" text, "Played" real, "Draw" real, "Lost" real, "Favour" real, "Against" real )
What is the lowest number of games played where they tied more than 7 of them?
SELECT MIN("Played") FROM table_45480 WHERE "Draw" > '7'
wikisql
CREATE TABLE table_31618 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Tell me the total number of gold for bronze more than 0 and total more than 100
SELECT COUNT("Gold") FROM table_31618 WHERE "Bronze" > '0' AND "Rank" = 'total' AND "Total" > '100'
wikisql
CREATE TABLE table_name_19 ( coach VARCHAR, year VARCHAR )
Who was the coach in 1953?
SELECT coach FROM table_name_19 WHERE year = "1953"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
provide the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and age is less than 61?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.age < "61"
mimicsql_data
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 procedures ( ...
provide the number of patients whose days of hospital stay is greater than 1 and drug route is nu?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "1" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_name_96 ( week VARCHAR, record VARCHAR )
What week was the record 0-5?
SELECT week FROM table_name_96 WHERE record = "0-5"
sql_create_context
CREATE TABLE table_1634 ( "Period" text, "% trains arriving within 5 mins of scheduled time (over three months)" text, "Change over same quarter the previous year" text, "% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text, "Change over previous year as a whole" text ...
What's the change over previous year as a whole in the period in which the change over same quarter the previous year was up 2.8%?
SELECT "Change over previous year as a whole" FROM table_1634 WHERE "Change over same quarter the previous year" = 'Up 2.8%'
wikisql
CREATE TABLE table_33201 ( "Tournament" text, "2007" text, "2011" text, "2012" text, "2013" text )
What value for 2013 corresponds to the US Open Tournament?
SELECT "2013" FROM table_33201 WHERE "Tournament" = 'us open'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
count the number of patients that were diagnosed with congestive heart failure - right-sided and didn't come back to the hospital within 2 months until 2104.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive heart failure - right-sided' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1...
eicu
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40),...
Give me a line chart, that bins all date of transactions into the weekday interval, and the count for each bin.
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name te...
top 100 tags since july 1.
SELECT Tags, ViewCount, CommentCount, Score, FavoriteCount FROM Posts WHERE CreationDate > '2020-07-01' ORDER BY ViewCount DESC LIMIT 100
sede
CREATE TABLE table_34580 ( "Position" text, "Artist" text, "Single" text, "Year" text, "Weeks" text )
what artist won in 1953
SELECT "Artist" FROM table_34580 WHERE "Year" = '1953'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) C...
Questions with 'what have you tried comments' between two dates.
SELECT COUNT(*) AS QuestionCount, SUM(A.TriedComments) AS TriedCount FROM (SELECT SUM(CASE WHEN C.Text LIKE '%have you tried%' OR c.Text LIKE '%you have tried%' THEN 1 ELSE 0 END) AS TriedComments, P.Id FROM Posts AS P LEFT JOIN Comments AS C ON C.PostId = P.Id WHERE P.CreationDate BETWEEN @pStartDate AND @pEndDate AND...
sede
CREATE TABLE table_name_48 ( date VARCHAR, stadium VARCHAR, final_score VARCHAR )
What is the date that a game at the Alltel Stadium had a final score of 6-20?
SELECT date FROM table_name_48 WHERE stadium = "alltel stadium" AND final_score = "6-20"
sql_create_context
CREATE TABLE table_70806 ( "Rank" real, "Fastest time (s)" real, "Wind (m/s)" real, "Athlete" text, "Nation" text, "Date" text, "Location" text )
what is the wind speed when brenda morehead was in the united states?
SELECT MIN("Wind (m/s)") FROM table_70806 WHERE "Nation" = 'united states' AND "Athlete" = 'brenda morehead'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
what is the number of patients whose diagnoses long title is pressure ulcer, stage iv and lab test abnormal status is delta?
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 = "Pressure ulcer, stage IV" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int )
Plot how many country by grouped by country as a bar graph, rank from low to high by the bars please.
SELECT Country, COUNT(Country) FROM member GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_100518_1 ( direction VARCHAR, weapon VARCHAR )
What are the directions for the guardian whose weapon is kha ga (sword)?
SELECT direction FROM table_100518_1 WHERE weapon = "Khaḍga (sword)"
sql_create_context
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...
这个叫章乐悦的团伙成员最常开的药品排序都是什么?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '章乐悦' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID...
css
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...
Good and Bad code examples.
SELECT COUNT(*) FROM Posts WHERE Body LIKE '%<code>%' AND ParentId IN (1109022, 151777, 541966, 1016896, 6343166, 477572, 2591036, 3145089, 2201917, 5033012, 600207, 3035692, 1560788, 2091465, 531427, 2139134, 6495898, 3166501, 4605527, 2736389, 2150078, 6200533, 867518, 2471935, 3624280, 2459916, 1667278, 2795833, 231...
sede
CREATE TABLE table_36303 ( "Season" text, "Winner" text, "Result" text, "Runner-up" text, "1st of Regular Season" text, "Record" text, "Champion's Coach" text, "Finals MVP" text )
Who is the runner-up of the season with Tanel Sokk as the finals MVP and Alar Varrak as the champion's coach?
SELECT "Runner-up" FROM table_36303 WHERE "Finals MVP" = 'tanel sokk' AND "Champion's Coach" = 'alar varrak'
wikisql
CREATE TABLE table_17672 ( "Year" text, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
What was the playoff result in 2002?
SELECT "Playoffs" FROM table_17672 WHERE "Year" = '2002'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit ...
how much is the daily minimum weight of patient 9294 since 2105?
SELECT MIN(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 = 9294)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit...
mimic_iii
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
Repeated `Comment` for `PostHistoryTypeId IN (33, 34)`.
SELECT Comment, COUNT(*) AS "Count" FROM PostHistory WHERE PostHistoryTypeId IN (33, 34) GROUP BY Comment HAVING COUNT(*) > 2 ORDER BY 'Count' DESC
sede
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHA...
Show the sum of account details for different statement details in a bar chart, and sort in ascending by the y-axis.
SELECT Statement_Details, SUM(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY SUM(Account_Details)
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...
mention the age and procedure long title of patient with patient id 2560.
SELECT demographic.age, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_35 ( music VARCHAR, team VARCHAR, points_jury VARCHAR )
What is the Music for Team anna guzik & rafa kami ski that has a Points Jury of 24 (7,5,6,6)?
SELECT music FROM table_name_35 WHERE team = "anna guzik & rafał kamiński" AND points_jury = "24 (7,5,6,6)"
sql_create_context
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 )
A bar chart for what are the number of the names of all products?, and sort by the Y-axis in asc.
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE table_15409403_1 ( year VARCHAR, playoffs VARCHAR )
When did the playoffs reached Conference Finals?
SELECT year FROM table_15409403_1 WHERE playoffs = "Conference Finals"
sql_create_context
CREATE TABLE table_22727 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Land area (km\u00b2)" text, "Population density (per km\u00b2)" text )
When beauval is the name what is the lowest population of 2011?
SELECT MIN("Population (2011)") FROM table_22727 WHERE "Name" = 'Beauval'
wikisql
CREATE TABLE roller_coaster ( roller_coaster_id number, name text, park text, country_id number, length number, height number, speed text, opened text, status text ) CREATE TABLE country ( country_id number, name text, population number, area number, languages te...
Show the park of the roller coaster with the highest speed.
SELECT park FROM roller_coaster ORDER BY speed DESC LIMIT 1
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
indicate the yearly minimum amount of heartrate for patient 016-34108.
SELECT MIN(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-34108')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
how many metoprolol tartrate 25 mg tab prescriptions since 4 years ago have been prescribed?
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'metoprolol tartrate 25 mg tab' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year')
eicu
CREATE TABLE table_16572 ( "Character" text, "Portrayed by" text, "First appearance" text, "Last appearance" text, "Duration" text, "Episodes" text )
Which actors first appeared in episode 'Blink' 1, 2, 3?
SELECT "Portrayed by" FROM table_16572 WHERE "First appearance" = 'Blink" 1, 2, 3'
wikisql
CREATE TABLE table_name_3 ( date VARCHAR, venue VARCHAR )
Which Date has a Venue of bucharest?
SELECT date FROM table_name_3 WHERE venue = "bucharest"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose discharge location is dead/expired and procedure short title is contrast aortogram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND procedures.short_title = "Contrast aortogram"
mimicsql_data
CREATE TABLE table_75461 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Competition" text )
Which Venue has a Competition of pl group b, and a Score of 2-2?
SELECT "Venue" FROM table_75461 WHERE "Competition" = 'pl group b' AND "Score" = '2-2'
wikisql
CREATE TABLE table_name_83 ( grid VARCHAR, time VARCHAR, laps VARCHAR )
How many grids were there races with more than 10 laps and a time of +34.121?
SELECT COUNT(grid) FROM table_name_83 WHERE time = "+34.121" AND laps > 10
sql_create_context
CREATE TABLE table_34026 ( "Site" text, "Bebo" real, "Facebook" real, "Friendster" real, "LinkedIn" real, "MySpace" real, "Ning" real, "Orkut" real, "Plaxo" real )
How many linkedin have Facebook as the site, with a myspace less than 64?
SELECT COUNT("LinkedIn") FROM table_34026 WHERE "Site" = 'facebook' AND "MySpace" < '64'
wikisql
CREATE TABLE table_name_22 ( attendance INTEGER, date VARCHAR, report VARCHAR, score VARCHAR )
What is the total attendance with a Report of sd.hr, and a Score of 3 1, and a Date of 14 apr 2001?
SELECT SUM(attendance) FROM table_name_22 WHERE report = "sd.hr" AND score = "3–1" AND date = "14 apr 2001"
sql_create_context
CREATE TABLE qtb ( 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...
5569109这家医院的所有患者就诊记录里,算一下医保大病支付的部分与全部医疗费用相比的比值里最小值,依照科室及入院诊断疾病的编码区别列出结果
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '5569109' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gyb JOIN t_kc24 ON gyb...
css
CREATE TABLE table_50492 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
When Hawthorn is the away team, what is their score?
SELECT "Away team score" FROM table_50492 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE staff ( staff_id number, staff_details text ) CREATE TABLE claim_headers ( claim_header_id number, claim_status_code text, claim_type_code text, policy_id number, date_of_claim time, date_of_settlement time, amount_claimed number, amount_piad number ) CREATE TABLE ...
Which types of policy are chosen by more than 2 customers? Give me the policy type codes.
SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING COUNT(*) > 2
spider
CREATE TABLE table_name_84 ( disposals VARCHAR, marks VARCHAR )
What is the number of disposals when marks is 134?
SELECT disposals FROM table_name_84 WHERE marks = "134"
sql_create_context
CREATE TABLE table_60242 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
What is the lowest to par for Bob Charles?
SELECT MIN("To par") FROM table_60242 WHERE "Player" = 'bob charles'
wikisql
CREATE TABLE table_37353 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is the Call sign for the ERP W 19?
SELECT "Call sign" FROM table_37353 WHERE "ERP W" = '19'
wikisql
CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE...
I want to know the proportion of the total number for each time of day.
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day
nvbench
CREATE TABLE table_175442_1 ( common_name VARCHAR, scientific_name VARCHAR )
Name the common name for rhampholeon spectrum
SELECT common_name FROM table_175442_1 WHERE scientific_name = "Rhampholeon spectrum"
sql_create_context
CREATE TABLE table_name_10 ( date VARCHAR, away_team VARCHAR )
What was the date of the game when North Melbourne was the away team?
SELECT date FROM table_name_10 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CR...
is there a flight from DENVER to SAN FRANCISCO on CO leaving after 1200 o'clock in the afternoon
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.departure_time > 1200 AND flight.to_airport = AIRPORT_SERVICE_...
atis
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
tell me the percentile of mcv 97.0 in patients of the same age as patient 2127 during the last hospital visit?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE...
mimic_iii
CREATE TABLE table_6263 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Name the most top-5 for wins less than 0 and events less than 16
SELECT MAX("Top-5") FROM table_6263 WHERE "Events" < '16' AND "Wins" < '0'
wikisql
CREATE TABLE table_name_22 ( laps INTEGER, time_retired VARCHAR, driver VARCHAR )
I want the lowest Laps for time/retired of engine and driver of charles de tornaco
SELECT MIN(laps) FROM table_name_22 WHERE time_retired = "engine" AND driver = "charles de tornaco"
sql_create_context
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...
列出患者奚妮娜的检验报告单中结果指标均正常的检验报告单号
SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info...
css
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) 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 ...
show me DL flights from DALLAS to DENVER
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS...
atis
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
show me the DAILY flight schedule between BOSTON and PITTSBURGH
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CIT...
atis
CREATE TABLE table_23030 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
Name the viewers for the episode directed by tony phelan
SELECT "U.S. viewers (millions)" FROM table_23030 WHERE "Directed by" = 'Tony Phelan'
wikisql
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...
A bar chart shows the distribution of Team_Name and ACC_Percent , and list X in asc order please.
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE table_name_50 ( area VARCHAR, name VARCHAR )
What area is named Mackenzie college?
SELECT area FROM table_name_50 WHERE name = "mackenzie college"
sql_create_context
CREATE TABLE table_2886617_6 ( nationality VARCHAR, player VARCHAR )
What nationality was peter slamiar?
SELECT nationality FROM table_2886617_6 WHERE player = "Peter Slamiar"
sql_create_context
CREATE TABLE table_30975 ( "Season no." real, "Series no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
What is the last episode in the season that had 3.91 million viewers in the US?
SELECT MIN("Season no.") FROM table_30975 WHERE "U.S. viewers (millions)" = '3.91'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
provide the number of patients whose insurance is medicare and year of birth is less than 2182?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dob_year < "2182"
mimicsql_data
CREATE TABLE table_24231638_3 ( team VARCHAR, position_in_table VARCHAR )
What is the team for the position in table 19th?
SELECT team FROM table_24231638_3 WHERE position_in_table = "19th"
sql_create_context
CREATE TABLE climber ( Points INTEGER, Country VARCHAR )
What is the maximum point for climbers whose country is United Kingdom?
SELECT MAX(Points) FROM climber WHERE Country = "United Kingdom"
sql_create_context
CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, support_rep_id number ) CREATE TABLE sqlite_sequence ( name text, seq tex...
What are the top 5 countries by number of invoices and how many do they have?
SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5
spider