context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_37 ( position INTEGER, played VARCHAR, points VARCHAR, goals_against VARCHAR )
What is the lowest position with 32-6 points and less then 59 goals when there are more than 38 played?
SELECT MIN(position) FROM table_name_37 WHERE points = "32-6" AND goals_against < 59 AND played > 38
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Percentage of questions in a given tag per week.
SELECT number = ROW_NUMBER() OVER (ORDER BY YEAR(CreationDate), TIME_TO_STR(CreationDate, '%W')), (CAST(SUM(CASE WHEN (Tags LIKE '%<##Tagname##>%') THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(Posts.Id)) AS "perc" FROM Posts WHERE (PostTypeId = 1 AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##') GROUP BY Y...
sede
CREATE TABLE table_8781 ( "Tournament" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "Career SR" text )
What result in 1994 has a SR as the tournament?
SELECT "1994" FROM table_8781 WHERE "Tournament" = 'sr'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
what was the daily maximum amount of t tube given to patient 4469 on the last icu visit?
SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4469) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.it...
mimic_iii
CREATE TABLE table_name_45 ( partner VARCHAR, surface VARCHAR, opponents VARCHAR )
What was the partner of the team that faced the guillermo garc a-l pez albert portas on clay?
SELECT partner FROM table_name_45 WHERE surface = "clay" AND opponents = "guillermo garcía-lópez albert portas"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
患者23602060在医院9638787就诊期间门诊诊断的病名内包含后遗症的门诊就诊记录都啥啊?
SELECT * FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '23602060' AND hz_info.YLJGDM = '9638787' AND txmzjzjlb.JZZDSM LIKE '%后遗症%' UNION SELECT * FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND h...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
during a year before what were the top four most frequent procedures that patients were given within 2 months after the diagnosis of nutritional deficiency?
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 = 'nutritional deficiency' AND DATETIME(dia...
eicu
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
What is the number of platforms for each location? Show the comparison with a bar chart.
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
nvbench
CREATE TABLE table_name_3 ( a_ VARCHAR, year_ INTEGER, position VARCHAR, college VARCHAR )
What is the most recent year georgia tech chose a linebacker?
SELECT MAX(year_) AS "a_" FROM table_name_3 WHERE position = "linebacker" AND college = "georgia tech"
sql_create_context
CREATE TABLE table_name_40 ( lost INTEGER, season VARCHAR, avg_attend VARCHAR )
What is the maximum number of losses that the Minnesota Kicks had after 1979 with an average attendance of 16,605?
SELECT MAX(lost) FROM table_name_40 WHERE season > 1979 AND avg_attend = 16 OFFSET 605
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
show me the three most frequent output events since 5 years ago?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_37333 ( "Unit" text, "Russian" text, "Translation" text, "Ratio" real, "Metric value" text, "Avoirdupois value" text, "Ordinary value" text )
Which Avoirdupois value is translated to grain?
SELECT "Avoirdupois value" FROM table_37333 WHERE "Translation" = 'grain'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, ...
%sql SELECT * \ FROM INFORMATION_SCHEMA.TABLES \ WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE.
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG = '$database' AND TABLE_SCHEMA != 'sys' ORDER BY TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION
sede
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, ...
what are the five most frequently ordered procedures for patients in the age 30s until 2104?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE table_18274 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
where is the district where the incumbent is del latta?
SELECT "District" FROM table_18274 WHERE "Incumbent" = 'Del Latta'
wikisql
CREATE TABLE table_17161 ( "Suburb" text, "Population (in 2008)" real, "Median age (in 2006)" text, "Mean household size (in 2006)" text, "Area (km\u00b2)" text, "Density (/km\u00b2)" real, "Date first settled as a suburb" real, "Gazetted as a Division Name" text )
What is the date settled for 40 years?
SELECT "Date first settled as a suburb" FROM table_17161 WHERE "Median age (in 2006)" = '40 years'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
Get top users from Armenia.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE Location LIKE '%Turkey%' ORDER BY Reputation DESC
sede
CREATE TABLE table_14945608_1 ( attendance INTEGER )
What was the highest attendance?
SELECT MAX(attendance) FROM table_14945608_1
sql_create_context
CREATE TABLE table_80229 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
In 1937, what was the finish?
SELECT "Finish" FROM table_80229 WHERE "Year" = '1937'
wikisql
CREATE TABLE table_70 ( "County" text, "Precincts" real, "Lunsford" real, "% Lunsford" text, "McConnell" real, "% McConnell" text, "Total" text )
If % lunsford is 51.82% what is the % mcconnell in Letcher?
SELECT "% McConnell" FROM table_70 WHERE "% Lunsford" = '51.82%'
wikisql
CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(...
Give me the comparison about the amount of date_address_from over the date_address_from bin date_address_from by weekday by a bar chart.
SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_43 ( score VARCHAR, venue VARCHAR )
Tell me the score for Venue of tanteen recreation ground, st. george's
SELECT score FROM table_name_43 WHERE venue = "tanteen recreation ground, st. george's"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessD...
Total Questions, Answers, and Comments of 1000 most recently active users.
WITH RecentUsers AS (SELECT Posts.OwnerUserId, MAX(Posts.LastActivityDate) AS LastActivityDate, SUM(CASE WHEN Posts.PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN Posts.PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE Posts.OwnerUserId IN (SELECT Posts.Id FROM Posts ORDER BY Posts.LastActivi...
sede
CREATE TABLE table_name_5 ( played VARCHAR, drawn VARCHAR, lost VARCHAR )
how many times is there more than 0 draws and more than 0 losses?
SELECT COUNT(played) FROM table_name_5 WHERE drawn > 0 AND lost > 0
sql_create_context
CREATE TABLE table_35843 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text )
How many Januarys had records of 22-15-6?
SELECT COUNT("January") FROM table_35843 WHERE "Record" = '22-15-6'
wikisql
CREATE TABLE table_name_26 ( to_par INTEGER, score VARCHAR )
Name the sum To par for score of 71-74-71-72=288
SELECT SUM(to_par) FROM table_name_26 WHERE score = 71 - 74 - 71 - 72 = 288
sql_create_context
CREATE TABLE table_203_234 ( id number, "description" text, "total" number, "poland" number, "baltic states(resettled in poland during war)" number, "resettled in poland during war(from ussr and romania)" number, "sudetendeutsch" number, "se europe\n(hungary, romania, yugoslavia & slovak...
what is the total number of violent deaths across all regions ?
SELECT "total" FROM table_203_234 WHERE "description" = 'violent deaths'
squall
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compa...
does the PHILADELPHIA airport have a name
SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA'
atis
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
For each party, return the name of the party and the number of delegates from that party Plot them as bar chart, sort in asc by the Y-axis.
SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY AVG(COUNT(*))
nvbench
CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE station_company ( station_id number, company_id number, ran...
For each location, how many gas stations are there in order?
SELECT location, COUNT(*) FROM gas_station GROUP BY location ORDER BY COUNT(*)
spider
CREATE TABLE table_5753 ( "Season" real, "Level" text, "Division" text, "Administration" text, "Position" text )
Which Season has a Level of tier 2 and a Position of 1st?
SELECT COUNT("Season") FROM table_5753 WHERE "Level" = 'tier 2' AND "Position" = '1st'
wikisql
CREATE TABLE table_name_5 ( d_45_o VARCHAR, d_44_o VARCHAR )
Name the D 45 O with D 44 O majority
SELECT d_45_o FROM table_name_5 WHERE d_44_o = "majority →"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
Draw a bar chart about the distribution of Nationality and the average of meter_100 , and group by attribute Nationality, and order Y in desc order.
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY AVG(meter_100) DESC
nvbench
CREATE TABLE table_49818 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text )
In which county is the swann covered bridge located?
SELECT "County" FROM table_49818 WHERE "Name" = 'swann covered bridge'
wikisql
CREATE TABLE table_name_44 ( name VARCHAR, nationality VARCHAR )
Which player is from Belgium?
SELECT name FROM table_name_44 WHERE nationality = "belgium"
sql_create_context
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed...
Bin the claim date into the Day of Week interval and count them for visualizing a bar chart, and rank y axis in descending order.
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made) DESC
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
count the number of patients whose religion is jehovah's witness and lab test name is triglycerides?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEHOVAH'S WITNESS" AND lab.label = "Triglycerides"
mimicsql_data
CREATE TABLE table_name_1 ( event VARCHAR, time VARCHAR )
What is the event with a 2:08 time?
SELECT event FROM table_name_1 WHERE time = "2:08"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE club ( clubid number, clubname text, clubdes...
Find the first name and last name for the 'CTO' of the club 'Hopkins Student Enterprises'?
SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO"
spider
CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number ) CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text )
What is the name of the body builder with the greatest body weight?
SELECT T2.name FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T2.weight DESC LIMIT 1
spider
CREATE TABLE table_10073 ( "City" text, "Province" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Name the IATA with a City of budapest?
SELECT "IATA" FROM table_10073 WHERE "City" = 'budapest'
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_CLINIC_ID text, MED_DIRE_CD tex...
患者陶乐贤来之前哪些检查项目已经做过了
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '陶乐贤' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P...
css
CREATE TABLE table_13110459_2 ( overall VARCHAR, viewers__m_ VARCHAR )
what are all the overall with viewers (m) being 2.61
SELECT overall FROM table_13110459_2 WHERE viewers__m_ = "2.61"
sql_create_context
CREATE TABLE table_name_87 ( laps VARCHAR, time_retired VARCHAR )
How many laps have a Time/Retired of +12.5 secs?
SELECT COUNT(laps) FROM table_name_87 WHERE time_retired = "+12.5 secs"
sql_create_context
CREATE TABLE table_62411 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Who is the player with a t8 place?
SELECT "Player" FROM table_62411 WHERE "Place" = 't8'
wikisql
CREATE TABLE table_19369 ( "Team" text, "Average" text, "Points" real, "Played" real, "1986-87" text, "1987-88" text, "1988-89" real )
how many points did the team that scored 38 points in the 1986-87 season score during the 1988-89 season?
SELECT MIN("1988-89") FROM table_19369 WHERE "1986-87" = '38'
wikisql
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CR...
Find names of trains that run through stations for the local authority Chiltern, compare the total number of name in a bar graph, and sort in asc by the y-axis.
SELECT name, COUNT(name) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY name ORDER BY COUNT(name)
nvbench
CREATE TABLE table_21062353_1 ( opponent VARCHAR, game VARCHAR )
Who were the opponents of the Wildcats in game 4?
SELECT opponent FROM table_21062353_1 WHERE game = 4
sql_create_context
CREATE TABLE table_49611 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text )
What is No. 7, when Region (Year) is Arizona (2010)?
SELECT "No. 7" FROM table_49611 WHERE "Region (year)" = 'arizona (2010)'
wikisql
CREATE TABLE table_name_59 ( party VARCHAR, name VARCHAR )
What is the party of Richard Simpson?
SELECT party FROM table_name_59 WHERE name = "richard simpson"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
沈玉堂这个患者所有检验报告单中的标本在2002年6月12日到2006年8月24日期间内采集的都是啥呀?
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjz...
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varc...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, sort in desc by the names.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_78 ( money___£__ VARCHAR, score VARCHAR )
How much money does the player with a 68-71-68-72=279 score have?
SELECT money___£__ FROM table_name_78 WHERE score = 68 - 71 - 68 - 72 = 279
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
列出俞阳泽患者在编码0973581的医院中就诊科室名称不包含医学科的所有医疗就诊记录都有哪些?
SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '俞阳泽' AND gwyjzb.MED_SER_ORG_NO = '0973581' AND NOT gwyjzb.MED_ORG_DEPT_NM LIKE '%医学科%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '俞阳泽' AND fgwyjzb.MED_SER_ORG_NO = '0973581' AND NOT fgwyjzb.MED_ORG_DEPT_NM LIKE '%医学科%'
css
CREATE TABLE table_53846 ( "Species" text, "Strain" text, "Type" text, "Base Pairs" real, "Genes" real )
What is the largest base pair with a Strain of unspecified?
SELECT MAX("Base Pairs") FROM table_53846 WHERE "Strain" = 'unspecified'
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_CLINIC_ID text, MED_DIRE_CD tex...
患者63660143在二00七年七月二十一日到二0一0年十二月二十四日期间,总共医治过几种病
SELECT COUNT(qtb.IN_DIAG_DIS_CD) FROM qtb WHERE qtb.PERSON_ID = '63660143' AND qtb.IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24' UNION SELECT COUNT(gyb.IN_DIAG_DIS_CD) FROM gyb WHERE gyb.PERSON_ID = '63660143' AND gyb.IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24' UNION SELECT COUNT(zyb.IN_DIAG_DIS_CD) FROM zy...
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is patient 016-38131's height for the last time on the current hospital encounter?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_value_billion text ) CREATE TABLE buildings ( id number, name text, city text, height number, stories number, ...
Find the stories of the building with the largest height.
SELECT stories FROM buildings ORDER BY height DESC LIMIT 1
spider
CREATE TABLE table_name_89 ( opponent VARCHAR, score VARCHAR )
Who was the opponent when the score was 6-3, 6-3?
SELECT opponent FROM table_name_89 WHERE score = "6-3, 6-3"
sql_create_context
CREATE TABLE table_26844 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" text, "Points won" real, "New points" real, "Status" text )
What was david ferrer seeded?
SELECT MAX("Seed") FROM table_26844 WHERE "Player" = 'David Ferrer'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
whats patient 006-171217 last ward id during the previous year?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.unitadmittime DESC LIM...
eicu
CREATE TABLE table_203_254 ( id number, "position" number, "team" text, "points" number, "played" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "difference" number )
what is the total number of teams that played 1919 brazilian football ?
SELECT COUNT("team") FROM table_203_254
squall
CREATE TABLE table_13762472_3 ( game INTEGER, record VARCHAR )
What was the last game where the record was 6-3?
SELECT MAX(game) FROM table_13762472_3 WHERE record = "6-3"
sql_create_context
CREATE TABLE table_204_909 ( id number, "pollutant" text, "units" text, "emission standard" number, "coal-fired" text, "petroleum coke-fired" text )
which pollutant had the same emission standard as pm10 ?
SELECT "pollutant" FROM table_204_909 WHERE "pollutant" <> 'pm10' AND "emission standard" = (SELECT "emission standard" FROM table_204_909 WHERE "pollutant" = 'pm10')
squall
CREATE TABLE table_name_69 ( location_attendance INTEGER, team VARCHAR )
What was the attendance number for the Timberwolves game?
SELECT SUM(location_attendance) FROM table_name_69 WHERE team = "timberwolves"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
Did Prof. David Remy in Spring-Summer 2000 teach MATSCIE 480 ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MATSCIE' AND course.number = 480 AND instructor.name LIKE '%David Remy%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i...
advising
CREATE TABLE table_name_9 ( song VARCHAR, artist VARCHAR )
What song was made by the sex pistols?
SELECT song FROM table_name_9 WHERE artist = "sex pistols"
sql_create_context
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Compare the lowest rating among all movies by each title using a histogram, could you rank from high to low by the X-axis?
SELECT title, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title DESC
nvbench
CREATE TABLE table_79246 ( "Round" text, "Date" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text, "Attendance" real )
what is the round on 21 february 2009?
SELECT "Round" FROM table_79246 WHERE "Date" = '21 february 2009'
wikisql
CREATE TABLE table_204_823 ( id number, "dates" text, "location" text, "attendance" text, "official guests" text, "notes" text )
who was the only official guest on july 16-18 ?
SELECT "official guests" FROM table_204_823 WHERE "dates" = 'july 16-18, 1982'
squall
CREATE TABLE table_name_34 ( catalogue VARCHAR, date VARCHAR )
What is the catalogue on october 15, 2004?
SELECT catalogue FROM table_name_34 WHERE date = "october 15, 2004"
sql_create_context
CREATE TABLE table_name_14 ( gold INTEGER, silver INTEGER )
What is the lowest amount of gold for more than 16 silver?
SELECT MIN(gold) FROM table_name_14 WHERE silver > 16
sql_create_context
CREATE TABLE table_47844 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text...
what is 2013 when 2001 is qf and 2011 is 4r?
SELECT "2013" FROM table_47844 WHERE "2001" = 'qf' AND "2011" = '4r'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose procedure long title is excision or destruction of other lesion or tissue of heart, open approach and lab test fluid is pleural.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Excision or destruction of other lesion or tissue of heart, open approach" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
tell me the first careunit patient 11579 got since 2103?
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11579) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) >= '2103' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId num...
Relational database trends (# of Questions per Month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE table_203_447 ( id number, "constituency" number, "region" text, "name" text, "party" text, "last elected" number )
what is the first name on the table ?
SELECT "name" FROM table_203_447 WHERE id = 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
what are the two year survival rates for those who were prescribed albuterol sulfate 2.5 mg inhl neb soln after having been diagnosed with metastatic lung ca?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
What is the size of 542 ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 542
advising
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_NM = '张昊焱' AND t_kc21.CLINIC_TYPE = '门诊'
css
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, draw a bar chart about the distribution of name and price , and group by attribute headquarter, and I want to sort X-axis from high to low order please.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_name_15 ( region VARCHAR, format VARCHAR, label VARCHAR )
Which region has the format CD and label MCA?
SELECT region FROM table_name_15 WHERE format = "cd" AND label = "mca"
sql_create_context
CREATE TABLE table_204_824 ( id number, "no." number, "train no:" text, "origin" text, "destination" text, "train name" text )
how many trains originate from mangalore central ?
SELECT COUNT(*) FROM table_204_824 WHERE "origin" = 'mangalore central'
squall
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number )
Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).
SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name
spider
CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number )
What are the names of actors and the musicals that they are in?
SELECT T1.name, T2.name FROM actor AS T1 JOIN musical AS T2 ON T1.musical_id = T2.musical_id
spider
CREATE TABLE table_23325 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
What was the record in the game where McWilliams (8) did the most high rebounds?
SELECT "Record" FROM table_23325 WHERE "High rebounds" = 'McWilliams (8)'
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 demographic (...
How many patients died who had an endovascular approach procedure of excision or destruction of other lesion or tissue of heart?
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 = "Exc/des hrt les,endovasc"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what is the monthly minimum amount of rbc patient 002-41391 has since 2 years ago?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41391')) AND lab.labname = 'rbc' AND DATETIME(lab.labresulttime) >= DATETIME(C...
eicu
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, sort from high to low by the x-axis.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_31185 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Featured character(s)" text, "U.S. viewers (millions)" text, "Original air date" text )
What is the title of the episode that featured Abbud Siddiqui?
SELECT "Title" FROM table_31185 WHERE "Featured character(s)" = 'Abbud Siddiqui'
wikisql
CREATE TABLE table_75160 ( "Region" real, "Group A" text, "Group B" text, "Group C" text, "Group D" text, "Group E" text, "Group F" text )
What is the group C region with Illinois as group B?
SELECT "Group C" FROM table_75160 WHERE "Group B" = 'illinois'
wikisql
CREATE TABLE record ( id number, result text, swimmer_id number, event_id number ) CREATE TABLE swimmer ( id number, name text, nationality text, meter_100 number, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, ...
List all the event names by year from the most recent to the oldest.
SELECT name FROM event ORDER BY year DESC
spider
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart, order in desc by the total number.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_62455 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is the Club of the Player with a Date of Birth of 1979-01-29?
SELECT "Club" FROM table_62455 WHERE "Date of Birth" = '1979-01-29'
wikisql
CREATE TABLE table_name_93 ( date VARCHAR, catalog VARCHAR )
On what date was the Catalog FT 507?
SELECT date FROM table_name_93 WHERE catalog = "ft 507"
sql_create_context
CREATE TABLE table_65863 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text )
What is the total rank of the match with tipperary as the opposition?
SELECT COUNT("Rank") FROM table_65863 WHERE "Opposition" = 'tipperary'
wikisql
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Tota...
List the types of competition and the number of competitions of each type Visualize by bar chart, and I want to order the total number from high to low order.
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC
nvbench
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, ...
对于医疗费总额不少于5529.18元患者12483440的就医记录,能列出出院诊断疾病编号和名称吗?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '12483440' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5529.18)
css
CREATE TABLE table_39407 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is cornell's lowest pick number?
SELECT MIN("Pick #") FROM table_39407 WHERE "College" = 'cornell'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
what was the last time a medication was prescribed to patient 5395?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii