context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 ) ...
provide the number of patients whose discharge location is snf and primary disease is upper gi bleed?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "UPPER GI BLEED"
mimicsql_data
CREATE TABLE table_18493 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What are the candidates for noah m. mason?
SELECT COUNT("Candidates") FROM table_18493 WHERE "Incumbent" = 'Noah M. Mason'
wikisql
CREATE TABLE table_name_67 ( meet VARCHAR, club VARCHAR )
Which Meet has a Club of centro de natacon carabobo?
SELECT meet FROM table_name_67 WHERE club = "centro de natacon carabobo"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate...
count the number of patients who had undergone a implt/repl carddefib tot procedure two or more times until 2103.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'implt/repl carddefib ...
mimic_iii
CREATE TABLE table_42287 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real )
What was the lowest wins of Larry Nelson, who ranked less than 5?
SELECT MIN("Wins") FROM table_42287 WHERE "Player" = 'larry nelson' AND "Rank" < '5'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayNa...
Amount of reputation from edits by Community.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%fremont%' OR UPPER(Location) LIKE '%FREMONT%' OR Location LIKE '%fremont%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Order_Items ( order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(15) ) CREATE TABLE Customer_...
A bar chart for finding the number of the 'date became customers' of the customers whose ID is between 10 and 20, and display by the y-axis in descending.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench
CREATE TABLE table_1513 ( "Institution" text, "Wins" real, "Loss" real, "Home Wins" real, "Home Losses" real, "Away Wins" real, "Away Losses" real, "Neutral Wins" real, "Neutral Losses" real, "Current Streak" text )
How many losses did the Michigan State Spartans have?
SELECT MAX("Loss") FROM table_1513 WHERE "Institution" = 'Michigan State Spartans'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
从2019年4月10日开始到2019年4月22日结束的这段时间患者86828604被开出盐酸帕罗西汀片统共有多少次?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '86828604' AND t_kc22.STA_DATE BETWEEN '2019-04-10' AND '2019-04-22' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸帕罗西汀片'
css
CREATE TABLE table_name_82 ( date VARCHAR, year VARCHAR )
When was the date in 1786?
SELECT date FROM table_name_82 WHERE year = 1786
sql_create_context
CREATE TABLE table_21891 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What was the outcome in 1975?
SELECT "Outcome" FROM table_21891 WHERE "Year" = '1975'
wikisql
CREATE TABLE table_2746 ( "Season" real, "Winner" text, "Captain" text, "Coach" text, "League finish" text, "Mat" real, "W" real, "L" real, "Win %" text, "Runner-up" text )
Name the captain for royal challengers bangalore for 5
SELECT "Captain" FROM table_2746 WHERE "Runner-up" = 'Royal Challengers Bangalore' AND "L" = '5'
wikisql
CREATE TABLE table_name_23 ( age_as_of_1_february_2014 VARCHAR, province_or_country_of_birth VARCHAR )
What is the average age as of February 1, 2014 for the supercentenarians born in the United States?
SELECT age_as_of_1_february_2014 FROM table_name_23 WHERE province_or_country_of_birth = "united states"
sql_create_context
CREATE TABLE table_18424435_4 ( directed_by VARCHAR, production_code VARCHAR )
Who directed the episode with a production code of 301?
SELECT directed_by FROM table_18424435_4 WHERE production_code = 301
sql_create_context
CREATE TABLE table_62998 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
Which college did the player picked number 136 go to?
SELECT "College" FROM table_62998 WHERE "Pick" = '136'
wikisql
CREATE TABLE table_203_875 ( id number, "#" number, "name" text, "birth and death" text, "office started" text, "office ended" text )
which bishop served between the years of 1846 and 1866 ?
SELECT "name" FROM table_203_875 WHERE "office started" >= 1846 AND "office ended" <= 1866
squall
CREATE TABLE table_name_33 ( others VARCHAR, martin VARCHAR, source VARCHAR )
What percent of others did ogm/news count when MARTIN had 9%?
SELECT others FROM table_name_33 WHERE martin = "9%" AND source = "ogm/news"
sql_create_context
CREATE TABLE table_name_38 ( güzelçamlı’s_lost_panther VARCHAR )
Which 2005 has a G zel aml s Lost Panther of the muse?
SELECT MAX(2005) FROM table_name_38 WHERE güzelçamlı’s_lost_panther = "the muse"
sql_create_context
CREATE TABLE table_name_4 ( tournament VARCHAR )
What is the 2012 that has tournament played as the tournament?
SELECT 2012 FROM table_name_4 WHERE tournament = "tournament played"
sql_create_context
CREATE TABLE table_16787 ( "Series #" real, "Episode title" text, "Writer(s)" text, "Director" text, "U.S. viewers (millions)" text, "Original air date" text )
When did Shelia Lawrence join the series?
SELECT MIN("Series #") FROM table_16787 WHERE "Writer(s)" = 'Shelia Lawrence'
wikisql
CREATE TABLE table_name_1 ( silver INTEGER, nation VARCHAR, bronze VARCHAR )
Which Silver has a Nation of total, and a Bronze smaller than 18?
SELECT MAX(silver) FROM table_name_1 WHERE nation = "total" AND bronze < 18
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 zyjzjlb ( CYBQDM text, CYBQMC...
患者沈鸿风的检测指标721371的情况,在16年7月25日到17年10月2日期间怎么样?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_name_47 ( bowl_game VARCHAR, season VARCHAR, location VARCHAR )
Which bowl game has a season greater than 2008, with new orleans, Louisiana as the location?
SELECT bowl_game FROM table_name_47 WHERE season > 2008 AND location = "new orleans, louisiana"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
医疗费总额与医疗就诊03425240816相同的医疗就诊记录有哪些呢?查出这些记录的ID、人员ID、人员姓名、公民身份号码、人员性别、人员年龄
SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '03425240816')
css
CREATE TABLE table_59852 ( "Year" real, "Song" text, "Artist" text, "Place" text, "Points" text, "Composer" text )
What is the place in 2007 for the song ' work your magic '?
SELECT "Place" FROM table_59852 WHERE "Year" = '2007' AND "Song" = ' work your magic '
wikisql
CREATE TABLE table_75683 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" real, "Class" text, "Hometown" text, "Games\u2191" real )
Which Class has a Weight of 203?
SELECT "Class" FROM table_75683 WHERE "Weight" = '203'
wikisql
CREATE TABLE table_2562572_2 ( population__1991_ VARCHAR, urban_settlement VARCHAR )
What is the 1991 population for the urban settlement named Ba ki Jarak?
SELECT population__1991_ FROM table_2562572_2 WHERE urban_settlement = "Bački Jarak"
sql_create_context
CREATE TABLE table_name_4 ( total INTEGER, nation VARCHAR, bronze VARCHAR )
Which Total has a Nation of united states, and a Bronze larger than 3?
SELECT MAX(total) FROM table_name_4 WHERE nation = "united states" AND bronze > 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, ...
患者51166395425是在什么时间结束的门诊就诊?
SELECT mzjzjlb.JZJSSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '51166395425'
css
CREATE TABLE table_204_212 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text, "notes" text )
what is the last wager on the chart ?
SELECT "wager" FROM table_204_212 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_name_5 ( br_number VARCHAR, lms_number INTEGER )
Which BR number has an LMS number over 14768?
SELECT br_number FROM table_name_5 WHERE lms_number > 14768
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
how many hours have passed since patient 31482's last stay in careunit tsicu on their current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_19 ( venue VARCHAR, away_team VARCHAR )
Where was the game when Collingwood was the home team?
SELECT venue FROM table_name_19 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_77024 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of Gold, when Silver is 2, and when Total is less than 7?
SELECT COUNT("Gold") FROM table_77024 WHERE "Silver" = '2' AND "Total" < '7'
wikisql
CREATE TABLE table_204_479 ( id number, "defendant" text, "arrested" text, "charge" text, "result" text, "sentence" text )
vernon cassel and reginald shaffer was sentenced how many years ?
SELECT "sentence" FROM table_204_479 WHERE "defendant" IN ('vernon cassel', 'reginald shaffer')
squall
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
what 's the difference between fare code Q and fare code B
SELECT DISTINCT booking_class, class_description, rank FROM class_of_service WHERE booking_class = 'B' OR booking_class = 'Q'
atis
CREATE TABLE table_67505 ( "Season" real, "Cars Entered" real, "Winning Driver" text, "Second Driver" text, "Third Driver" text, "Race Report" text )
What are the largest Cars Entered with a Winning Driver of rodger ward, and a Season smaller than 1959?
SELECT MAX("Cars Entered") FROM table_67505 WHERE "Winning Driver" = 'rodger ward' AND "Season" < '1959'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Find Nationality and the average of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and I want to display in ascending by the the average of meter 100.
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY AVG(meter_100)
nvbench
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...
查查医疗机构6786102患者做盐酸多奈哌齐胶囊的检查记录
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '6786102' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊'
css
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
依据科室的不同编码和入院时诊断的疾病编码看一下医院1314915所有的记录里面医保的大病支付和总医疗费用比值最小是多少
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1314915' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gyb JOIN t_kc24 ON gyb...
css
CREATE TABLE table_69810 ( "Year" text, "Men's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Which women's doubles has a Year of 1992?
SELECT "Women's doubles" FROM table_69810 WHERE "Year" = '1992'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
what are the four most commonly given microbiological tests for patients who had previously received antibacterials - macrolide in the same hospital encounter?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacte...
eicu
CREATE TABLE table_203_221 ( id number, "name" text, "nationality" text, "matches played" number, "goals scored" number, "notes" text )
what is the total number of matches played by brazilians for melbourne ?
SELECT SUM("matches played") FROM table_203_221 WHERE "nationality" = 'brazil'
squall
CREATE TABLE table_name_28 ( title VARCHAR, translation VARCHAR )
Which title has the Translation of vesoul?
SELECT title FROM table_name_28 WHERE translation = "vesoul"
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, ...
被门诊诊断的病人云思远患有躁狂抑郁性精神病当前为躁狂相的的检测指标350790的结果定量以及单位都是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZ...
css
CREATE TABLE table_35249 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many Total medals for the team with a Rank of 8, 1 Bronze and more than 1 Silver?
SELECT MIN("Total") FROM table_35249 WHERE "Bronze" = '1' AND "Rank" = '8' AND "Silver" > '1'
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, ...
列出在2007-12-26到2017-05-25期间,患者华歌韵所有检验结果指标记录的检测人为尤弘业的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ...
css
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, descript...
list the three earliest flights from ATLANTA to PHILADELPHIA on wednesday
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 = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4...
atis
CREATE TABLE table_name_28 ( grid INTEGER, driver VARCHAR, laps VARCHAR )
What is the number of the grid for Johnny Herbert with more than 52 laps?
SELECT SUM(grid) FROM table_name_28 WHERE driver = "johnny herbert" AND laps > 52
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, depart...
do you have any flights from PITTSBURGH to BOSTON on wednesday of next week in the morning
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 (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_nam...
atis
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...
根据不同的入院诊断疾病编码和科室编码,列出所有医疗就诊记录中患者在医院7880116中的平均年龄有多大?
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7880116' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '78801...
css
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
Show me a scatter plot of account id and the total number for .
SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id
nvbench
CREATE TABLE table_2501754_4 ( viewing_figures_millions VARCHAR, prod_code VARCHAR )
How many millions of people watched the episode with a production code of icec483x?
SELECT viewing_figures_millions FROM table_2501754_4 WHERE prod_code = "ICEC483X"
sql_create_context
CREATE TABLE table_name_68 ( position VARCHAR, hometown VARCHAR )
Which position does the player from Muscle Shoals, Alabama play?
SELECT position FROM table_name_68 WHERE hometown = "muscle shoals, alabama"
sql_create_context
CREATE TABLE table_61203 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 2nd leg that Team 1 is Union Berlin?
SELECT "2nd leg" FROM table_61203 WHERE "Team 1" = 'union berlin'
wikisql
CREATE TABLE table_56970 ( "Track" real, "Title" text, "Translation" text, "Composer" text, "Recorded" text )
Which title has a Track of 3?
SELECT "Title" FROM table_56970 WHERE "Track" = '3'
wikisql
CREATE TABLE table_60117 ( "Rank" real, "Club" text, "Season" text, "Goals" real, "Apps" real )
Which Season has a Club of real madrid, and a Rank smaller than 6, and less than 121 goals?
SELECT "Season" FROM table_60117 WHERE "Club" = 'real madrid' AND "Rank" < '6' AND "Goals" < '121'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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_re...
yes what flights will be used on 7 7 in the morning from ATLANTA to BOSTON
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 = 'BOSTON' AND date_day.day_number = 7 AND date_day.month_number = 7 AND da...
atis
CREATE TABLE table_66971 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the margin of victory for Isao Aoki when he was a runner-up?
SELECT "Margin of victory" FROM table_66971 WHERE "Runner(s)-up" = 'isao aoki'
wikisql
CREATE TABLE table_51673 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What Away team has a Home team score of 18.12 (120)?
SELECT "Away team" FROM table_51673 WHERE "Home team score" = '18.12 (120)'
wikisql
CREATE TABLE table_name_27 ( total_medals INTEGER, gold_medals VARCHAR, ensemble VARCHAR )
What is the highest Total Medals that has 0 Gold Medal and a Ensemble of east 80 indoor percussion?
SELECT MAX(total_medals) FROM table_name_27 WHERE gold_medals = 0 AND ensemble = "east 80 indoor percussion"
sql_create_context
CREATE TABLE table_name_84 ( goals_for INTEGER, drawn INTEGER )
What is the total sum of the goals at competitions with more than 10 draws?
SELECT SUM(goals_for) FROM table_name_84 WHERE drawn > 10
sql_create_context
CREATE TABLE table_name_25 ( year_left INTEGER, mascot VARCHAR )
What is the year that the Roughriders left the conference?
SELECT MAX(year_left) FROM table_name_25 WHERE mascot = "roughriders"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures...
what was the name of the organism to be found in the last eye test of patient 23760 during the first hospital encounter?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23760 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'eye' AND NOT microbiologyeven...
mimic_iii
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
what was the procedure which during a month before had been given to patient 51200 two times?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 512...
mimic_iii
CREATE TABLE table_name_30 ( miss_maja_pilipinas VARCHAR, binibining_pilipinas_tourism VARCHAR, binibining_pilipinas_universe VARCHAR )
What Miss Maja Pilipinas has a Binibining Pilipinas-Tourism of not awarded, and a Binibining Pilipinas-Universe of anjanette abayari?
SELECT miss_maja_pilipinas FROM table_name_30 WHERE binibining_pilipinas_tourism = "not awarded" AND binibining_pilipinas_universe = "anjanette abayari"
sql_create_context
CREATE TABLE table_name_76 ( until VARCHAR, name VARCHAR )
When did Jos Luis S nchez Sol end his term of coaching?
SELECT until FROM table_name_76 WHERE name = "josé luis sánchez solá"
sql_create_context
CREATE TABLE table_17118657_10 ( high_points VARCHAR, score VARCHAR )
If the score is 62-70, what are the high points?
SELECT high_points FROM table_17118657_10 WHERE score = "62-70"
sql_create_context
CREATE TABLE table_203_439 ( id number, "pos." number, "rider" text, "semi-final points" number, "final points" number, "final heats" text, "total points" number )
what is hisor her total semifinal points to qualify for the 12th position ?
SELECT "semi-final points" FROM table_203_439 WHERE "pos." = 12
squall
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 age is less than 72 and drug name is sodium citrate 4%?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.drug = "Sodium CITRATE 4%"
mimicsql_data
CREATE TABLE table_204_360 ( id number, "year" number, "host" text, "gold" text, "silver" text, "bronze" text )
how many countries took home the gold the same year they hosted fiba ?
SELECT COUNT(*) FROM table_204_360 WHERE "host" = "gold"
squall
CREATE TABLE table_name_68 ( school VARCHAR, college VARCHAR )
Which school is the player who is headed to Duke from?
SELECT school FROM table_name_68 WHERE college = "duke"
sql_create_context
CREATE TABLE table_15865 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
Which country is the player that went to Georgetown from?
SELECT "Nationality" FROM table_15865 WHERE "School/Club Team" = 'Georgetown'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
Which upper level classes use projects rather than exams for evaluation ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_66972 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score in the mazda senior tournament players championship?
SELECT "Winning score" FROM table_66972 WHERE "Tournament" = 'mazda senior tournament players championship'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose gender is f and lab test name is mcv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "MCV"
mimicsql_data
CREATE TABLE table_1637981_7 ( grand_rapids__grr_ VARCHAR, saginaw__mbs_ VARCHAR )
When Saginaw's fare is $470.47, what was the fare to Grand Rapids?
SELECT grand_rapids__grr_ FROM table_1637981_7 WHERE saginaw__mbs_ = "$470.47"
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 last patient 021-25408 had a procedure since 2105?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25408')) AND STRFTIME('%y', treatment.treatmenttime) >= '2105...
eicu
CREATE TABLE table_name_7 ( line_name VARCHAR, nimt_junction VARCHAR )
What line has Junction of Huntly NIMT
SELECT line_name FROM table_name_7 WHERE nimt_junction = "huntly"
sql_create_context
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 diagnoses ( ...
mention the primary disease and diagnosis short title of the subject name betty campbell.
SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Betty Campbell"
mimicsql_data
CREATE TABLE table_name_90 ( player VARCHAR, previous_team__league_ VARCHAR, year VARCHAR )
What is Player, when Previous Team (League) is 'Medicine Hat Tigers ( WHL )', and when Year is less than 2002?
SELECT player FROM table_name_90 WHERE previous_team__league_ = "medicine hat tigers ( whl )" AND year < 2002
sql_create_context
CREATE TABLE table_name_21 ( at_austin VARCHAR, texas_vs VARCHAR )
What is the Austin record of Kansas State?
SELECT at_austin FROM table_name_21 WHERE texas_vs = "kansas state"
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, ...
这个检验结果指标记录68679682654的仪器编号和设备编码以及仪器名字分别都是什么呢?
SELECT jyjgzbb.SBBM, jyjgzbb.YQBH, jyjgzbb.YQMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '68679682654'
css
CREATE TABLE performance ( Date VARCHAR, Attendance VARCHAR )
What is the date of the performance with the highest number of attendees?
SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1
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, ...
what did patient 31854 last have as an intake today?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854)) AND DATETIME(inputevents_cv....
mimic_iii
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
tell me the first glucose in patient 55247 until 62 months ago?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55247) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-62 mon...
mimic_iii
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
Can I take the 314 course next term ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 314 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId n...
List of Users in a given location. This query lists all users in a given location sorted by reputation.
SELECT * FROM Users WHERE Location LIKE '%##location##%' ORDER BY CreationDate
sede
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( ...
Find the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties, and count them by a bar chart, and rank the number of comptroller from low to high order.
SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller)
nvbench
CREATE TABLE table_16580 ( "#" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (timeslot)" real, "Rank (night)" real, "Rank (week)" text )
How many times was the episode named 'conference call'?
SELECT COUNT("#") FROM table_16580 WHERE "Episode" = 'Conference Call'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id...
Users created each year.
SELECT Users.DisplayName, Users.Reputation, Users.Location, Badges.Name FROM Users INNER JOIN Badges ON Users.Id = Badges.UserId WHERE Users.Reputation = (SELECT MAX(Reputation) FROM Users WHERE Location = 'South Africa' AND Badges.Name = 'Enlightened' AND YEAR(Badges.Date) = 2016)
sede
CREATE TABLE table_204_703 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
name the country that had the same number of bronze medals as russia .
SELECT "nation" FROM table_204_703 WHERE "nation" <> 'russia' AND "bronze" = (SELECT "bronze" FROM table_204_703 WHERE "nation" = 'russia')
squall
CREATE TABLE table_203_737 ( id number, "#" number, "employer" text, "# of employees" number )
how many employees does mundelein high school have ?
SELECT "# of employees" FROM table_203_737 WHERE "employer" = 'mundelein high school'
squall
CREATE TABLE table_31991 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
Name the report for raymond sommer
SELECT "Report" FROM table_31991 WHERE "Winning driver" = 'raymond sommer'
wikisql
CREATE TABLE table_1013129_1 ( college_junior_club_team VARCHAR, player VARCHAR )
What teams did the player vadim sharifijanov play for?
SELECT college_junior_club_team FROM table_1013129_1 WHERE player = "Vadim Sharifijanov"
sql_create_context
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 demographic (...
what is admission time and diagnoses short title of subject name josette orr?
SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr"
mimicsql_data
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 who stayed in hospital for more than 29 days had nu roue of drug administration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "29" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_27969432_4 ( us_viewers__in_millions_ VARCHAR, no_in_season VARCHAR )
How many viewers in millions were there for episode 4 of this season?
SELECT COUNT(us_viewers__in_millions_) FROM table_27969432_4 WHERE no_in_season = 4
sql_create_context
CREATE TABLE table_76739 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text )
What is Team, when Game is 77?
SELECT "Team" FROM table_76739 WHERE "Game" = '77'
wikisql