context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_21974 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
What is the broadcast date when 8.3 million viewers watched?
SELECT "Broadcast date" FROM table_21974 WHERE "Viewers (in millions)" = '8.3'
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...
count the number of patients whose marital status is widowed and item id is 50924?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "50924"
mimicsql_data
CREATE TABLE table_name_17 ( opponent VARCHAR, result VARCHAR, venue VARCHAR )
What is Opponent, when Result is Loss, and when Venue is Mosaic Stadium?
SELECT opponent FROM table_name_17 WHERE result = "loss" AND venue = "mosaic stadium"
sql_create_context
CREATE TABLE table_name_70 ( game_site VARCHAR, record VARCHAR )
Record of 9 1 had what game site?
SELECT game_site FROM table_name_70 WHERE record = "9–1"
sql_create_context
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...
give me the number of patients whose year of death is less than or equal to 2174 and diagnoses icd9 code is 2984?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2174.0" AND diagnoses.icd9_code = "2984"
mimicsql_data
CREATE TABLE table_3831 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What was the series record at after game 3?
SELECT "Series" FROM table_3831 WHERE "Game" = '3'
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...
编号为4510388的这个医院医治过多少异地患者?在2016-09-10到2020-07-08的这段时间
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4510388' AND qtb.IN_HOSP_DATE BETWEEN '2016-09-10' AND '2020-07-08' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4510388' AND gyb.IN_HOSP_DATE BETWEEN '2016-09-10' AND '2020-07-08' AND g...
css
CREATE TABLE table_27734577_7 ( team VARCHAR, location_attendance VARCHAR )
What is every team with location attendance of Philips Arena 12,140?
SELECT team FROM table_27734577_7 WHERE location_attendance = "Philips Arena 12,140"
sql_create_context
CREATE TABLE table_38197 ( "Team" text, "Driver" text, "Laps" real, "Time" text, "Grid" real )
Which Time has a Grid of 19?
SELECT "Time" FROM table_38197 WHERE "Grid" = '19'
wikisql
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Bar graph to show the total number from different allergytype, and show from low to high by the x axis.
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType
nvbench
CREATE TABLE table_15815 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text )
What Loss had an Attendance of 17,675?
SELECT "Loss" FROM table_15815 WHERE "Attendance" = '17,675'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
how long does it take to get from ATL airport into the city of ATLANTA
SELECT DISTINCT airport_service.minutes_distant FROM airport, airport_service, city WHERE airport.airport_code = 'ATL' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA'
atis
CREATE TABLE table_33174 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did Hawthorn play as the home team?
SELECT "Venue" FROM table_33174 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE table_33026 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the number of the crowd for the home team of South Melbourne?
SELECT SUM("Crowd") FROM table_33026 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_203_160 ( id number, "rank" number, "heat" number, "nation" text, "competitors" text, "time" text, "notes" text )
how many teams finished below 3 minutes and 3 seconds ?
SELECT COUNT("nation") FROM table_203_160 WHERE "time" < 3 OR ("time" = 3 AND "time" < 3)
squall
CREATE TABLE table_73899 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
in 1953, which of the institutions joined?
SELECT "Institution" FROM table_73899 WHERE "Joined" = '1953'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of email and department_id , and order by the bar from low to high please.
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
nvbench
CREATE TABLE table_60455 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
What is Tournament, when 2003 is 'A'?
SELECT "Tournament" FROM table_60455 WHERE "2003" = 'a'
wikisql
CREATE TABLE table_name_25 ( player VARCHAR, round VARCHAR, position VARCHAR )
Tell me the player for round more than 5 and position of c
SELECT player FROM table_name_25 WHERE round > 5 AND position = "c"
sql_create_context
CREATE TABLE table_1341690_20 ( result VARCHAR, incumbent VARCHAR )
What are all the results where Robert Bauman is the incumbent politician?
SELECT result FROM table_1341690_20 WHERE incumbent = "Robert Bauman"
sql_create_context
CREATE TABLE table_name_14 ( year INTEGER, nominee VARCHAR, result VARCHAR )
What year has a Nominee of , and a Result of nominated?
SELECT AVG(year) FROM table_name_14 WHERE nominee = "—" AND result = "nominated"
sql_create_context
CREATE TABLE table_train_182 ( "id" int, "allergy_to_sulfa" bool, "creatinine_clearance_cl" float, "liver_disease" bool, "allergy_to_glyburide" bool, "allergy_to_metformin" bool, "NOUSE" float )
allergy to glyburide;
SELECT * FROM table_train_182 WHERE allergy_to_glyburide = 1
criteria2sql
CREATE TABLE table_9221 ( "Event" text, "Time" text, "Name" text, "Nation" text, "Games" text, "Date" text )
What country did Chris Witty represent?
SELECT "Nation" FROM table_9221 WHERE "Name" = 'chris witty'
wikisql
CREATE TABLE table_203_584 ( id number, "date" text, "race name" text, "d(f)" number, "course" text, "prize (\u00a3)" number, "odds" text, "runners" number, "place" number, "margin" number, "winner/runner-up" text, "time" text, "jockey" text )
in what year did bend or win his first race ?
SELECT MIN("date") FROM table_203_584 WHERE "place" = 1
squall
CREATE TABLE table_name_47 ( silver INTEGER, total VARCHAR, bronze VARCHAR )
What is the highest silver total for nations with 3 total and over 2 bronze?
SELECT MAX(silver) FROM table_name_47 WHERE total = 3 AND bronze > 2
sql_create_context
CREATE TABLE table_name_56 ( tier INTEGER, postseason VARCHAR, season VARCHAR )
What is the average Tier when the postseason shows -, and the season is 2012 13?
SELECT AVG(tier) FROM table_name_56 WHERE postseason = "–" AND season = "2012–13"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
查查检测指标280143数值的平均值以及最值,是针对门诊诊断为牙龈出血的患者的
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_proce...
what are the top three most frequent microbiology tests administered to patients during the same month after undergoing peripheral nerve graft during the previous year?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_23674 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real, "Total" real )
Where did McCain get 20226 votes?
SELECT "County" FROM table_23674 WHERE "McCain#" = '20226'
wikisql
CREATE TABLE table_22006 ( "Team" text, "Outgoing manage" text, "Manner" text, "Date of vacancy" text, "Incoming manager" text, "Date of appointment" text )
Who was the outgoing manager when the incoming manager was jo o pereira?
SELECT "Outgoing manage" FROM table_22006 WHERE "Incoming manager" = 'João Pereira'
wikisql
CREATE TABLE table_27425 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
When the opponent was Yan Zi Jie Zheng, what was the outcome?
SELECT "Outcome" FROM table_27425 WHERE "Opponents" = 'Yan Zi Jie Zheng'
wikisql
CREATE TABLE table_name_18 ( score VARCHAR, away_team VARCHAR )
What is Score, when Away Team is 'Newcastle Benfield'?
SELECT score FROM table_name_18 WHERE away_team = "newcastle benfield"
sql_create_context
CREATE TABLE table_202_158 ( id number, "z" number, "element" text, "observed or predicted" text, "isolated (widely known)" number, "observer" text, "first isolator" text, "notes" text )
which element was observed or predicted in 1771 by w.scheele ?
SELECT "element" FROM table_202_158 WHERE "observed or predicted" = 1771 AND "observer" = 'w. scheele'
squall
CREATE TABLE table_20179 ( "Week" real, "Date" text, "Result" text, "Record" text, "Opponent" text, "Points For" real, "Points Against" real, "First Downs" real, "Attendance" real )
Name the points against for november 7
SELECT "Points Against" FROM table_20179 WHERE "Date" = 'November 7'
wikisql
CREATE TABLE table_49670 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What was the Overall number that is the lowest, and has a pick greater than 9?
SELECT MIN("Overall") FROM table_49670 WHERE "Pick" > '9'
wikisql
CREATE TABLE table_204_794 ( id number, "iec\nworld plugs\nType" text, "standard" text, "power\nrating" text, "earthed" text, "polarised" text, "fused" text, "insulated\npins" text, "europlug\ncompatible" text )
how many plugs in the list are not earthed ?
SELECT COUNT(*) FROM table_204_794 WHERE "earthed" = 'no'
squall
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_DIRE_CD text, MED_DIRE_NM text,...
在08年10月19日到19年6月15日期间,因疾病Y97.841导致住院产生的平均费用在科室96256有多少
SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '96256' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-10-19' AND '2019-06-15' AND t_kc21.IN_DIAG_DIS_CD = 'Y97.841' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_60 ( opponent VARCHAR, date VARCHAR )
Who did the cubs play on june 3?
SELECT opponent FROM table_name_60 WHERE date = "june 3"
sql_create_context
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text )
Group by the result and count them by a bar chart, and list by the x-axis from low to high.
SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY Result
nvbench
CREATE TABLE table_54407 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Chart Peak" text, "Song Title" text, "Time" text )
What is the time from the song called Treat Me Nice?
SELECT "Time" FROM table_54407 WHERE "Song Title" = 'treat me nice'
wikisql
CREATE TABLE table_13079788_3 ( circuit VARCHAR, gtc_winner VARCHAR, pole_position VARCHAR )
what are all the circuit for gtc winner graeme mundy jamie smyth and pole position bradley ellis alex mortimer
SELECT circuit FROM table_13079788_3 WHERE gtc_winner = "Graeme Mundy Jamie Smyth" AND pole_position = "Bradley Ellis Alex Mortimer"
sql_create_context
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, ...
calculate the number of times that patient 025-57841 had a p.o. intake until 01/30/2105.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-57841')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, C...
Top 20 Users from bangalore.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bengaluru%' OR LOWER(Location) LIKE '%bengalore%' ORDER BY Reputation DESC LIMIT 20
sede
CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE city ...
Show the number of competitions held in each city with a bar chart, and rank x axis in ascending order.
SELECT Official_Name, COUNT(Official_Name) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY Official_Name ORDER BY Official_Name
nvbench
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...
在患者81881911的诊疗记录里,从00年9月13日到12年2月14日这期间,为其检测转铁蛋白的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE table_11680175_1 ( year VARCHAR, eichstädt VARCHAR )
How many years where Eichst dt had a number of 939?
SELECT COUNT(year) FROM table_11680175_1 WHERE eichstädt = 939
sql_create_context
CREATE TABLE table_22848931_3 ( outgoing_manager VARCHAR, date_of_vacancy VARCHAR )
Name the outgoing manager for 10 june 2009
SELECT COUNT(outgoing_manager) FROM table_22848931_3 WHERE date_of_vacancy = "10 June 2009"
sql_create_context
CREATE TABLE table_80387 ( "Team" text, "Manager" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text )
Which team has george graham as the manager?
SELECT "Team" FROM table_80387 WHERE "Manager" = 'george graham'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
What's the unit of measure used for the product commodity code PO?
SELECT conunit FROM resultsdata15 WHERE commod = "PO"
pesticide
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
what is average age of patients whose days of hospital stay is 11 and year of death is less than 2155?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.days_stay = "11" AND demographic.dod_year < "2155.0"
mimicsql_data
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
show me flights from PITTSBURGH to PHILADELPHIA
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHI...
atis
CREATE TABLE table_44145 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent" text, "Score" text )
Who was the partner for the tournament in Lyon, France?
SELECT "Partnering" FROM table_44145 WHERE "Tournament" = 'lyon, france'
wikisql
CREATE TABLE table_name_75 ( rank VARCHAR, floors VARCHAR )
What is the rank for the 96 floors?
SELECT rank FROM table_name_75 WHERE floors = "96"
sql_create_context
CREATE TABLE table_20183474_1 ( oil_rig INTEGER, draw VARCHAR )
What's the oil rig of the song with a draw number 9?
SELECT MIN(oil_rig) FROM table_20183474_1 WHERE draw = 9
sql_create_context
CREATE TABLE table_79274 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) retired" text )
Which class had a quantity made of 20?
SELECT "Class" FROM table_79274 WHERE "Quantity made" = '20'
wikisql
CREATE TABLE table_14966537_1 ( result VARCHAR, date VARCHAR )
What was the final score of the game on October 4, 1970?
SELECT result FROM table_14966537_1 WHERE date = "October 4, 1970"
sql_create_context
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
Show all the distinct president votes made on 08/30/2015.
SELECT DISTINCT president_vote FROM voting_record WHERE registration_date = "08/30/2015"
spider
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients with iv drip route of drug administration have diagnosis icd9 code v4281?
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.icd9_code = "V4281" AND prescriptions.route = "IV DRIP"
mimicsql_data
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
For each county, find the name of the county and the number of delegates from that county. Show the proportion.
SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id
nvbench
CREATE TABLE table_5946 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff" text, "Game site" text, "Record" text, "Match Report" text )
Which Record has a Match Report of recap, and a Result of l 30 20?
SELECT "Record" FROM table_5946 WHERE "Match Report" = 'recap' AND "Result" = 'l 30–20'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
Rank User By Number of Upvotes.
SELECT 'user_link', UpVotes, DownVotes, rn FROM (SELECT a.Id AS "user_link", a.DownVotes, UpVotes, DENSE_RANK() OVER (ORDER BY a.UpVotes DESC) AS rn FROM Users AS a) AS x WHERE rn <= '##NumberOfUser##' AND DownVotes = 0 ORDER BY UpVotes DESC
sede
CREATE TABLE table_name_49 ( laps INTEGER, finish VARCHAR, start VARCHAR )
What's the smallest amount of Laps that had a finish of 7 with a start of 6?
SELECT MIN(laps) FROM table_name_49 WHERE finish = "7" AND start = "6"
sql_create_context
CREATE TABLE table_name_84 ( time VARCHAR, date VARCHAR )
What Time has Date of May 9?
SELECT time FROM table_name_84 WHERE date = "may 9"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
how much is the maximum hospital bill that includes hypertension - uncontrolled since 2102?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'hypertension - uncontrolled')) AND STRFTIME(...
eicu
CREATE TABLE table_3165 ( "Saddle cloth" real, "Horse" text, "Trainer" text, "Jockey" text, "Weight (kg)" text, "Barrier [b ]" real, "Placing" text )
What was the weight in kg when the horse was Alcopop?
SELECT "Weight (kg)" FROM table_3165 WHERE "Horse" = 'Alcopop'
wikisql
CREATE TABLE table_75342 ( "Station" text, "Services" text, "Local authority" text, "Zone 2007" text, "Zone 2008" text, "Zone 2010" text, "Zone 2013" text )
Which Local authority has Services of greater anglia?
SELECT "Local authority" FROM table_75342 WHERE "Services" = 'greater anglia'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) )
what is minimum hours of the students playing in different position?
SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos
nvbench
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 mzjzjlb ( YLJGDM text, JZLSH ...
列出在2001年9月29日到2016年9月29日内医院5844379开出的检验报告单中,不同的检测指标名称和不同检测指标结果定量单位下,按平均值升序排序检测指标结果定量的平均值是多少?
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '5844379' AND BGRQ BETWEEN '2001-09-29' AND '2016-09-29' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL)
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labi...
count the number of icu visits from patient 59707.
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59707)
mimic_iii
CREATE TABLE table_39651 ( "Pick" real, "Player" text, "Nationality" text, "WNBA Team" text, "School/Club Team" text )
What player was chosen for the Chicago Sky?
SELECT "Player" FROM table_39651 WHERE "WNBA Team" = 'chicago sky'
wikisql
CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE competition_record ( competition_id number, farm_id number, rank number ) CREATE TABLE farm_competition ( competition_id number, year...
List the official names of cities that have not held any competition.
SELECT official_name FROM city WHERE NOT city_id IN (SELECT host_city_id FROM farm_competition)
spider
CREATE TABLE table_name_11 ( college_junior_club_team VARCHAR, round VARCHAR )
Which College/junior/club team has a Round of 2?
SELECT college_junior_club_team FROM table_name_11 WHERE round = 2
sql_create_context
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
What 's the schedule for 736 in the Fall ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE region ( Region_ID int, Region_name text, Date ...
Stacked bar of took office and how many took office colored by Minister, and display by the Y-axis in descending.
SELECT Took_office, COUNT(Took_office) FROM party GROUP BY Minister ORDER BY COUNT(Took_office) DESC
nvbench
CREATE TABLE table_name_97 ( player VARCHAR, place VARCHAR, score VARCHAR )
What was the player for t9 and a score of 73-69-74=216?
SELECT player FROM table_name_97 WHERE place = "t9" AND score = 73 - 69 - 74 = 216
sql_create_context
CREATE TABLE table_42208 ( "Record" text, "Athlete" text, "Nation" text, "Venue" text, "Date" text )
What is the Nation with a Date that is may 6, 1991?
SELECT "Nation" FROM table_42208 WHERE "Date" = 'may 6, 1991'
wikisql
CREATE TABLE table_23680576_2 ( may_2009 VARCHAR, jul_2009 VARCHAR )
If the polling average in July 2009 was 7.2%, what was it in May 2009?
SELECT may_2009 FROM table_23680576_2 WHERE jul_2009 = "7.2%"
sql_create_context
CREATE TABLE table_name_78 ( score VARCHAR, high_points VARCHAR )
What was the final score for the game in which Carmelo Anthony (26) was the high points scorer?
SELECT score FROM table_name_78 WHERE high_points = "carmelo anthony (26)"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
1714876这个医院涉及医疗费总额超过6282.3元的科室有多少?时间范围是2004-06-08到2016-11-26
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1714876' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-08' AND '2016-11-26' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 6282.3) AS T
css
CREATE TABLE LOTS ( lot_details VARCHAR )
Show all distinct lot details.
SELECT DISTINCT lot_details FROM LOTS
sql_create_context
CREATE TABLE table_10893 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average number of silver medals for rank 2 and more than 1 bronze medal?
SELECT AVG("Silver") FROM table_10893 WHERE "Rank" = '2' AND "Bronze" > '1'
wikisql
CREATE TABLE table_26565936_2 ( written_by VARCHAR, no_in_series VARCHAR )
Who wrote episode number 109 in the series?
SELECT written_by FROM table_26565936_2 WHERE no_in_series = 109
sql_create_context
CREATE TABLE table_76100 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What was the Position of the Player, Britton Johnsen?
SELECT "Position" FROM table_76100 WHERE "Player" = 'britton johnsen'
wikisql
CREATE TABLE table_name_20 ( group_a VARCHAR, region VARCHAR )
What is the group A region with a region number of 2?
SELECT group_a FROM table_name_20 WHERE region = 2
sql_create_context
CREATE TABLE table_7844 ( "Species" text, "Species common name" text, "NCBI Accession Number (mRNA/Protein)" text, "Length (bp/aa)" text, "Protein Identity" text )
What is the NCBI Accession Number (mRNA/Protein) for the homo sapiens Species?
SELECT "NCBI Accession Number (mRNA/Protein)" FROM table_7844 WHERE "Species" = 'homo sapiens'
wikisql
CREATE TABLE table_78291 ( "Disaster" text, "Year" text, "Countries Affected" text, "Scale of Disaster" text, "People Assisted" text, "Nature of Help" text )
Which year did USA undergo a disaster?
SELECT "Year" FROM table_78291 WHERE "Countries Affected" = 'usa'
wikisql
CREATE TABLE table_24906653_5 ( field_goals VARCHAR, points VARCHAR )
List the number of long range shors where the score is 171.
SELECT COUNT(field_goals) FROM table_24906653_5 WHERE points = 171
sql_create_context
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,...
查询52622012病患的检验报告单中结果指标均异常的检验报告单?需要检验报告的单号
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '52622012' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_name_68 ( venue VARCHAR, club VARCHAR )
Which venue hosted the Dixie Derby Girls?
SELECT venue FROM table_name_68 WHERE club = "dixie derby girls"
sql_create_context
CREATE TABLE table_69352 ( "Episode" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
Which theme has a Episode of top 6?
SELECT "Theme" FROM table_69352 WHERE "Episode" = 'top 6'
wikisql
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
患者赵思美所有检验报告单的审核日期时间从01年8月29日至14年11月21日期间内都是哪天吗?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '赵思美' AND jybg...
css
CREATE TABLE table_57158 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Placings" real )
Tell me the lowest placings for United Kingdom and rank less than 13
SELECT MIN("Placings") FROM table_57158 WHERE "Nation" = 'united kingdom' AND "Rank" < '13'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Top questions for a TAG.
SELECT CONCAT('https://stackoverflow.com/questions/', Id), AcceptedAnswerId, CreationDate AS Score, ViewCount, FavoriteCount, Title, Tags, AnswerCount, CommentCount, Body, OwnerUserId, LastEditDate FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%<##TagName##>%' ORDER BY ViewCount DESC LIMIT 50
sede
CREATE TABLE table_name_43 ( time VARCHAR, heat VARCHAR, nationality VARCHAR )
What's Australia's time in the heat more than 4?
SELECT time FROM table_name_43 WHERE heat > 4 AND nationality = "australia"
sql_create_context
CREATE TABLE table_63247 ( "Sunrayia FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What's the total wins for Wentworth with less than 0 byes?
SELECT COUNT("Wins") FROM table_63247 WHERE "Sunrayia FL" = 'wentworth' AND "Byes" < '0'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
查询入院诊断为J45.129的最低和最高医疗费总额,主要针对医院7271121的医疗记录
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7271121' AND t_kc21.IN_DIAG_DIS_CD = 'J45.129')
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
count the number of newborn admission patients who have more than 10 days of hospital stay.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.days_stay > "10"
mimicsql_data
CREATE TABLE Reservations ( Room VARCHAR ) CREATE TABLE Rooms ( roomName VARCHAR, RoomId VARCHAR )
Find the names of rooms that have been reserved for more than 60 times.
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60
sql_create_context
CREATE TABLE table_22685 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
What was the score in the game that had a record of 25-8?
SELECT "Score" FROM table_22685 WHERE "Record" = '25-8'
wikisql
CREATE TABLE table_name_26 ( filename_extension VARCHAR, interactivity_support VARCHAR, word_wrap_support VARCHAR, open_standard VARCHAR )
Which Filename extension has a Word wrap support of yes, an Open standard of no, and an Interactivity support of yes?
SELECT filename_extension FROM table_name_26 WHERE word_wrap_support = "yes" AND open_standard = "no" AND interactivity_support = "yes"
sql_create_context