context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_27922491_8 ( wickets INTEGER )
What is the least amount of wickets?
SELECT MIN(wickets) FROM table_27922491_8
sql_create_context
CREATE TABLE table_202_179 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
who were the top 3 finishers in the 2005 belgian grand prix ?
SELECT "driver" FROM table_202_179 ORDER BY "points" DESC LIMIT 3
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is drug type of drug name nafcillin?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Nafcillin"
mimicsql_data
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 with infected right thigh graft were of american indian/alaska native ethnicty?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT"
mimicsql_data
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, D...
Show the number of documents in different ending date Bin ending date by weekday and group by location code with a stacked bar chart, could you display in descending by the y axis please?
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To) DESC
nvbench
CREATE TABLE table_name_45 ( position VARCHAR, round VARCHAR, player VARCHAR )
Which Position has a Round larger than 4, and a Player of patrick johnson?
SELECT position FROM table_name_45 WHERE round > 4 AND player = "patrick johnson"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, ...
when was the last time that patient 31482 had a minimum calcium, total on their current hospital encounter?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') ORDER BY labevents.valuenum, ...
mimic_iii
CREATE TABLE table_66332 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Who was the fight against when loss was the result at the Gladiator Challenge 87: Collision Course event?
SELECT "Opponent" FROM table_66332 WHERE "Res." = 'loss' AND "Event" = 'gladiator challenge 87: collision course'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number...
when was the last time patient 010-1155 had a drug intake of volume (ml) magnesium sulfate since 01/16/2105?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155')) AND intakeoutput.cellpath LIKE '%intake%'...
eicu
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
What is the primary disease and drug route of Albers Bauer?
SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Albert Bauer"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
did patient 006-171217 suffer from any type of allergy in the previous year?
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURR...
eicu
CREATE TABLE table_12963 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
Which venue had an against smaller than 7?
SELECT "Venue" FROM table_12963 WHERE "Against" < '7'
wikisql
CREATE TABLE table_77498 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner-up" text )
What was the to par of the tournament that had Ken Duke as a runner-up?
SELECT "To par" FROM table_77498 WHERE "Runner-up" = 'ken duke'
wikisql
CREATE TABLE table_name_52 ( november VARCHAR, year VARCHAR, october VARCHAR )
Who is in November after 1988 when Prinzzess is in October?
SELECT november FROM table_name_52 WHERE year > 1988 AND october = "prinzzess"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( c...
What time do NATIVEAM 311 lectures start next semester ?
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'NATIVEAM' AND cours...
advising
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
COMP 416 requires me to take what classes before I can take it ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_204_48 ( id number, "date" text, "race name" text, "location" text, "uci rating" text, "winner" text, "team" text )
what is the name of the first race in the year ?
SELECT "race name" FROM table_204_48 ORDER BY "date" LIMIT 1
squall
CREATE TABLE player_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes TEXT ) CREATE TABLE team_half ( year INTEGER, league_id TEXT, team_id TEXT, half INTEGER, div_id TEXT, div_win TEXT, rank INTEGER, g INTEGER, w INTEGER, ...
For each year, bin the year into day of the week interval, and return the average of the number of times the team Boston Red Stockings won in the postseasons using a line chart, order X in desc order please.
SELECT year, AVG(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
nvbench
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
Reasonable quality old posts with spelling errors.
SELECT P.Id AS "post_link", P.CreationDate, P.Score, P.PostTypeId, p.LastEditDate, p.LastActivityDate FROM Posts AS P WHERE p.LastEditDate < DATEADD(month, -6, p.LastActivityDate) AND Score >= 5 AND (Title LIKE '%dinamic%' OR Title LIKE '%sintax%' OR Title LIKE '%programatically%') ORDER BY P.Score, P.CreationDate
sede
CREATE TABLE table_30241 ( "Entrant" text, "Constructor" text, "Car" text, "Driver" text, "Co-driver" text, "Rounds" text )
who is the person that is part of the belgian vw club that works with fr d ric miclotte
SELECT "Driver" FROM table_30241 WHERE "Entrant" = 'Belgian VW Club' AND "Co-driver" = 'Frédéric Miclotte'
wikisql
CREATE TABLE table_15187735_19 ( segment_a VARCHAR, episode VARCHAR )
What is the segment A on episode 237?
SELECT segment_a FROM table_15187735_19 WHERE episode = 237
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUser...
Percent of closed answered negative-scored questions over time.
SELECT MAX(h.t), h.pc AS "Percent of closed answered negative-scored questions over time" FROM (SELECT q.t AS t, NTILE(100) OVER (ORDER BY q.t) AS pc FROM (SELECT ClosedDate - CreationDate AS t FROM Posts WHERE PostTypeId = 1 AND AnswerCount > 0 AND Score < 0 AND NOT ClosedDate IS NULL) AS q) AS h WHERE h.t <= '23:59:5...
sede
CREATE TABLE table_name_68 ( first_airdate VARCHAR, episodes VARCHAR, nielsen_ranking VARCHAR )
What was the first airdate or the season that had less than 24 episodes and a Nielsen ranking of #38?
SELECT first_airdate FROM table_name_68 WHERE episodes < 24 AND nielsen_ranking = "#38"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
when was the first time patient 022-187132 had a gastric (ng) output during the previous day?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132')) AND intakeoutput.cellpath LIKE '%output...
eicu
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 procedures_icd ( row_id number, subject_id number, ...
did in 2105 patient 71689 visit the hospital?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 71689 AND STRFTIME('%y', admissions.admittime) = '2105'
mimic_iii
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
has patient 24921 undergone any medical procedure on their first hospital encounter?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
mimic_iii
CREATE TABLE table_66089 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
What is the location for the game with a score of w 106-81?
SELECT "Location/Attendance" FROM table_66089 WHERE "Score" = 'w 106-81'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
在检验报告单20790393793都对应了哪些就诊流水号?
SELECT JZLSH FROM jybgb WHERE BGDH = '20790393793'
css
CREATE TABLE table_name_55 ( area__km²_ INTEGER, population__2010_ VARCHAR )
Where is the lowest area with a population of 7,616?
SELECT MIN(area__km²_) FROM table_name_55 WHERE population__2010_ = 7 OFFSET 616
sql_create_context
CREATE TABLE table_16588 ( "#" real, "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Season" text, "Rating" text, "Share" real, "18\u201349" text, "Viewers (m)" text, "Rank (#)" text )
What is the number of rank with the viewership of 5.96 million?
SELECT COUNT("Rank (#)") FROM table_16588 WHERE "Viewers (m)" = '5.96'
wikisql
CREATE TABLE table_6104 ( "Celebrity" text, "Known for" text, "Entered" text, "Exited" text, "Finished" text )
What day did the person who finished in 12th place leave on?
SELECT "Exited" FROM table_6104 WHERE "Finished" = '12th'
wikisql
CREATE TABLE book_club ( publisher VARCHAR, YEAR VARCHAR )
Show all publishers which do not have a book in 1989.
SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989
sql_create_context
CREATE TABLE table_name_47 ( overall INTEGER, pick__number VARCHAR, position VARCHAR, round VARCHAR )
Position of defensive tackle, and a Round of 4, and a Pick # smaller than 36 has what overall average?
SELECT AVG(overall) FROM table_name_47 WHERE position = "defensive tackle" AND round = 4 AND pick__number < 36
sql_create_context
CREATE TABLE table_name_24 ( record VARCHAR, visitor VARCHAR )
What was the Record of the game in which the Trail Blazers was the visiting team?
SELECT record FROM table_name_24 WHERE visitor = "trail blazers"
sql_create_context
CREATE TABLE table_name_99 ( date VARCHAR, decision VARCHAR, home VARCHAR, points VARCHAR )
Which Date has a Home of montreal canadiens, and Points larger than 9, and a Decision of price?
SELECT date FROM table_name_99 WHERE home = "montreal canadiens" AND points > 9 AND decision = "price"
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
What classes next semester are being taught by Dr. Scott Baron ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Scott Baron%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer...
advising
CREATE TABLE Albums ( label VARCHAR )
What are all the labels?
SELECT DISTINCT label FROM Albums
sql_create_context
CREATE TABLE table_name_72 ( driver VARCHAR, points VARCHAR )
Which river had 26 points?
SELECT driver FROM table_name_72 WHERE points = 26
sql_create_context
CREATE TABLE table_70184 ( "Week" real, "Issue Date" text, "Artist" text, "Single" text, "Download" text, "Title" text )
What's the Issue Date for an Eric Prydz song with a no available Download information?
SELECT "Issue Date" FROM table_70184 WHERE "Download" = 'no available' AND "Artist" = 'eric prydz'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what were the allergies that patient 006-153198 has had since 119 months ago?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-153198')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(...
eicu
CREATE TABLE table_name_59 ( december INTEGER, opponent VARCHAR, game VARCHAR )
What is the sum for December against the vancouver canucks earlier than game 33?
SELECT SUM(december) FROM table_name_59 WHERE opponent = "vancouver canucks" AND game < 33
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airli...
list the flights arriving in BALTIMORE from DENVER on 8 3
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, date_day, days, flight, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 2 AND date_day.month_number =...
atis
CREATE TABLE table_name_96 ( cuts_made INTEGER, wins VARCHAR, top_5 VARCHAR )
How many vuts made for a player with 2 wins and under 7 top 5s?
SELECT AVG(cuts_made) FROM table_name_96 WHERE wins = 2 AND top_5 < 7
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
查一下给患者11260648开氟哌啶醇片(糖衣)的医院有哪些
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '11260648' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '氟哌啶醇片(糖衣)')
css
CREATE TABLE table_name_47 ( result VARCHAR, opponent VARCHAR, attendance VARCHAR )
When the opponent was Brechin City and the attendance was 656, what was the Result?
SELECT result FROM table_name_47 WHERE opponent = "brechin city" AND attendance = 656
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
Monthly active users in StackOverflow / StackExchange.
SELECT COUNT(*) AS ActivePosters5 FROM Posts AS p WHERE p.Score >= 0 AND DATEDIFF(day, p.CreationDate, GETDATE()) <= 30 GROUP BY p.OwnerUserId HAVING COUNT(p.Id) >= 5
sede
CREATE TABLE table_11224 ( "Name" text, "Area (km 2 )" real, "Population Estimate 2005" real, "Population Census 2010" real, "Capital" text )
what is the population estimate 2005 for the with the area (km2) 3,034.08?
SELECT AVG("Population Estimate 2005") FROM table_11224 WHERE "Area (km 2 )" = '3,034.08'
wikisql
CREATE TABLE table_name_75 ( name VARCHAR, rank VARCHAR, year VARCHAR )
I want the name for rank less than 6 and year more than 1974
SELECT name FROM table_name_75 WHERE rank < 6 AND year > 1974
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
从06年1月17日至12年11月19日期间内为28372470患者检测促肾上腺皮质激素的医务人员姓名和工号分别什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_26156 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
What is the lowest numbered division Cleveland played in?
SELECT MIN("Division") FROM table_26156
wikisql
CREATE TABLE table_name_50 ( attendance INTEGER, result VARCHAR )
What is the highest Attendance with a Result that is w 24-21?
SELECT MAX(attendance) FROM table_name_50 WHERE result = "w 24-21"
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE proce...
how many times did patient 3929 come to icu during their current hospital visit?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_10885 ( "Model number" text, "Frequency" text, "L2 cache" text, "FPU width" text, "Multiplier 1" text, "Socket" text, "Release date" text, "Order part number" text )
what is the frequency of part number tmn550dcr23gm?
SELECT "Frequency" FROM table_10885 WHERE "Order part number" = 'tmn550dcr23gm'
wikisql
CREATE TABLE table_57294 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
Name the speed for andy reynolds
SELECT "Speed" FROM table_57294 WHERE "Rider" = 'andy reynolds'
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, ...
这位褚泰鸿的患者在11年1月20日到21年4月6日期间医保的医疗总消费金额有多少
SELECT SUM(t_kc24.MED_AMOUT) 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 '2011-01-20' AND '2021-04-06' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE...
css
CREATE TABLE table_2402209_1 ( no_of_barangays VARCHAR, area_coordinator VARCHAR )
How many Barangays lived in the municipality with area coordinator of 110.95?
SELECT no_of_barangays FROM table_2402209_1 WHERE area_coordinator = "110.95"
sql_create_context
CREATE TABLE table_41530 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" text, "Province / Club" text )
What is Caps, when Province / Club is DRFC, and when Position is Center?
SELECT "Caps" FROM table_41530 WHERE "Province / Club" = 'drfc' AND "Position" = 'center'
wikisql
CREATE TABLE table_train_107 ( "id" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "modified_hachinski_ischemia_scale" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "clinical_dementia_rating_cdr" float, "NOUSE" float )
modified hachinski less than or equal to 4
SELECT * FROM table_train_107 WHERE modified_hachinski_ischemia_scale <= 4
criteria2sql
CREATE TABLE table_train_277 ( "id" int, "gender" string, "cholesterol" float, "blood_platelet_counts" int, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "severe_dyslipidemia" bool, "fasting_triglyceride" int, "body_mass_index_bmi" float, "trig...
creatinine level ( a measure of kidney function is greater than 1.4 mg / dl ( for female ) or greater than 1.5 mg / dl ( for male ) or your estimated gfr is under 60 .
SELECT * FROM table_train_277 WHERE (creatinine_clearance_cl > 1.4 AND gender = 'female') OR (creatinine_clearance_cl > 1.5 AND gender = 'male') OR estimated_glomerular_filtration_rate_egfr < 60
criteria2sql
CREATE TABLE table_20963074_1 ( result VARCHAR, original_title VARCHAR )
Name the total number of results for octubre
SELECT COUNT(result) FROM table_20963074_1 WHERE original_title = "Octubre"
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...
查出医院3713663在2008年7月24日到2015年1月4日内哪些医疗就诊记录符合入院诊断疾病结果与出院诊断疾病结果不同的情况
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '3713663' AND qtb.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '3713663' AND gyb.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '3713663' AND zyb.IN_HOSP_DATE BETW...
css
CREATE TABLE table_name_22 ( launched VARCHAR, commissioned VARCHAR, bow_number VARCHAR )
When did the ship that was commissioned July 1948 with a bow number of ps-31 launch?
SELECT launched FROM table_name_22 WHERE commissioned = "july 1948" AND bow_number = "ps-31"
sql_create_context
CREATE TABLE table_44259 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Team points" real, "Opponent score" real, "Record" text, "Streak" text )
Which streak before game 12 had a team points larger than 113 on November 16?
SELECT "Streak" FROM table_44259 WHERE "Team points" > '113' AND "Game" < '12' AND "Date" = 'november 16'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
what are the new prescriptions of patient 021-111547 of today compared to the prescription yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-111547') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medic...
eicu
CREATE TABLE table_18600760_13 ( ansi_code INTEGER )
What is the smallest ansi code?
SELECT MIN(ansi_code) FROM table_18600760_13
sql_create_context
CREATE TABLE table_27359 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What are the NFL Teams in College North Texas State?
SELECT "NFL Team" FROM table_27359 WHERE "College" = 'North Texas State'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE l...
since 2102 patient 003-50177 has undergone antibiotics - cephalosporin in other hospitals?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-50177' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-50177' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE table_51165 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
WHAT DATE HAD A GAME SMALLER THAN 58, AND FROM BOSTON?
SELECT "Date" FROM table_51165 WHERE "Game" < '58' AND "Team" = 'boston'
wikisql
CREATE TABLE table_40927 ( "From" real, "Goal" text, "Round 1" text, "Round 2" text, "Round 3" text, "Round 4" text, "Round 5" text, "Round 6+" text )
What is Round 4 when Round 6+ is triple, Round 5 is triple and Round 3 is single?
SELECT "Round 4" FROM table_40927 WHERE "Round 6+" = 'triple' AND "Round 5" = 'triple' AND "Round 3" = 'single'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Top 200 users from Iran. Lists the top 200 users (ranked by reputation) that are located in Iran according to their profile information.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
列出首诊医生以及其他所有接诊医生在门诊就诊16949706262里面的工号都是什么?
SELECT wdmzjzjlb.ZZYSGH, wdmzjzjlb.QTJZYSGH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '16949706262' UNION SELECT bdmzjzjlb.ZZYSGH, bdmzjzjlb.QTJZYSGH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '16949706262'
css
CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE station ( id number, ...
What are all the different start station names for a trip that lasted less than 100?
SELECT DISTINCT start_station_name FROM trip WHERE duration < 100
spider
CREATE TABLE table_10432 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the date when Richmond was the home team?
SELECT "Date" FROM table_10432 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE table_279 ( "car plates (since 1937)" text, "Voivodeship Separate city" text, "Capital" text, "Area in 1000km\u00b2 (1930)" text, "Population in 1000 (1931)" text )
List all areas within 1000 km in the city of Lubelskie?
SELECT "Area in 1000km\u00b2 (1930)" FROM table_279 WHERE "Voivodeship Separate city" = 'lubelskie'
wikisql
CREATE TABLE table_name_60 ( events INTEGER, player VARCHAR, earnings___$__ VARCHAR )
Which Events have a Player of tom kite, and Earnings ($) smaller than 760,405?
SELECT AVG(events) FROM table_name_60 WHERE player = "tom kite" AND earnings___$__ < 760 OFFSET 405
sql_create_context
CREATE TABLE table_1637981_7 ( detroit__dtw_ VARCHAR, grand_rapids__grr_ VARCHAR )
When Grand Rapids's fare was $377.29, what is the fare to Detroit?
SELECT detroit__dtw_ FROM table_1637981_7 WHERE grand_rapids__grr_ = "$377.29"
sql_create_context
CREATE TABLE table_name_3 ( surface VARCHAR, opponent VARCHAR )
What was the surface for the opponent Marcos Baghdatis?
SELECT surface FROM table_name_3 WHERE opponent = "marcos baghdatis"
sql_create_context
CREATE TABLE table_name_59 ( rank INTEGER, result VARCHAR, group VARCHAR, athlete VARCHAR )
What is the average rank for Group A athlete Yanina Karolchyk, and a result higher than 18?
SELECT AVG(rank) FROM table_name_59 WHERE group = "a" AND athlete = "yanina karolchyk" AND result > 18
sql_create_context
CREATE TABLE table_name_45 ( finish INTEGER, start VARCHAR, year VARCHAR, manufacturer VARCHAR )
What is the smallest finish time for a race where start was less than 3, buick was the manufacturer, and the race was held after 1978?
SELECT MIN(finish) FROM table_name_45 WHERE year > 1978 AND manufacturer = "buick" AND start < 3
sql_create_context
CREATE TABLE table_66952 ( "Year" real, "Division" text, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
What division did the Nashville Metros play in during the year that they did not qualify for the Playoffs, where in the USL PDL League, and had the Regular Season 7th, Southeast?
SELECT "Division" FROM table_66952 WHERE "Playoffs" = 'did not qualify' AND "League" = 'usl pdl' AND "Regular Season" = '7th, southeast'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose days of hospital stay is greater than 20 and drug name is neo*iv*fat emulsion?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.drug = "NEO*IV*Fat Emulsion"
mimicsql_data
CREATE TABLE table_238124_1 ( bleeding_time VARCHAR, condition VARCHAR )
What is the bleeding time for glanzmann's thrombasthenia?
SELECT bleeding_time FROM table_238124_1 WHERE condition = "Glanzmann's thrombasthenia"
sql_create_context
CREATE TABLE table_26464 ( "Confederation" text, "Teams started" text, "Teams that have secured qualification" text, "Teams that can still qualify" text, "Teams that have been eliminated" text, "Remaining places in finals" text, "Total places in finals" text, "Qualifying start date" text...
What is the qualifying end date when the qualifying start date is qualifying start date?
SELECT "Qualifying end date" FROM table_26464 WHERE "Qualifying start date" = 'Qualifying start date'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how many patients were diagnosed with sepsis and they didn't return to the hospital in a year before within 2 months?
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ...
eicu
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
For CS majors , name the classes that are available this Winter .
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.sem...
advising
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, ...
患者王飞燕有哪些门诊就诊的检验报告日期在2020-10-11以后?查询这些门诊就诊的流水号
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '王飞燕' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2020-10-1...
css
CREATE TABLE table_name_34 ( score VARCHAR, total_points VARCHAR )
What was the score where the total points was 50?
SELECT score FROM table_name_34 WHERE total_points = 50
sql_create_context
CREATE TABLE table_name_50 ( elevator VARCHAR, elevated VARCHAR )
What is the Elevator of the Elected Elevated on September 21, 1179?
SELECT elevator FROM table_name_50 WHERE elevated = "september 21, 1179"
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...
1) Top 15 Posts, Ranked. Show post id, FavoriteCount (use column label votes), CommentCount (label:answers), ViewCount (label: views), and title
SELECT TOP(15) AS Id, FavoriteCount AS Votes, CommentCount AS Answers, ViewCount AS Views, Title FROM Posts WHERE NOT Title IS NULL ORDER BY Score DESC
sede
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
以往患者32467373有哪些门诊诊断还记得吗?
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '32467373'
css
CREATE TABLE table_69496 ( "Game" real, "Date" text, "Score" text, "Location" text, "Time" text, "Attendance" real )
Attendance larger than 55,189 is which average game?
SELECT AVG("Game") FROM table_69496 WHERE "Attendance" > '55,189'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
during the current hospital visit how many times did patient 016-9636 get a ptt test?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'ptt'
eicu
CREATE TABLE table_32200 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text )
What is the total overall in round 1, in which Charles White was a player?
SELECT SUM("Overall") FROM table_32200 WHERE "Player" = 'charles white' AND "Round" < '1'
wikisql
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, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
门诊就诊08031682316中这个病人的身高、体重的数据是什么?体温、收缩压、舒张压、心率、呼吸频率、脉率的详细数据是怎样的
SELECT mzjzjlb.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '08031682316'
css
CREATE TABLE table_62659 ( "Rank" real, "Railway Station" text, "Annual entry/exit (millions) 2011\u201312" real, "Annual interchanges (millions) 2011\u201312" real, "Total Passengers (millions) 2011\u201312" real, "Location" text, "Number of Platforms" real )
What's the lowest number of total passengers (millions) for an annual entry/exit of 36.609?
SELECT MIN("Total Passengers (millions) 2011\u201312") FROM table_62659 WHERE "Annual entry/exit (millions) 2011\u201312" = '36.609'
wikisql
CREATE TABLE table_204_416 ( id number, "chip" text, "flash size" text, "eeprom" number, "sram" number, "frequency\n[mhz]" number, "package" text )
what is the flash size difference in the at90s8515 chip and the at90s4414 ?
SELECT ABS((SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s8515') - (SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s4414'))
squall
CREATE TABLE table_57402 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Name the score for december 5
SELECT "Score" FROM table_57402 WHERE "Date" = 'december 5'
wikisql
CREATE TABLE table_name_29 ( crowd INTEGER, away_team VARCHAR )
What is the average crowd to watch Hawthorn as the away team?
SELECT AVG(crowd) FROM table_name_29 WHERE away_team = "hawthorn"
sql_create_context
CREATE TABLE table_name_69 ( Id VARCHAR )
2007 of 8 4 is involved in what 2002?
SELECT 2002 FROM table_name_69 WHERE 2007 = "8–4"
sql_create_context
CREATE TABLE table_17360840_9 ( attendance INTEGER, opponent VARCHAR, record VARCHAR )
What was the attendance when the opposing team was the Ottawa Senators and the record was 24-35-17?
SELECT MAX(attendance) FROM table_17360840_9 WHERE opponent = "Ottawa Senators" AND record = "24-35-17"
sql_create_context