context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 prescriptions ( row_id number, subject_id number, h...
tell me the maximum sao2 in patient 4368 on 05/24/this year?
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'...
mimic_iii
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type...
Show the number of documents created in each day and bin document date by year interval with a line chart, display in desc by the Document_Date please.
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date DESC
nvbench
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,...
Let me know the number of patients with diagnoses icd9 code 49320 who had a urine test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "49320" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_43387 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many Gold medals did Great Britain with a Total of more than 2 medals receive?
SELECT MIN("Gold") FROM table_43387 WHERE "Nation" = 'great britain' AND "Total" > '2'
wikisql
CREATE TABLE table_20574 ( "Date (CE)" text, "Text" text, "Simplified characters" text, "Traditional characters" text, "Pinyin" text, "Wade-Giles" text, "Literal meaning" text )
Name the pinyin for 657 date
SELECT "Pinyin" FROM table_20574 WHERE "Date (CE)" = '657'
wikisql
CREATE TABLE table_70169 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Podiums" real )
How many wins has a podiums greater than 1 and 9 as the races with a season after 1984?
SELECT COUNT("Wins") FROM table_70169 WHERE "Podiums" > '1' AND "Races" = '9' AND "Season" > '1984'
wikisql
CREATE TABLE mzb ( 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...
能知道医疗机构8227829金额排在前二十四名的项目吗
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.MED_SER_ORG_NO = '8227829' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 24 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.ME...
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
给病人72447719审核检验报告的人员工号及姓名是什么,在医疗就诊00619973238中
SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '00619973238'
css
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
Show the amount for all the payments processed with Visa distributing the payment date with a bar chart, display in descending by the Date_Payment_Made please.
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made DESC
nvbench
CREATE TABLE table_50675 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What was the finish for the golfer with a total of 285?
SELECT "Finish" FROM table_50675 WHERE "Total" = '285'
wikisql
CREATE TABLE table_name_46 ( away_team VARCHAR, tie_no VARCHAR )
For the Tie number of 14 who was the away team?
SELECT away_team FROM table_name_46 WHERE tie_no = "14"
sql_create_context
CREATE TABLE table_9537 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What 2009 has statistics by surface in 2012?
SELECT "2009" FROM table_9537 WHERE "2012" = 'statistics by surface'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
在2012年12月29日到13年8月9日期间,医疗机构5217265的科室476处理的住院就诊数是多少?
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '5217265' AND JZKSDM = '476' AND RYDJSJ BETWEEN '2012-12-29' AND '2013-08-09'
css
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 did not have any job in the past, give me the comparison about the average of department_id over the job_id , and group by attribute job_id.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE table_72689 ( "Conflict" text, "United Nations Mission" text, "Sexual abuse 1" real, "Murder 2" real, "Extortion/Theft 3" text )
What is the sexual abuse rate where the conflict is the Burundi Civil War?
SELECT MAX("Sexual abuse 1") FROM table_72689 WHERE "Conflict" = 'Burundi Civil War'
wikisql
CREATE TABLE table_51415 ( "Air Date" text, "Timeslot (EST)" text, "Season" text, "Rating" real, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" real, "Weekly Rank (#)" text )
What is the highest number of viewers for a rating greater than 9.4?
SELECT MAX("Viewers (m)") FROM table_51415 WHERE "Rating" > '9.4'
wikisql
CREATE TABLE table_47602 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the score when the home team was Stockport County?
SELECT "Score" FROM table_47602 WHERE "Home team" = 'stockport county'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
能知道患者苏家欣在2000.2.24到2009.4.29这段时间曾经去过哪几家医院看病吗
SELECT COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '苏家欣' AND IN_HOSP_DATE BETWEEN '2000-02-24' AND '2009-04-29'
css
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...
病号21701297在2000年5月29日到2009年5月18日内期间所有检验结果指标记录中使用的仪器编号还有名称都叫什么
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_15518 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the average round of the match in the Hero's 9 event with a time of 5:00?
SELECT AVG("Round") FROM table_15518 WHERE "Time" = '5:00' AND "Event" = 'hero''s 9'
wikisql
CREATE TABLE table_51453 ( "Opponent" text, "Result" text, "Score" text, "Date" text, "Venue" text )
Who won that game on 24 July 2010?
SELECT "Result" FROM table_51453 WHERE "Date" = '24 july 2010'
wikisql
CREATE TABLE table_name_80 ( ends VARCHAR, transfer_fee VARCHAR )
What is the total number of ends when the transfer fee was dkk 14m?
SELECT COUNT(ends) FROM table_name_80 WHERE transfer_fee = "dkk 14m"
sql_create_context
CREATE TABLE table_10881 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
Which Event has the Opponent, Jason Yee?
SELECT "Event" FROM table_10881 WHERE "Opponent" = 'jason yee'
wikisql
CREATE TABLE table_name_21 ( away_team VARCHAR )
What did South Melbourne score when they were the Away team?
SELECT away_team AS score FROM table_name_21 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_11462 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2007 value with NMS in 2011?
SELECT "2007" FROM table_11462 WHERE "2011" = 'nms'
wikisql
CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE staff_roles ( role_code text, role_description text ) CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE organisati...
How many kinds of roles are there for the staff?
SELECT COUNT(DISTINCT role_code) FROM project_staff
spider
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, ...
when was the first time that patient 007-849 on the last intensive care unit visit had systemicmean less than 215.0?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849') AND NOT patient.unitdischargetime IS NULL...
eicu
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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 TA...
show me the flights from SAN FRANCISCO to DALLAS
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_203_449 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text )
how many novelists are listed ?
SELECT COUNT(*) FROM table_203_449 WHERE "notable as" = 'novelist'
squall
CREATE TABLE bdmzjzjlb ( 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, MZZYZDZ...
在两千年七月三十日至两千零四年二月二十九日期间医院4897749有几科室在门诊就诊中开出了超过30张检验报告单?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '4897749' AND jybgb.BGRQ BETWEEN '2000-07-30' AND '2004-02-29' GROUP BY jybgb.KSBM HAVING COUNT(*) > 30 UNION SELECT jybgb.KSBM FROM bdmzjzjlb J...
css
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, ...
在2009年8月1日到2015年7月7日期间编码为8000303的医院入院诊断疾病结果与出院诊断疾病结果不同的医疗就诊记录有哪些例?
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8000303' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-08-01' AND '2015-07-07' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8000303' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2009-08-01' AND '2015-07-07' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '800030...
css
CREATE TABLE table_23486853_8 ( score VARCHAR, location VARCHAR, points VARCHAR )
What is every score at the location of Verizon Center and points of 68?
SELECT score FROM table_23486853_8 WHERE location = "Verizon Center" AND points = 68
sql_create_context
CREATE TABLE table_59626 ( "Player" text, "Team" text, "Matches" real, "Overs" real, "Runs" real, "Wickets" real, "Best" text, "Econ" real, "S/Rate" real, "4/inns" real, "5+/inns" real, "Average" real )
What is the average wickets that have overs greater than 44, danish kaneria as the player, with an average greater than 13.8?
SELECT AVG("Wickets") FROM table_59626 WHERE "Overs" > '44' AND "Player" = 'danish kaneria' AND "Average" > '13.8'
wikisql
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...
how many patients are admitted before the year 2170 and used the drug clobetasol propionate 0.05% oinment?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.drug = "Clobetasol Propionate 0.05% Ointment"
mimicsql_data
CREATE TABLE table_76273 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is High Points, when Game is less than 10, and when High Assists is 'Chauncey Billups (8)'?
SELECT "High points" FROM table_76273 WHERE "Game" < '10' AND "High assists" = 'chauncey billups (8)'
wikisql
CREATE TABLE table_33047 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Carlton's score when they were the away team?
SELECT "Away team score" FROM table_33047 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_1566852_4 ( centerfold_model VARCHAR, cover_model VARCHAR )
How many centerfold models were there when the cover model was Torrie Wilson?
SELECT COUNT(centerfold_model) FROM table_1566852_4 WHERE cover_model = "Torrie Wilson"
sql_create_context
CREATE TABLE table_71210 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who took the loss on May 25?
SELECT "Loss" FROM table_71210 WHERE "Date" = 'may 25'
wikisql
CREATE TABLE table_38228 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
Which Date has a Visitor of boston?
SELECT "Date" FROM table_38228 WHERE "Visitor" = 'boston'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jo...
What are all the courses for Other ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_train_3 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "mean_arterial_pressure_map" int, "leukocyte_count" int, "renal_disease" bool, "temperature" float, "sepsis" bool, "hypotension" bool, "heart_rate" i...
patient age > 18 years
SELECT * FROM table_train_3 WHERE age > 18
criteria2sql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE...
select count(*) from posts where posts.ViewCount > 58000;.
SELECT COUNT(*) FROM Posts WHERE Posts.ViewCount > 58000
sede
CREATE TABLE table_18499 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's the result with dbeingtrict being florida 4
SELECT "Result" FROM table_18499 WHERE "District" = 'Florida 4'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE cite ( ...
How many papers does michael i. jordan have in 2016 ?
SELECT DISTINCT COUNT(writes.paperid) FROM author, paper, writes WHERE author.authorname = 'michael i. jordan' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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...
病人名叫周泰宁在11年11月14日到13年6月11日内什么时间审核检验报告单的具体时间都是什么?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
give me the number of patients with hypopotassemia diagnoses who have both eyes as route of drug administration.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypopotassemia" AND prescriptions.route = "BOTH EYES"
mimicsql_data
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Show the average price of the rooms in different decor using a bar chart, sort from low to high by the X please.
SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor ORDER BY decor
nvbench
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
Draw a bar chart for what is average age of male for different job title?, order by the job in asc.
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_name_24 ( position VARCHAR, pick VARCHAR, college VARCHAR )
What position did the player from Rice College play who was picked under 15?
SELECT position FROM table_name_24 WHERE pick < 15 AND college = "rice"
sql_create_context
CREATE TABLE table_7814 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the sum of top-10 values for the Open Championship and less than 3 in the top-25?
SELECT SUM("Top-10") FROM table_7814 WHERE "Tournament" = 'the open championship' AND "Top-25" < '3'
wikisql
CREATE TABLE table_name_2 ( series VARCHAR, season VARCHAR )
What is Series, when Season is 2007?
SELECT series FROM table_name_2 WHERE season = 2007
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...
Number of custom off-topic close reasons for each site.
SELECT COUNT(*) FROM CloseAsOffTopicReasonTypes WHERE NOT ApprovalDate IS NULL AND DeactivationDate IS NULL
sede
CREATE TABLE table_22020 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
Which club had 2 wins and 1 draw?
SELECT "Club" FROM table_22020 WHERE "Drawn" = '1' AND "Won" = '2'
wikisql
CREATE TABLE table_1231316_5 ( fastest_time__s_ VARCHAR, nation VARCHAR )
Nigeria had the fastest time once.
SELECT COUNT(fastest_time__s_) FROM table_1231316_5 WHERE nation = "Nigeria"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose age is less than 24 and procedure long title is endoscopic removal of stone(s) from biliary tract?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "24" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
mimicsql_data
CREATE TABLE table_35497 ( "Player" text, "Position" text, "Overall Pick" real, "Round" text, "NFL Draft" real, "Franchise" text )
What is the highest NFL Draft that has jeff robinson as the player, with an overall pick less than 98?
SELECT MAX("NFL Draft") FROM table_35497 WHERE "Player" = 'jeff robinson' AND "Overall Pick" < '98'
wikisql
CREATE TABLE table_77984 ( "Player" text, "Position" text, "Round" real, "Pick" real, "NFL Club" text )
What was the latest round that Derek Pagel was selected with a pick higher than 50?
SELECT MAX("Round") FROM table_77984 WHERE "Pick" > '50' AND "Player" = 'derek pagel'
wikisql
CREATE TABLE table_name_4 ( date VARCHAR, score VARCHAR, opponents VARCHAR )
What is Date, when Score is '0-2', and when Opponents is 'Bayer Leverkusen'?
SELECT date FROM table_name_4 WHERE score = "0-2" AND opponents = "bayer leverkusen"
sql_create_context
CREATE TABLE table_name_17 ( d_40 VARCHAR, d_44 VARCHAR )
I want the D 40 with D 44 of d 15
SELECT d_40 FROM table_name_17 WHERE d_44 = "d 15"
sql_create_context
CREATE TABLE table_20680 ( "Dates (MDY)" text, "Position" real, "Gross sales" text, "Tickets sold / available" text, "Sellout (%)" text )
What is the position of tickets sold/available when the sellout is 82%?
SELECT COUNT("Tickets sold / available") FROM table_20680 WHERE "Sellout (%)" = '82%'
wikisql
CREATE TABLE table_16713 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
what's the pole position with location being hockenheimring
SELECT "Pole Position" FROM table_16713 WHERE "Location" = 'Hockenheimring'
wikisql
CREATE TABLE table_4685 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who is the away team when the home team scores 12.20 (92)?
SELECT "Away team" FROM table_4685 WHERE "Home team score" = '12.20 (92)'
wikisql
CREATE TABLE table_8218 ( "University" text, "Common short form and abbreviation" text, "Location" text, "Enrollment" real, "Athletics nickname" text, "School Colors" text, "Founded" text, "Student newspaper" text )
Which School Colors has an Enrollment larger than 15,664, and Founded of 1910, and a Location of bowling green?
SELECT "School Colors" FROM table_8218 WHERE "Enrollment" > '15,664' AND "Founded" = '1910' AND "Location" = 'bowling green'
wikisql
CREATE TABLE table_name_1 ( tournament VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR )
What tournament had a victory of a 1 stroke margin and the final winning score 69-75-71-70?
SELECT tournament FROM table_name_1 WHERE margin_of_victory = "1 stroke" AND winning_score = "69-75-71-70"
sql_create_context
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...
Posts that contain inline code formatting.
SELECT Id AS "post_link" FROM Posts WHERE Body LIKE '%<code>%' AND OwnerUserId = @UserID ORDER BY CreationDate DESC
sede
CREATE TABLE table_42301 ( "Aces" real, "Player" text, "Opponent" text, "Year" real, "Event" text, "Sets" real, "Result" text )
what's the earliest year that serena williams had more than 2 sets?
SELECT MIN("Year") FROM table_42301 WHERE "Player" = 'serena williams' AND "Sets" > '2'
wikisql
CREATE TABLE table_27387 ( "Language" text, "Quillacollo Municipality" real, "Sipe Sipe Municipality" real, "Tiquipaya Municipality" real, "Vinto Municipality" real, "Colcapirhua Municipality" real )
What is the Sipe Sipe Municipality minimum if the language is Quechua?
SELECT MIN("Sipe Sipe Municipality") FROM table_27387 WHERE "Language" = 'Quechua'
wikisql
CREATE TABLE table_472 ( "Year" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winners share ($)" real )
What is the winners Share ($) in the year 2004?
SELECT MIN("Winners share ($)") FROM table_472 WHERE "Year" = '2004'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
when was patient 29635's last microbiological examination when they came to the hospital last time?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29635 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
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 ...
how many of the patients with infected right thigh graft had coronary arteriogr-1 cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT" AND procedures.short_title = "Coronar arteriogr-1 cath"
mimicsql_data
CREATE TABLE table_204_232 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country scored the least medals ?
SELECT "nation" FROM table_204_232 WHERE "total" = (SELECT MIN("total") FROM table_204_232)
squall
CREATE TABLE table_15743 ( "Discipline" text, "2003 Cadiz" text, "2007 Cascais" text, "2011 Perth" text, "2014 Santander" text )
Which Discipline has a 2007 laser radial Cascais ?
SELECT "Discipline" FROM table_15743 WHERE "2007 Cascais" = 'laser radial'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
在一六年十二月二十七日到二零年九月十九日这段时间内,找医生06844302看病的门诊病人有多少
SELECT COUNT(person_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGD...
css
CREATE TABLE table_78974 ( "Lexton Plains" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What team has fewer than 9 wins and less than 1593 against?
SELECT "Lexton Plains" FROM table_78974 WHERE "Wins" < '9' AND "Against" < '1593'
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 (...
find the procedure icd9 code for patient with patient id 10317.
SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "10317"
mimicsql_data
CREATE TABLE table_53115 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the Lightning's record at their home game against Carolina with an attendance over 16,526 and a decision of Holmqvist?
SELECT "Record" FROM table_53115 WHERE "Decision" = 'holmqvist' AND "Attendance" > '16,526' AND "Visitor" = 'carolina'
wikisql
CREATE TABLE table_name_45 ( winning_driver VARCHAR, round VARCHAR )
Which Winning Driver has a Round of 9?
SELECT winning_driver FROM table_name_45 WHERE round = 9
sql_create_context
CREATE TABLE table_25773116_2 ( location VARCHAR, round VARCHAR )
Where was the round 1 race?
SELECT location FROM table_25773116_2 WHERE round = 1
sql_create_context
CREATE TABLE table_71978 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Name the tournament for grass surface and opponent in the final being paul baccanello
SELECT "Tournament" FROM table_71978 WHERE "Surface" = 'grass' AND "Opponent in the final" = 'paul baccanello'
wikisql
CREATE TABLE table_name_22 ( opposition VARCHAR, date VARCHAR )
Who was the opposition in the game on July 29?
SELECT opposition FROM table_name_22 WHERE date = "july 29"
sql_create_context
CREATE TABLE table_15173 ( "Stage" text, "Date" text, "Course" text, "Distance" text, "Winner" text, "Race Leader" text )
What's the distance of the course of stage 4?
SELECT "Distance" FROM table_15173 WHERE "Stage" = '4'
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...
医疗记录中医院0869256的出院诊断,统计其急性支气管炎的最低和最高医疗费总数目都是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '0869256' AND qtb.OUT_DIAG_DIS_NM = '急性支气管炎' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '0869256' AND gyb.OUT_DIAG_DIS_NM = '急性支气管炎' UNION S...
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
名叫袁秀筠的患者检测指标634250从09年10月15日到14年10月24日的情况如何?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG...
css
CREATE TABLE table_67651 ( "Res." text, "Record" text, "Opponent" text, "Type" text, "Rd., Time" text, "Date" text )
What is the type of the match with a win result and Michael Gomez as the opponent?
SELECT "Type" FROM table_67651 WHERE "Res." = 'win' AND "Opponent" = 'michael gomez'
wikisql
CREATE TABLE table_name_78 ( Severe INTEGER, tropical_cyclones VARCHAR, tropical_lows VARCHAR )
What is the highest number of severe tropical cyclones when there are 10 tropical cyclones and 14 tropical lows?
SELECT MAX(Severe) AS tropical_cyclones FROM table_name_78 WHERE tropical_cyclones = 10 AND tropical_lows = 14
sql_create_context
CREATE TABLE table_204_804 ( id number, "version" text, "length" text, "album" text, "remixed by" text, "year" number, "comment" text )
how many songs were remixed by garraund ?
SELECT COUNT(*) FROM table_204_804 WHERE "remixed by" = 'joachim garraud'
squall
CREATE TABLE table_name_71 ( change VARCHAR, share VARCHAR )
Name the change with share of 2.9%
SELECT change FROM table_name_71 WHERE share = "2.9%"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
what was the top four most frequent diagnoses that patients were given within the same hospital visit after receiving a digoxin until 2 years ago?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'digox...
eicu
CREATE TABLE table_name_41 ( district VARCHAR, party VARCHAR, results VARCHAR )
What district is the incumbent Republican and the incumbent retired to run for governor democratic gain?
SELECT district FROM table_name_41 WHERE party = "republican" AND results = "retired to run for governor democratic gain"
sql_create_context
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE va...
Show the relation between max(stu gpa) and the average of stu gpa for each DEPT_CODE using a scatter chart
SELECT MAX(STU_GPA), AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
Questions and Accepted Answer: Search the set.
SELECT p1.Id AS "post_link", p1.*, p2.Id AS "post_link", p2.Id AS "post_link", p2.Score AS "p2Score", p2.Body AS "p2Body", p2.OwnerUserId AS "p2UserId", p2.OwnerDisplayName AS "p2OwnerDisplayName", p2.CommentCount AS "p2CommentCount" FROM Posts AS p1, Posts AS p2 WHERE p1.ParentId IS NULL AND NOT p1.AcceptedAnswerId IS...
sede
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 marital status as well as preferred language of the patient with patient id 2560.
SELECT demographic.marital_status, demographic.language FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_33447 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Report" text )
What time was the fastest lap during Stoh's 200 in 1982?
SELECT "Fastest Lap" FROM table_33447 WHERE "Name" = 'stoh''s 200'
wikisql
CREATE TABLE table_train_89 ( "id" int, "chronically_uncontrolled_hypertension" bool, "uncontrolled_diabetes" bool, "hemoglobin_a1c_hba1c" float, "body_weight" float, "renal_disease" bool, "creatinine_clearance_cl" float, "geriatric_depression_scale_gds" int, "major_depression" bool,...
active renal disease.
SELECT * FROM table_train_89 WHERE renal_disease = 1
criteria2sql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
Posting activity by hour of day.
SELECT HourOfDay, COUNT(*) AS PostCount FROM (SELECT TIME_TO_STR(DATE(CreationDate, '##UTCTimeShift## hh'), '%I') AS HourOfDay FROM Posts WHERE OwnerUserId = '##UserId##') AS sub GROUP BY HourOfDay ORDER BY HourOfDay
sede
CREATE TABLE table_1341930_5 ( party VARCHAR, incumbent VARCHAR )
Name the number of party with the incubent james william trimble
SELECT COUNT(party) FROM table_1341930_5 WHERE incumbent = "James William Trimble"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
Is there a way to find out how many edits have made by user. suport query for https://meta.stackexchange.com/questions/291912/is-there-a-way-to-find-out-how-many-edits-ive-made-network-wide
SELECT SUM('4') AS "title", SUM('5') AS "body", SUM('6') AS "tag", COUNT(*) AS "revtot" FROM (SELECT RevisionGUID, '4', '5', '6' FROM (SELECT RevisionGUID, PostHistoryTypeId FROM PostHistory AS ph INNER JOIN Users AS u ON u.Id = ph.UserId WHERE PostHistoryTypeId IN (4, 5, 6) AND AccountId = @accountid) AS data PIVOT(CO...
sede
CREATE TABLE table_21725 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
How many verbs mean to grow, to produce
SELECT COUNT("Part 1") FROM table_21725 WHERE "Verb meaning" = 'to grow, to produce'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
How many words have a user written all together?.
SELECT SUM(LENGTH(Body) - LENGTH(REPLACE(Body, ' ', '')) + 1) AS NumbofWords FROM Posts AS p WHERE p.OwnerUserId = '##UserId##'
sede
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
Can I take both these classes in the same semester , MUSTHTRE 441 and MUSTHTRE 133 ?
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'MUSTHTRE' AND COU...
advising