context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_2508633_6 (
position VARCHAR,
college VARCHAR
) | Name the position for delaware | SELECT position FROM table_2508633_6 WHERE college = "Delaware" | sql_create_context |
CREATE TABLE table_name_76 (
first_elected VARCHAR,
district VARCHAR,
result VARCHAR,
party VARCHAR
) | How much First elected has a Result of re-elected, and a Party of republican, and a District of illinois 4? | SELECT COUNT(first_elected) FROM table_name_76 WHERE result = "re-elected" AND party = "republican" AND district = "illinois 4" | sql_create_context |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE va... | What is the number of professors for different school Plot them as bar chart, sort from high to low by the the total number . | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_3002894_4 (
sonnet VARCHAR,
nupowr_117 VARCHAR
) | When 0,4, or 8 mb is the nupowr 117 what is the sonnet? | SELECT sonnet FROM table_3002894_4 WHERE nupowr_117 = "0,4, or 8 MB" | sql_create_context |
CREATE TABLE table_name_97 (
against INTEGER,
wins VARCHAR,
losses VARCHAR
) | Which Against has Wins of 11, and Losses smaller than 7? | SELECT AVG(against) FROM table_name_97 WHERE wins = 11 AND losses < 7 | sql_create_context |
CREATE TABLE table_15700367_2 (
runs_conceded VARCHAR,
overs_bowled VARCHAR
) | Name the runs conceded where overs bowled is 53 | SELECT COUNT(runs_conceded) FROM table_15700367_2 WHERE overs_bowled = "53" | sql_create_context |
CREATE TABLE table_25465 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | How many high rebounds are in series 3-3? | SELECT COUNT("High rebounds") FROM table_25465 WHERE "Series" = '3-3' | wikisql |
CREATE TABLE table_58943 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | Who was the away team that played Northampton Town at home with a tie number of replay? | SELECT "Away team" FROM table_58943 WHERE "Tie no" = 'replay' AND "Home team" = 'northampton town' | wikisql |
CREATE TABLE table_20876 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | who was the successor for district ohio 15th? | SELECT "Successor" FROM table_20876 WHERE "District" = 'Ohio 15th' | wikisql |
CREATE TABLE table_204_3 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" number
) | how long did the last place swimmer take to swim the 100 meter butterfly ? | SELECT "time" FROM table_204_3 ORDER BY "rank" DESC LIMIT 1 | squall |
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... | 患者46318635的医疗记录中,有过哪些医疗费总额超过2893.35元的信息,把入院诊断疾病编码和名称说一下 | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '46318635' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2893.35) | css |
CREATE TABLE table_73993 (
"Edition" text,
"Year" real,
"Host city" text,
"Host country" text,
"Date" text,
"No. of athletes" text,
"Nations" real
) | What was the number of athletes for the 7th edition? | SELECT "No. of athletes" FROM table_73993 WHERE "Edition" = '7th' | wikisql |
CREATE TABLE table_69704 (
"Date" text,
"Opponents" text,
"Result F\u2013A" text,
"Attendance" real,
"Group position" text
) | Date of 1 october 2003 had what attendance? | SELECT "Attendance" FROM table_69704 WHERE "Date" = '1 october 2003' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
... | when was the last time the respiratory rate of patient 27409 was less than 19.0, on the first intensive care unit visit? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27409) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (... | mimic_iii |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,... | Searching for community wiki answers with multiple editors. http://meta.stackexchange.com/questions/257018/searching-for-community-wiki-answers-with-multiple-editors | SELECT p.Id AS "post_link", ph.UserId AS "user_link", u.Reputation, ph.CreationDate FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id INNER JOIN Users AS u ON ph.UserId = u.Id WHERE NOT CommunityOwnedDate IS NULL AND ph.PostHistoryTypeId IN (4, 5, 6) AND u.Reputation < 2000 AND ph.UserId > -1 AND ph.Id =... | sede |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | select distinct tags from posts. | SELECT t.Id, t.TagName, COUNT(DISTINCT OwnerUserId) AS cnt FROM PostTags AS pt LEFT JOIN (SELECT Id, OwnerUserId FROM Posts WHERE YEAR(CreationDate) = 2018 OR YEAR(CreationDate) = 2017 OR YEAR(CreationDate) = 2016 OR YEAR(CreationDate) = 2015 OR YEAR(CreationDate) = 2014 AND NOT Tags IS NULL) AS p ON pt.PostId = p.Id L... | sede |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | was patient 015-23047 excreting any emesis in 12/this year? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE table_32393 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | In which city is Hayman Hall (Tom Gola Arena) located? | SELECT "City" FROM table_32393 WHERE "Venue" = 'hayman hall (tom gola arena)' | wikisql |
CREATE TABLE table_62535 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Which Venue has Against of 25? | SELECT "Venue" FROM table_62535 WHERE "Against" = '25' | wikisql |
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... | what is average age of patients whose admission type is emergency and primary disease is posterior communicating aneurysm/sda? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" | mimicsql_data |
CREATE TABLE table_39807 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Location" text
) | What is the Status with an Author that is woodruff? | SELECT "Status" FROM table_39807 WHERE "Authors" = 'woodruff' | wikisql |
CREATE TABLE table_name_1 (
temperature_rating VARCHAR,
temperature_classification VARCHAR
) | What is the temperature rating of the intermediate temperature classification? | SELECT temperature_rating FROM table_name_1 WHERE temperature_classification = "intermediate" | sql_create_context |
CREATE TABLE table_9260 (
"City" text,
"Round 1" real,
"Round 2" text,
"Round 3" text,
"Round 4" text
) | Round 3 with a round 4 of 50? | SELECT "Round 3" FROM table_9260 WHERE "Round 4" = '50' | wikisql |
CREATE TABLE table_45637 (
"Leader" text,
"Party" text,
"Leader's Seat" text,
"Number of Seats" real,
"Leader since" text
) | Which leader has been a leader since 2007? | SELECT "Leader" FROM table_45637 WHERE "Leader since" = '2007' | wikisql |
CREATE TABLE table_41017 (
"Team" text,
"Tries for" real,
"Tries against" real,
"Try diff" text,
"Points for" real,
"Points against" real,
"Points diff" text
) | What Tries against that have a Points against of 95 and Tries for larger than 20? | SELECT SUM("Tries against") FROM table_41017 WHERE "Points against" = '95' AND "Tries for" > '20' | wikisql |
CREATE TABLE table_64915 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | Who's the actor for the Archers having a character of Martha Woodford? | SELECT "Actor" FROM table_64915 WHERE "Soap Opera" = 'the archers' AND "Character" = 'martha woodford' | wikisql |
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 the first time that patient 29410 was prescribed trazodone hcl and ns until 21 months ago at the same time? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'ns' AND admissions.subject_id = 29410 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-21 month')) AS t1 JOIN (S... | mimic_iii |
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... | how many patients diagnosed with heart valve replacement by transplant left against medical advice? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND diagnoses.long_title = "Heart valve replaced by transplant" | mimicsql_data |
CREATE TABLE table_name_21 (
track INTEGER,
catalogue VARCHAR
) | What track has a catalogue of 47-9465? | SELECT SUM(track) FROM table_name_21 WHERE catalogue = "47-9465" | sql_create_context |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE... | How many flights for each origin city? Return a pie chart. | SELECT origin, COUNT(origin) FROM flight GROUP BY origin | nvbench |
CREATE TABLE table_8115 (
"Name" text,
"Nationality" text,
"Position" text,
"Flamengo career" text,
"Appearances" real,
"Goals" real
) | How many appearances did the flamengo player who was with flamengo during the years 1989 1993 1996 1998 2004 2005 have? | SELECT MAX("Appearances") FROM table_8115 WHERE "Flamengo career" = '1989–1993 1996–1998 2004–2005' | 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_... | For those employees who did not have any job in the past, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday, and rank sum salary in ascending order. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_name_79 (
tournament VARCHAR,
date VARCHAR
) | Name the tournament for april 3, 2005 | SELECT tournament FROM table_name_79 WHERE date = "april 3, 2005" | sql_create_context |
CREATE TABLE table_name_34 (
monday_to_friday VARCHAR,
mañana_es_para_siempre VARCHAR
) | What is Ma ana es para siempre of impreuna pentru totdeauna from Monday to Friday? | SELECT monday_to_friday FROM table_name_34 WHERE mañana_es_para_siempre = "impreuna pentru totdeauna" | sql_create_context |
CREATE TABLE table_name_83 (
wins INTEGER,
losses VARCHAR
) | What is the wins average when 17 games were lost? | SELECT AVG(wins) FROM table_name_83 WHERE losses = 17 | sql_create_context |
CREATE TABLE table_72041 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
) | What is the names for the medalist in the sport of canoeing? | SELECT "Name" FROM table_72041 WHERE "Sport" = 'canoeing' | wikisql |
CREATE TABLE table_68989 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the most points when the entrant was Jaguar racing earlier than 2001? | SELECT MAX("Points") FROM table_68989 WHERE "Entrant" = 'jaguar racing' AND "Year" < '2001' | wikisql |
CREATE TABLE table_name_93 (
ground VARCHAR,
home_team VARCHAR
) | What is the name of the home stadium of Brisbane Lions? | SELECT ground FROM table_name_93 WHERE home_team = "brisbane lions" | sql_create_context |
CREATE TABLE table_name_47 (
competition VARCHAR,
year VARCHAR,
notes VARCHAR
) | What competition was held earlier than 2007 and has 7434 in the notes field? | SELECT competition FROM table_name_47 WHERE year < 2007 AND notes = "7434" | sql_create_context |
CREATE TABLE table_16502 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
) | What is the average? | SELECT MIN("Average") FROM table_16502 | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Delet... | Unanswered questions with a tag favorited by users with a badge in that tag. | SELECT p.Id AS "post_link", p.Score, p.CommentCount, p.CreationDate FROM Posts AS p, Badges AS b, Votes AS v WHERE b.Name = '##tag##' AND v.VoteTypeId = 5 AND v.PostId = p.Id AND v.UserId = b.UserId AND p.Tags LIKE '%##tag##%' AND p.AnswerCount = 0 AND p.ClosedDate IS NULL GROUP BY p.Id, p.Score, p.CommentCount, p.Crea... | sede |
CREATE TABLE table_32725 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away teams score at Princes Park? | SELECT "Away team score" FROM table_32725 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE WINE (
Grape VARCHAR,
Winery VARCHAR,
YEAR VARCHAR,
Price INTEGER
) | List the grape, winery and year of the wines whose price is bigger than 100 ordered by year. | SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR | sql_create_context |
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... | 医疗机构6311978在03年3月17号到08年10月21号期间内医疗就诊记录里公务员的就诊数量 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '6311978' AND IN_HOSP_DATE BETWEEN '2003-03-17' AND '2008-10-21' AND SERVANT_FLG = '公务员' | css |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagn... | how did patient 71091 last visit since 2105 to the hospital? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 71091 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_74607 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team score for the Richmond away team? | SELECT "Home team score" FROM table_74607 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE table_name_73 (
date VARCHAR,
opponent VARCHAR,
result VARCHAR
) | Name the date of st albans city for result of drew 0-0 | SELECT date FROM table_name_73 WHERE opponent = "st albans city" AND result = "drew 0-0" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | when did patient 017-49538 receive his/her first prescription for potassium chloride crys er 20 meq po tbcr on their first hospital visit? | 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 = '017-49538' AND NOT patient.hospitaldischargetime IS NULL ORDER... | eicu |
CREATE TABLE table_23585197_3 (
position INTEGER,
date_eliminated VARCHAR
) | What is the position of the song that was eliminated on 11 november? | SELECT MAX(position) FROM table_23585197_3 WHERE date_eliminated = "11 November" | sql_create_context |
CREATE TABLE table_204_868 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"opponent" text,
"score" text
) | on how many dates was the outcome the same as on 1 august 2011 | SELECT COUNT("date") FROM table_204_868 WHERE "date" <> '1 august 2011' AND "outcome" = (SELECT "outcome" FROM table_204_868 WHERE "date" = '1 august 2011') | squall |
CREATE TABLE table_6505 (
"Country/Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue number" text
) | What is the date for the release with a catalogue number of WARPCDD333? | SELECT "Date" FROM table_6505 WHERE "Catalogue number" = 'warpcdd333' | wikisql |
CREATE TABLE table_name_97 (
capacity INTEGER,
stadium VARCHAR
) | What is the average capacity that has rod laver arena as the stadium? | SELECT AVG(capacity) FROM table_name_97 WHERE stadium = "rod laver arena" | sql_create_context |
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 mzjzjlb (
HXPLC number,
HZXM ... | 从2007年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来 | SELECT zyjybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN zyjybgb 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 WHERE hz_info.RYBH = '47198797' AND zyjybgb.BGRQ BETWEEN '2007-11-06' AND '2012-05... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many newborn type admissions were before the year 2155? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2155" | mimicsql_data |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHA... | Bar chart x axis date of transaction y axis mean share count, and could you list by the Y in asc? | SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY AVG(share_count) | nvbench |
CREATE TABLE table_name_7 (
player VARCHAR,
years_with_spurs VARCHAR
) | What is Player, when Years With Spurs is 1988-95? | SELECT player FROM table_name_7 WHERE years_with_spurs = "1988-95" | sql_create_context |
CREATE TABLE table_13403 (
"2012" real,
"2011" real,
"2010" real,
"2009" real,
"2008" real
) | How much 2012 has a 2011 smaller than 26,452, and a 2009 larger than 3.38, and a 2008 smaller than 90.3? | SELECT COUNT("2012") FROM table_13403 WHERE "2011" < '26,452' AND "2009" > '3.38' AND "2008" < '90.3' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose admission type is emergency and lab test name is cd3 cells, percent? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "CD3 Cells, Percent" | mimicsql_data |
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 the number of patients who were ordered an albumin body fluid lab test and stayed in hospital for more than 13 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "13" AND lab.label = "Albumin, Body Fluid" | mimicsql_data |
CREATE TABLE coach (
coach_id number,
coach_name text,
gender text,
club_id number,
rank number
)
CREATE TABLE club (
club_id number,
club_name text,
region text,
start_year number
)
CREATE TABLE player_coach (
player_id number,
coach_id number,
starting_year number
)
... | Show different occupations along with the number of players in each occupation. | SELECT occupation, COUNT(*) FROM player GROUP BY occupation | spider |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepted... | Top SO Users from Bangladesh. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd' ORDER BY Reputation DESC | sede |
CREATE TABLE table_66078 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What opponent has a week less than 12, with November 25, 1965 as the date? | SELECT "Opponent" FROM table_66078 WHERE "Week" < '12' AND "Date" = 'november 25, 1965' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college va... | What will be offered in the way of intelligent systems in Winter or Fall 2017 ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%intel... | advising |
CREATE TABLE table_name_46 (
score VARCHAR,
record VARCHAR
) | What score has 3-7 as the record? | SELECT score FROM table_name_46 WHERE record = "3-7" | sql_create_context |
CREATE TABLE table_4544 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the VFL played Brunswick Street Oval what was the home team score? | SELECT "Home team score" FROM table_4544 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_55251 (
"Year" text,
"President" text,
"Vice President" text,
"Gen.-Secretary" text,
"Treasurer" text
) | Which treasurer has a President of sebastian ihler? | SELECT "Treasurer" FROM table_55251 WHERE "President" = 'sebastian ihler' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | Provide me the number of patients diagnosed with other chronic nonalcoholic liver disease who have a prescription for famotidine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chronic liver dis NEC" AND prescriptions.drug = "Famotidine" | mimicsql_data |
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 ... | what is the name of the drug that has been prescribed two times in the current hospital encounter to patient 14467? | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467 AND admissions.dischtime IS NULL) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2 | mimic_iii |
CREATE TABLE table_2881 (
"Rank" real,
"Rider" text,
"Mon 24 Aug" text,
"Tues 25 Aug" text,
"Wed 26 Aug" text,
"Thurs 27 Aug" text,
"Fri 28 Aug" text,
"Sat 29 Aug" text
) | When 6 is the rank what is the time for Tuesday August 25th? | SELECT "Tues 25 Aug" FROM table_2881 WHERE "Rank" = '6' | wikisql |
CREATE TABLE table_63735 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | What team has a pick larger than 30, when the college is saginaw valley state? | SELECT "Team" FROM table_63735 WHERE "Pick" > '30' AND "College" = 'saginaw valley state' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime ... | count the number of patients who were prescribed iso-osmotic dextrose in the same month after being diagnosed with diastolc hrt failure nos since 2101. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'diastolc hrt failu... | mimic_iii |
CREATE TABLE table_name_99 (
surface VARCHAR,
score VARCHAR
) | On what Surface was the match with a Score of 3-6, 1-6 played? | SELECT surface FROM table_name_99 WHERE score = "3-6, 1-6" | sql_create_context |
CREATE TABLE table_203_34 (
id number,
"season" text,
"appearance" number,
"interchange" number,
"tries" number,
"goals" number,
"f/g" number,
"points" number
) | there were years where he had 0 goals but was year did he have the most goals ? | SELECT "season" FROM table_203_34 ORDER BY "goals" DESC LIMIT 1 | squall |
CREATE TABLE table_name_17 (
max_aggregate_bandwidth__bi_directional_ VARCHAR,
hypertransport_version VARCHAR
) | What is the Max Aggregate bandwidth with a HyperTransport of 2? | SELECT max_aggregate_bandwidth__bi_directional_ FROM table_name_17 WHERE hypertransport_version = 2 | sql_create_context |
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 PostHistoryTypes (
Id number,
Name te... | What question should I accept answeres to?. | SELECT q.Id AS "post_link", q.Tags, q.Score, q.AnswerCount, q.ViewCount, DATEDIFF(day, q.CreationDate, CURRENT_TIMESTAMP()) AS age FROM Posts AS q WHERE q.OwnerUserId = @UserId AND q.AcceptedAnswerId IS NULL AND q.PostTypeId = 1 AND q.Score > 0 AND q.AnswerCount > 0 AND q.ViewCount > 0 ORDER BY (LOG(q.Score) * @ScoreWe... | sede |
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... | 在11年12月28日到18年2月10日这个时间段里医疗机构7972448统共处理了多少次新生儿门诊的就诊? | SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '79... | css |
CREATE TABLE table_17743 (
"No." real,
"P" text,
"Name" text,
"Country" text,
"Age" real,
"Loan Club" text,
"Started" text,
"Ended" text,
"Start Source" text,
"End Source" text
) | What is the number for De Vries? | SELECT MIN("No.") FROM table_17743 WHERE "Name" = 'de Vries' | wikisql |
CREATE TABLE table_11964047_5 (
score VARCHAR,
record VARCHAR
) | what's the score where record is 0 2 | SELECT score FROM table_11964047_5 WHERE record = "0–2" | sql_create_context |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | Show me the number of born state by born state in a histogram | SELECT born_state, COUNT(born_state) FROM head GROUP BY born_state | nvbench |
CREATE TABLE table_15992 (
"Case/Suffix" text,
"we two" text,
"you and I" text,
"you two" text,
"them two (the two)" text,
"who-two" text
) | What is who-two where you and i is ng ban? | SELECT "who-two" FROM table_15992 WHERE "you and I" = 'ngœban' | wikisql |
CREATE TABLE table_name_89 (
notes VARCHAR,
app_l_c_e_ VARCHAR
) | What is Notes, when App(L/C/E) is 13 (7/2/4)? | SELECT notes FROM table_name_89 WHERE app_l_c_e_ = "13 (7/2/4)" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | how many hours has it been since the first time patient 027-61708 was diagnosed during their current hospital encounter with obstructive sleep apnea? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708... | eicu |
CREATE TABLE table_26591309_2 (
first_broadcast_uk___bbc_four__ VARCHAR,
official_tns_gallup_ratings VARCHAR
) | When was the first UK broadcast for the episode with an official TNS Gallup rating of 1575000? | SELECT first_broadcast_uk___bbc_four__ FROM table_26591309_2 WHERE official_tns_gallup_ratings = 1575000 | sql_create_context |
CREATE TABLE table_name_22 (
language VARCHAR,
original_title VARCHAR
) | What language is the film Karnal in? | SELECT language FROM table_name_22 WHERE original_title = "karnal" | sql_create_context |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit... | what is the total amount of gammagard s/d that patient 32606 has been prescribed during their first hospital visit? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32606 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'gammagard s/d' | mimic_iii |
CREATE TABLE table_18277458_2 (
ticket_sold___available VARCHAR,
venue VARCHAR
) | How many tickets are sold for the Carver-Hawkeye Arena? | SELECT ticket_sold___available FROM table_18277458_2 WHERE venue = "Carver-Hawkeye Arena" | sql_create_context |
CREATE TABLE table_2199290_1 (
year INTEGER
) | What is the latest year? | SELECT MAX(year) FROM table_2199290_1 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | during this year did patient 3097 visit the hospital? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 3097 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
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... | 在二零一零年一月七日到二零一零年十月九日的这段时间里,医疗机构7738882的总金额和统筹总金额分别是怎么样的 | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) 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 = '7738882' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-01-07' AND '2010-10-09' | css |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Stacked bar of class and the number of class colored by Rank, and display in asc by the x axis please. | SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class | 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... | get the number of patients admitted before the year 2182 who were on non-invasive mechanical ventilation. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2182" AND procedures.short_title = "Non-invasive mech vent" | mimicsql_data |
CREATE TABLE table_61912 (
"Name in English" text,
"Name in Malay" text,
"Acronym" text,
"Foundation" text,
"Location" text
) | What is the location of the Kkspe Foundation? | SELECT "Location" FROM table_61912 WHERE "Foundation" = 'kkspe' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 患者82545528的体重和身高各是多少? | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM... | css |
CREATE TABLE table_26612 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | Who was the director of the episode called 'If I had a hammer'? | SELECT "Directed by" FROM table_26612 WHERE "Title" = 'If I Had a Hammer' | wikisql |
CREATE TABLE table_name_86 (
against INTEGER,
played INTEGER
) | What is the sum of againsts the team with less than 38 played had? | SELECT SUM(against) FROM table_name_86 WHERE played < 38 | sql_create_context |
CREATE TABLE table_name_26 (
attendance INTEGER,
date VARCHAR
) | What was the Attendance high on August 28? | SELECT MAX(attendance) FROM table_name_26 WHERE date = "august 28" | sql_create_context |
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 change of salary over hire_date in a line chart. | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
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 ... | Find the number of routes operated by American Airlines. | SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | spider |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
... | In the past , who taught WOMENSTD 300 ? | SELECT DISTINCT instructor.name 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 INNER JOIN semester... | advising |
CREATE TABLE table_name_10 (
loss VARCHAR,
opponent VARCHAR
) | Name the loss for the angels opponent | SELECT loss FROM table_name_10 WHERE opponent = "angels" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.