context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_train_61 ( "id" int, "white_blood_cell_count_wbc" int, "in_another_study" bool, "systolic_blood_pressure_sbp" int, "trauma" bool, "temperature" float, "anc" int, "hypotension" bool, "heart_rate" int, "paco2" float, "gastrointestinal_disease" bool, "burn...
gastrointestinal hemorrhage, seizure, drug overdose, burn or trauma
SELECT * FROM table_train_61 WHERE gastrointestinal_disease = 1 OR seizure_disorder = 1 OR drug_abuse = 1 OR burn_injury > 0 OR trauma = 1
criteria2sql
CREATE TABLE table_train_138 ( "id" int, "mini_mental_state_examination_mmse" int, "stroke" bool, "body_weight" float, "cranial_neurosurgery" bool, "first_degree_relative" bool, "seizure_disorder" bool, "alcohol_abuse" bool, "body_mass_index_bmi" float, "aneurysm" bool, "NOUS...
subjects with diagnosis of current alcohol related problems
SELECT * FROM table_train_138 WHERE alcohol_abuse = 1
criteria2sql
CREATE TABLE table_67700 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What would be the lowest Attendance that also showed a loss of Obermueller (1-2)?
SELECT MIN("Attendance") FROM table_67700 WHERE "Loss" = 'obermueller (1-2)'
wikisql
CREATE TABLE table_19508635_1 ( order__number VARCHAR, theme VARCHAR )
Name the order number for 1960s
SELECT order__number FROM table_19508635_1 WHERE theme = "1960s"
sql_create_context
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
What are the first and last names of all the female students who have president votes?
SELECT DISTINCT T1.fname, T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.president_vote WHERE T1.sex = "F"
spider
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_NM = '戚文栋' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_28352 ( "\u00d7" text, "Wehdat" text, "Faisaly" text, "Ramtha" text, "Ahli" text, "Hussein" text, "Jazeera" text, "Amman" text, "Qadisiya" text, "Jeel" text, "Baqaa" text )
what is the capital where it is ramtha
SELECT "Qadisiya" FROM table_28352 WHERE "\u00d7" = 'Ramtha'
wikisql
CREATE TABLE table_66397 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the Attendance of the game in Week 12?
SELECT MAX("Attendance") FROM table_66397 WHERE "Week" = '12'
wikisql
CREATE TABLE table_name_39 ( attendance VARCHAR, week VARCHAR, opponent VARCHAR )
Which attendance number was taken in a week less than 16 when the Washington Redskins were the opponents?
SELECT attendance FROM table_name_39 WHERE week < 16 AND opponent = "washington redskins"
sql_create_context
CREATE TABLE table_name_28 ( nation VARCHAR, gold VARCHAR, bronze VARCHAR )
For what nation is the gold medals 0, and the bronze medals less than 1?
SELECT nation FROM table_name_28 WHERE gold = 0 AND bronze < 1
sql_create_context
CREATE TABLE table_35448 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the score for the game on February 29?
SELECT "Score" FROM table_35448 WHERE "Date" = 'february 29'
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...
请分别列出医疗就诊09954947689与医疗费总费用相同的医疗就诊记录的ID、人员ID、人员姓名、人员性别、公民身份号码、人员年龄分别是什么呢?
SELECT t_kc24.MED_CLINIC_ID, t_kc24.t_kc21_PERSON_ID, t_kc24.t_kc21_PERSON_NM, t_kc24.t_kc21_IDENTITY_CARD, t_kc24.t_kc21_PERSON_SEX, t_kc24.t_kc21_PERSON_AGE FROM t_kc24 WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '09954947689')
css
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
Top 5k Users by Reputation per Post.
SELECT (u.Reputation / COUNT(p.OwnerUserId)) AS "Rep Per Post", u.DisplayName, COUNT(p.OwnerUserId) AS "Posts", u.Reputation FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE u.Reputation >= 5000 GROUP BY u.Reputation, u.DisplayName ORDER BY (u.Reputation / COUNT(p.OwnerUserId)) DESC
sede
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...
列出在2001-03-25到2020-05-29内患者马欣怿被开出的所有检验报告单的检验报告单号是什么?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '马...
css
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 prescriptions...
calculate the total number of patients with item id 51244
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51244"
mimicsql_data
CREATE TABLE table_41983 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
What is the total of the 3-0 score with a set 2 of 25-12 and a set 3 of 25-18?
SELECT "Total" FROM table_41983 WHERE "Score" = '3-0' AND "Set 3" = '25-18' AND "Set 2" = '25-12'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
what is the names of the medications which patient 004-7984 was allergic to until 36 months ago?
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-7984')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-...
eicu
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 zzmzjzjlb ( HXPLC number, HZX...
通过门诊诊断出疾病A48.710的病员的促甲状腺激素受体抗体数值的平均值和他们的最值分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'A48.710' AND jyjgzbb.JCZBMC = '...
css
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...
Ratio of downvoted questions over time.. Look at the Graph, to see the evolution of the upvote/downvote ratio.
SELECT DATEFROMPARTS(YEAR(CreationDate), MONTH(CreationDate), 1) AS YearMonth, 1 / (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT), 0)) AS Ratio FROM Votes WHERE CreationDate > '01-01-2010' GROUP BY DATEFROMPARTS(YEAR(CreationDate),...
sede
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Find the average rating star for each movie that are not reviewed by Brittany Harris. Plot them as scatter chart.
SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID
nvbench
CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, Bronze int, Points int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starti...
Draw a bar chart of gender versus the number of gender
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender
nvbench
CREATE TABLE table_name_47 ( years VARCHAR, nation VARCHAR, assist VARCHAR, rank VARCHAR )
Which years did the USA have a rank lower than 6 and an assist number less than 26?
SELECT years FROM table_name_47 WHERE assist < 26 AND rank < 6 AND nation = "usa"
sql_create_context
CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id in...
Visualize a bar chart for what are the ids and trade names of the medicine that can interact with at least 3 enzymes?, could you sort x-axis in desc order?
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name DESC
nvbench
CREATE TABLE table_name_71 ( avg_g INTEGER, long VARCHAR, loss VARCHAR )
Which Avg/G has a Long of 93, and a Loss smaller than 249?
SELECT SUM(avg_g) FROM table_name_71 WHERE long = 93 AND loss < 249
sql_create_context
CREATE TABLE table_28472 ( "Character" text, "Played by" text, "Season 1" real, "Season 2" real, "Season 3" real, "Season 4" real, "First Appearance" text )
How many season 4 appearances are there by Mrs. Jennifer Knight?
SELECT MIN("Season 4") FROM table_28472 WHERE "Character" = 'Mrs. Jennifer Knight'
wikisql
CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, s...
Visualize a pie chart to show the credit scores of customers who have taken a loan by different names.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID
nvbench
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
when is the last time patient 4758 visited the hospital since 2105?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 4758 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
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...
病患36963389检测丙戊酸在2012年2月7日起到2019年5月3日结束的医务人员工号及姓名分别是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE Claims_Processing ( Claim_Processing_ID INTEGER, Claim_ID INTEGER, Claim_Outcome_Code CHAR(15), Claim_Stage_ID INTEGER, Staff_ID INTEGER ) CREATE TABLE Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATETIME, End_Date DATETI...
Find the number of records of each policy type and its type code. Visualize by bar chart.
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code
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...
count the number of patients whose discharge location is short term hospital and year of birth is less than 2078?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2078"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
what is the percentile 109.0 in the laboratory test of chloride with regard to the same age of patient 15986 in their current hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age ...
mimic_iii
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 Users ( Id number, Reputation number,...
Tags with a high proportion of unanswered questions. with score <= 0, low views, no answers
SELECT t.TagName, 100 * CAST(COUNT(p.Id) AS FLOAT) / COUNT(*) AS "% Unanswered", COUNT(p.Id) AS Unanswered, COUNT(*) AS Posts FROM Tags AS t LEFT JOIN PostTags AS pt ON t.Id = pt.TagId LEFT OUTER JOIN Posts AS p ON pt.PostId = p.Id AND p.PostTypeId = 1 AND p.ViewCount < 500 AND (p.AnswerCount < 1 OR p.AnswerCount IS NU...
sede
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
what were the three most frequent drugs that were prescribed within 2 months to patients of age 30s after they had been diagnosed with hyperglycemia - stress related since 2104.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia - stress related' AND STRFTIME('%y',...
eicu
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 ...
when was first time that patient 20000 had the minimum calculated total co2 value since 102 months ago?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TI...
mimic_iii
CREATE TABLE table_58358 ( "Position" text, "Game 1" text, "Game 2" text, "Game 3" text, "Game 4" text )
During which Game 4, did Brett Kenny play Game 2?
SELECT "Game 4" FROM table_58358 WHERE "Game 2" = 'brett kenny'
wikisql
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state ...
Draw a bar chart for what is the average account balance of customers with credit score below 50 for the different account types?, could you list by the X-axis in ascending?
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type
nvbench
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 admitted before 2194 who were diagnosed with hypopotassemia.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.long_title = "Hypopotassemia"
mimicsql_data
CREATE TABLE table_28491 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What was Katie's order number when the theme was The Rolling Stones?
SELECT "Order #" FROM table_28491 WHERE "Theme" = 'The Rolling Stones'
wikisql
CREATE TABLE table_39458 ( "Year" real, "Class" text, "Team" text, "Machine" text, "Points" real, "Rank" text, "Wins" real )
How many years have 78 for points?
SELECT COUNT("Year") FROM table_39458 WHERE "Points" = '78'
wikisql
CREATE TABLE table_56891 ( "Result" text, "Opponent" text, "Method" text, "Event" text, "Date" real )
What was the event for vinny magalh es?
SELECT "Event" FROM table_56891 WHERE "Opponent" = 'vinny magalhães'
wikisql
CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, ...
A bar chart about the number of faults for different fault status of all the faults recoreded in the logs, sort by the Y-axis in desc.
SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_status ORDER BY COUNT(fault_status) DESC
nvbench
CREATE TABLE table_name_57 ( built VARCHAR, cr_no VARCHAR, lms_no VARCHAR )
What's the built date when the CR number is more than 940 and the LMS number is 14760?
SELECT built FROM table_name_57 WHERE cr_no > 940 AND lms_no = 14760
sql_create_context
CREATE TABLE table_name_9 ( built VARCHAR, location VARCHAR )
When was la vista built?
SELECT built FROM table_name_9 WHERE location = "la vista"
sql_create_context
CREATE TABLE table_44527 ( "Team" text, "Average" real, "Points" real, "Played" real, "1991-92" text, "1992-93" text, "1993-94" real )
Total points with 114 played and average of 0.982?
SELECT SUM("Points") FROM table_44527 WHERE "Played" = '114' AND "Average" = '0.982'
wikisql
CREATE TABLE table_7901 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
What round was jerry corcoran drafted in as pick number 114?
SELECT MAX("Round") FROM table_7901 WHERE "Pick" > '114' AND "Player" = 'jerry corcoran'
wikisql
CREATE TABLE table_57045 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text )
Which Tournament has Pat Cash as a runner-up?
SELECT "Tournament" FROM table_57045 WHERE "Runner-up" = 'pat cash'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is drug type of drug name enalaprilat?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Enalaprilat"
mimicsql_data
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 the number of patients whose death status is 0 and admission location is emergency room admit?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
mimicsql_data
CREATE TABLE table_name_66 ( round VARCHAR, college VARCHAR, overall VARCHAR )
In what Round with an Overall greater than 306 was the pick from the College of Virginia Tech?
SELECT COUNT(round) FROM table_name_66 WHERE college = "virginia tech" AND overall > 306
sql_create_context
CREATE TABLE table_74753 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" text, "Round of 32" text, "Sweet Sixteen" text, "Elite Eight" text, "Final Four" text, "Championship Game" text )
What Sweet Sixteen team is in the Colonial conference?
SELECT "Sweet Sixteen" FROM table_74753 WHERE "Conference" = 'colonial'
wikisql
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
Return a pie chart on what are the memories and carriers of phones?
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE table_name_80 ( home_team VARCHAR, tie_no VARCHAR )
Who was the Home team in Tie #23?
SELECT home_team FROM table_name_80 WHERE tie_no = 23
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...
provide the number of patients whose admission year is less than 2158 and diagnoses long title is benign neoplasm of spinal meninges?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2158" AND diagnoses.long_title = "Benign neoplasm of spinal meninges"
mimicsql_data
CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, ...
What are the cities that have a branch that opened in 2001 and a branch with more than 100 members?
SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100
spider
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Compare the total number of different ranks using a bar graph, could you order X in desc order?
SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY Rank DESC
nvbench
CREATE TABLE table_2889810_2 ( moto2_250cc VARCHAR, country VARCHAR )
how many total number of moto2/250cc when country is united states
SELECT COUNT(moto2_250cc) FROM table_2889810_2 WHERE country = "United States"
sql_create_context
CREATE TABLE table_name_9 ( original_title VARCHAR, english_title VARCHAR )
English title of mal na had what original title?
SELECT original_title FROM table_name_9 WHERE english_title = "malèna"
sql_create_context
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTME...
Visualize a scatter chart on what are total salaries and department id for each department that has more than 2 employees?
SELECT DEPARTMENT_ID, SUM(SALARY) FROM employees GROUP BY DEPARTMENT_ID
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
哪几家医院为45027908这个病患开了7909这个药
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '45027908' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '7909')
css
CREATE TABLE table_25695027_1 ( number_built VARCHAR, valve_gear VARCHAR, cylinder_size VARCHAR, firebox VARCHAR )
How many engines were built with a cylinder size of 20 x 26 , firebox is belpaire and valve gear is from Stephenson?
SELECT number_built FROM table_25695027_1 WHERE cylinder_size = "20 ½” x 26”" AND firebox = "Belpaire" AND valve_gear = "Stephenson"
sql_create_context
CREATE TABLE table_name_17 ( name VARCHAR, country VARCHAR )
What is the name of the player from NGA?
SELECT name FROM table_name_17 WHERE country = "nga"
sql_create_context
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, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Does Prof. Gabriel Horowitz teach INSTHUM 611 with a lab ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.department = 'INST...
advising
CREATE TABLE table_name_34 ( bike VARCHAR, rider VARCHAR, grid VARCHAR, laps VARCHAR )
Which bike did Jiri Drazdak ride when he had a grid number larger than 14 and less than 22 laps?
SELECT bike FROM table_name_34 WHERE grid > 14 AND laps < 22 AND rider = "jiri drazdak"
sql_create_context
CREATE TABLE table_20539826_1 ( mccain_percentage VARCHAR, county VARCHAR )
How many percent of the votes in Debaca did McCain get?
SELECT mccain_percentage FROM table_20539826_1 WHERE county = "DeBaca"
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description...
i would like to travel from BOSTON to DENVER early in the morning
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE table_57842 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What week number saw a w 31-16 result?
SELECT MIN("Week") FROM table_57842 WHERE "Result" = 'w 31-16'
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 hz_info ( KH text, KLX number...
从二0一六年十二月八日到二0二0年十二月二十九日,患者79918177的所有检验结果指标记录中的检测方法共有多少种,给全部列出来
SELECT jyjgzbb.JCFF 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_in...
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
在编码为5902863的医院中列出83546041病人出院科室名称包含肾内科的住院就诊记录是哪几条?
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '83546041' AND hz_info.YLJGDM = '5902863' AND zyjzjlb.CYKSMC LIKE '%肾内科%'
css
CREATE TABLE table_10463 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text, "Boxscore" text )
Which box score has an Attendance of 54,773?
SELECT "Boxscore" FROM table_10463 WHERE "Attendance" = '54,773'
wikisql
CREATE TABLE table_14716 ( "Year" real, "Category" text, "Film" text, "Winner/Nominee(s)" text, "Result" text )
What year did the movie Rango come out?
SELECT AVG("Year") FROM table_14716 WHERE "Film" = 'rango'
wikisql
CREATE TABLE table_80085 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Who was in 1963?
SELECT "Entrant" FROM table_80085 WHERE "Year" = '1963'
wikisql
CREATE TABLE table_61865 ( "Pick" real, "Player" text, "Team" text, "Position" text, "Hometown/School" text )
WHAT TEAM HAS A PICK LARGER THAN 29?
SELECT "Team" FROM table_61865 WHERE "Pick" > '29'
wikisql
CREATE TABLE journal ( journal_id number, date text, theme text, sales number ) CREATE TABLE journal_committee ( editor_id number, journal_id number, work_type text ) CREATE TABLE editor ( editor_id number, name text, age number )
List the names of editors in ascending order of age.
SELECT name FROM editor ORDER BY age
spider
CREATE TABLE table_20065425_1 ( title VARCHAR, termination_of_mission VARCHAR )
How many different titles does the representative whose mission was terminated on August 5, 1984 have?
SELECT COUNT(title) FROM table_20065425_1 WHERE termination_of_mission = "August 5, 1984"
sql_create_context
CREATE TABLE table_name_57 ( venue VARCHAR, home_team VARCHAR )
What is the venue where the home team is Footscray?
SELECT venue FROM table_name_57 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_name_41 ( loss INTEGER, long INTEGER )
What is the lowest Loss, when Long is less than 0?
SELECT MIN(loss) FROM table_name_41 WHERE long < 0
sql_create_context
CREATE TABLE table_1213511_6 ( nationality VARCHAR, nhl_team VARCHAR )
What is the nationality of the player from the Detroit Red Wings?
SELECT nationality FROM table_1213511_6 WHERE nhl_team = "Detroit Red Wings"
sql_create_context
CREATE TABLE table_name_76 ( since INTEGER, transfer_fee VARCHAR, ends VARCHAR )
What is the lowest year in since that had a transfer fee of 14m and ended after 2011?
SELECT MIN(since) FROM table_name_76 WHERE transfer_fee = "€ 14m" AND ends > 2011
sql_create_context
CREATE TABLE table_name_79 ( record VARCHAR, date VARCHAR )
What was the record on march 26?
SELECT record FROM table_name_79 WHERE date = "march 26"
sql_create_context
CREATE TABLE table_name_80 ( year VARCHAR, first_publisher VARCHAR, english_title VARCHAR )
What is the Year of Kodansha Novels' Tokyo Nightmare?
SELECT year FROM table_name_80 WHERE first_publisher = "kodansha novels" AND english_title = "tokyo nightmare"
sql_create_context
CREATE TABLE table_65004 ( "Municipality" text, "FIPS code" real, "Founded" real, "Population (2010)" real, "Area" text )
What is the FIPS code for the municipality that has an area of 114.76 sq mi (297.23 sq km) and had a 2010 population of less than 166,327?
SELECT AVG("FIPS code") FROM table_65004 WHERE "Area" = '114.76 sq mi (297.23 sq km)' AND "Population (2010)" < '166,327'
wikisql
CREATE TABLE table_name_17 ( class VARCHAR, power VARCHAR )
what is the class when the power is 22500 watts?
SELECT class FROM table_name_17 WHERE power = "22500 watts"
sql_create_context
CREATE TABLE table_60259 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Name the Place which has a Score of 67-71=138, united states?
SELECT "Place" FROM table_60259 WHERE "Country" = 'united states' AND "Score" = '67-71=138'
wikisql
CREATE TABLE table_63271 ( "Name" text, "Games" text, "A-League" text, "Finals" text, "Goals" real, "Assists" real, "Years" text )
What is the lowest number of goals of the player with 9 (0) games and less than 0 assists?
SELECT MIN("Goals") FROM table_63271 WHERE "Games" = '9 (0)' AND "Assists" < '0'
wikisql
CREATE TABLE table_name_21 ( home_team VARCHAR, crowd INTEGER )
Who played as the home team when the attendance was more than 30,080?
SELECT home_team FROM table_name_21 WHERE crowd > 30 OFFSET 080
sql_create_context
CREATE TABLE table_name_81 ( set_2 VARCHAR, total VARCHAR )
What is Set 2, when Total is '52:44'?
SELECT set_2 FROM table_name_81 WHERE total = "52:44"
sql_create_context
CREATE TABLE table_name_85 ( college_junior_club_team VARCHAR, round INTEGER )
What is the college club that plays before round 3?
SELECT college_junior_club_team FROM table_name_85 WHERE round < 3
sql_create_context
CREATE TABLE table_8048 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text )
What is the report for Challenge Stadium?
SELECT "Report" FROM table_8048 WHERE "Venue" = 'challenge stadium'
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...
姓名是水清妍的参保人在2004年9月13日到2007年6月5日期间门诊检查一共花了多少钱?
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '水清妍' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-09-13' AND '2007-06-05' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb...
css
CREATE TABLE table_330 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
What height was the player that played for the Rockets between 1992-93?
SELECT "Height in Ft." FROM table_330 WHERE "Years for Rockets" = '1992-93'
wikisql
CREATE TABLE table_name_94 ( total VARCHAR, sports VARCHAR, silver VARCHAR, gold VARCHAR, bronze VARCHAR )
What is the Total medals the Year Yugoslavia had 1 Sport and won 0 Gold, Bronze or Silver?
SELECT total FROM table_name_94 WHERE gold = "0" AND bronze = "0" AND silver = "0" AND sports = "1"
sql_create_context
CREATE TABLE table_26847237_3 ( score VARCHAR, opposition VARCHAR )
What is the score when the opposition is mid canterbury?
SELECT score FROM table_26847237_3 WHERE opposition = "Mid Canterbury"
sql_create_context
CREATE TABLE table_name_11 ( round VARCHAR, club VARCHAR )
Which round did Dundee United end in?
SELECT round FROM table_name_11 WHERE club = "dundee united"
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...
在编码为6682741的医院患者秦鸿德出院诊断疾病名称不包含脑瘫的医疗就诊记录是多少号码?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '秦鸿德' AND qtb.MED_SER_ORG_NO = '6682741' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%脑瘫%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '秦鸿德' AND gyb.MED_SER_ORG_NO = '6682741' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%脑瘫%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb ...
css
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...
69939554这个病人被门诊诊断为脑外伤所致精神障碍,他做的胱抑素C2代的结果定量及其单位分别是啥
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE stadium ( id number, name text, home_games number, average_attendance number, total_attendance number, capacity_percentage number ) CREATE TABLE injury_accident ( game_id number, id number, player text, injury text, number_of_matches text, source text ) CRE...
How many different kinds of information sources are there for injury accidents?
SELECT COUNT(DISTINCT source) FROM injury_accident
spider
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
provide the number of patients whose discharge location is home health care and age is less than 31?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.age < "31"
mimicsql_data
CREATE TABLE table_dev_34 ( "id" int, "gender" string, "heart_disease" bool, "body_weight" float, "hematocrit_hct" float, "fasting_blood_glucose_fbg" float, "hyperlipidemia" bool, "systemic_illness" bool, "angina" bool, "serum_ldl" int, "clinically_significant_atherosclerotic...
hematocrit of less than 36 % for male , less than 32 % for female .
SELECT * FROM table_dev_34 WHERE (hematocrit_hct < 36 AND gender = 'male') OR (hematocrit_hct < 32 AND gender = 'female')
criteria2sql
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
can you give me the latest flight from ATLANTA to DENVER on 7 7
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 7 AND date_day.month_number = 7 AND da...
atis
CREATE TABLE table_204_110 ( id number, "year" number, "champion" text, "city" text, "llws" text, "record" text )
who came in first place in 1966 ?
SELECT "champion" FROM table_204_110 WHERE "year" = 1966
squall