context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_203_613 ( id number, "formula" text, "color" text, "symmetry" text, "space group" text, "no" number, "pearson symbol" text, "a (pm)" number, "b (pm)" number, "c (pm)" number, "z" number, "density, g/cm3" number )
what is the pearson symbol for the formula with the lightest density ?
SELECT "formula" FROM table_203_613 ORDER BY "density, g/cm3" LIMIT 1
squall
CREATE TABLE table_29129 ( "Name" text, "Position" text, "Height" text, "Weight" real, "Age" real, "Home Town" text, "Team/School" text )
How tall is the player from farmington, ky?
SELECT "Height" FROM table_29129 WHERE "Home Town" = 'Farmington, KY'
wikisql
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 ) ...
for the last time until 07/2103, when was patient 025-33728 prescribed narcan and miralax at the same time?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'narcan' AND patient.uniquepid = '025-33728' AND STRFTIME('%y-%m', medication.drugstarttime) <= '2103-07') AS t1 JOIN (SEL...
eicu
CREATE TABLE table_name_33 ( design VARCHAR, denomination VARCHAR )
What stamp design has a denomination of $1.18?
SELECT design FROM table_name_33 WHERE denomination = "$1.18"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
那个编号是66824026743的医疗就诊中药品6637开出的医疗发票项目类别有几种?
SELECT t_kc22.MED_INV_ITEM_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '66824026743' AND t_kc22.SOC_SRT_DIRE_CD = '6637'
css
CREATE TABLE table_204_230 ( id number, "team #1" text, "agg." text, "team #2" text, "1st match" text, "2nd match" text )
what was the total amount of points scored between topolniky and union landhaus in the 1st match ?
SELECT "1st match" + "1st match" FROM table_204_230 WHERE "team #1" = 'topolniky'
squall
CREATE TABLE table_name_55 ( award VARCHAR, category VARCHAR )
Which award is in the category of best music video?
SELECT award FROM table_name_55 WHERE category = "best music video"
sql_create_context
CREATE TABLE table_55520 ( "Rank" real, "Name" text, "Nation" text, "SP+FS" real, "Points" real, "Places" real )
What is the highest SP+FS that has 131.02 Points, and a Rank larger than 15?
SELECT MAX("SP+FS") FROM table_55520 WHERE "Points" = '131.02' AND "Rank" > '15'
wikisql
CREATE TABLE table_52772 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" text, "Record" text )
What location had a final score of W 30 5?
SELECT "Location" FROM table_52772 WHERE "Final Score" = 'w 30 – 5'
wikisql
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 prescription...
how many patients with diagnoses icd9 code 99591 are below the age of 76?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "76" AND diagnoses.icd9_code = "99591"
mimicsql_data
CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested in...
Show each county along with the number of schools, and could you rank by the x-axis in asc?
SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY County
nvbench
CREATE TABLE table_160728_4 ( network VARCHAR, station VARCHAR )
What station on the network is tv3?
SELECT network FROM table_160728_4 WHERE station = "TV3"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_co...
what was the maximum yearly number of patients who were admitted for syst/diast hrt fail nos until 1 year ago?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'syst/diast hrt fail nos') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')...
mimic_iii
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
Compare the average of artists' age by country in a bar graph, and could you show Country from low to high order?
SELECT Country, AVG(Age) FROM artist GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREA...
who has written the most papers on semantic parsing ?
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY CO...
scholar
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_i...
what is the average potassium, whole blood value in 05/this year for patient 12367?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12367) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium, whole blood') AND DATETIME(labevents.charttime, 'start of year')...
mimic_iii
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_co...
TAMPA to CHARLOTTE sunday morning
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 27 AND DATE_DAYalias0.month_number = 8 AND DATE_DAYalias0.year = 1991)) AND to...
atis
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 ( ...
give me long title of procedure and route of drug administration for patient marilyn norvell.
SELECT procedures.long_title, prescriptions.route FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell"
mimicsql_data
CREATE TABLE table_64839 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the bronze number for the nation with less than 0 gold?
SELECT MIN("Bronze") FROM table_64839 WHERE "Gold" < '0'
wikisql
CREATE TABLE table_45705 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What round of the draft was Stan Adams selected?
SELECT AVG("Round") FROM table_45705 WHERE "Player" = 'stan adams'
wikisql
CREATE TABLE table_name_60 ( total VARCHAR, set_2 VARCHAR )
Which Total has a Set 2 of 19 25?
SELECT total FROM table_name_60 WHERE set_2 = "19–25"
sql_create_context
CREATE TABLE table_name_94 ( crowd INTEGER, venue VARCHAR )
What is the smallest crowd at the Victoria Park Venue?
SELECT MIN(crowd) FROM table_name_94 WHERE venue = "victoria park"
sql_create_context
CREATE TABLE table_name_17 ( rank VARCHAR, cause_of_death VARCHAR, badge_serial_number VARCHAR )
What is the Rank of the Officer with Badge/Serial Number 11755 who died in Gunfire?
SELECT rank FROM table_name_17 WHERE cause_of_death = "gunfire" AND badge_serial_number = "11755"
sql_create_context
CREATE TABLE table_name_59 ( money___ INTEGER, country VARCHAR, to_par VARCHAR, score VARCHAR )
How much is the money ($) when the country is united states, to par is e and the score is 72-75-70-71=288?
SELECT SUM(money___) AS $__ FROM table_name_59 WHERE country = "united states" AND to_par = "e" AND score = 72 - 75 - 70 - 71 = 288
sql_create_context
CREATE TABLE table_1132588_3 ( pole_position VARCHAR, constructor VARCHAR, grand_prix VARCHAR )
What is the pole position for the ferrari at the austrian grand prix?
SELECT pole_position FROM table_1132588_3 WHERE constructor = "Ferrari" AND grand_prix = "Austrian grand_prix"
sql_create_context
CREATE TABLE table_1979619_3 ( district INTEGER, residence VARCHAR )
Name the district for newtown square
SELECT MIN(district) FROM table_1979619_3 WHERE residence = "Newtown Square"
sql_create_context
CREATE TABLE table_name_44 ( build_year VARCHAR, total_production VARCHAR )
Tell me the build year for total production of 150
SELECT build_year FROM table_name_44 WHERE total_production = 150
sql_create_context
CREATE TABLE table_1566848_7 ( pictorials VARCHAR, centerfold_model VARCHAR )
Who were the pictorials when the centerfold model was Ava Fabian?
SELECT pictorials FROM table_1566848_7 WHERE centerfold_model = "Ava Fabian"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
Retrieve Answered Posts Tagged as 'Java' (and may contain othe) Created In The Month of January 2018.
SELECT Q.Id, Q.AcceptedAnswerId, Q.CreationDate, Q.Score, Q.Body AS "Question Body", Q.Title AS "Question Title", A.Body AS "Answer Body", Q.Tags FROM Posts AS Q INNER JOIN Posts AS A ON Q.AcceptedAnswerId = A.Id INNER JOIN PostTags AS PT ON PT.PostId = Q.Id WHERE PT.TagId = 17 AND Q.CreationDate BETWEEN '2018-01-01' A...
sede
CREATE TABLE table_12071 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the number of wins that has a top-10 of 2, and more events than 8, more cuts than 6?
SELECT COUNT("Wins") FROM table_12071 WHERE "Top-10" = '2' AND "Events" > '8' AND "Cuts made" > '6'
wikisql
CREATE TABLE table_18788823_5 ( position_in_table VARCHAR, outgoing_manager VARCHAR )
How many times did Keith Downing depart a position?
SELECT COUNT(position_in_table) FROM table_18788823_5 WHERE outgoing_manager = "Keith Downing"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score num...
Stack Overflow questions with outstanding close votes (PHP Tag). A list of Stack Overflow questions with outstanding close votes, sorted by number of votes.
SELECT * FROM (SELECT Posts.Id AS "post_link", AVG(Posts.Score) AS "score", COUNT(*) AS "close_votes", MAX(Votes.CreationDate) AS "last_vote", MIN(Votes.CreationDate) AS "first_vote" FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 6 AND Posts.ClosedDate IS NULL AND Posts.Tags LIKE '%<php...
sede
CREATE TABLE table_name_95 ( date VARCHAR, venue VARCHAR )
On what date was the venue at Brisbane Cricket Ground?
SELECT date FROM table_name_95 WHERE venue = "brisbane cricket ground"
sql_create_context
CREATE TABLE table_name_91 ( goals INTEGER, matches VARCHAR, rank VARCHAR )
What is the average number of goals for players ranked above 9 and playing more than 205 matches?
SELECT AVG(goals) FROM table_name_91 WHERE matches = 205 AND rank > 9
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
Specify the number of patients who were discharged to home after sm bowel endoscopy nec
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Sm bowel endoscopy NEC"
mimicsql_data
CREATE TABLE table_75910 ( "Rank" real, "Name" text, "Built" real, "Height" text, "Floors" real )
What is the lowest Built, when Floors is greater than 23, and when Rank is 3?
SELECT MIN("Built") FROM table_75910 WHERE "Floors" > '23' AND "Rank" = '3'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE...
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 sum of manager_id , and group by attribute job_id, list y-axis in descending order.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_36 ( grid INTEGER, laps VARCHAR, driver VARCHAR )
what average grid has laps larger than 52 and contains the driver of andrea de adamich?
SELECT AVG(grid) FROM table_name_36 WHERE laps > 52 AND driver = "andrea de adamich"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
how many patients were treated with a procedure-one vessel since 6 years ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'procedure-one vessel') AND DATETIME(procedures_icd.c...
mimic_iii
CREATE TABLE bridge ( length_meters INTEGER, architect_id VARCHAR ) CREATE TABLE architect ( name VARCHAR, id VARCHAR )
What is the maximum length in meters for the bridges and what are the architects' names?
SELECT MAX(T1.length_meters), T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id
sql_create_context
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 employees ( EMPLOYEE_ID decimal(6,0...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, rank by the bars in desc please.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
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 did patient 028-45581 get diagnosed with in 2102 for the first time?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-45581')) AND STRFTIME('%y', diagnosis.diagnosistime) = '2102'...
eicu
CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boarding text, year_entered_competition number, school_colors text ) CREATE TABLE school_details ( school_id number, nickn...
What are the denomination more than one school have?
SELECT denomination FROM school GROUP BY denomination HAVING COUNT(*) > 1
spider
CREATE TABLE table_32402 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which week had an attendance of 70,225
SELECT MIN("Week") FROM table_32402 WHERE "Attendance" = '70,225'
wikisql
CREATE TABLE table_19112_3 ( profits__billion_$_ VARCHAR, market_value__billion_$_ VARCHAR )
Name the profits for market value of 11.8
SELECT profits__billion_$_ FROM table_19112_3 WHERE market_value__billion_$_ = "11.8"
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...
在965科室因疾病U57.745在08年12月24到2011年6月4日内住院的平均费用是多少?
SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '965' AND zyb.IN_HOSP_DAYS BETWEEN '2008-12-24' AND '2011-06-04' AND zyb.IN_DIAG_DIS_NM = 'U57.745'
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
how many patients are diagnosed with urinary tract infection nos and have sI drug route?
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 = "Urin tract infection NOS" AND prescriptions.route = "SL"
mimicsql_data
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, ...
从10年8月28日起到16年3月5日内参保人张阳冰10元以内小金额结算次数总共有多少次?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '张阳冰' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-08-28' AND '2016-03-05' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.P...
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 varc...
For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, and show Y-axis in descending order.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC
nvbench
CREATE TABLE table_name_60 ( date VARCHAR, score VARCHAR )
What was the date of the game that had a score of 3 1?
SELECT date FROM table_name_60 WHERE score = "3 – 1"
sql_create_context
CREATE TABLE table_35778 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the score of the Boston Bruins game from April 11?
SELECT "Score" FROM table_35778 WHERE "Home" = 'boston bruins' AND "Date" = 'april 11'
wikisql
CREATE TABLE table_1964 ( "#" real, "Player" text, "Country" text, "Points" real, "Events" real, "Reset Points" real )
Name the number of events for reset points being 98625
SELECT COUNT("Events") FROM table_1964 WHERE "Reset Points" = '98625'
wikisql
CREATE TABLE table_name_93 ( cumulative_time__min_and_seconds_ VARCHAR, shuttle_time__seconds_ VARCHAR, total_level_time__s_ VARCHAR )
What is the cumulative time (min and seconds) that has more than 6 seconds in shuttle time and a total level time of 64.8 seconds?
SELECT cumulative_time__min_and_seconds_ FROM table_name_93 WHERE shuttle_time__seconds_ > 6 AND total_level_time__s_ = 64.8
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTy...
Most recent comments on answers in a given tag.
SELECT c.UserId AS "user_link", c.CreationDate, c.Id AS "comment_link", c.PostId AS "post_link", c.Text FROM Comments AS c JOIN Posts AS p ON c.PostId = p.Id JOIN Posts AS q ON p.ParentId = q.Id WHERE (p.PostTypeId = 2) AND (q.Tags LIKE '%<##tagName?gn.general-topology##>%') ORDER BY CreationDate DESC LIMIT 500
sede
CREATE TABLE table_64432 ( "Fuel gas" text, "Upper index Kcal/ Nm 3" real, "Lower index Kcal/ Nm 3" real, "Upper index MJ/ Nm 3" real, "Lower index MJ/ Nm 3" real )
What is the average upper index MJ/Nm 3 for the upper index Kcal/Nm 3 entry of 19,376?
SELECT AVG("Upper index MJ/ Nm 3") FROM table_64432 WHERE "Upper index Kcal/ Nm 3" = '19,376'
wikisql
CREATE TABLE table_28750 ( "Episode number (Production number)" text, "Title" text, "Original air date" text, "Total viewers on FX" text, "Total viewers on FX+" text, "Total viewers" text, "Rank on channel" text )
Name the total viewers on fx+ for night on the sun
SELECT "Total viewers on FX+" FROM table_28750 WHERE "Title" = 'Night on the Sun'
wikisql
CREATE TABLE table_58507 ( "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
What is the chassis for Bruce Mclaren with all rounds and a g tyre?
SELECT "Chassis" FROM table_58507 WHERE "Rounds" = 'all' AND "Tyre" = 'g' AND "Driver" = 'bruce mclaren'
wikisql
CREATE TABLE table_name_41 ( artist VARCHAR, year VARCHAR )
what artist won in 1953
SELECT artist FROM table_name_41 WHERE year = "1953"
sql_create_context
CREATE TABLE table_name_73 ( duration VARCHAR, translation VARCHAR )
Which one of the duration has a translation of 1000 lies?
SELECT duration FROM table_name_73 WHERE translation = "1000 lies"
sql_create_context
CREATE TABLE table_name_47 ( cuts_made VARCHAR, events INTEGER )
What is the total number of cuts made when the events are more than 3?
SELECT COUNT(cuts_made) FROM table_name_47 WHERE events > 3
sql_create_context
CREATE TABLE table_name_9 ( goals INTEGER, name VARCHAR, ends VARCHAR )
What is the greatest goals for Curtis Davies if ends is greater than 2012?
SELECT MAX(goals) FROM table_name_9 WHERE name = "curtis davies" AND ends > 2012
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
what are the number of patients who received a calculated thyroxine (t4) index lab test during the previous year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated thyroxine (t4) index') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(...
mimic_iii
CREATE TABLE country ( Country_ID int, Name text, Population int, Area int, Languages text ) CREATE TABLE roller_coaster ( Roller_Coaster_ID int, Name text, Park text, Country_ID int, Length real, Height real, Speed text, Opened text, Status text )
Show the names of countries and the average speed of roller coasters from each country with a bar chart, and I want to display by the y axis from high to low.
SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name ORDER BY AVG(T2.Speed) DESC
nvbench
CREATE TABLE table_37603 ( "Order" real, "Built" text, "Serial Numbers" text, "Quantity" real, "1st No." text )
with build 5/69-6/69 what's the order?
SELECT SUM("Order") FROM table_37603 WHERE "Built" = '5/69-6/69'
wikisql
CREATE TABLE table_19769687_3 ( _number_of_total_votes INTEGER, election VARCHAR )
Name the most number of total votes for election for 1878
SELECT MAX(_number_of_total_votes) FROM table_19769687_3 WHERE election = "1878"
sql_create_context
CREATE TABLE table_72432 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's the party with incumbent being william e. evans
SELECT "Party" FROM table_72432 WHERE "Incumbent" = 'William E. Evans'
wikisql
CREATE TABLE table_41394 ( "Year" real, "Senior PGA Championship" text, "The Tradition" text, "Senior Players Championship" text, "U.S. Senior Open" text, "Senior British Open" text )
Who won the Senior British Open when Hale Irwin (3/7) won the Senior PGA Championship?
SELECT "Senior British Open" FROM table_41394 WHERE "Senior PGA Championship" = 'hale irwin (3/7)'
wikisql
CREATE TABLE table_name_43 ( team VARCHAR, driver VARCHAR, laps VARCHAR, points VARCHAR )
When Patrick Carpentier is driving and has less than 19 points with 90 laps, what team is racing?
SELECT team FROM table_name_43 WHERE laps = 90 AND points < 19 AND driver = "patrick carpentier"
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, ...
get me the number of self pay insurance patients who have been diagnosed with lumbago.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Lumbago"
mimicsql_data
CREATE TABLE table_28850 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the incumbent for robert monell (j) 63.6% tilly lynde 36.4%
SELECT "Incumbent" FROM table_28850 WHERE "Candidates" = 'Robert Monell (J) 63.6% Tilly Lynde 36.4%'
wikisql
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...
从10年11月16日到19年10月24日,医院9744702一共有多少购药医疗记录
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9744702' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-11-16' AND '2019-10-24' AND gwyjzb.CLINIC_TYPE = '购药' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9744702' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-11-16' AND '2019-10-24' AND fgwyjzb.CLINIC_TY...
css
CREATE TABLE table_27733258_6 ( location_attendance VARCHAR, score VARCHAR )
Name the location attendance for l 105 123 (ot)
SELECT location_attendance FROM table_27733258_6 WHERE score = "L 105–123 (OT)"
sql_create_context
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 hz_info ( KH text, KLX number...
编号为69886935的患者的检验报告单的报告日期在一四年六月十八日之前的住院就诊的流水号有哪些
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj...
css
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
on the last hospital visit, what was the average antithrombin value for patient 92063?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92063 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.labe...
mimic_iii
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
tell me the primary disease and days for which patient with patient id 8440 was hospitalized.
SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "8440"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
tell me the total 8 hr total fluid removed output that patient 030-28944 has had on this month/26?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-28944')) AND intakeoutput.celllabel = '8 hr ...
eicu
CREATE TABLE table_21599 ( "Release" real, "Title" text, "Start" real, "Pieces" real, "Board (inches)" text, "Board (cm)" text, "Type" text, "New units New units when compared to the original A&A: Classic version of the game." text, "Playable Powers" text )
What year(s) was axis & allies: d-day released?
SELECT "Release" FROM table_21599 WHERE "Title" = 'Axis & Allies: D-Day'
wikisql
CREATE TABLE table_1206583_2 ( builder VARCHAR, launched VARCHAR )
What is the builder launched 30 october 1944?
SELECT builder FROM table_1206583_2 WHERE launched = "30 October 1944"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of patients whose ethnicity is asian and drug name is loperamide?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug = "Loperamide"
mimicsql_data
CREATE TABLE table_31245 ( "Episode" real, "Title" text, "Directed by" text, "Written by" text, "UK viewers (million)" text, "Share (%)" text, "Original air date" text )
Who is the director when the share is 11.8?
SELECT "Directed by" FROM table_31245 WHERE "Share (%)" = '11.8'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
医院1868481的医疗记录中,出院诊断为X20.040的最少医疗费总额是多少?最多的总额又是多少
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1868481' AND gwyjzb.OUT_DIAG_DIS_CD = 'X20.040' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1868481' AND fgwyjzb.OUT_D...
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 )
What are the names of all products, and count them by a bar chart, sort by the x-axis in desc.
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_37128 ( "Episode No." text, "Episode Title" text, "UK Broadcast Date" text, "Presenter" text, "Details of Journey" text, "Countries Visited" text )
Which episode title featured a visit to the country of Cuba?
SELECT "Episode Title" FROM table_37128 WHERE "Countries Visited" = 'cuba'
wikisql
CREATE TABLE gyb ( 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...
自二零零二年一月十日开始,截止到二零一四年九月十日,患者张修真通过医疗机构7718159开的西药总数有多少
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '张修真' AND t_kc22.STA_DATE BETWEEN '2002-01-10' AND '2014-09-10' AND qtb.MED_SER_ORG_NO = '7718159' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN...
css
CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), ...
Show each state and the number of addresses in each state Show bar chart, sort by the Y-axis from low to high.
SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county ORDER BY COUNT(*)
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者郑欣嘉的检验报告单中有多少检验结果指标均异常?查询检验报告的单号
SELECT jybgb.BGDH 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 NOT ...
css
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...
尤飞双这位患者在就诊期间购买的药物价格超了7155.47元的次数有几次?都对应了什么编号?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '尤飞双' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7155.47)
css
CREATE TABLE table_32610 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the attendance of week 1
SELECT "Attendance" FROM table_32610 WHERE "Week" = '1'
wikisql
CREATE TABLE table_9735 ( "Season" text, "Winner" text, "Prize" text, "Runner-Up" text, "3rd place" text )
What is 3rd Place, when Runner-Up is 'Simon Ehne', and when Prize is $100,000?
SELECT "3rd place" FROM table_9735 WHERE "Runner-Up" = 'simon ehne' AND "Prize" = '$100,000'
wikisql
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 chartevents ( row_id number, subject_id number, had...
among patients that were prescribed with nystatin oral suspension, what are the three most frequently prescribed drugs at the same time, during this year.
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nystatin oral suspension' AND DATETIME(prescriptions.startdate, '...
mimic_iii
CREATE TABLE table_51575 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Transfer fee" text )
Which name had 6 goals?
SELECT "Name" FROM table_51575 WHERE "Goals" = '6'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, Profi...
Average number of posts created within two days of user creation date in 2019.
SELECT COUNT(Posts.Id) FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.CreationDate < DATEADD(Day, 2, Users.CreationDate) AND YEAR(Users.CreationDate) = 2019 GROUP BY Users.Id
sede
CREATE TABLE table_18278508_2 ( date_performed VARCHAR, main_contestant VARCHAR, co_contestant__yaar_vs_pyaar_ VARCHAR )
What date did Jatin Shah and Shalini Chandran perform?
SELECT date_performed FROM table_18278508_2 WHERE main_contestant = "Jatin Shah" AND co_contestant__yaar_vs_pyaar_ = "Shalini Chandran"
sql_create_context
CREATE TABLE table_name_23 ( call_sign VARCHAR, erp_w VARCHAR )
Which Call sign has an ERP W of 75?
SELECT call_sign FROM table_name_23 WHERE erp_w = 75
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, and order by the total number in desc.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_204_766 ( id number, "event" text, "meeting gaz de france\nparis" text, "golden gala\nrome" text, "bislett games\noslo" text, "weltklasse zurich" text, "memorial van damme\nbrussels" text, "istaf\nberlin" text )
what event is listed previous to the pole vault ?
SELECT "event" FROM table_204_766 WHERE id = (SELECT id FROM table_204_766 WHERE "event" = 'pole vault') - 1
squall
CREATE TABLE table_25173505_13 ( english_version VARCHAR, buena_vista_edition VARCHAR )
what is the english version that is buena vista edition is daisuke gouri?
SELECT english_version FROM table_25173505_13 WHERE buena_vista_edition = "Daisuke Gouri"
sql_create_context
CREATE TABLE table_name_91 ( rapid VARCHAR, distance__km_ VARCHAR, station VARCHAR )
Which rapid has a distance in km smaller than 14.2, and a Station of k my ji?
SELECT rapid FROM table_name_91 WHERE distance__km_ < 14.2 AND station = "kōmyōji"
sql_create_context
CREATE TABLE table_name_32 ( team_1 VARCHAR )
When Aalborg BK is Team 1, what is the 1st leg?
SELECT 1 AS st_leg FROM table_name_32 WHERE team_1 = "aalborg bk"
sql_create_context
CREATE TABLE table_24115349_4 ( kennedy__percentage VARCHAR, coakley__percentage VARCHAR )
What percentage did kennedy win while coakly won 37.9%
SELECT kennedy__percentage FROM table_24115349_4 WHERE coakley__percentage = "37.9%"
sql_create_context