instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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... | SELECT COUNT(gwyjzb.IN_DIAG_DIS_CD) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '施思云' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-04-28' AND '2007-10-27' UNION SELECT COUNT(fgwyjzb.IN_DIAG_DIS_CD) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '施思云' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-04-28' AND '2007-10-27' | css |
CREATE TABLE table_50056 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player for Zimbabwe?
| SELECT "Player" FROM table_50056 WHERE "Country" = 'zimbabwe' | 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... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '82617822' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "UPPER GI BLEED" AND procedures.icd9_code = "66" | mimicsql_data |
CREATE TABLE table_name_9 (
year VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was E. Meyer the driver?
| SELECT year FROM table_name_9 WHERE driver = "e. meyer" | sql_create_context |
CREATE TABLE table_49283 (
"Rank" text,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT MIN("Profits (billion $)") FROM table_49283 WHERE "Market Value (billion $)" < '201.3' AND "Headquarters" = 'united states' AND "Company" = 'jpmorgan chase' | wikisql |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | SELECT party FROM party WHERE NOT party_id IN (SELECT party FROM election) | spider |
CREATE TABLE table_name_84 (
place VARCHAR,
name VARCHAR,
clubs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many places have bianka panova as the name, with clubs less than 10?
| SELECT COUNT(place) FROM table_name_84 WHERE name = "bianka panova" AND clubs < 10 | sql_create_context |
CREATE TABLE table_1366 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number for fox news c... | SELECT "N\u00b0" FROM table_1366 WHERE "Television service" = 'Fox News Channel' | wikisql |
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE time_slot (
time_slot_id text,
day text,
start_hr number,
start_min number,
end_hr number,
end_min number
)
CREATE TABLE instructor (
id text,
name text,
dept_name text,
salary number
)
CREATE TABLE ta... | SELECT course_id FROM section WHERE semester = 'Fall' AND year = 2009 UNION SELECT course_id FROM section WHERE semester = 'Spring' AND year = 2010 | spider |
CREATE TABLE table_18335 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was incumbent mark w. hannaford elected?
| SELECT MIN("First elected") FROM table_18335 WHERE "Incumbent" = 'Mark W. Hannaford' | wikisql |
CREATE TABLE table_49953 (
"Driver" text,
"Race 1" text,
"Race 2" text,
"Race 3" text,
"Race 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Race 4, when Race 1 is 28?
| SELECT "Race 4" FROM table_49953 WHERE "Race 1" = '28' | wikisql |
CREATE TABLE table_name_75 (
losses INTEGER,
goals_against VARCHAR,
draws VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Losses have Draws larger than 6, and a Club of cd mestalla, and Goals against larger than 44?
| SELECT MIN(losses) FROM table_name_75 WHERE draws > 6 AND club = "cd mestalla" AND goals_against > 44 | sql_create_context |
CREATE TABLE table_10178 (
"Role" text,
"Original Broadway production" text,
"First US National Tour" text,
"Second US National Tour" text,
"Original Italian production" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Original Broadway producti... | SELECT "Original Broadway production" FROM table_10178 WHERE "Role" = 'dr. victor von frankenstein' | wikisql |
CREATE TABLE table_46013 (
"Year" real,
"Best teenage/Young Adult" text,
"Reader's Vote" text,
"Best Non-Fiction" text,
"Lifetime Achievement" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won the lifetime achievement in the year 1998?
| SELECT "Lifetime Achievement" FROM table_46013 WHERE "Year" = '1998' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Rev... | SELECT TIME_TO_STR(e.CreationDate, '%M') AS "month", TIME_TO_STR(e.CreationDate, '%Y') AS "year", SUM(CASE r.PostHistoryTypeId WHEN 10 THEN 1 ELSE 0 END) AS Closed, SUM(CASE r.PostHistoryTypeId WHEN 11 THEN 1 ELSE 0 END) AS reopen FROM PostHistory AS e JOIN PostHistory AS r ON r.PostId = e.PostId WHERE e.CreationDate <... | sede |
CREATE TABLE table_name_19 (
carriers VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which carrier is ranked 20?
| SELECT carriers FROM table_name_19 WHERE rank = 20 | sql_create_context |
CREATE TABLE table_55906 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Away team that played at Carlton on ... | SELECT "Away team" FROM table_55906 WHERE "Date" = '11 june 1966' AND "Home team" = 'carlton' | wikisql |
CREATE TABLE table_224839_3 (
state__class_ VARCHAR,
reason_for_change VARCHAR,
vacator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the states (class) when the reason for change was resigned November 26, 1798 and the vacator was John Hunt... | SELECT state__class_ FROM table_224839_3 WHERE reason_for_change = "Resigned November 26, 1798" AND vacator = "John Hunter ( DR )" | sql_create_context |
CREATE TABLE table_43266 (
"Date" text,
"Label" text,
"Format" text,
"Country" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date for Catalog of lp 5060?
| SELECT "Date" FROM table_43266 WHERE "Catalog" = 'lp 5060' | wikisql |
CREATE TABLE table_1326 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is... | SELECT "Location Attendance" FROM table_1326 WHERE "Game" = '38' | wikisql |
CREATE TABLE table_26934 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent on Oct. 4?
| SELECT "Opponent" FROM table_26934 WHERE "Date" = 'Oct. 4' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABL... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_name_47 (
locality VARCHAR,
ofsted VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the locality with Ofsted less than 106478 for Meadowbank Primary and Nursery School?
| SELECT locality FROM table_name_47 WHERE ofsted < 106478 AND school = "meadowbank primary and nursery school" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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 instructor (
instructo... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.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 program_course.catego... | advising |
CREATE TABLE table_name_38 (
team VARCHAR,
number VARCHAR,
years_with_franchise VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team is number 14 and had a franchise in 1993-2000?
| SELECT team FROM table_name_38 WHERE number = 14 AND years_with_franchise = "1993-2000" | sql_create_context |
CREATE TABLE table_name_88 (
venue VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of game 3?
| SELECT venue FROM table_name_88 WHERE game = 3 | 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 t_kc21.FLX_MED_ORG_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '12867892792' | css |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varc... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHYSIOL' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sum... | advising |
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... | SELECT * FROM qtb WHERE qtb.PERSON_NM = '袁静娴' AND qtb.MED_SER_ORG_NO = '3905191' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%放射治疗%' UNION SELECT * FROM gyb WHERE gyb.PERSON_NM = '袁静娴' AND gyb.MED_SER_ORG_NO = '3905191' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%放射治疗%' UNION SELECT * FROM zyb WHERE zyb.PERSON_NM = '袁静娴' AND zyb.MED_SER_... | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTyp... | SELECT Body, Tags, CreationDate FROM Posts WHERE CreationDate > '2019-07-01' AND CreationDate < '2019-08-01' AND Tags != '' LIMIT 1000 | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | 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 = 'sinusitis - radiographically demonstrated' AND DAT... | eicu |
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... | SELECT patients.dob FROM patients WHERE patients.subject_id = 76327 | mimic_iii |
CREATE TABLE table_50792 (
"Event" text,
"Long Course/Short Course" text,
"Year Set" real,
"Time" text,
"Meet" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did a short course have a time of 7:51.80?
| SELECT COUNT("Year Set") FROM table_50792 WHERE "Long Course/Short Course" = 'short course' AND "Time" = '7:51.80' | 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... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4916262' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-02-15' AND '2001-03-24' AND t_kc21.CLINIC_TYPE = '住院' | css |
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
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name | nvbench |
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city... | SELECT COUNT(DISTINCT sportname) FROM sportsinfo | spider |
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "WHITE" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "TraMADOL (Ultram)" | mimicsql_data |
CREATE TABLE table_43346 (
"Year" real,
"Title" text,
"Label" text,
"RIAA Sales Certification" text,
"Billboard 200 Peak" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the Billboard 200 Peak scores given to the song with the Titl... | SELECT SUM("Billboard 200 Peak") FROM table_43346 WHERE "Title" = 'bread' | wikisql |
CREATE TABLE table_name_2 (
netflix VARCHAR,
segment_d VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Netflix number having a segment D, of NED can corn?
| SELECT netflix FROM table_name_2 WHERE segment_d = "ned can corn" | sql_create_context |
CREATE TABLE table_name_59 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average crowd for Carlton?
| SELECT AVG(crowd) FROM table_name_59 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE table_228973_5 (
directed_by VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode that originally aired on February 16, 1999?
| SELECT directed_by FROM table_228973_5 WHERE original_air_date = "February 16, 1999" | sql_create_context |
CREATE TABLE table_11394 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which smallest swimsuit number's interview was less than 8.574 when the average number was bigg... | SELECT MIN("Swimsuit") FROM table_11394 WHERE "Interview" < '8.574' AND "Average" > '8.532' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT p.Id AS "post_link", p.Score, p.ViewCount, p.CommentCount, p.CreationDate, p.Tags FROM Posts AS p WHERE AnswerCount = 0 AND CommentCount = 0 AND p.ClosedDate IS NULL AND p.Id NOT IN (SELECT PostId FROM PostHistory WHERE (PostHistoryTypeId = 10 AND Comment IN (1)) OR PostHistoryTypeId IN (17, 18, 35, 37, 38)) ORD... | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9572624' AND t_kc21.OUT_DIAG_DIS_NM = '牙齿楔状缺损') | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012... | eicu |
CREATE TABLE table_name_36 (
games VARCHAR,
wins VARCHAR,
losses VARCHAR,
percent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is games when the losses is more than 1, percent is 0.5 and wins is 2?
| SELECT games FROM table_name_36 WHERE losses > 1 AND percent = 0.5 AND wins = 2 | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,... | SELECT 'https://codegolf.meta.stackexchange.com/a/' + CAST(P.Id AS VARCHAR) + '/43214|' + CAST(P.Score AS VARCHAR) FROM Posts AS P WHERE ParentId = 2140 AND P.Score <= '##Score##' AND P.LastActivityDate <= DATEADD(mm, -'##Month##', GETDATE()) | sede |
CREATE TABLE table_6195 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the finish for lee janzen
| SELECT "Finish" FROM table_6195 WHERE "Player" = 'lee janzen' | wikisql |
CREATE TABLE table_47127 (
"Date" text,
"Location" text,
"Head coach" text,
"Opponent" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result when the opponent was Arsenal?
| SELECT "Result" FROM table_47127 WHERE "Opponent" = 'arsenal' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
ProfileImage... | SELECT Body, Title, Tags FROM Posts WHERE Tags LIKE '%ruby%' LIMIT 20 | sede |
CREATE TABLE table_23294081_10 (
original_airdate VARCHAR,
performer_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date that the episode with Jeff Davis as the second performer originally aired?
| SELECT original_airdate FROM table_23294081_10 WHERE performer_2 = "Jeff Davis" | sql_create_context |
CREATE TABLE table_27588823_2 (
branding VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the branding for the station located in san jose del monte?
| SELECT branding FROM table_27588823_2 WHERE location = "San Jose Del Monte" | sql_create_context |
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 PostId AS "post_link", COUNT(DISTINCT RevisionGUID) AS "revisions" FROM PostHistory WHERE PostHistoryTypeId <= 9 GROUP BY PostId ORDER BY COUNT(DISTINCT RevisionGUID) DESC LIMIT 1000 | sede |
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "OU" | mimicsql_data |
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 jybgb (
YLJGDM text,
YLJGDM_M... | SELECT JZKSBM, JZKSMC FROM mzjzjlb WHERE JZLSH = '41738710901' | css |
CREATE TABLE table_55098 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the home team scored 19.10 (124), what was ... | SELECT COUNT("Crowd") FROM table_55098 WHERE "Home team score" = '19.10 (124)' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'cyclopentolate-phenylephrine' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_name_3 (
silver INTEGER,
nation VARCHAR,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Silver medals did the Nation of Croatia receive with a Total medal of more than 1?
| SELECT MIN(silver) FROM table_name_3 WHERE bronze = 1 AND total > 1 AND nation = "croatia" | sql_create_context |
CREATE TABLE table_dev_58 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"intra_aortic_balloon_pump_iabp" bool,
"systemic_arterial_po2" int,
"creatinine_clearance_cl" float,
"supplemental_oxygen" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the foll... | SELECT * FROM table_dev_58 WHERE intra_aortic_balloon_pump_iabp = 1 | criteria2sql |
CREATE TABLE table_70799 (
"Date" text,
"Opponents" text,
"Result F\u2013A" text,
"Attendance" real,
"Group position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Attendance larger than 63,439, and an Opponent of bayer leverkusen had what result?
| SELECT "Result F\u2013A" FROM table_70799 WHERE "Attendance" > '63,439' AND "Opponents" = 'bayer leverkusen' | wikisql |
CREATE TABLE table_name_42 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team score at Corio Oval?
| SELECT away_team AS score FROM table_name_42 WHERE venue = "corio oval" | sql_create_context |
CREATE TABLE table_6594 (
"Locomotive" text,
"Delivered as" text,
"Entered service" text,
"Owner" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Delivered as name of the H3 Locomotive?
| SELECT "Delivered as" FROM table_6594 WHERE "Locomotive" = 'h3' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pericardial tamponade - by echocardiogram' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS... | eicu |
CREATE TABLE table_26510 (
"Team" text,
"Location" text,
"Stadium" text,
"Capacity" real,
"Manager" text,
"Captain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- San Juan Jabloteh calls which stadium home?
| SELECT "Stadium" FROM table_26510 WHERE "Team" = 'San Juan Jabloteh' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code te... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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_... | mimic_iii |
CREATE TABLE table_13497 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- wh... | SELECT "County" FROM table_13497 WHERE "Latitude" > '48.581299' AND "ANSI code" > '1037103' AND "GEO ID" = '3801985060' | wikisql |
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 (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.diagnosis = "CORONARY ARTERY DISEASE" | mimicsql_data |
CREATE TABLE table_48906 (
"State" text,
"Preliminary" real,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the best preliminary score from a contestant from Oklahoma with... | SELECT MAX("Preliminary") FROM table_48906 WHERE "State" = 'oklahoma' AND "Evening Gown" < '8.853' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50802" AND lab.flag = "delta" | 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... | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2104-12' ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking_status_code text,... | SELECT DISTINCT building_description FROM apartment_buildings | spider |
CREATE TABLE table_13152 (
"Elected" text,
"Assembled" text,
"Dissolved" text,
"1st member" text,
"2nd member" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the dissolved date of the parliament assembled on 16 January 1621 with richard tayl... | SELECT "Dissolved" FROM table_13152 WHERE "2nd member" = 'richard taylor' AND "Assembled" = '16 january 1621' | 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... | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "KPHO45I" | mimicsql_data |
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... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE happy_hour (
HH_ID int,
Shop_ID int,
Month text,
Num_of_shaff_in_charge int
)
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
... | SELECT Address, COUNT(*) FROM member GROUP BY Address ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3898598' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-03-05' AND '2019-03-26' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 3087.01) AS T | 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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ... | mimic_iii |
CREATE TABLE code_description (
code varchar,
description text
)
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,
fligh... | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND days.day_name = 'SATURDAY' AND flight.flight_days = days.days_cod... | atis |
CREATE TABLE table_name_10 (
date VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for mark cavendish
| SELECT date FROM table_name_10 WHERE winner = "mark cavendish" | sql_create_context |
CREATE TABLE table_test_15 (
"id" int,
"anemia" bool,
"cell_therapy" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"active_hepatitis" bool,
"chronic_inflammatory_disease" bool,
"platelet_c... | SELECT * FROM table_test_15 WHERE platelet_count < 80000 | criteria2sql |
CREATE TABLE table_name_9 (
date VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Masters Tournament?
| SELECT date FROM table_name_9 WHERE tournament = "masters tournament" | sql_create_context |
CREATE TABLE table_29262 (
"No. in series" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode number for 'Old Monster'?
| SELECT "No. in series" FROM table_29262 WHERE "Title" = 'Old Monster' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(gwyjzb.MED_SER_ORG_NO) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '尤英秀' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-04-29' AND '2015-07-29' UNION SELECT COUNT(fgwyjzb.MED_SER_ORG_NO) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '尤英秀' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-04-29' AND '2015-07-29' | css |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_N... | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY Main_Industry | nvbench |
CREATE TABLE tags (
id int,
msid int,
kid int
)
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE producer (
pid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year i... | SELECT title FROM movie WHERE release_year = 2015 | imdb |
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
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_42263 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total points that Scuderia Ferrari with a Ferrari V12 engine have before 1971?
| SELECT SUM("Points") FROM table_42263 WHERE "Year" < '1971' AND "Entrant" = 'scuderia ferrari' AND "Engine" = 'ferrari v12' | wikisql |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY Type DESC | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | 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 = '022-140336')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutp... | eicu |
CREATE TABLE table_20185 (
"Class" text,
"Wheel Arrangement" text,
"Railway" text,
"Number at Doncaster" real,
"Number at Pyewipe" real,
"Number at March" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number of pyewipe
| SELECT MAX("Number at Pyewipe") FROM table_20185 | wikisql |
CREATE TABLE table_name_74 (
time VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Time in the Mina Clavero 2 Stage?
| SELECT time FROM table_name_74 WHERE name = "mina clavero 2" | sql_create_context |
CREATE TABLE table_28180840_15 (
act VARCHAR,
name_name_of_act VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the performance zhu xiaoming performed?
| SELECT act FROM table_28180840_15 WHERE name_name_of_act = "Zhu Xiaoming" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT SUM(t_kc24.PER_ACC_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.PERSON_NM = '范明喆' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-06-01' AND '2003-12-05' | css |
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 diagnosis (
diagn... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_name_59 (
icelandic VARCHAR,
danish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Icelandic has a Danish of bl t/bl ?
| SELECT icelandic FROM table_name_59 WHERE danish = "blåt/blå" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | 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.long_title = "Rheumatoid arthritis" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_37805 (
"Tournament" text,
"2006" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2011 with 2010 of 1r and 2012 of sf
| SELECT "2011" FROM table_37805 WHERE "2010" = '1r' AND "2012" = 'sf' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.