context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_52501 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Original air date" text, "Production code" text )
What title aired on March 19, 1998?
SELECT "Title" FROM table_52501 WHERE "Original air date" = 'march 19, 1998'
wikisql
CREATE TABLE ALBUM ( ArtistId VARCHAR, Title VARCHAR ) CREATE TABLE ARTIST ( Name VARCHAR, ArtistId VARCHAR )
Which artist does the album 'Balls to the Wall' belong to?
SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = "Balls to the Wall"
sql_create_context
CREATE TABLE table_9497 ( "Model number" text, "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Part number(s)" text )
Which frequency has voltage of 1.6v and part number kp80524kx300256kc80524kx300256pmg30002002aa?
SELECT "Frequency" FROM table_9497 WHERE "Voltage" = '1.6v' AND "Part number(s)" = 'kp80524kx300256kc80524kx300256pmg30002002aa'
wikisql
CREATE TABLE table_22797 ( "Match no." real, "Match Type" text, "Team Europe" text, "Score" text, "Team USA" text, "Progressive Total" text )
When 14 is the match number how many usa teams are there?
SELECT COUNT("Team USA") FROM table_22797 WHERE "Match no." = '14'
wikisql
CREATE TABLE table_6973 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Which Tournament has a Score of 1 6, 0 6?
SELECT "Tournament" FROM table_6973 WHERE "Score" = '1–6, 0–6'
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 jyjgzbb ( BGDH text, BGRQ tim...
从2000年9月28日到2007年1月25日这段时间内患者奚霞辉所有检验结果指标记录中的仪器编号以及名称都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
what is patient 13686's average calcium, total value in 07/this year?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13686) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND DATETIME(labevents.charttime, 'start of year') = DATET...
mimic_iii
CREATE TABLE table_41372 ( "Place" real, "Rider" text, "Country" text, "Machine" text, "Speed" text, "Time" text, "Points" real )
What are the fewest points that Roger Dutton/Tony Wright have received?
SELECT MIN("Points") FROM table_41372 WHERE "Rider" = 'roger dutton/tony wright'
wikisql
CREATE TABLE table_train_259 ( "id" int, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "hearing_problem" bool, "heart_disease" bool, "high_blood_pressure" bool, "diabetic" string, "immune_deficiency_disorder" bool, "visual_impairment" bool...
subject has type ii diabetes with hgba1c < 8 %
SELECT * FROM table_train_259 WHERE diabetic = 'ii' AND hemoglobin_a1c_hba1c < 8
criteria2sql
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 admission type and diagnosis long title of subject id 2560?
SELECT demographic.admission_type, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_480 ( "Station" text, "Channel" text, "Network Affiliation" text, "City of License" text, "Status" text )
What station has a univision network affiliation?
SELECT "Station" FROM table_480 WHERE "Network Affiliation" = 'Univision'
wikisql
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 hz_info ( KH text, KLX number...
把患者章清懿在医院0923275住院就诊的所有记录中,出院时科室名字里有眼睛的住院就诊记录列出
SELECT * 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 hz_info.YLJGDM = '0923275' AND zyjzjlb.CYKSMC LIKE '%眼睛%'
css
CREATE TABLE table_name_28 ( first_elected VARCHAR, party VARCHAR, district VARCHAR )
What is the total number of First Elected, when Party is 'Democratic', and when District is 'Tennessee 5'?
SELECT COUNT(first_elected) FROM table_name_28 WHERE party = "democratic" AND district = "tennessee 5"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Questions per day over time.
SELECT DATEADD(year, DATEDIFF(year, '20120101', CreationDate), '20120101'), COUNT(*) / 365.0 AS QpD FROM Posts WHERE PostTypeId = 1 GROUP BY DATEDIFF(year, '20120101', CreationDate) ORDER BY DATEDIFF(year, '20120101', CreationDate)
sede
CREATE TABLE table_6989 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, ...
What is the highest administrative panel value with an agricultural panel less than 1 and a labour panel value less than 5?
SELECT MAX("Administrative Panel") FROM table_6989 WHERE "Agricultural Panel" < '1' AND "Labour Panel" < '5'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose diagnoses long title is malnutrition of mild degree?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Malnutrition of mild degree"
mimicsql_data
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Co...
Create a bar chart showing the total number across location code, and order from high to low by the total number.
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_45262 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text )
How many rounds was the match against Jason Fairn?
SELECT "Round" FROM table_45262 WHERE "Opponent" = 'jason fairn'
wikisql
CREATE TABLE table_name_85 ( venue VARCHAR, scored INTEGER )
Where was the game with a higher score than 1 played?
SELECT venue FROM table_name_85 WHERE scored > 1
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients had stayed in the hospital for more than 23 days with 1504 as their diagnosis icd9 code?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "23" AND diagnoses.icd9_code = "1504"
mimicsql_data
CREATE TABLE table_27441210_20 ( number_one_single_s_ VARCHAR, weeks_at__number1 VARCHAR )
Name the number one singles for week 1 being 5
SELECT number_one_single_s_ FROM table_27441210_20 WHERE weeks_at__number1 = 5
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
had patient 1798 received a laboratory test for sodium, urine until 2102?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, urine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1798) AND STRFTIME('%y', labevents.charttime) <= '2102'
mimic_iii
CREATE TABLE table_name_49 ( torque VARCHAR, name VARCHAR )
What is the torque of 1.2 petrol?
SELECT torque FROM table_name_49 WHERE name = "1.2 petrol"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
All of the PreMajor classes are ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
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...
Visualize a bar chart about the distribution of All_Road and School_ID , could you sort total number from high to low order?
SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
Recent short posts containing multiple common typos. Posts containing a body that is less than 8 chars long
SELECT Id AS "post_link", Body FROM Posts WHERE PostTypeId = 1 AND Id > 1000000 AND Id < 5000000 AND Body LIKE '%, and%' AND Body LIKE '%doesnt%' AND LENGTH(Body) < 500 ORDER BY Id DESC
sede
CREATE TABLE table_31706 ( "Pos." text, "Driver" text, "Constructor" text, "Part 1" text, "Grid" text )
Tell me the pos for adrian sutil
SELECT "Pos." FROM table_31706 WHERE "Driver" = 'adrian sutil'
wikisql
CREATE TABLE table_train_220 ( "id" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "creatinine_clearance_cl" float, "fasting_plasma_glucose" int, "hba1c" float, "serum_creatinine" float, "body_mass_index_bmi" float, "NOUSE" float )
body mass index < 42 kg / m^2
SELECT * FROM table_train_220 WHERE body_mass_index_bmi < 42
criteria2sql
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...
Average score for questions (of any status except community) from postswithdeleted.
SELECT YEAR(CreationDate) AS "year", (1.0 * SUM(Score)) / (1.0 * SUM(Score)) AS "avgscore", COUNT(*) AS "#" FROM Posts WHERE YEAR(CreationDate) >= 2009 AND CommunityOwnedDate IS NULL AND PostTypeId IN (1) GROUP BY YEAR(CreationDate) ORDER BY YEAR(CreationDate)
sede
CREATE TABLE table_28047 ( "Series no." real, "No. in season" real, "Title" text, "Written by" text, "Directed by" text, "Original air date" text )
How many people directed the episode that Joe Toplyn wrote?
SELECT COUNT("Directed by") FROM table_28047 WHERE "Written by" = 'Joe Toplyn'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
Is Biology and Management of Insects a class that is offered ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Biology and Management of Insects%' OR name LIKE '%Biology and Management of Insects%') AND department = 'EECS'
advising
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
How many patients with congestive heart failure (unspecified) were admitted in the year less than 2154?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.long_title = "Congestive heart failure, unspecified"
mimicsql_data
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
Give me a bar chart to show the names and revenue of the company that earns the highest revenue in each headquarter city, list in asc by the y axis.
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue)
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 number of patients whose admission type is urgent and procedure icd9 code is 8960?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "8960"
mimicsql_data
CREATE TABLE table_name_62 ( date VARCHAR, opponent VARCHAR )
What was the date of the game against Northwestern?
SELECT date FROM table_name_62 WHERE opponent = "northwestern"
sql_create_context
CREATE TABLE table_36993 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What was the final score on the February 19, 2012 final?
SELECT "Score in the final" FROM table_36993 WHERE "Date" = 'february 19, 2012'
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...
被门诊诊断患者57039168为脑梗死后遗症的的妊娠相关性血浆蛋白-A的结果定量及其单位是什么情况?
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_178242_1 ( name VARCHAR, channel VARCHAR, premiere___aired VARCHAR )
What is the title that aired from 17 may 2008 21 june 2008 on Nederland 3?
SELECT name FROM table_178242_1 WHERE channel = "Nederland 3" AND premiere___aired = "17 May 2008 – 21 June 2008"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
tell me the minimum hospital cost that includes feeding tube - gastrostomy since 2105?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'feeding tube - gastrostomy')) AND STRFTIME('...
eicu
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top langs vs C, Python, JavaScript, Java & Rust average question score.
SELECT CASE WHEN Tags LIKE '%<c>%' THEN 'C' WHEN Tags LIKE '%<python>%' THEN 'Python' WHEN Tags LIKE '%<javascript>%' THEN 'JavaScript' WHEN Tags LIKE '%<java>%' THEN 'Java' WHEN Tags LIKE '%<rust>%' THEN 'Rust' ELSE 'Anything else' END AS Language, AVG(CAST(Score AS FLOAT)) AS "average_score", COUNT(*) AS "n_questions...
sede
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReas...
Find questions with just the reactjs tag.
SELECT Id AS "post_link", CreationDate, Tags FROM Posts WHERE Tags = '<reactjs>' ORDER BY CreationDate DESC LIMIT 100
sede
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 departments ( DEPARTMENT_ID decimal...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and commission_pct , and visualize them by a bar chart.
SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
count the number of patients whose marital status is single and diagnoses short title is toxic encephalopathy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.short_title = "Toxic encephalopathy"
mimicsql_data
CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rat...
What are all the gyms in ' Los Angeles ' ?
SELECT business.name FROM business, category WHERE business.city = 'Los Angeles' AND category.business_id = business.business_id AND category.category_name = 'gyms'
yelp
CREATE TABLE table_35230 ( "Game" real, "Date" real, "Opponent" text, "Score" text, "Location/attendance" text, "Record" text )
What is the latest date at Los Angeles with a game less than 62?
SELECT MAX("Date") FROM table_35230 WHERE "Location/attendance" = 'los angeles' AND "Game" < '62'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
自2000年8月9日起,到2005年9月8日,医院3415980涉及的医疗费总额少于7321.4元的科室有多少
SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '3415980' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-08-09' AND '2005-09-08' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 7321.4) AS T
css
CREATE TABLE table_2646656_3 ( candidates VARCHAR, result VARCHAR, incumbent VARCHAR )
Who were the candidates where the result was retired Republican hold and the incumbent was Philemon Bliss?
SELECT candidates FROM table_2646656_3 WHERE result = "Retired Republican hold" AND incumbent = "Philemon Bliss"
sql_create_context
CREATE TABLE table_76838 ( "Name" text, "Took Office" text, "Left Office" text, "President" text, "Party" text )
What is Party, when Took Office is 1998?
SELECT "Party" FROM table_76838 WHERE "Took Office" = '1998'
wikisql
CREATE TABLE table_name_89 ( county VARCHAR, mascot VARCHAR )
What county is the team with the mascot of the Tigers in?
SELECT county FROM table_name_89 WHERE mascot = "tigers"
sql_create_context
CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) ...
What destination has the fewest number of flights?
SELECT destination FROM flight GROUP BY destination ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ...
How many comments are here?.
SELECT COUNT(C.Id) AS "Comments" FROM Comments AS C
sede
CREATE TABLE table_20726262_3 ( production_code VARCHAR, usviewers__million_ VARCHAR )
What was the production code for the episode with 3.38 million viewers?
SELECT production_code FROM table_20726262_3 WHERE usviewers__million_ = "3.38"
sql_create_context
CREATE TABLE table_26257223_13 ( team_classification VARCHAR, winner VARCHAR )
Who led team classification during the stage whose winner was Chris Horner?
SELECT team_classification FROM table_26257223_13 WHERE winner = "Chris Horner"
sql_create_context
CREATE TABLE table_66619 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text )
Which series had a release on 1939-07-15 with the 8863 production number?
SELECT "Series" FROM table_66619 WHERE "Release date" = '1939-07-15' AND "Production Num." = '8863'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose primary disease is transient ischemic attack and year of birth is less than 2098?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.dob_year < "2098"
mimicsql_data
CREATE TABLE table_16768245_2 ( latitude VARCHAR, diameter VARCHAR )
What is the latitude when the diameter is 184.0?
SELECT latitude FROM table_16768245_2 WHERE diameter = "184.0"
sql_create_context
CREATE TABLE table_61231 ( "Ship" text, "Hull Number" text, "Laid down" text, "Launched" text, "Commissioned" text )
What is Launched, when Laid Down is '31 October 1981'?
SELECT "Launched" FROM table_61231 WHERE "Laid down" = '31 october 1981'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year 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, ...
A bar chart shows the distribution of meter_200 and the average of ID , and group by attribute meter_200, and list Y in desc order.
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID) DESC
nvbench
CREATE TABLE table_40699 ( "Date" text, "Race Name" text, "Location" text, "UCI Rating" real, "Winner" text, "Team" text )
What team won the Tour de Santa Catarina?
SELECT "Team" FROM table_40699 WHERE "Race Name" = 'tour de santa catarina'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, Acc...
Number and ratio of closed questions per day for the last three month.
SELECT DATEPART(dayofyear, ClosedDate) AS "day", COUNT(*) AS "number_of_closed_questions" FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND DATEDIFF(day, ClosedDate, GETDATE()) < 90 GROUP BY DATEPART(dayofyear, ClosedDate) ORDER BY DATEPART(dayofyear, ClosedDate)
sede
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
count the number of patients who have received a ct scan procedure in the same hospital encounter after having received a therapeutic antibacterials - second generation cephalosporin during this year.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - second generation cephalosporin' AND DATETIM...
eicu
CREATE TABLE table_dev_43 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "hemoglobin_a1c_hba1c" float, "point_of_care_blood_glucose_poc" int, "diabetic" string, "temperature" float, "creatinine_clearance_cl" float...
one of the following: diagnosed with diabetes type i or diagnosed with diabetes type ii , with an hba1c > 8 % or point _ of _ care blood glucose ( poc ) > 180 at admission, and requiring insulin during this hospitalization.
SELECT * FROM table_dev_43 WHERE (CASE WHEN diabetic = 'i' OR diabetic = 'ii' THEN 1 ELSE 0 END + CASE WHEN hemoglobin_a1c_hba1c > 8 OR point_of_care_blood_glucose_poc > 180 THEN 1 ELSE 0 END + CASE WHEN insulin_requirement = 1 THEN 1 ELSE 0 END) >= 1
criteria2sql
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 me the number of patients whose marital status is divorced and lab test chart time is 2182-12-31 17:20:00?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.charttime = "2182-12-31 17:20:00"
mimicsql_data
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
when patient 025-44495 has received a microbiology test for the last time on the last hospital visit?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_49094 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
What event in guam did Tetsuji Kato win against patrick madayag?
SELECT "Event" FROM table_49094 WHERE "Res." = 'win' AND "Location" = 'guam' AND "Opponent" = 'patrick madayag'
wikisql
CREATE TABLE table_name_44 ( highest_rank VARCHAR, name VARCHAR )
Which Rank is Highest for Yoshiazuma?
SELECT highest_rank FROM table_name_44 WHERE name = "yoshiazuma"
sql_create_context
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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '喻奇文' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '氯雷他定片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '喻奇文' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE table_name_62 ( date VARCHAR, goal VARCHAR )
What was the date of the game where Esteban Paredes scored 2 goals?
SELECT date FROM table_name_62 WHERE goal = 2
sql_create_context
CREATE TABLE table_60751 ( "Date" text, "Time" text, "Competition" text, "Opponent" text, "Ground" text, "Score" text )
What is the competition on 15 August 2008?
SELECT "Competition" FROM table_60751 WHERE "Date" = '15 august 2008'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE i...
how many days has been passed since the last time patient 25814 stayed in careunit micu in this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number )
What are the names of all people who are friends with Alice for the shortest amount of time?
SELECT name FROM personfriend WHERE friend = 'Alice' AND year = (SELECT MIN(year) FROM personfriend WHERE friend = 'Alice')
spider
CREATE TABLE table_name_40 ( money___$__ VARCHAR, place VARCHAR, player VARCHAR )
What is T4 Place Player Nick Price's Money?
SELECT money___$__ FROM table_name_40 WHERE place = "t4" AND player = "nick price"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
how many patients have been admitted to hospitals until 2100?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) <= '2100'
eicu
CREATE TABLE table_name_13 ( lok_sabha VARCHAR, party_affiliation VARCHAR, duration VARCHAR )
What is the Lok Sabha for Dravida Munnetra Kazhagam, in 1999-04?
SELECT lok_sabha FROM table_name_13 WHERE party_affiliation = "dravida munnetra kazhagam" AND duration = "1999-04"
sql_create_context
CREATE TABLE table_19940 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is the Segment A for when Segment C is s Sailboard?
SELECT "Segment A" FROM table_19940 WHERE "Segment C" = 's Sailboard'
wikisql
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
What are the last names and ages of the students who are allergic to milk and cat? Plot them as bar chart, show from high to low by the x axis.
SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY LName DESC
nvbench
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TA...
Number of Users in a Location.
SELECT COUNT(*) AS NumberOfUsers FROM Users WHERE LOWER(Location) LIKE LOWER('%##Location##%')
sede
CREATE TABLE table_25548213_1 ( title VARCHAR, us_viewers__million_ VARCHAR )
What was the name of the episode that had 4.65 million viewers?
SELECT title FROM table_25548213_1 WHERE us_viewers__million_ = "4.65"
sql_create_context
CREATE TABLE table_22583466_5 ( reporters VARCHAR, year VARCHAR )
Who were the reporters for the 1977 Belmont Stakes?
SELECT reporters FROM table_22583466_5 WHERE year = 1977
sql_create_context
CREATE TABLE table_29398373_2 ( team VARCHAR, head_coach VARCHAR )
Name the team for javier clemente
SELECT team FROM table_29398373_2 WHERE head_coach = "Javier Clemente"
sql_create_context
CREATE TABLE table_75551 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "Result" text, "Record" text )
What week that shows a game record of 0 1?
SELECT AVG("Week") FROM table_75551 WHERE "Record" = '0–1'
wikisql
CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boarding text, year_entered_competition number, school_colors text ) CREATE TABLE player ( player_id number, player text, ...
Please show different denominations and the corresponding number of schools in descending order.
SELECT denomination, COUNT(*) FROM school GROUP BY denomination ORDER BY COUNT(*) DESC
spider
CREATE TABLE table_41501 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text )
What 2006 has 0-0 as the 2011?
SELECT "2006" FROM table_41501 WHERE "2011" = '0-0'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of employee_id bin hire_date by time in a bar chart, list in asc by the total number.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_54578 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which venue has an Away team score of 12.11 (83)?
SELECT "Venue" FROM table_54578 WHERE "Away team score" = '12.11 (83)'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many patients died in or before 2165 and tested for albumin in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.label = "Albumin"
mimicsql_data
CREATE TABLE table_49518 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the Score of the Chicago Black Hawks Home game on March 28?
SELECT "Score" FROM table_49518 WHERE "Home" = 'chicago black hawks' AND "Date" = 'march 28'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
the number of times patient 030-77189 had had a digoxin procedure since 2102.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-77189')) AND treatment.treatmentname = 'digoxin' AND STRFTIME('%y', treatmen...
eicu
CREATE TABLE table_19229713_4 ( production_code VARCHAR, us_viewers__million_ VARCHAR )
Name the production code for viewers for 1.69
SELECT production_code FROM table_19229713_4 WHERE us_viewers__million_ = "1.69"
sql_create_context
CREATE TABLE table_204_255 ( id number, "constituency number" number, "name" text, "reserved for (sc/st/none)" text, "district" text, "number of electorates (2009)" number )
besides tikamgarth , what is the other district ?
SELECT "district" FROM table_204_255 WHERE "district" <> 'tikamgarh' AND agg = 0
squall
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 ( ...
kelly gallardo is taking medication via which route?
SELECT prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_name_94 ( score VARCHAR, record VARCHAR )
WHAT IS THE SCORE WITH A RECORD OF 1-0?
SELECT score FROM table_name_94 WHERE record = "1-0"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Find meter_500 and meter_100 , and visualize them by a bar chart, and order in descending by the X-axis.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500 DESC
nvbench
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
give me some good arabic -s on buchanan in san francisco ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_26250176_1 ( theme VARCHAR, week__number VARCHAR )
What is the theme for Audition week?
SELECT theme FROM table_26250176_1 WHERE week__number = "Audition"
sql_create_context
CREATE TABLE table_203_745 ( id number, "year" text, "title" text, "catalog" text )
what was the first single to be released ?
SELECT "title" FROM table_203_745 ORDER BY "year" LIMIT 1
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
provide me with the short title of procedure and lab test ordered for the patient with patient id 25543.
SELECT procedures.short_title, lab.label FROM procedures INNER JOIN lab ON procedures.hadm_id = lab.hadm_id WHERE procedures.subject_id = "25543"
mimicsql_data
CREATE TABLE table_61416 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
How many people attended the Away team of middlesbrough?
SELECT COUNT("Attendance") FROM table_61416 WHERE "Away team" = 'middlesbrough'
wikisql
CREATE TABLE table_name_21 ( record VARCHAR, week VARCHAR, attendance VARCHAR )
What was the record of the game after Week 6 with an attendance larger than 52,560?
SELECT record FROM table_name_21 WHERE week > 6 AND attendance > 52 OFFSET 560
sql_create_context
CREATE TABLE table_16342 ( "Model" text, "RU" real, "Max processors" text, "Processor frequency" text, "Max memory" text, "Max disk capacity" text, "GA Date" text )
What is the ga date of the t5120 model?
SELECT "GA Date" FROM table_16342 WHERE "Model" = 'T5120'
wikisql