context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, order in asc by the JOB_ID.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE Student ( Stuid VARCHAR, Lname VARCHAR, Fname VARCHAR ) CREATE TABLE Video_games ( gameid VARCHAR ) CREATE TABLE Plays_games ( gameid VARCHAR, Stuid VARCHAR )
Show all game names played by Linda Smith
SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = "Smith" AND T3.Fname = "Linda"
sql_create_context
CREATE TABLE table_2334 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (2005)" text, "Founded" real )
What school had an enrollment in 2005 of 69?
SELECT "School" FROM table_2334 WHERE "Enrollment (2005)" = '69'
wikisql
CREATE TABLE table_name_98 ( grid INTEGER, driver VARCHAR, points VARCHAR )
Which Grid has a Driver of cristiano da matta, and Points smaller than 33?
SELECT SUM(grid) FROM table_name_98 WHERE driver = "cristiano da matta" AND points < 33
sql_create_context
CREATE TABLE table_16800 ( "House Name" text, "Composition" text, "Named after" text, "Founded" real, "Colours" text )
What year was the house named gongola made?
SELECT "Founded" FROM table_16800 WHERE "House Name" = 'Gongola'
wikisql
CREATE TABLE table_14454 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real )
What club has less than 60 goals against, a goal difference smaller than 1, and a position of 8?
SELECT "Club" FROM table_14454 WHERE "Goals against" < '60' AND "Goal Difference" < '1' AND "Position" = '8'
wikisql
CREATE TABLE table_204_164 ( id number, "branding" text, "callsign" text, "frequency" text, "power (kw)" text, "location" text )
what is the last location on this chart ?
SELECT "location" FROM table_204_164 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_45631 ( "Year" real, "Pick" text, "Player" text, "Position" text, "College" text )
What year was the player pick number 15 picked?
SELECT "Year" FROM table_45631 WHERE "Pick" = '15'
wikisql
CREATE TABLE table_name_17 ( population INTEGER, location VARCHAR, island VARCHAR )
What is the highest population of Trondra Island in the Scalloway Islands?
SELECT MAX(population) FROM table_name_17 WHERE location = "scalloway islands" AND island = "trondra"
sql_create_context
CREATE TABLE table_name_93 ( game_site VARCHAR, attendance VARCHAR )
What is the location of the game with attendance of 63,336?
SELECT game_site FROM table_name_93 WHERE attendance = "63,336"
sql_create_context
CREATE TABLE table_name_76 ( date VARCHAR, circuit VARCHAR )
Name the date for pescara
SELECT date FROM table_name_76 WHERE circuit = "pescara"
sql_create_context
CREATE TABLE table_42260 ( "City" text, "Municipality" text, "County" text, "Town status" text, "Population" real )
What is the highest population within the municipality of Porsgrunn?
SELECT MAX("Population") FROM table_42260 WHERE "Municipality" = 'porsgrunn'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
患者28348727的检验结果指标均异常的检验报告单号是什么
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 = '28348727' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
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...
统计年龄不高于26岁的患者医疗记录的平均看病费总额是多少元?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE <= 26 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE <= 26 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE <= 26 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER...
css
CREATE TABLE table_204_783 ( id number, "position" text, "player" text, "free agency\ntag" text, "date signed" text, "2013 team" text )
total number of players that signed in march ?
SELECT COUNT("player") FROM table_204_783 WHERE "date signed" = 3
squall
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of revenue , and group by attribute headquarter, list in asc by the x-axis.
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
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 labevents ( row_id number, subject_id number, hadm_...
the number of patients who received lmb/lmbsac fus post/post since 2103.
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 = 'lmb/lmbsac fus post/post') AND STRFTIME('%y', proced...
mimic_iii
CREATE TABLE table_name_46 ( week INTEGER, date VARCHAR, attendance VARCHAR )
Which December 4, 1976 week has an attendance less than 57,366?
SELECT MIN(week) FROM table_name_46 WHERE date = "december 4, 1976" AND attendance < 57 OFFSET 366
sql_create_context
CREATE TABLE table_13018116_1 ( played VARCHAR, pts_agst VARCHAR )
What is the number of played when points against 645?
SELECT COUNT(played) FROM table_13018116_1 WHERE pts_agst = 645
sql_create_context
CREATE TABLE table_name_56 ( home_team VARCHAR, venue VARCHAR )
Who is the home team based at windy hill?
SELECT home_team FROM table_name_56 WHERE venue = "windy hill"
sql_create_context
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, ...
on 07/01/last year, when was the first time that patient 4092 had a arterial bp mean measured?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4092)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
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...
what are the flights from ORLANDO to CLEVELAND on US that arrive around 10pm
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 (((flight.arrival_time <= 2230 AND flight.arrival_time >= 2130) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight....
atis
CREATE TABLE table_52479 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Team" text, "College" text )
What was the lowest pick number for the Boston Celtics?
SELECT MIN("Pick") FROM table_52479 WHERE "Team" = 'boston celtics'
wikisql
CREATE TABLE table_9417 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text )
Which team has fewer than 4 rounds for Jan Van Breda Kolff?
SELECT "School/Club Team" FROM table_9417 WHERE "Round" < '4' AND "Player" = 'jan van breda kolff'
wikisql
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_mana...
Which apartments have unit status availability of both 0 and 1? Return their apartment numbers.
SELECT T1.apt_number FROM apartments AS T1 JOIN view_unit_status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM apartments AS T1 JOIN view_unit_status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1
spider
CREATE TABLE table_51562 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text )
Which date was for Japan?
SELECT "Date" FROM table_51562 WHERE "Country" = 'japan'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
在医疗记录中那个病号蒋蕴藉购买了金额超过8634.98元的药品几次?记录的就诊编号是多些?
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 > 8634.98)
css
CREATE TABLE table_59184 ( "Elimination" text, "Wrestler" text, "Eliminated by" text, "Elimination Move" text, "Time" text )
Which Wrestler has an Elimination of 5?
SELECT "Wrestler" FROM table_59184 WHERE "Elimination" = '5'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
how much does remov ext immobilization cost.
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_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 = 'remov ext immobilization'))
mimic_iii
CREATE TABLE table_12895 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Streak" text )
Which Streak has a Record of 21 22?
SELECT "Streak" FROM table_12895 WHERE "Record" = '21–22'
wikisql
CREATE TABLE table_72554 ( "Rank" real, "Place" text, "County" text, "Per Capita Income" text, "Median House- hold Income" text, "Population" real, "Number of Households" real )
What is the median household income for Woodside?
SELECT "Median House- hold Income" FROM table_72554 WHERE "Place" = 'Woodside'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
找出患者吴鹏天去3862887这家医院看门诊诊断结果不含有缺血的看病记录
SELECT * 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 hz_info.YLJGDM = '3862887' AND NOT zzmzjzjlb.JZZDSM LIKE '%缺血%' UNION SELECT * FROM person_info JO...
css
CREATE TABLE Artist ( ArtistId integer, Name varchar(120) ) CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varchar(20), Title varchar(30), ReportsTo integer, BirthDate datetime, HireDate datetime, Address varchar(70), City varchar(40), State ...
What are the number of the phone numbers for each employee?, rank by the Y from high to low.
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
患者奚星光在零六年十一月十七日往后有哪些门诊就诊的检验报告单?列出门诊就诊流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '奚星光' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2006-11-17')
css
CREATE TABLE table_name_97 ( country VARCHAR, network VARCHAR )
Which Country has a Network of channel 1?
SELECT country FROM table_name_97 WHERE network = "channel 1"
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
How small is 549 ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 549
advising
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
For those dates that have the 5 highest cloud cover rates, please bin the date into Year interval and compute their average cloud cover, rank by the y axis from high to low.
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) DESC
nvbench
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number...
All questions and answers by user, rendered as HTML.
SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb', 'Data.StackExchange')
sede
CREATE TABLE table_name_43 ( bowling_figures_wickets_runs__overs_ VARCHAR, venue VARCHAR, versus VARCHAR )
During the competition at Port Elizabeth, where the opponent was Australia, what were the bowling figures?
SELECT bowling_figures_wickets_runs__overs_ FROM table_name_43 WHERE venue = "port elizabeth" AND versus = "australia"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients transferred within this facility have stayed in the hospital for more than 34 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "34"
mimicsql_data
CREATE TABLE table_74685 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which team was the away team when the game was at punt road oval?
SELECT "Away team" FROM table_74685 WHERE "Venue" = 'punt road oval'
wikisql
CREATE TABLE table_name_77 ( place VARCHAR, to_par VARCHAR, score VARCHAR )
What place has a To par of +4 and a score of 74-70-74-74=292?
SELECT place FROM table_name_77 WHERE to_par = "+4" AND score = 74 - 70 - 74 - 74 = 292
sql_create_context
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text )
what two hospitals holding consecutive rankings of 8 and 9 respectively , both provide 1200 hospital beds ?
SELECT "hospital" FROM table_203_216 WHERE "rank" IN (8, 9)
squall
CREATE TABLE table_17080868_6 ( location_attendance VARCHAR, date VARCHAR )
what is the total number of attendance where the date is december 29?
SELECT COUNT(location_attendance) FROM table_17080868_6 WHERE date = "December 29"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airp...
list all flights going from BOSTON to ATLANTA after 1800 o'clock on wednesday and before 700 o'clock am on thursday
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 WHERE ((date_day.day_number = 24 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients whose procedure long title is other bronchoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Other bronchoscopy"
mimicsql_data
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CR...
are there any flights on 6 10 from BURBANK to TACOMA
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 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND date_day.day_number = 10 AND date_day.month_number = 6 AND da...
atis
CREATE TABLE table_name_10 ( to_par VARCHAR, money___$__ VARCHAR )
Which to par has a prize less than $800?
SELECT to_par FROM table_name_10 WHERE money___$__ = 800
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
what is the minimum total hospital cost that includes the total cholesterol lab test until 3 years ago?
SELECT MIN(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 lab.patientunitstayid FROM lab WHERE lab.labname = 'total cholesterol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRE...
eicu
CREATE TABLE table_56750 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the largest Crowd number for the Home team of North Melbourne?
SELECT MAX("Crowd") FROM table_56750 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
Can you draw the trend of maximal score over the year?, rank by the x-axis in descending.
SELECT Year, MAX(Score) FROM wine GROUP BY Year ORDER BY Year DESC
nvbench
CREATE TABLE table_203_808 ( id number, "rank" number, "peak name" text, "elevation" text, "location" text, "notes" text )
how many peaks are below 3200 feet ?
SELECT COUNT("peak name") FROM table_203_808 WHERE "elevation" < 3200
squall
CREATE TABLE table_24018430_3 ( written_by VARCHAR, directed_by VARCHAR )
what is writtenand directed by shannon flynn?
SELECT written_by FROM table_24018430_3 WHERE directed_by = "Shannon Flynn"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
provide the number of patients whose admission type is emergency and procedure short title is cont inv mec ven 96+ hrs?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Cont inv mec ven 96+ hrs"
mimicsql_data
CREATE TABLE table_name_96 ( occ_championships INTEGER, school VARCHAR )
How many times have Central Crossing won the OCC Championship?
SELECT SUM(occ_championships) FROM table_name_96 WHERE school = "central crossing"
sql_create_context
CREATE TABLE table_22654073_13 ( game VARCHAR, date VARCHAR )
How many games were played on May 11?
SELECT COUNT(game) FROM table_22654073_13 WHERE date = "May 11"
sql_create_context
CREATE TABLE table_204_496 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
at the 2006 gran premio telmex , who finished last ?
SELECT "driver" FROM table_204_496 ORDER BY "pos" DESC LIMIT 1
squall
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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_icd_procedures ( ...
in a year before, how many prescriptions were written for moexipril?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'moexipril' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_33717 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What day did they play the New Orleans Saints?
SELECT "Date" FROM table_33717 WHERE "Opponent" = 'new orleans saints'
wikisql
CREATE TABLE table_name_52 ( iata VARCHAR, icao VARCHAR )
What is the IATA when the ICAO is wipp?
SELECT iata FROM table_name_52 WHERE icao = "wipp"
sql_create_context
CREATE TABLE table_24966 ( "No." real, "Season" text, "Championship" real, "No. of teams" real, "Start (reg. season)" text, "Finish (incl. championship)" text, "Top record" text, "National Champion" text )
What is the year range of season 4?
SELECT "Season" FROM table_24966 WHERE "No." = '4'
wikisql
CREATE TABLE gwyjzb ( 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, ...
被医疗就诊17535786353患者的总医疗费花销是多少?
SELECT gwyjzb.MED_AMOUT FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '17535786353' UNION SELECT fgwyjzb.MED_AMOUT FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '17535786353'
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...
在6998667这个医院的患者魏烨磊,他的出院诊断疾病名称中不包括楔状缺损的医疗就诊记录编号是哪些
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '魏烨磊' AND t_kc21.MED_SER_ORG_NO = '6998667' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%楔状缺损%'
css
CREATE TABLE table_27756572_10 ( score VARCHAR, date VARCHAR )
What was the score in the game on March 26?
SELECT score FROM table_27756572_10 WHERE date = "March 26"
sql_create_context
CREATE TABLE table_name_59 ( date VARCHAR, opponents_in_the_final VARCHAR )
Which Date has Opponents in the final of valeria casillo lilly raffa?
SELECT date FROM table_name_59 WHERE opponents_in_the_final = "valeria casillo lilly raffa"
sql_create_context
CREATE TABLE table_59954 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
Which Place that has Money of 150, and a Player of bobby cruickshank?
SELECT "Place" FROM table_59954 WHERE "Money ( $ )" = '150' AND "Player" = 'bobby cruickshank'
wikisql
CREATE TABLE table_name_88 ( end_term INTEGER, title VARCHAR )
What is the total End term with a Title of prince regent of bavaria?
SELECT SUM(end_term) FROM table_name_88 WHERE title = "prince regent of bavaria"
sql_create_context
CREATE TABLE table_name_43 ( visitor VARCHAR, decision VARCHAR, date VARCHAR )
Who was the visitor on november 14 with leclaire recording the decision?
SELECT visitor FROM table_name_43 WHERE decision = "leclaire" AND date = "november 14"
sql_create_context
CREATE TABLE table_name_70 ( abbr VARCHAR, votes__2011_ VARCHAR )
WHAT IS THE ABBR WITH VOTES OF 11.2% IN 2011?
SELECT abbr FROM table_name_70 WHERE votes__2011_ = "11.2%"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
what are the new prescriptions of patient 007-849 today compared with the prescriptions yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '007-849') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicati...
eicu
CREATE TABLE table_name_25 ( laps VARCHAR, start VARCHAR )
How many laps have 1 as the start?
SELECT COUNT(laps) FROM table_name_25 WHERE start = "1"
sql_create_context
CREATE TABLE table_10794 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What is the record for the game that has a loss of Johnson (5-6)?
SELECT "Record" FROM table_10794 WHERE "Loss" = 'johnson (5-6)'
wikisql
CREATE TABLE table_14782 ( "Candidate" text, "Background" text, "Original Team" text, "Hometown" text, "Result" text )
What is the original team that was Hired by Trump (5-19-2005)?
SELECT "Original Team" FROM table_14782 WHERE "Result" = 'hired by trump (5-19-2005)'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is age and religion of subject id 29961?
SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "29961"
mimicsql_data
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Agreements ( Do...
Compare the total number of different product names, show y axis in asc order.
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name)
nvbench
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...
calculate the number of patients with abnormal loss of weight who had a lab test for pleural fluid.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Abnormal loss of weight" AND lab.fluid = "Pleural"
mimicsql_data
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...
查询7146110医院从14年7月6日到18年9月11日所有姓赵的病人的医疗就诊记录
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '7146110' AND qtb.IN_HOSP_DATE BETWEEN '2014-07-06' AND '2018-09-11' AND qtb.PERSON_NM LIKE '赵%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '7146110' AND gyb.IN_HOSP_DATE BETWEEN '2014-07-06' AND '2018-09-11' AND gyb.PERSON_NM LIKE '赵%' UNION SELECT * FROM zyb WHERE ...
css
CREATE TABLE table_27755784_6 ( record VARCHAR, date VARCHAR )
What was the record after the game on November 10?
SELECT record FROM table_27755784_6 WHERE date = "November 10"
sql_create_context
CREATE TABLE table_13764 ( "Rank" real, "Name" text, "1st run" text, "2nd run" text, "3rd run" text, "Total" real )
How many totals have 38.023 (6) as the 3rd run?
SELECT COUNT("Total") FROM table_13764 WHERE "3rd run" = '38.023 (6)'
wikisql
CREATE TABLE table_13544 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
What manufacturer has a year made of 1883?
SELECT "Manufacturer" FROM table_13544 WHERE "Year made" = '1883'
wikisql
CREATE TABLE table_79753 ( "Exam" text, "2006 First Time" text, "2006 All" text, "2007 First Time" text, "2007 All" text, "2008 First Time" text, "2008 All" text, "2009 First Time" text, "2009 All" text, "2010 First Time" text, "2011 First Time" text, "2012 First Time" te...
What is the percentage for 2008 First time when in 2006 it was 85%?
SELECT "2008 First Time" FROM table_79753 WHERE "2006 First Time" = '85%'
wikisql
CREATE TABLE table_name_75 ( team VARCHAR, seed VARCHAR, notes VARCHAR )
What team with a seed value greater than 7 has a note that they were an NCRAA champion?
SELECT team FROM table_name_75 WHERE seed > 7 AND notes = "ncraa champion"
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 mzjzjlb ( HXPLC number, HZXM ...
从2009年9月11日直到17年9月26日为止编号为52631015的作为检查人对患者15672063所有检验结果指标记载的检验指标流水号都是啥?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '15672063' AND jyjgzbb.JYRQ BETWEEN '2009-09-1...
css
CREATE TABLE table_1473672_2 ( nhl_team VARCHAR, player VARCHAR )
What nhl team does stan weir play for?
SELECT nhl_team FROM table_1473672_2 WHERE player = "Stan Weir"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int,...
what flights do you have leaving DENVER and arriving in SAN FRANCISCO
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_name_32 ( college_junior_club_team__league_ VARCHAR, round VARCHAR )
What College/Junior/Club Team (League) has a round of 3?
SELECT college_junior_club_team__league_ FROM table_name_32 WHERE round = 3
sql_create_context
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_33053 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the Home team's score when the Venue was mcg?
SELECT "Home team score" FROM table_33053 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_name_28 ( boat_builder VARCHAR, number VARCHAR, name VARCHAR )
What boat builder built the valmai with a number less than 65?
SELECT boat_builder FROM table_name_28 WHERE number < 65 AND name = "valmai"
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
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, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, and sort from low to high by the Y.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID)
nvbench
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...
count the number of patients on id route of drug administration who have been diagnosed with stevens-johnson syndrome-toxic epidermal necrolysis overlap syndrome.
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 = "Stevens-Johnson-TEN syn" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_name_44 ( score VARCHAR, date VARCHAR )
What is the score of the match on November 15, 2011?
SELECT score FROM table_name_44 WHERE date = "november 15, 2011"
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
on 08/04/last year', what was minimum arterial bp [systolic] of patient 29666?
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29666)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
calculate the number of patients with unspecified opioid type dependence who received drug via ivpca 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.long_title = "Opioid type dependence, unspecified" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_37462 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What date has dallas cowboys as the opponent?
SELECT "Date" FROM table_37462 WHERE "Opponent" = 'dallas cowboys'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what is the ingesting method of lactated ringers iv solp?
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'lactated ringers iv solp'
eicu
CREATE TABLE table_1831262_2 ( hydroxymatairesinol VARCHAR, sesamin VARCHAR )
what is the number of hydroxymatairesinol where sesamin is 62724?
SELECT hydroxymatairesinol FROM table_1831262_2 WHERE sesamin = "62724"
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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
what was the first value of a bilirubin, total lab test of patient 25493 in the first hospital visit?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25493 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilir...
mimic_iii
CREATE TABLE table_51295 ( "Event" text, "2nd round" text, "Quarterfinal" text, "Semifinal" text, "Final" text, "Rank" real )
Which Quarterfinal has a Rank larger than 9?
SELECT "Quarterfinal" FROM table_51295 WHERE "Rank" > '9'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
how many visits did patient 027-91255 undergo at the icu since 2103?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-91255') AND STRFTIME('%y', patient.unitadmittime) >= '2103'
eicu