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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
count the number of patients whose diagnoses long title is perforation of intestine and lab test abnormal status is abnormal?
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 = "Perforation of intestine" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_41 ( orchestra VARCHAR, songwriter_s_ VARCHAR )
Name the orchestra for ted varnick
SELECT orchestra FROM table_name_41 WHERE songwriter_s_ = "ted varnick"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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, ...
患者李弘伟的报告日期均在2016年5月19日之后的检验报告单中有哪些相关的住院就诊记录?当时住院就诊流水号都是什么呢?
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '李弘伟' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2016-05-19')
css
CREATE TABLE table_21837 ( "Season" real, "Winners" text, "Total wins" real, "Runners-up" text, "Third-place" text, "Number of clubs" real )
What is the lowest season?
SELECT MIN("Season") FROM table_21837
wikisql
CREATE TABLE table_name_45 ( to_par VARCHAR, place VARCHAR, player VARCHAR )
What is the to par of player ed sneed, who has a t5 place?
SELECT to_par FROM table_name_45 WHERE place = "t5" AND player = "ed sneed"
sql_create_context
CREATE TABLE table_28005100_1 ( no VARCHAR, title VARCHAR )
How many numbers are there for kam wa7ed fina?
SELECT COUNT(no) FROM table_28005100_1 WHERE title = "Kam Wa7ed Fina"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the number of patients whose marital status is widowed and item id is 51489?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "51489"
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...
count the number of patients whose age is less than 30 and lab test abnormal status is delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "30" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_31 ( high_points VARCHAR, game INTEGER )
What is the highest amount of points when the game is less than 2?
SELECT high_points FROM table_name_31 WHERE game < 2
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, had...
when was the first time that patient 2514 had taken a d5w on 06/26/2105?
SELECT inputevents_cv.charttime 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 = 2514)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
mimic_iii
CREATE TABLE table_72278 ( "Name" text, "Location" text, "Light vehicle" text, "Heavy vehicle (2 axles)" text, "Heavy vehicle (3/4 axles)" text, "Heavy vehicle (5+ axles)" text )
What is the toll for heavy vehicles with 3/4 axles at Verkeerdevlei toll plaza?
SELECT "Heavy vehicle (3/4 axles)" FROM table_72278 WHERE "Name" = 'Verkeerdevlei Toll Plaza'
wikisql
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 primary disease of subject name jane dillard?
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Jane Dillard"
mimicsql_data
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airp...
get SATURDAY fares from WASHINGTON to TORONTO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONTO' AND DAYS_1.day_name =...
atis
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
how many hours have elapsed since patient 017-88691 had his first procedure during this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '017-88691...
eicu
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 ...
Is a lab included in 579 ?
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 579
advising
CREATE TABLE table_name_6 ( college VARCHAR, position VARCHAR )
Where did the player picked for the linebacker position play in college?
SELECT college FROM table_name_6 WHERE position = "linebacker"
sql_create_context
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text )
Which type of crime happen the most in Salford?
SELECT type FROM greatermanchestercrime WHERE lsoa LIKE "%Salford%" GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
greatermanchestercrime
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...
患者陈雅惠之前哪些检查已经做了
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.PERSON_NM = '陈雅惠' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_203_408 ( id number, "rd." number, "grand prix" text, "date" text, "location" text, "pole position" text, "fastest lap" text, "winning driver" text, "constructor" text, "report" text )
who had pole position the most times ?
SELECT "pole position" FROM table_203_408 GROUP BY "pole position" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL...
How many accounts for each customer? Show a bar chart that groups by customer's first name, rank by the x-axis from high to low.
SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY customer_first_name DESC
nvbench
CREATE TABLE table_14630796_1 ( class_aAAA VARCHAR, class_a VARCHAR )
Name the class aaaa for menard
SELECT class_aAAA FROM table_14630796_1 WHERE class_a = "Menard"
sql_create_context
CREATE TABLE table_name_79 ( away_team VARCHAR, home_team VARCHAR )
Who is the away side when north melbourne is the home side?
SELECT away_team FROM table_name_79 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_5612 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year Joined" real, "Previous Conference" text, "Year Left" real, "Conference Joined" text )
Which Year Left is the lowest one that has a School of calumet, and a Year Joined larger than 1993?
SELECT MIN("Year Left") FROM table_5612 WHERE "School" = 'calumet' AND "Year Joined" > '1993'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
脂蛋白(a)二代的参考值界线在被诊断为矽肺(硅肺)I期的患者身上下限和上限是多些?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '矽肺(硅肺)I期' AND jyjgzbb.JCZBMC = '脂蛋白(a)二代' UNION SELECT jyjgzbb.C...
css
CREATE TABLE table_12990 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" text )
What is the type if the transfer window is summer and the moving from category is free agent?
SELECT "Type" FROM table_12990 WHERE "Transfer window" = 'summer' AND "Moving from" = 'free agent'
wikisql
CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE time_slot ( time_slot_id text, day tex...
Which department has the lowest budget?
SELECT dept_name FROM department ORDER BY budget LIMIT 1
spider
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, ...
找出患者吴鹏天去3862887这家医院看门诊诊断结果不含有缺血的看病记录
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjz...
css
CREATE TABLE table_1973648_1 ( founded INTEGER, nickname VARCHAR )
Name the most founded for sea gulls
SELECT MAX(founded) FROM table_1973648_1 WHERE nickname = "Sea Gulls"
sql_create_context
CREATE TABLE table_12602 ( "Date" text, "Opponent" text, "Score" text, "Decision" text, "Attendance" real, "Record" text )
What was the record for the game played @ Dallas stars, with an attendance larger than 15,643, and a decision of Budaj?
SELECT "Record" FROM table_12602 WHERE "Attendance" > '15,643' AND "Decision" = 'budaj' AND "Opponent" = '@ dallas stars'
wikisql
CREATE TABLE table_name_28 ( overall VARCHAR, position VARCHAR, player VARCHAR )
What was the overall draft number of Tom Fleming, a wide receiver?
SELECT COUNT(overall) FROM table_name_28 WHERE position = "wide receiver" AND player = "tom fleming"
sql_create_context
CREATE TABLE table_70801 ( "Date" text, "Opponents" text, "Result F\u2013A" text, "Attendance" real, "Group position" text )
Result F A of 2 0 had what total number of attendance?
SELECT COUNT("Attendance") FROM table_70801 WHERE "Result F\u2013A" = '2–0'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, cha...
how much was the hospital stay for patient 10765?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10765)
mimic_iii
CREATE TABLE table_name_95 ( year INTEGER, state VARCHAR, name VARCHAR )
What is the sum of the years when the winner was prof. priyambada mohanty hejmadi from orissa?
SELECT SUM(year) FROM table_name_95 WHERE state = "orissa" AND name = "prof. priyambada mohanty hejmadi"
sql_create_context
CREATE TABLE table_name_8 ( name VARCHAR, location VARCHAR )
What name is located in China?
SELECT name FROM table_name_8 WHERE location = "china"
sql_create_context
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
Find the number of different states which banks are located at.
SELECT COUNT(DISTINCT state) FROM bank
spider
CREATE TABLE table_46064 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text )
What is the sum of Game, when Record is '2-1-1', and when October is less than 21?
SELECT SUM("Game") FROM table_46064 WHERE "Record" = '2-1-1' AND "October" < '21'
wikisql
CREATE TABLE table_19919 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
Name the segment b for 226 episode
SELECT "Segment B" FROM table_19919 WHERE "Episode" = '226'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
in 03/2105, what was the last lab test time for patient 011-53628?
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 = '011-53628')) AND STRFTIME('%y-%m', lab.labresulttime) = '2105-03' ORDER BY lab.labr...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, u...
how many days have passed since patient 032-24135 was admitted to the hospital.
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '032-24135' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_79515 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Bronze has a Gold of 2, and a Nation of slovakia, and a Total larger than 2?
SELECT MAX("Bronze") FROM table_79515 WHERE "Gold" = '2' AND "Nation" = 'slovakia' AND "Total" > '2'
wikisql
CREATE TABLE table_name_62 ( home_team VARCHAR, venue VARCHAR )
What home team plays at Princes Park?
SELECT home_team FROM table_name_62 WHERE venue = "princes park"
sql_create_context
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 PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), ...
A bar chart about how many different locations does each school have?, I want to order Y from low to high order.
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_ADDRESS)
nvbench
CREATE TABLE table_38410 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
Which Position has Draws smaller than 7 and a Played larger than 22?
SELECT AVG("Position") FROM table_38410 WHERE "Draws" < '7' AND "Played" > '22'
wikisql
CREATE TABLE table_18084 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many numbers were listed under losing bonus when there were 68 tries for?
SELECT COUNT("Losing bonus") FROM table_18084 WHERE "Tries for" = '68'
wikisql
CREATE TABLE table_26322 ( "Episode number Production number" text, "Title" text, "Original airing" text, "Rating" text, "Share" real, "Rating/share (18\u201349)" text, "Total viewers (in millions)" text )
What is the rating/share total number if the total viewers is 12.75 million?
SELECT COUNT("Rating/share (18\u201349)") FROM table_26322 WHERE "Total viewers (in millions)" = '12.75'
wikisql
CREATE TABLE table_67867 ( "Bowler" text, "Over no." real, "Venue" text, "Date" text, "Wickets" text )
Bowler of shane bond has what lowest overall number?
SELECT MIN("Over no.") FROM table_67867 WHERE "Bowler" = 'shane bond'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
which pesticides have been used the least?
SELECT pestcode FROM resultsdata15 GROUP BY pestcode ORDER BY COUNT(*) LIMIT 1
pesticide
CREATE TABLE table_name_89 ( name VARCHAR, year_built VARCHAR )
What was built in 1857?
SELECT name FROM table_name_89 WHERE year_built = 1857
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Yearly average questions per day.
SELECT YEAR(CreationDate) * 12 + MONTH(CreationDate) AS MonthNumber, CAST(COUNT(*) AS FLOAT) / 30 AS "Approximate Questions Per Day" FROM Posts WHERE PostTypeId = 1 GROUP BY YEAR(CreationDate), MONTH(CreationDate) ORDER BY YEAR(CreationDate) DESC, MONTH(CreationDate) DESC
sede
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...
在7379867号医院的医疗记录中记录的入院确诊是患有T83.572的病人的最低和最高医疗费统共多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7379867' AND t_kc21.IN_DIAG_DIS_CD = 'T83.572')
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what was the first height of patient 002-34744 in 12/this year.
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-34744') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-...
eicu
CREATE TABLE Player_Attributes ( id INTEGER, player_fifa_api_id INTEGER, player_api_id INTEGER, date TEXT, overall_rating INTEGER, potential INTEGER, preferred_foot TEXT, attacking_work_rate TEXT, defensive_work_rate TEXT, crossing INTEGER, finishing INTEGER, heading_accu...
, list X-axis in ascending order.
SELECT preferred_foot, COUNT(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot ORDER BY preferred_foot
nvbench
CREATE TABLE table_46355 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Competition" text, "Match Report" text )
What is Match Report, when Venue is 'Westfalenstadion , Dortmund'?
SELECT "Match Report" FROM table_46355 WHERE "Venue" = 'westfalenstadion , dortmund'
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...
how many hours is it from the first time that patient 006-172277 has received a procedure in the current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '006-17227...
eicu
CREATE TABLE table_54046 ( "Year" text, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text, "Purse" text )
Who is the Winner with a Time of 1:12.00 and Melvin A. Holland as the Jockey?
SELECT "Winner" FROM table_54046 WHERE "Time" = '1:12.00' AND "Jockey" = 'melvin a. holland'
wikisql
CREATE TABLE table_name_30 ( home_team VARCHAR, score VARCHAR )
What home team has a score of 5 - 5?
SELECT home_team FROM table_name_30 WHERE score = "5 - 5"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
在被门诊诊断出患有慢性支气管炎的患者身上他们的检测指标001097数值的平均值还有最值分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '慢性支气管炎' AND jyjgzbb.JCZBDM = '001097'
css
CREATE TABLE table_54798 ( "Year" text, "Winner and nominees" text, "Original title" text, "Country" text, "Director" text )
The winner and nominee 'Hidden Agenda' is from which country?
SELECT "Country" FROM table_54798 WHERE "Winner and nominees" = 'hidden agenda'
wikisql
CREATE TABLE table_11729 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What home team had a record of 4-16-7?
SELECT "Home" FROM table_11729 WHERE "Record" = '4-16-7'
wikisql
CREATE TABLE table_203_211 ( id number, "pos." number, "time" text, "athlete" text, "country" text, "venue" text, "date" text )
what is the time of each of the athletes who are in the number 10 position in the rankings ?
SELECT "time" FROM table_203_211 WHERE "pos." = 10
squall
CREATE TABLE table_name_53 ( score VARCHAR, date VARCHAR )
What was the score on April 22?
SELECT score FROM table_name_53 WHERE date = "april 22"
sql_create_context
CREATE TABLE table_66567 ( "Year" text, "Location" text, "Gold" text, "Silver" text, "Bronze" text )
Who received the silver in 2006?
SELECT "Silver" FROM table_66567 WHERE "Year" = '2006'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients were admitted in emergency for replacement of small bowel tube?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Replace small bowel tube"
mimicsql_data
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...
医院1576740共有几个科室在2009年5月14日到2017年3月10日内涉及医疗费总额低于1967.84元有多少?
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1576740' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-05-14' AND '2017-03-10' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 1967.84) AS T
css
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...
What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000 Plot them as bar chart, rank y-axis in ascending order.
SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 ORDER BY MAX_SALARY - MIN_SALARY
nvbench
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在医院6234584中,以出院诊断疾病名称为依据,查出不同疾病的患者平均年龄是多少
SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6234584' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6234584' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
统计医院9343283的出院诊断为慢性牙周炎的在医疗记录中最低医疗费总额是多少?最高医疗费总额是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9343283' AND t_kc21.OUT_DIAG_DIS_NM = '慢性牙周炎')
css
CREATE TABLE table_15602 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What was the loss of the game attended by 37,119?
SELECT "Loss" FROM table_15602 WHERE "Attendance" = '37,119'
wikisql
CREATE TABLE table_37005 ( "Player" text, "Sacks" real, "INT'S" real, "Yards" real, "Average" real, "Long" text )
What is the lowest value of INT's with an average more than 25?
SELECT MIN("INT'S") FROM table_37005 WHERE "Average" > '25'
wikisql
CREATE TABLE table_name_52 ( losing_bonus VARCHAR )
With a lost of lost what was the losing bonus?
SELECT losing_bonus FROM table_name_52 WHERE "lost" = "lost"
sql_create_context
CREATE TABLE table_name_25 ( eliminated_contestant VARCHAR, date_premiered__2009_ VARCHAR )
What eliminated contestant has October 10, 2009 as the date premiered?
SELECT eliminated_contestant FROM table_name_25 WHERE date_premiered__2009_ = "october 10"
sql_create_context
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...
在11-02-09到20-05-11期间,60366088的患者被开出多少次药品3367-2
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '60366088' AND t_kc22.STA_DATE BETWEEN '2011-02-09' AND '2020-05-11' AND t_kc22.SOC_SRT_DIRE_CD = '3367-2'
css
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在两千零四年一月十八日至两千一八年九月十四日期间医院9763546的科室8589涉及的医疗费总额有多少?
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9763546' AND gwyjzb.MED_ORG_DEPT_CD = '8589' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9763546' AND fgwyjzb.MED_ORG_DEPT_CD = '8589') AND t...
css
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
Show me about the distribution of meter_500 and ID in a bar chart.
SELECT meter_500, ID FROM swimmer
nvbench
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
For those employees who was hired before 2002-06-21, return a line chart about the change of department_id over hire_date , rank by the X-axis in descending.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_48915 ( "Rank" real, "Team" text, "Loss" real, "Sets Won" real, "Sets Lost" real, "Percentage" text )
What is the least rank with more than 3 losses and less than 25 sets lost?
SELECT MIN("Rank") FROM table_48915 WHERE "Loss" > '3' AND "Sets Lost" < '25'
wikisql
CREATE TABLE table_2028 ( "Name" text, "Nation" text, "Seasons" text, "Championship Titles" text, "Race Starts" real, "Poles" real, "Wins" real, "Podiums" real, "Fastest Laps" real )
What is the smallest number of fastest laps listed?
SELECT MIN("Fastest Laps") FROM table_2028
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE T...
what is the total amount of output from patient 5828 on the current intensive care unit visit?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL)
mimic_iii
CREATE TABLE table_name_17 ( nationality VARCHAR, round VARCHAR, position VARCHAR )
What is the nationality of the player in Position C from Round 1?
SELECT nationality FROM table_name_17 WHERE round = "1" AND position = "c"
sql_create_context
CREATE TABLE table_name_98 ( player VARCHAR, score VARCHAR )
Who had a score of 68-67=135?
SELECT player FROM table_name_98 WHERE score = 68 - 67 = 135
sql_create_context
CREATE TABLE table_18064 ( "Country" text, "Population" real, "Native American" text, "Whites" text, "s Mestizo" text, "es Mulatto" text, "Blacks" text, "s Zambo" text, "Asians" text )
how many native american with whites being 1.0%
SELECT COUNT("Native American") FROM table_18064 WHERE "Whites" = '1.0%'
wikisql
CREATE TABLE table_name_62 ( place VARCHAR, score VARCHAR )
What place was the golfer with a score of 67-67-66-68=268 ranked in?
SELECT place FROM table_name_62 WHERE score = 67 - 67 - 66 - 68 = 268
sql_create_context
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 method of intake of clobetasol propionate 0.05% ointment?
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'clobetasol propionate 0.05% ointment'
mimic_iii
CREATE TABLE table_name_69 ( chord VARCHAR, major_third VARCHAR )
What is the Chord with a Major that is third of e?
SELECT chord FROM table_name_69 WHERE major_third = "e"
sql_create_context
CREATE TABLE table_46924 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What day was the away team Cardiff City?
SELECT "Date" FROM table_46924 WHERE "Away team" = 'cardiff city'
wikisql
CREATE TABLE table_23058 ( "Series #" real, "Episode #" real, "Title" text, "Written by" text, "Directed by" text, "Viewers" real, "Original airdate" text )
If the title if the Lost Boy, how many directors were there?
SELECT COUNT("Directed by") FROM table_23058 WHERE "Title" = 'The Lost Boy'
wikisql
CREATE TABLE table_25246990_2 ( no_in_series VARCHAR, prod_code VARCHAR )
What number episode in the series had a production code of 110?
SELECT no_in_series FROM table_25246990_2 WHERE prod_code = "110"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
在门诊诊断为疾病X60.562的患者身上其抗凝血酶III的参考值范围下限和上限具体为多少数值?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number V...
Draw a bar chart about the distribution of date_address_to and the amount of date_address_to , and group by attribute other_details and bin date_address_to by weekday.
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_1473672_6 ( nhl_team VARCHAR, player VARCHAR )
What NHL team drafted Rob Palmer?
SELECT nhl_team FROM table_1473672_6 WHERE player = "Rob Palmer"
sql_create_context
CREATE TABLE table_38111 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text )
What was the score for the final played on 2 July 2012?
SELECT "Score" FROM table_38111 WHERE "Date" = '2 july 2012'
wikisql
CREATE TABLE table_29104 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original air date" text )
What episode number in the series is 'millennium'?
SELECT MIN("Series #") FROM table_29104 WHERE "Title" = 'Millennium'
wikisql
CREATE TABLE table_22361 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
When did the title 'training video' originally air?
SELECT "Original air date" FROM table_22361 WHERE "Title" = 'Training Video'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
日期均在2014-02-18之前的患者94709761的哪些住院就诊记录对应的检验报告单的报告?列出住院有什么就诊流水号?
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE Employee ( eid VARCHAR, salary VARCHAR, name VARCHAR )
Show the id and salary of Mark Young.
SELECT eid, salary FROM Employee WHERE name = 'Mark Young'
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, ...
经过门诊就诊的病号97338418415用的卡的卡号以及卡类型是什么呢?
SELECT mzjzjlb.KH, mzjzjlb.KLX FROM mzjzjlb WHERE mzjzjlb.JZLSH = '97338418415'
css
CREATE TABLE table_18128 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
How many candidates were there in the district won by Joe Hoeffel?
SELECT COUNT("Candidates") FROM table_18128 WHERE "Incumbent" = 'Joe Hoeffel'
wikisql
CREATE TABLE table_34614 ( "Title" text, "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text, "Attendance" text )
Who was the winner in the game that had a title of 32nd, and Waseda as the runner-up?
SELECT "Winner" FROM table_34614 WHERE "Runner-up" = 'waseda' AND "Title" = '32nd'
wikisql
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 jybgb ( BBCJBW text, BBDM tex...
张承悦这位患者自04.12.30起,到08.2.28止,到医院就诊的次数是多少
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '张承悦' AND mzjzjlb.JZKSRQ BETWEEN '2004-12-30' AND '2008-02-28') + (SELECT COUNT(*) FROM person_info J...
css
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, ...
检验报告单64706172687的报告人工号是什么?报告人姓名叫什么?
SELECT zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.BGDH = '64706172687' UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.BGDH = '64706172687'
css