context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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, ...
患者秦茉莉在门诊诊断为疾病O29.001时的二氧化碳结果定量及单位分别是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
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...
自2002年1月31日到2009年6月9日,查一下医疗机构2412028的总金额和统筹总金额
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2412028' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-01-31' AND '2009-06-09' UNION SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_k...
css
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 admitted to phys referral/normal deli were treated with simv40?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.formulary_drug_cd = "SIMV40"
mimicsql_data
CREATE TABLE table_77400 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What is the total number for a place with points smaller than 12?
SELECT COUNT("Place") FROM table_77400 WHERE "Points" < '12'
wikisql
CREATE TABLE table_47206 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text )
What name was in the number 4 spot when Aiden was number 7 and James was number 3?
SELECT "No. 4" FROM table_47206 WHERE "No. 7" = 'aiden' AND "No. 3" = 'james'
wikisql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE View_Unit_Status ...
Show the number of apartment bookings in each day and group by booking end date with a line chart, sort by the booking_end_date in descending.
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date ORDER BY booking_end_date DESC
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...
患者李弘伟的报告日期均在2016年5月19日之后的检验报告单中有哪些相关的住院就诊记录?当时住院就诊流水号都是什么呢?
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '李弘伟' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2016-05-19')
css
CREATE TABLE table_name_51 ( bus_width__bits_ INTEGER, designation VARCHAR )
Designation of pc800 has which highest Bus width (bits)?
SELECT MAX(bus_width__bits_) FROM table_name_51 WHERE designation = "pc800"
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...
what is the number of patients whose ethnicity is white - russian and age is less than 77?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.age < "77"
mimicsql_data
CREATE TABLE table_73031 ( "Engine" text, "Production" text, "Transmission" text, "Power" text, "Torque" text, "Acceleration 0\u2013100km/h (0\u201362mph)" text, "Top Speed" text )
What is the acceleration 0-100km/h that was produced in 2002-2006?
SELECT "Acceleration 0\u2013100km/h (0\u201362mph)" FROM table_73031 WHERE "Production" = '2002-2006'
wikisql
CREATE TABLE table_22824297_1 ( no VARCHAR, hometown VARCHAR )
How many values for number occur with the hometown of Canton, Illinois?
SELECT COUNT(no) FROM table_22824297_1 WHERE hometown = "Canton, Illinois"
sql_create_context
CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata t...
Find the name of the airports located in Cuba or Argentina.
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
spider
CREATE TABLE table_204_495 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
name one date with the only attendance over 32,000
SELECT "date" FROM table_204_495 WHERE "attendance" > 32000
squall
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 the number of patients whose admission location is clinic referral/premature and procedure short title is endosc retro cholangiopa?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.short_title = "Endosc retro cholangiopa"
mimicsql_data
CREATE TABLE table_77422 ( "Rank" text, "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text )
What nation has 28 bronze medals?
SELECT "Nation" FROM table_77422 WHERE "Bronze" = '28'
wikisql
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...
在2003年9月3日到2003年10月12日间患者53577732全部检验报告单的审核日期都是几月几号?
SELECT jybgb.SHSJ 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 = '53577732' AND jybgb.BGRQ BETWEEN '2003-09-03' AND '2003-10-12' UNION...
css
CREATE TABLE table_name_27 ( tyre VARCHAR, entrant VARCHAR )
What tyre was used for an entrant of Ecurie Nationale Suisse?
SELECT tyre FROM table_name_27 WHERE entrant = "ecurie nationale suisse"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_...
i need a flight from PHILADELPHIA to DENVER on sunday
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 = 'DENVER' AND date_day.day_number = 27 AND date_day.month_number = 8 AND da...
atis
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...
count the number of patients whose year of birth is less than 1846 and drug route is po?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1846" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is minimum age of patients whose marital status is widowed and age is greater than or equal to 43?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "43"
mimicsql_data
CREATE TABLE exhibition ( exhibition_id number, year number, theme text, artist_id number, ticket_price number ) CREATE TABLE exhibition_record ( exhibition_id number, date text, attendance number ) CREATE TABLE artist ( artist_id number, name text, country text, year_j...
What are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009?
SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE year < 2009
spider
CREATE TABLE table_13258851_2 ( date VARCHAR, opponent VARCHAR )
On what date was the game against San Diego Chargers played?
SELECT date FROM table_13258851_2 WHERE opponent = "San Diego Chargers"
sql_create_context
CREATE TABLE table_25801 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
List all players with highest assists from April 2.
SELECT "High assists" FROM table_25801 WHERE "Date" = 'April 2'
wikisql
CREATE TABLE table_name_28 ( failures INTEGER, launches VARCHAR, partial_failures VARCHAR )
What is the least amount of failures with 1 launch and 0 partial failures?
SELECT MIN(failures) FROM table_name_28 WHERE launches = 1 AND partial_failures < 0
sql_create_context
CREATE TABLE table_name_53 ( gender VARCHAR, area VARCHAR )
What Gender has the area of swannanoa?
SELECT gender FROM table_name_53 WHERE area = "swannanoa"
sql_create_context
CREATE TABLE table_69123 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What are the total amount of Goals Conceded when the Points are less than 26, and when the value for Played is less than 18?
SELECT SUM("Goals Conceded") FROM table_69123 WHERE "Points" < '26' AND "Played" < '18'
wikisql
CREATE TABLE table_name_5 ( flap INTEGER, class VARCHAR )
What is the highest flap for class 500 cc?
SELECT MAX(flap) FROM table_name_5 WHERE class = "500 cc"
sql_create_context
CREATE TABLE table_68626 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Points" real )
What is the lowest amount of points for a Ford Cosworth DFR (Mader) 3.5 V8 engine?
SELECT MIN("Points") FROM table_68626 WHERE "Engine" = 'ford cosworth dfr (mader) 3.5 v8'
wikisql
CREATE TABLE table_name_74 ( nationality VARCHAR, college_country_team VARCHAR )
What is the nationality of the player who went to college at Mississippi?
SELECT nationality FROM table_name_74 WHERE college_country_team = "mississippi"
sql_create_context
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), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Use a histogram to show the department's id and corresponding employees' first name.
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees
nvbench
CREATE TABLE table_23770 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" text, "Jockey" text, "Winner/2nd" text )
What was the result of the race where the jockey was J. Marshall?
SELECT "Result" FROM table_23770 WHERE "Jockey" = 'J. Marshall'
wikisql
CREATE TABLE table_31194 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real )
What is the minimum stolen ends record where the pa record is 40?
SELECT MIN("Stolen Ends") FROM table_31194 WHERE "PA" = '40'
wikisql
CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percen...
Count the number of programs broadcast for each time section of a day in a bar chart, and could you order in desc by the x axis?
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY Time_of_day DESC
nvbench
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 demographic ...
provide the number of patients whose discharge location is home and procedure icd9 code is 5783?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.icd9_code = "5783"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id ...
what was the first procedure time of patient 41393 for spinal tap until 2103?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spinal tap') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 41393) AND STRFTIME('%y'...
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 ...
what are the three most commonly ordered procedures for patients who have received temporary tracheostomy within 2 months previously in 2102?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admi...
mimic_iii
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
能知道医疗机构8227829金额排在前二十四名的项目吗
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '8227829' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 2...
css
CREATE TABLE table_name_14 ( athlete VARCHAR, time VARCHAR )
What is the Athlete of the race with a Time of 9.78?
SELECT athlete FROM table_name_14 WHERE time = 9.78
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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_diagnoses ( row_id number, icd9_code text, sh...
whats the sex of patient 25869?
SELECT patients.gender FROM patients WHERE patients.subject_id = 25869
mimic_iii
CREATE TABLE table_name_76 ( opponent VARCHAR, game_site VARCHAR, week VARCHAR )
Which opponent was played at Forbes Field after week 4?
SELECT opponent FROM table_name_76 WHERE game_site = "forbes field" AND week > 4
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...
how many patients are in thecatholic region and procedured for excision or destruction of other lesion or tissue of heart with an endovascular approach?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.religion = "CATHOLIC" AND procedures.long_title = "Excision or destruction of other lesion or tissue of heart, endovascular approach"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is days of hospital stay and death status of subject id 7578?
SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "7578"
mimicsql_data
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHA...
What are the different transaction types, and how many transactions of each have taken place Show bar chart, and sort by the the total number in ascending.
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_37 ( in_service INTEGER, unit VARCHAR )
What is the highest In service for a vessel with a listed Unit of 12th minesweeper squadron?
SELECT MAX(in_service) FROM table_name_37 WHERE unit = "12th minesweeper squadron"
sql_create_context
CREATE TABLE table_name_51 ( bronze INTEGER, silver VARCHAR, gold VARCHAR )
What is the number of bronze that silver is smaller than 1 and gold bigger than 0?
SELECT AVG(bronze) FROM table_name_51 WHERE silver < 1 AND gold > 0
sql_create_context
CREATE TABLE table_51337 ( "Wicket Partnership" text, "Runs" text, "Batsmen" text, "Opponents" text, "Venue" text, "Season" text )
Which season is the wicket 2nd partnership in?
SELECT "Season" FROM table_51337 WHERE "Wicket Partnership" = '2nd'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, ...
i want to go from DENVER to ATLANTA round trip and make a stop at PITTSBURGH is this possible
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.ci...
atis
CREATE TABLE table_name_56 ( name VARCHAR, number_of_electorates__2009_ INTEGER )
Which Name has a Number of electorates (2009) greater than 188,799?
SELECT name FROM table_name_56 WHERE number_of_electorates__2009_ > 188 OFFSET 799
sql_create_context
CREATE TABLE table_203_499 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
how many golfers made at least $ 40,000 ?
SELECT COUNT("player") FROM table_203_499 WHERE "money ($)" >= 40000
squall
CREATE TABLE table_21478 ( "Downstream" text, "Upstream" text, "Bandwidth" text, "Price TL" text, "Every 1 GB" text, "MAX" text )
What is the upstream speed that you get for 89 tl?
SELECT "Upstream" FROM table_21478 WHERE "Price TL" = '89 TL'
wikisql
CREATE TABLE table_47097 ( "Asomtavruli" text, "Nuskhuri" text, "Mkhedruli" text, "Letter name" text, "Phoneme" text )
What is the Phoneme symbol for the letter name z n?
SELECT "Phoneme" FROM table_47097 WHERE "Letter name" = 'zɛn'
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 ( ...
count the number of patients whose days of hospital stay is greater than 23 and drug name is phenylephrine hcl?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "23" AND prescriptions.drug = "Phenylephrine HCl"
mimicsql_data
CREATE TABLE table_26986076_5 ( sat_29_aug VARCHAR, tues_24_aug VARCHAR )
When 21' 10.25 106.930mph is Tuesday August 24th what is Saturday August 29th?
SELECT sat_29_aug FROM table_26986076_5 WHERE tues_24_aug = "21' 10.25 106.930mph"
sql_create_context
CREATE TABLE table_58599 ( "Mid Gippsland FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What's the sum of draws for against larger than 1228 with fewer than 1 wins?
SELECT SUM("Draws") FROM table_58599 WHERE "Against" > '1228' AND "Wins" < '1'
wikisql
CREATE TABLE table_name_13 ( crowd INTEGER, venue VARCHAR )
What was the smallest crowd in games at the corio oval?
SELECT MIN(crowd) FROM table_name_13 WHERE venue = "corio oval"
sql_create_context
CREATE TABLE zyb ( 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...
根据不同的科室编码和出院诊断疾病编码,列出患者的平均年龄在医院8332581所有医疗就诊记录中是多大?
SELECT qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '8332581' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '8332581' GROUP BY gyb.MED_ORG_DEPT_CD, gyb....
css
CREATE TABLE table_38177 ( "Round" text, "Venue" text, "Discipline" text, "Date" text, "Winner" text, "Second" text, "Third" text )
Who was third in round 14?
SELECT "Third" FROM table_38177 WHERE "Round" = '14'
wikisql
CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate n...
List the studios of each film and the number of films produced by that studio.
SELECT studio, COUNT(*) FROM film GROUP BY studio
spider
CREATE TABLE table_15187735_1 ( episode INTEGER, segment_d VARCHAR )
In what episode was segment D ned Can Corn?
SELECT MAX(episode) FROM table_15187735_1 WHERE segment_d = "ned Can Corn"
sql_create_context
CREATE TABLE table_name_49 ( national_university_of_ireland INTEGER, cultural_and_educational_panel VARCHAR, labour_panel VARCHAR )
What is the lowest number of National University of Ireland that has a Cultural and Educational Panel of 0, and a Labour Panel smaller than 1?
SELECT MIN(national_university_of_ireland) FROM table_name_49 WHERE cultural_and_educational_panel = 0 AND labour_panel < 1
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize a bar chart about the distribution of All_Games and ACC_Percent , and rank by the Y in descending.
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
nvbench
CREATE TABLE table_29695 ( "Team" text, "Chairman" text, "Head Coach" text, "Captain" text, "Kitmaker" text, "Shirt sponsor" text )
What is the name of the captain when teh shirt sponsor is n/a?
SELECT "Captain" FROM table_29695 WHERE "Shirt sponsor" = 'N/A'
wikisql
CREATE TABLE table_13049 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What team 2 has lokomotiva as team 1?
SELECT "Team 2" FROM table_13049 WHERE "Team 1" = 'lokomotiva'
wikisql
CREATE TABLE table_train_9 ( "id" int, "pregnancy_or_lactation" bool, "intention_to_arterial_catheter" bool, "intention_to_central_venous_catheter" bool, "surgery" bool, "hypotension" bool, "chest_trauma" bool, "burn_injury" int, "impossible_transthoracic_echocardiogram_tte" bool, ...
known pregnancy
SELECT * FROM table_train_9 WHERE pregnancy_or_lactation = 1
criteria2sql
CREATE TABLE table_27700375_11 ( high_rebounds VARCHAR, location_attendance VARCHAR )
Name the high rebounds for wells fargo center 16,695
SELECT high_rebounds FROM table_27700375_11 WHERE location_attendance = "Wells Fargo Center 16,695"
sql_create_context
CREATE TABLE table_42667 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
What is the Score with a Hoe that is etobicoke kangaroos?
SELECT "Score" FROM table_42667 WHERE "Home" = 'etobicoke kangaroos'
wikisql
CREATE TABLE Student ( Fname VARCHAR, Lname VARCHAR, Sex VARCHAR, Age VARCHAR, Major VARCHAR )
List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.
SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F'
sql_create_context
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 ( ...
give me the number of patients whose primary disease is t5 fracture?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "T5 FRACTURE"
mimicsql_data
CREATE TABLE table_19887 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
Name the segment b for 167
SELECT "Segment B" FROM table_19887 WHERE "Episode" = '167'
wikisql
CREATE TABLE table_55216 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who is the home team that played at MCG?
SELECT "Home team score" FROM table_55216 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_name_73 ( pl_gp VARCHAR, player VARCHAR, reg_gp VARCHAR )
What is the total of PI GP played by Anton Rodin with a Reg GP less than 0?
SELECT COUNT(pl_gp) FROM table_name_73 WHERE player = "anton rodin" AND reg_gp < 0
sql_create_context
CREATE TABLE table_8290 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What was the outcome when darija jurak ana s laurendon was the opponent?
SELECT "Outcome" FROM table_8290 WHERE "Opponents" = 'darija jurak anaïs laurendon'
wikisql
CREATE TABLE table_name_73 ( career_caps VARCHAR, position VARCHAR, tests VARCHAR )
What is the career caps for half-back, when tests is more than 3?
SELECT career_caps FROM table_name_73 WHERE position = "half-back" AND tests > 3
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
整理下患者姜淑华在二零零四年七月三十日到二零二零年十一月二十六日内所有检验结果指标记录的检测人为17450031的检验指标流水号好嘛
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 ...
css
CREATE TABLE table_62847 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
Which Elevation (m) has a Prominence (m) smaller than 2,456, and a Peak of mount kyllini, and a Col (m) smaller than 506?
SELECT MAX("Elevation (m)") FROM table_62847 WHERE "Prominence (m)" < '2,456' AND "Peak" = 'mount kyllini' AND "Col (m)" < '506'
wikisql
CREATE TABLE table_name_7 ( authority VARCHAR, roll VARCHAR )
What's the authority when the roll is 40?
SELECT authority FROM table_name_7 WHERE roll = 40
sql_create_context
CREATE TABLE table_43018 ( "Country" text, "Area (km\u00b2)" text, "Population (2011 est.)" text, "Population density (per km\u00b2)" text, "GDP (PPP) $M USD" text )
How much is the population density with a GDP at $188,112?
SELECT "Population density (per km\u00b2)" FROM table_43018 WHERE "GDP (PPP) $M USD" = '$188,112'
wikisql
CREATE TABLE table_70787 ( "Lithium" text, "Sodium" text, "Potassium" text, "Rubidium" text, "Caesium" text )
what is the properties of sodium when lithium is h a l o g e n s and rubidium is nacl (2.1)?
SELECT "Sodium" FROM table_70787 WHERE "Lithium" = 'h a l o g e n s' AND "Rubidium" = 'nacl (2.1)'
wikisql
CREATE TABLE table_name_19 ( _percentage_gdp VARCHAR, surplus_deficit_ VARCHAR, income VARCHAR, year VARCHAR, expenditure VARCHAR )
Which % GDP has a Year smaller than 2011, and an Expenditure larger than 41.3, and an Income smaller than 48, and a Surplus(Deficit) of (24.6)?
SELECT _percentage_gdp FROM table_name_19 WHERE year < 2011 AND expenditure > 41.3 AND income < 48 AND surplus_deficit_ = "(24.6)"
sql_create_context
CREATE TABLE table_69061 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text )
Which ERP W has a Class of A, and a Call sign of wffc?
SELECT "ERP W" FROM table_69061 WHERE "Class" = 'a' AND "Call sign" = 'wffc'
wikisql
CREATE TABLE table_31859 ( "Place" real, "Lane" real, "Name" text, "Nationality" text, "50m Split" real, "100m Split" text, "150m Split" text, "Time" text )
Which average 50m split had a 150m split of 1:40.00, with a placing of less than 2?
SELECT AVG("50m Split") FROM table_31859 WHERE "150m Split" = '1:40.00' AND "Place" < '2'
wikisql
CREATE TABLE table_name_23 ( date VARCHAR, game INTEGER )
On what date was the game more than 5?
SELECT date FROM table_name_23 WHERE game > 5
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, ...
检验报告单33959685545对应的患者在住院就诊中叫什么名字?
SELECT hz_info.person_info_XM FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '33959685545'
css
CREATE TABLE table_59530 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is Date, when Opposing Teams is 'South Africa', and when Venus is 'Vodacom Park , Bloemfontein'?
SELECT "Date" FROM table_59530 WHERE "Opposing Teams" = 'south africa' AND "Venue" = 'vodacom park , bloemfontein'
wikisql
CREATE TABLE table_23346303_5 ( blocks VARCHAR, points VARCHAR )
What is the blocks total number if the points is 4?
SELECT COUNT(blocks) FROM table_23346303_5 WHERE points = 4
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE tra...
was there any microbiology test result since 3 years ago for the foreign body of patient 54825?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND microbiologyevents.spec_type_desc = 'foreign body' AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE table_19079 ( "Rd." real, "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text, "Report" text )
What was the number of rounds on the Hidden Valley Raceway?
SELECT COUNT("Rd.") FROM table_19079 WHERE "Circuit" = 'Hidden Valley Raceway'
wikisql
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1),...
Find the number of departments in each school Plot them as bar chart, and I want to show by the y axis from high to low please.
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_NAME) DESC
nvbench
CREATE TABLE table_59070 ( "Name" text, "Owner" text, "Programming" text, "Type" text, "Encryption" text )
What is the type for a general programming and the owner tv kanal 5?
SELECT "Type" FROM table_59070 WHERE "Programming" = 'general' AND "Owner" = 'tv kanal 5'
wikisql
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 founder and the sum of price , and group by attribute founder, and order by the x-axis in asc.
SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
What are the prerequisites to EARTH 142 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( c...
show me the five year survival probability of patients who were prescribed clonidine hcl 0.1 mg po tabs after having been diagnosed with s/p breast biopsy?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_17881033_1 ( division_southwest VARCHAR, division_south VARCHAR, division_east VARCHAR )
what is the division southwest when division south was ko uf and division east was osogovo
SELECT division_southwest FROM table_17881033_1 WHERE division_south = "Kožuf" AND division_east = "Osogovo"
sql_create_context
CREATE TABLE table_name_10 ( pick INTEGER, round VARCHAR )
What is the sum of the pick in round 17?
SELECT SUM(pick) FROM table_name_10 WHERE round = 17
sql_create_context
CREATE TABLE table_204_245 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "event" text, "notes" text )
did los perros del mal hold the championship title before ultimo gladiador and ultimo vampiro ?
SELECT (SELECT "date" FROM table_204_245 WHERE "wrestlers" = 'los perros del mal') < (SELECT "date" FROM table_204_245 WHERE "wrestlers" = 'ultimo gladiador and ultimo vampiro')
squall
CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(255) ) CREATE TABLE Services ( service_id INTEGER, organization_id INTEGER, service_type_code CHAR(15), service_details VARCHAR(255) ) C...
Give me a bar chart that the X-axis is the date_moved_in and the Y-axis is Count them, please bin X-axis into Year interval, and show by the Y-axis from low to high.
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events ORDER BY COUNT(date_moved_in)
nvbench
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
在15年8月6日到16年2月8日这段时间,患者37516141一共有多少检验报告单,把这些检验报告单的标本采集部位列出来
(SELECT jybgb.BBCJBW 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 = '37516141' AND jybgb.BGRQ BETWEEN '2015-08-06' AND '2016-02-08') U...
css
CREATE TABLE table_37870 ( "Player" text, "League" real, "Malaysia Cup" real, "FA Cup" real, "Total" real )
What was the lowest FA Cup for a Malaysia Cup of 0?
SELECT MIN("FA Cup") FROM table_37870 WHERE "Malaysia Cup" < '0'
wikisql
CREATE TABLE table_21260421_1 ( winner VARCHAR, score VARCHAR )
How many winners scored exactly 202 (-11)?
SELECT COUNT(winner) FROM table_21260421_1 WHERE score = "202 (-11)"
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...
what is average age of patients whose death status is 0 and primary disease is st elevated myocardial infarction\cardiac cath?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data