context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_23248910_9 ( high_points VARCHAR, team VARCHAR )
Who is every high points for the Pistons team?
SELECT high_points FROM table_23248910_9 WHERE team = "Pistons"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
what is the price for amylase, body fluid?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'amylase, body fluid'))
mimic_iii
CREATE TABLE table_5631 ( "Frequency (MHz)" real, "Call letters" text, "Licensed location" text, "Type" text, "Format" text )
Frequency (MHz) that has a Type of primary, and a Call letters of ktbb-fm has what total number?
SELECT COUNT("Frequency (MHz)") FROM table_5631 WHERE "Type" = 'primary' AND "Call letters" = 'ktbb-fm'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and sort by the x axis from high to low.
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_25695027_1 ( valves VARCHAR, years_built VARCHAR )
How many types of valves were used on this engine that was built on 1902-05?
SELECT COUNT(valves) FROM table_25695027_1 WHERE years_built = "1902-05"
sql_create_context
CREATE TABLE table_name_97 ( race_winner VARCHAR, fastest_lap VARCHAR, date VARCHAR )
Who won with the fastest lap of daijiro hiura on March 29?
SELECT race_winner FROM table_name_97 WHERE fastest_lap = "daijiro hiura" AND date = "march 29"
sql_create_context
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 lab ( la...
since 2100 what are the five most frequently ordered lab tests for patients 40s?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_79478 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
What is the Elevation (m) of the Peak with a Prominence (m) larger than 2,143 and Col (m) of 2012?
SELECT "Elevation (m)" FROM table_79478 WHERE "Prominence (m)" > '2,143' AND "Col (m)" = '2012'
wikisql
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...
看看药品130906139在一六年四月二十九日到一六年四月三十日,这两天被患者44192397总共开出过多少次
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '44192397' AND t_kc22.STA_DATE BETWEEN '2016-04-29' AND '2016-04-30' AND t_kc22.SOC_SRT_DIRE_CD = '130906139' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID ...
css
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE ...
What is the country of the airport with the highest elevation?
SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
spider
CREATE TABLE table_name_51 ( losing_bonus VARCHAR, drawn VARCHAR, try_bonus VARCHAR )
What was the losing bonus that had 1 draw and a 10 try bonus?
SELECT losing_bonus FROM table_name_51 WHERE drawn = "1" AND try_bonus = "10"
sql_create_context
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE lessons ( lesson_id number, customer_id number, l...
List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
SELECT first_name, last_name FROM customers WHERE amount_outstanding BETWEEN 1000 AND 3000
spider
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
查询在二零零六年一月五日二零一一年十二月三十日的这段时间里医院5091716有多少科室涉及的医疗费总额低于7482.56元
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 = '5091716' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-01-05' AND '2011-12-30' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 7482.56) AS T
css
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
列出在01年3月12号至2021年4月26号之间医院7215353开出的检验报告单中,不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值是什么?
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '7215353' AND BGRQ BETWEEN '2001-03-12' AND '2021-04-26' GROUP BY JCZBMC, JCZBJGDW
css
CREATE TABLE table_56767 ( "Grade" text, "Points" real, "Sit-up (reps)" text, "Standing Broad Jump (cm)" text, "Chin-up (reps)" text, "Shuttle Run (sec)" text, "2.4km Run (min:sec)" text )
What shuttle Run (sec) time has a 2.4km Run (min:sec) of 12:21-13:00?
SELECT "Shuttle Run (sec)" FROM table_56767 WHERE "2.4km Run (min:sec)" = '12:21-13:00'
wikisql
CREATE TABLE table_name_27 ( round INTEGER, result VARCHAR )
Which highest Round has a Result of loss?
SELECT MAX(round) FROM table_name_27 WHERE result = "loss"
sql_create_context
CREATE TABLE table_name_25 ( publication_date VARCHAR, fictional_date VARCHAR )
Name the publication date when the fictional date is 2112
SELECT publication_date FROM table_name_25 WHERE fictional_date = "2112"
sql_create_context
CREATE TABLE table_22466 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
What township is 28.597 square miles of land?
SELECT "Township" FROM table_22466 WHERE "Land ( sqmi )" = '28.597'
wikisql
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 employees ( EMPLOYEE_ID decimal(6,0...
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, and display from low to high by the sum employee id.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_name_32 ( laps INTEGER, driver VARCHAR )
What is the lowest number of laps obtained by driver Nick Heidfeld?
SELECT MIN(laps) FROM table_name_32 WHERE driver = "nick heidfeld"
sql_create_context
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
Show the name of each county along with the corresponding number of delegates from that county.
SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id
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...
give me the top four most common diagnoses since 1 year ago.
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
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...
what is drug type of drug name cephalexin?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Cephalexin"
mimicsql_data
CREATE TABLE table_name_43 ( career_sr VARCHAR )
What is the career SR with a 1r in 1985?
SELECT career_sr FROM table_name_43 WHERE 1985 = "1r"
sql_create_context
CREATE TABLE table_1341453_7 ( party VARCHAR, first_elected VARCHAR )
What party was first elected in 1974?
SELECT party FROM table_1341453_7 WHERE first_elected = 1974
sql_create_context
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 ...
编号为43827517的患者被门诊诊断为胃炎,看看检测指标983873的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb...
css
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
SELECT TOP 10 Id AS [Post Link] FROM Posts ORDER BY CreationDate DESC.
SELECT Id AS "post_link" FROM Posts ORDER BY CreationDate DESC LIMIT 10
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is lab test name of subject name kelly gallardo?
SELECT lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_name_45 ( attendance INTEGER, leading_scorer VARCHAR, date VARCHAR )
How many attended the game on 12/17 with stephen jackson as the leading scorer?
SELECT SUM(attendance) FROM table_name_45 WHERE leading_scorer = "stephen jackson" AND date = "12/17"
sql_create_context
CREATE TABLE table_204_722 ( id number, "season" text, "series" text, "team" text, "races" number, "wins" number, "poles" number, "f/lap" number, "podiums" number, "points" number, "position" text )
what is the least number of points that daly won in a single seasons
SELECT MIN("points") FROM table_204_722
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_i...
what is the number of patients who have had a tpn d9.0 intake until 2103?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d9.0' AND d_ite...
mimic_iii
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 ) ...
count the number of patients whose year of death is less than or equal to 2186 and diagnoses long title is hyperacusis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2186.0" AND diagnoses.long_title = "Hyperacusis"
mimicsql_data
CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Ar...
Return the number of the categories of music festivals that have the result 'Awarded'.
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category
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 ...
how many patients under the age of 80 years had their lab test fluid as joint fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_31228 ( "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 listed under L when the ends won is 21?
SELECT MAX("L") FROM table_31228 WHERE "Ends Won" = '21'
wikisql
CREATE TABLE table_15803 ( "Riding" text, "Candidate's Name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" real, "Rank" text )
What job is at red bank?
SELECT "Occupation" FROM table_15803 WHERE "Residence" = 'red bank'
wikisql
CREATE TABLE table_59579 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the score of the game against away team queens park rangers on 23 january 1982?
SELECT "Score" FROM table_59579 WHERE "Date" = '23 january 1982' AND "Away team" = 'queens park rangers'
wikisql
CREATE TABLE table_1845 ( "Date(s)" text, "Venue" text, "City, state" text, "Ticket price(s)" text, "Ticket sold / available" text, "Ticket grossing" text )
How much do the tickets cost for August 7, 1987?
SELECT "Ticket price(s)" FROM table_1845 WHERE "Date(s)" = 'August 7, 1987'
wikisql
CREATE TABLE table_63272 ( "Name" text, "Games" text, "A-League" text, "Finals" text, "Goals" real, "Assists" real, "Years" text )
How many finals had more than 0 goals and 8 assists?
SELECT "Finals" FROM table_63272 WHERE "Goals" > '0' AND "Assists" = '8'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
After 15:45 A.M. , what upper level electives are available next Spring-Summer ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '15:45' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester...
advising
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
在2006-11-13到2018-05-18内,2024496这个医疗机构的医疗费总额如何
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2024496' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-13' AND '2018-05-18'
css
CREATE TABLE table_71765 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
When did Deng Xuan first win Women's singles?
SELECT MIN("Year") FROM table_71765 WHERE "Women's singles" = 'deng xuan'
wikisql
CREATE TABLE table_55219 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who is the away team that played home team Footscray?
SELECT "Away team" FROM table_55219 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
provide the number of patients whose admission year is less than 2133 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.admityear < "2133" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE table_12517 ( "Rank" real, "Name" text, "Team" text, "Goals" real, "Appearances" real, "Minutes played" text )
What Rank has a Team of roma?
SELECT "Rank" FROM table_12517 WHERE "Team" = 'roma'
wikisql
CREATE TABLE table_name_50 ( population INTEGER, area_km_2 VARCHAR, official_name VARCHAR )
What is the population of northfield parish that has an area less than 342.4?
SELECT SUM(population) FROM table_name_50 WHERE area_km_2 < 342.4 AND official_name = "northfield"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text 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...
What are 12 -credit Anthropology of Contemporary American Culture courses ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Anthropology of Contemporary American Culture%' OR name LIKE '%Anthropology of Contemporary American Culture%') AND credits = 12
advising
CREATE TABLE table_54515 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
In what grid did Richard Robarts make 36 laps?
SELECT SUM("Grid") FROM table_54515 WHERE "Driver" = 'richard robarts' AND "Laps" < '36'
wikisql
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, ...
从08年10月22日起的2年内,患者66306240的395514指标情况记录
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, order total number in asc order.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_1914090_2 ( europe VARCHAR, america VARCHAR )
How many members did Europe have the year that America had 403892?
SELECT europe FROM table_1914090_2 WHERE america = 403892
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 demographic (...
how many patients were diagnosed for laparoscopic surgical procedure converted to open procedure and the death status is 0?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Laparoscopic surgical procedure converted to open procedure"
mimicsql_data
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 jobs ( JOB_ID varchar(10), JOB_...
For those employees who did not have any job in the past, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, and rank by the total number of manager id in asc please.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE table_11847 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the time/retired of Driver Masten Gregory Carroll Shelby when the constructor was Maserati, the Grid was larger than 10 and there were more than 2 laps?
SELECT "Time/Retired" FROM table_11847 WHERE "Grid" > '10' AND "Laps" > '2' AND "Constructor" = 'maserati' AND "Driver" = 'masten gregory carroll shelby'
wikisql
CREATE TABLE table_30036 ( "Semitological abbreviation" text, "Hebrew name" text, "Arabic name" text, "Morphological category" text, "Hebrew Form" text, "Arabic form" text, "Approximate translation" text )
How many hebrew forms are there for the arabic form yuktibu ?
SELECT COUNT("Hebrew Form") FROM table_30036 WHERE "Arabic form" = 'yuktibu يكتب'
wikisql
CREATE TABLE table_name_40 ( round INTEGER, player VARCHAR )
Which round was Joe Taylor selected in?
SELECT SUM(round) FROM table_name_40 WHERE player = "joe taylor"
sql_create_context
CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID INTEGER, Order_Quantity INTEGER, Other_Item_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR...
A bar chart for what are the number of the descriptions of the service types with product price above 100?, and could you list in descending by the how many service type description please?
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC
nvbench
CREATE TABLE table_2908 ( "Episode" text, "First broadcast" text, "Davids team" text, "Lees team" text, "Scores" text )
Who is on the David's Team for the episode with the Lees Team of Jack Dee and Peter Serafinowicz
SELECT "Davids team" FROM table_2908 WHERE "Lees team" = 'Jack Dee and Peter Serafinowicz'
wikisql
CREATE TABLE table_56984 ( "Variant (with Niqqud )" text, "without Niqqud" text, "Phonemic Value" text, "Phonetic Realisation" text, "English example" text )
If a variant without niqqud is as final letter: or , what is the phonetic realisation?
SELECT "Phonetic Realisation" FROM table_56984 WHERE "without Niqqud" = 'as final letter: ו or יו'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskTypes ( Id number, Name tex...
Sublimetext post counts by date.
SELECT TIME_TO_STR(CreationDate, '%d') AS "day", TIME_TO_STR(CreationDate, '%M') AS "month", TIME_TO_STR(CreationDate, '%Y') AS "year", COUNT(*) FROM Posts WHERE (STR_POSITION(Tags, '<sublimetext>') > 0) GROUP BY TIME_TO_STR(CreationDate, '%d'), TIME_TO_STR(CreationDate, '%M'), TIME_TO_STR(CreationDate, '%Y')
sede
CREATE TABLE table_name_67 ( year INTEGER, award VARCHAR, nominee VARCHAR )
What was the year Bernadette Peters was a nominee for the Tony award?
SELECT SUM(year) FROM table_name_67 WHERE award = "tony award" AND nominee = "bernadette peters"
sql_create_context
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 prescriptions ( subject_id text, hadm_id...
what is death status of subject id 3343?
SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_name_76 ( field_goals INTEGER, touchdowns VARCHAR, points VARCHAR )
Which Field goals is the highest one that has Touchdowns of 0, and Points larger than 4?
SELECT MAX(field_goals) FROM table_name_76 WHERE touchdowns = 0 AND points > 4
sql_create_context
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_det...
What are the purchase details of transactions with amount bigger than 10000, and count them by a bar chart, list by the the number of purchase details from low to high.
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details)
nvbench
CREATE TABLE table_name_83 ( part_1 VARCHAR, part_3 VARCHAR )
What is Part 1, when Part 3 is 'heldu'?
SELECT part_1 FROM table_name_83 WHERE part_3 = "heldu"
sql_create_context
CREATE TABLE table_name_31 ( school_club_team VARCHAR, pick VARCHAR )
What school/club had pick 33?
SELECT school_club_team FROM table_name_31 WHERE pick = 33
sql_create_context
CREATE TABLE table_name_81 ( hs_principal VARCHAR, year VARCHAR )
Who is the h.s. principal during 1973-1974?
SELECT hs_principal FROM table_name_81 WHERE year = "1973-1974"
sql_create_context
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 ...
查一下患者81795336之前有哪些门诊诊疗记录
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON 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_mzjzjlb.JZLSH = mzjzjlb.JZLS...
css
CREATE TABLE table_75348 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What is the highest field goals when there were more than 1 touchdown and 0 extra points?
SELECT MAX("Field goals") FROM table_75348 WHERE "Touchdowns" > '1' AND "Extra points" > '0'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
when did patient 14054 get discharged from hospital for the first time since 2105?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 14054 AND STRFTIME('%y', admissions.dischtime) >= '2105' ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_name_4 ( role VARCHAR, year VARCHAR, festival_organization VARCHAR )
What role was at the Sydney Film Festival in 2008?
SELECT role FROM table_name_4 WHERE year = 2008 AND festival_organization = "sydney film festival"
sql_create_context
CREATE TABLE table_63515 ( "Tournament" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text )
What is the 2007 value with a 1r in 2009?
SELECT "2007" FROM table_63515 WHERE "2009" = '1r'
wikisql
CREATE TABLE table_name_71 ( fatalities VARCHAR, aircraft VARCHAR )
What was the number of fatalities for the Viscount 700?
SELECT fatalities FROM table_name_71 WHERE aircraft = "viscount 700"
sql_create_context
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE projects ( project_id number, project_details text ) CREATE TABLE do...
What are the different statement ids on accounts, and the number of accounts for each?
SELECT statement_id, COUNT(*) FROM accounts GROUP BY statement_id
spider
CREATE TABLE table_17130 ( "Calculator" text, "CPU" text, "RAM" text, "Display Size" text, "Programming Languages" text, "Link Abilities" text, "Year Released" text, "Predecessors" text, "Successors" text )
what is the cpu for the calculator with 28 kb of ram and display size 128 64 pixels 21 8 characters?
SELECT "CPU" FROM table_17130 WHERE "RAM" = '28 KB of RAM' AND "Display Size" = '128×64 pixels 21×8 characters'
wikisql
CREATE TABLE table_25355392_2 ( june_10_11 VARCHAR, march_27_29 VARCHAR )
what is june 10-11 when march 27-29 is 149?
SELECT june_10_11 FROM table_25355392_2 WHERE march_27_29 = "149"
sql_create_context
CREATE TABLE table_64515 ( "Shirt No" real, "Nationality" text, "Player" text, "Birth Date" text, "Height" real, "Position" text )
What is the Shirt No for Henry Bell Cisnero whose height is less than 190?
SELECT MAX("Shirt No") FROM table_64515 WHERE "Height" < '190' AND "Player" = 'henry bell cisnero'
wikisql
CREATE TABLE table_68293 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
Which tournament had a 2010 finish of 4R?
SELECT "Tournament" FROM table_68293 WHERE "2010" = '4r'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
when was the first time patient 006-124193 was prescribed medication through the iv flush route since 14 months ago?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-124193')) AND medication.routeadmin = 'iv flush' AND DATET...
eicu
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE...
Just list the first name of the employee and show the location id of the corresponding department using a bar chart.
SELECT FIRST_NAME, LOCATION_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
nvbench
CREATE TABLE table_8627 ( "Discipline" text, "Championship" text, "Circuit" text, "Session" text, "Cause" text )
What was the discipline for the euroboss championship?
SELECT "Discipline" FROM table_8627 WHERE "Championship" = 'euroboss'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Negative questions with a single negative-but-accepted answer this year.
SELECT q.Id AS "post_link", q.Score AS "Q Score", a.Score AS "A Score" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.Score < 0 AND a.Score < 0 AND q.CreationDate > '2016-01-01 01:01:01' AND q.ClosedDate > '2016-01-01 01:01:01' AND NOT q.AcceptedAnswerId IS ...
sede
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
从2007年6月11日到2021年9月4日,科室5788因酒精性肝硬化住院产生了多少平均费用?
SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '5788' AND IN_HOSP_DATE BETWEEN '2007-06-11' AND '2021-09-04' AND IN_DIAG_DIS_NM = '酒精性肝硬化' AND CLINIC_TYPE = '住院'
css
CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUMERIC ) CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, points_max INTEGER, votes_first NUM...
Bar chart x axis year y axis the number of year
SELECT year, COUNT(year) FROM home_game
nvbench
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
what is the cost of a drug, permethrin?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'permethrin')
mimic_iii
CREATE TABLE table_68420 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text )
What was the score for the game that had an attendance of 41,087?
SELECT "Score" FROM table_68420 WHERE "Attendance" = '41,087'
wikisql
CREATE TABLE table_2013618_1 ( density VARCHAR, traditional VARCHAR )
Name the density for
SELECT density FROM table_2013618_1 WHERE traditional = "古田縣"
sql_create_context
CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Agreements ( Document_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTE...
List the number of the names of products that are not in any event, and rank x axis from high to low order please.
SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name ORDER BY Product_Name DESC
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the time of admission and prescribed drug for the patient with patient id 18480.
SELECT demographic.admittime, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "18480"
mimicsql_data
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, ...
count the number of patients whose marital status is widowed and procedure long title is laryngoscopy and other tracheoscopy.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Laryngoscopy and other tracheoscopy"
mimicsql_data
CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ...
How many lessons did the customer with the first name Ray take?
SELECT COUNT(*) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray"
spider
CREATE TABLE table_3509 ( "Year" real, "Qatari Male" real, "Qatari Female" real, "Total Qatari" real, "Non Qatari Male" real, "Non Qatari Female" real, "Total Non Qatar" real, "Total Male" real, "Total Female" real, "Grand Total" real )
If the qatari female is 918, what is the total number of females?
SELECT "Total Female" FROM table_3509 WHERE "Qatari Female" = '918'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int...
show me all direct flights from DALLAS FORT WORTH to either SAN FRANCISCO or OAKLAND
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND ...
atis
CREATE TABLE table_name_36 ( county VARCHAR, year_left VARCHAR )
what is the county when the year left is 1998?
SELECT county FROM table_name_36 WHERE year_left = "1998"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
患者许涵映在2012年7月16日之后做过的检验报告在哪些住院门诊?列出这些住院就诊的流水编码
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 JZLSH FROM jybgb WHERE BGRQ <= '2012-07-16')
css
CREATE TABLE table_42062 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
When Grey's Anatomy aired at 9:30 what aired at 9:00?
SELECT "9:00" FROM table_42062 WHERE "9:30" = 'grey''s anatomy'
wikisql
CREATE TABLE table_name_60 ( team_wins INTEGER, individual_winners VARCHAR, total_wins VARCHAR )
Which Team wins has an Individual winner smaller than 1 and Total win larger than 1?
SELECT SUM(team_wins) FROM table_name_60 WHERE individual_winners < 1 AND total_wins > 1
sql_create_context
CREATE TABLE table_36826 ( "Title" text, "Genre" text, "C=64" text, "ZX Spectrum" text, "Others" text, "Year" real, "Format" text )
Which ZX Spectrum has a Year larger than 1984, and a Genre of arcade/strategy?
SELECT "ZX Spectrum" FROM table_36826 WHERE "Year" > '1984' AND "Genre" = 'arcade/strategy'
wikisql
CREATE TABLE table_38946 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
After December 19, what is the Game number with a Record of 21 4 7?
SELECT COUNT("Game") FROM table_38946 WHERE "Record" = '21–4–7' AND "December" > '19'
wikisql
CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE instructor ( id text, name text, dept_name tex...
What are the distinct buildings with capacities of greater than 50?
SELECT DISTINCT building FROM classroom WHERE capacity > 50
spider