context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose marital status is married and item id is 51254?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51254"
mimicsql_data
CREATE TABLE table_55638 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the away team that scored 9.12 (66)?
SELECT "Away team" FROM table_55638 WHERE "Away team score" = '9.12 (66)'
wikisql
CREATE TABLE table_11396 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the highest mean number for Texas when the swimsuit stat was more than 8.839?
SELECT MAX("Average") FROM table_11396 WHERE "State" = 'texas' AND "Swimsuit" > '8.839'
wikisql
CREATE TABLE table_name_13 ( time___mt__ VARCHAR, opponent VARCHAR, date VARCHAR )
What is the (MT) time which has kansas city chiefs as an opponent on nov 11?
SELECT time___mt__ FROM table_name_13 WHERE opponent = "kansas city chiefs" AND date = "nov 11"
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...
从03年5月3日开始到09年5月24日结束患者45065975被开出的所有检验报告单的检验报告单号能否列出来?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_name_60 ( points VARCHAR, tries VARCHAR, goals VARCHAR )
What is the total number of Points with less than 1 tries, and more than 0 goals?
SELECT COUNT(points) FROM table_name_60 WHERE tries < 1 AND goals > 0
sql_create_context
CREATE TABLE table_12758 ( "Date" text, "Opponent#" text, "Rank#" text, "Result" text, "Attendance" text )
What is the result for opponent TCU?
SELECT "Result" FROM table_12758 WHERE "Opponent#" = 'tcu'
wikisql
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 inputevents_cv ( row_id number, subject_id number, ...
for the first time on their first hospital encounter, when did patient 16572 get a lab test?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1
mimic_iii
CREATE TABLE table_26649 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
List all dates of succession in the state class Missouri (3).
SELECT "Date of successors formal installation" FROM table_26649 WHERE "State (class)" = 'Missouri (3)'
wikisql
CREATE TABLE table_55651 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Which women's doubles has Howard Bach Tony Gunawan as Men's doubles and Taufik Hidayat as Men's Singles?
SELECT "Women's doubles" FROM table_55651 WHERE "Men's doubles" = 'howard bach tony gunawan' AND "Men's singles" = 'taufik hidayat'
wikisql
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give the number of patients whose diagnosis long title is other and unspecified coagulation defects.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other and unspecified coagulation defects"
mimicsql_data
CREATE TABLE table_64250 ( "Class" text, "Railway number(s)" text, "Quantity" real, "Year(s) of manufacture" text, "Axle arrangement ( UIC )" text )
what is the quantity when the year of manufacture is 1900 and the class is mc?
SELECT "Quantity" FROM table_64250 WHERE "Year(s) of manufacture" = '1900' AND "Class" = 'mc'
wikisql
CREATE TABLE table_1357 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the score for december 28
SELECT "Score" FROM table_1357 WHERE "Date" = 'December 28'
wikisql
CREATE TABLE table_name_61 ( date VARCHAR, label VARCHAR, catalog VARCHAR )
What is the Date when the label was alfa records, and a Catalog of alca-487?
SELECT date FROM table_name_61 WHERE label = "alfa records" AND catalog = "alca-487"
sql_create_context
CREATE TABLE table_12815 ( "Date" text, "Team" text, "Competition" text, "Round" text, "Opponent" text, "Location" text, "Score" text )
What is the Competition on July 7?
SELECT "Competition" FROM table_12815 WHERE "Date" = 'july 7'
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 demographic (...
count the number of patients who have been diagnosed with neonatal hypoglycemia and discharged to psychiatric facility-partial hospitalization.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND diagnoses.short_title = "Neonatal hypoglycemia"
mimicsql_data
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...
查查患者88565682之前的全部治疗方案
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '88565682' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ...
css
CREATE TABLE table_49848 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Location" text )
What method did Mikhail Ilyukhin win the fight in round 1 when his record was 13-5?
SELECT "Method" FROM table_49848 WHERE "Round" = '1' AND "Res." = 'win' AND "Record" = '13-5'
wikisql
CREATE TABLE table_841 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who ihad the highest points and what was the number when the record was 11-40?
SELECT "High points" FROM table_841 WHERE "Record" = '11-40'
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...
编码为73645436209检验报告单相对应的审核人工号以及姓名都是什么?
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.BGDH = '73645436209' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.BGDH = '73645436209'
css
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
按照平均住院时长把医院0310745各科室的编码、名称以及平均住院时长升序排列出来?
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0310745' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS)
css
CREATE TABLE table_name_38 ( money___ INTEGER, score VARCHAR )
Which average money has a Score of 69-72-72-72=285?
SELECT AVG(money___) AS $__ FROM table_name_38 WHERE score = 69 - 72 - 72 - 72 = 285
sql_create_context
CREATE TABLE table_38647 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which 2009 has a 2008 of A, and a 2010 of 4r?
SELECT "2009" FROM table_38647 WHERE "2008" = 'a' AND "2010" = '4r'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
what flights are available between PHILADELPHIA and DENVER on 9 16
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 = 16 AND date_day.month_number = 9 AND da...
atis
CREATE TABLE table_23624542_4 ( week INTEGER, attendance VARCHAR )
What week has an attendance of 10402
SELECT MIN(week) FROM table_23624542_4 WHERE attendance = 10402
sql_create_context
CREATE TABLE table_8991 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the sum number of round with Nebraska as the college and the overall greater than 40?
SELECT COUNT("Round") FROM table_8991 WHERE "College" = 'nebraska' AND "Overall" > '40'
wikisql
CREATE TABLE table_45844 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
Which years did the player from Providence play for the Grizzlies as small forward?
SELECT "Years for Grizzlies" FROM table_45844 WHERE "Position" = 'small forward' AND "School/Club Team" = 'providence'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of patients whose primary disease is acute subdural hematoma and year of death is less than or equal to 2186?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.dod_year <= "2186.0"
mimicsql_data
CREATE TABLE table_71903 ( "No.1" text, "No.2" text, "No.3" text, "No.5" text, "No.6" text, "FINAL" text )
Who is no.3 when Claudio Sylvie is no.1?
SELECT "No.3" FROM table_71903 WHERE "No.1" = 'claudio sylvie'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose drug code is lora1?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LORA1"
mimicsql_data
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...
手外的门诊量在03年4月3日到08年5月21之间,是多少?
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSMC = '手外科' AND txmzjzjlb.JZKSRQ BETWEEN '2003-04-03' AND '2008-05-21' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSMC = '手外科' AND ftxmzjzjlb.JZKSRQ BETWEEN '2003-04-03' AND '2008-05-21'
css
CREATE TABLE table_34350 ( "Date" text, "Site" text, "Sport" text, "Winning team" text, "Series" text )
Which Site has a Sport of w swimming?
SELECT "Site" FROM table_34350 WHERE "Sport" = 'w swimming'
wikisql
CREATE TABLE table_68031 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the average Year with Chassis equalling cooper t60?
SELECT AVG("Year") FROM table_68031 WHERE "Chassis" = 'cooper t60'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Labs are part of how many classes at the upper level ?
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_16976547_2 ( air_dates VARCHAR, cycle_no VARCHAR )
Name the total number of air dates for 05 cycle
SELECT COUNT(air_dates) FROM table_16976547_2 WHERE cycle_no = "05"
sql_create_context
CREATE TABLE table_20105 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
Who was the constructor of car 22?
SELECT "Constructor" FROM table_20105 WHERE "No" = '22'
wikisql
CREATE TABLE table_name_67 ( entrant VARCHAR, points VARCHAR, year VARCHAR )
What Entrant has 0 points and from 1997?
SELECT entrant FROM table_name_67 WHERE points = 0 AND year = 1997
sql_create_context
CREATE TABLE table_40345 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the result on 30 june 1995?
SELECT "Result" FROM table_40345 WHERE "Date" = '30 june 1995'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose diagnoses long title is unspecified hereditary and idiopathic peripheral neuropathy and lab test category is hematology?
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.long_title = "Unspecified hereditary and idiopathic peripheral neuropathy" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_30531 ( "Rnd" real, "Date" text, "Circuit" text, "Supporting" text, "Distance" text, "GT Winning Car" text, "TC Winning Car" text )
Who was supporting in the round when the gt winning car was dino crescentini?
SELECT "Supporting" FROM table_30531 WHERE "GT Winning Car" = 'Dino Crescentini'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what was the name of the drug, which was prescribed to patient 006-158759 first in 04/2104?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158759')) AND STRFTIME('%y-%m', medication.drugstarttime) = '21...
eicu
CREATE TABLE table_142 ( "! Late 1941" text, "Late 1942" real, "Sept. 1943" real, "Late 1943" real, "Late 1944" real, "1978 Veteran membership" real )
What is the late 1941 when 1978 veteran membership is 20000
SELECT "! Late 1941" FROM table_142 WHERE "1978 Veteran membership" = '20000'
wikisql
CREATE TABLE table_name_87 ( returned_on VARCHAR, year VARCHAR )
Which Returned On has a Year of 2011?
SELECT returned_on FROM table_name_87 WHERE year = 2011
sql_create_context
CREATE TABLE table_41405 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Rebounds" real )
How many Games for the player with Rebounds from Efes Pilsen?
SELECT "Games" FROM table_41405 WHERE "Team" = 'efes pilsen'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
37631577362这个医疗就诊是哪天出院
SELECT gwyjzb.OUT_HOSP_DATE FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '37631577362' UNION SELECT fgwyjzb.OUT_HOSP_DATE FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '37631577362'
css
CREATE TABLE investors ( investor_id number, investor_details text ) CREATE TABLE transactions ( transaction_id number, investor_id number, transaction_type_code text, date_of_transaction time, amount_of_transaction number, share_count text, other_details text ) CREATE TABLE lots (...
Show the maximum amount of transaction.
SELECT MAX(amount_of_transaction) FROM transactions
spider
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
病患去门诊诊断为器质性精神综合征时的同型半胱氨酸数据的平均值以及最值分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) 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.JY...
css
CREATE TABLE table_name_90 ( county VARCHAR, ihsaa_class VARCHAR, location VARCHAR )
What is the county with an AA IHSAA class in ferdinand?
SELECT county FROM table_name_90 WHERE ihsaa_class = "aa" AND location = "ferdinand"
sql_create_context
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text )
Give me a pie to show the number of author from different author.
SELECT Author, COUNT(Author) FROM submission GROUP BY Author
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose primary disease is sternal wound infection?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STERNAL WOUND INFECTION"
mimicsql_data
CREATE TABLE table_8263 ( "Name" text, "Company" text, "Tracking Method" text, "Latest stable release" text, "Price in USD" text )
Name the Company which has a Price in USD of free / negotiable?
SELECT "Company" FROM table_8263 WHERE "Price in USD" = 'free / negotiable'
wikisql
CREATE TABLE table_47584 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
What is the maximum game that was played against the New York Knickerbockers?
SELECT MAX("Game") FROM table_47584 WHERE "Opponent" = 'new york knickerbockers'
wikisql
CREATE TABLE table_name_34 ( year VARCHAR, result VARCHAR, matches VARCHAR )
What is the number of Year with a Result of champions, and Matches larger than 5?
SELECT COUNT(year) FROM table_name_34 WHERE result = "champions" AND matches > 5
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
哪几次医疗记录中给病患任雅昶开出过金额高于2237.38元的药品?列出医疗就诊编号是多少?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '任雅昶' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 2237.38)
css
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 manufacturer , and group by attribute headquarter, could you order in asc by the y-axis please?
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Manufacturer)
nvbench
CREATE TABLE table_23253 ( "School" text, "Baseball stadium" text, "Softball stadium" text, "Basketball arena" text, "Capacity" text )
What is the name of the softball stadium for the school that has Eastern Baseball Stadium?
SELECT "Softball stadium" FROM table_23253 WHERE "Baseball stadium" = 'Eastern Baseball Stadium'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
22021171患者被门诊诊断为混合性焦虑障碍,查看他的检测指标074536的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.Y...
css
CREATE TABLE table_name_40 ( film_title_used_in_nomination VARCHAR, language VARCHAR )
Name the film title that was norwegian
SELECT film_title_used_in_nomination FROM table_name_40 WHERE language = "norwegian"
sql_create_context
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, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
What is the number of 400 -level classes that are being offered for Spring and Summer term ?
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 400 AND 400 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.se...
advising
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 ( ...
How many of the patients had left internal jugular vein thrombosis left arm edema as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA"
mimicsql_data
CREATE TABLE table_29530 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (millions)" text, "Original U.S. air date" text, "Prod. code" real )
How many episodes did Eve Weston write?
SELECT COUNT("No. in series") FROM table_29530 WHERE "Written by" = 'Eve Weston'
wikisql
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest...
Show the names and heights of buildings with at least two institutions founded after 1880 by a bar chart.
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880
nvbench
CREATE TABLE table_name_51 ( series_11 VARCHAR, series_1 VARCHAR )
Who in series 11 corresponds to Peter Jones in series 1?
SELECT series_11 FROM table_name_51 WHERE series_1 = "peter jones"
sql_create_context
CREATE TABLE table_name_7 ( grid INTEGER, driver VARCHAR, points VARCHAR )
What is the sum of the grid of driver ryan hunter-reay, who has more than 24 points?
SELECT SUM(grid) FROM table_name_7 WHERE driver = "ryan hunter-reay" AND points > 24
sql_create_context
CREATE TABLE table_34012 ( "Year ended" text, "Passengers flown" real, "Employees (Average/Year)" real, "Net profit/loss (SEK)" real, "Basic eps (SEK)" real )
Which Net profit/loss (SEK) has a Basic eps (SEK) of -6.58, and Employees (Average/Year) larger than 31,035?
SELECT SUM("Net profit/loss (SEK)") FROM table_34012 WHERE "Basic eps (SEK)" = '-6.58' AND "Employees (Average/Year)" > '31,035'
wikisql
CREATE TABLE table_name_3 ( home VARCHAR, date VARCHAR )
Which home game has a date of January 7?
SELECT home FROM table_name_3 WHERE date = "january 7"
sql_create_context
CREATE TABLE table_name_19 ( matches INTEGER, econ VARCHAR, wickets VARCHAR, best VARCHAR )
What are the lowest matches that have wickets greater than 16, 3/15 as the best, and an econ less than 8?
SELECT MIN(matches) FROM table_name_19 WHERE wickets > 16 AND best = "3/15" AND econ < 8
sql_create_context
CREATE TABLE table_1341522_13 ( party VARCHAR, incumbent VARCHAR )
What party is Sanford Bishop a member of?
SELECT party FROM table_1341522_13 WHERE incumbent = "Sanford Bishop"
sql_create_context
CREATE TABLE table_name_56 ( date VARCHAR, opponent VARCHAR )
What day did Yugoslavia play Luxembourg?
SELECT date FROM table_name_56 WHERE opponent = "luxembourg"
sql_create_context
CREATE TABLE table_22986 ( "Name" text, "Completions" real, "Attempts" real, "Completion %" text, "Yards" real, "Touchdowns" real, "Interceptions" real, "QB Rating" text )
How many total yards for Bobby Layne?
SELECT MAX("Yards") FROM table_22986 WHERE "Name" = 'Bobby Layne'
wikisql
CREATE TABLE table_204_775 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
who is the top ranking nation with the most medals received ?
SELECT "nation" FROM table_204_775 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_name_95 ( all_time INTEGER, amateur_era VARCHAR, first_title VARCHAR, last_title VARCHAR )
What is the lowest All-Time, when First Title is before 1974, when Last Title is '1933', and when Amateur Era is greater than 2?
SELECT MIN(all_time) FROM table_name_95 WHERE first_title < 1974 AND last_title = 1933 AND amateur_era > 2
sql_create_context
CREATE TABLE table_name_80 ( week VARCHAR, date VARCHAR )
Name the week for december 4, 2009
SELECT week FROM table_name_80 WHERE date = "december 4, 2009"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
Show me manager_id by last name in a histogram
SELECT LAST_NAME, MANAGER_ID FROM employees
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
when did patient 030-44598 during the current hospital visit have the minimum creatinine for the last time?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-44598' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'creatinin...
eicu
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...
Among patients admitted before the year 2107, how many of them were Asian?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2107"
mimicsql_data
CREATE TABLE table_17689 ( "Quattroporte IV" text, "Units Produced" real, "Production Period" text, "Engine Capacity" text, "Power" text, "Max Speed" text )
What type of quattroporte iv only produced 340 units?
SELECT "Quattroporte IV" FROM table_17689 WHERE "Units Produced" = '340'
wikisql
CREATE TABLE table_name_31 ( date VARCHAR, venue VARCHAR )
I want to know the date for western oval venue
SELECT date FROM table_name_31 WHERE venue = "western oval"
sql_create_context
CREATE TABLE table_14962 ( "Home" text, "Score" text, "Away" text, "Venue" text, "Golden point(s) scorer" text )
What Away team has the Golden point(s) scorer Trent Hodkinson and the Home of Manly-Warringah Sea Eagles?
SELECT "Away" FROM table_14962 WHERE "Golden point(s) scorer" = 'trent hodkinson' AND "Home" = 'manly-warringah sea eagles'
wikisql
CREATE TABLE table_29508 ( "Period" text, "Live births per year" text, "Deaths per year" text, "Natural change per year" text, "CBR*" text, "CDR*" text, "NC*" text, "TFR*" text, "IMR*" real, "Life expectancy total" text, "Life expectancy males" text, "Life expectancy fema...
What is the natural change per year for the 7.2 CDR group?
SELECT "Natural change per year" FROM table_29508 WHERE "CDR*" = '7.2'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
一共多少人患脑梗死后遗症?
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '脑梗死后遗症' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '脑梗死后遗症'
css
CREATE TABLE table_664 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Winning score" text, "To par" text, "Margin of victory" text, "Purse ( $ )" real, "Winners share ($)" real )
How much is the purse ( $ ) when the margin of victory is 1 stroke?
SELECT "Purse ( $ )" FROM table_664 WHERE "Margin of victory" = '1 stroke'
wikisql
CREATE TABLE table_22619 ( "Pos" real, "Driver" text, "Starts" real, "Finishes" real, "Wins" real, "Podiums" real, "Stage wins" real, "Points" real )
How many podiums for the driver with 18 stage wins?
SELECT COUNT("Podiums") FROM table_22619 WHERE "Stage wins" = '18'
wikisql
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
when did patient 9241 have a microbiology test for the last time since 04/2105?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9241) AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2105-04' ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_53562 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team score where the crowd is greater than 25,000 and the Away team is south melbourne?
SELECT "Away team score" FROM table_53562 WHERE "Crowd" > '25,000' AND "Away team" = 'south melbourne'
wikisql
CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_na...
What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?
SELECT f_id FROM song WHERE resolution > (SELECT MAX(resolution) FROM song WHERE rating < 8)
spider
CREATE TABLE table_name_28 ( location VARCHAR, county VARCHAR )
What is the Location with a county of 30 Hancock?
SELECT location FROM table_name_28 WHERE county = "30 hancock"
sql_create_context
CREATE TABLE table_35392 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
What's the Pick average that has a School/Club Team of Alabama, with a Round that's smaller than 9?
SELECT AVG("Pick") FROM table_35392 WHERE "School/Club Team" = 'alabama' AND "Round" < '9'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, sub...
count the number of patients who have been admitted to the hospital until 2 years ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-2 year')
mimic_iii
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
all flights from BOSTON to PHILADELPHIA which show up on tuesday afternoon
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.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.da...
atis
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE CLASS ( CLASS_COD...
How many students that has a GPA lower than average? Show me a bar chart grouping by student's first name.
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
9616667这家医疗机构当前的在院人数
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9616667' AND HOSP_STS > 0
css
CREATE TABLE table_name_89 ( iata VARCHAR, city VARCHAR )
What shows for IATA for the City of sapporo?
SELECT iata FROM table_name_89 WHERE city = "sapporo"
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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
what was the number of patients that were given a plasma cells test since 2105?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'plasma cells') AND STRFTIME('%y', labevents.charttime) >= '2105')
mimic_iii
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number...
Number of questions asked on a Monday.
SELECT * FROM PostHistory AS p WHERE p.PostHistoryTypeId = 35 AND p.CreationDate BETWEEN '2016-10-18 00:00:00' AND '2018-10-18 23:59:59'
sede
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Please use a bar chart to show the average price of the rooms in a different decor, and display Y-axis in desc order.
SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor ORDER BY AVG(basePrice) DESC
nvbench
CREATE TABLE table_name_60 ( third VARCHAR, nation VARCHAR )
Who came in third in England?
SELECT third FROM table_name_60 WHERE nation = "england"
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
花费的医疗费总额不少于1973.76元的次数在患者72169223的医疗记录有多少,其有什么编号的病是入院诊断出来的,叫啥名?
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '72169223' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1973.76) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '72169223' AND fg...
css
CREATE TABLE table_49461 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
What is the fewest amount of laps when the grid was larger than 1 and 42:31.153?
SELECT MIN("Laps") FROM table_49461 WHERE "Time" = '42:31.153' AND "Grid" > '1'
wikisql
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number...
what were the five most frequent medications prescribed to male patients 30s after they were diagnosed with accidental op laceration within 2 months?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii