instruction
stringlengths 151
7.46k
| output
stringlengths 2
4.44k
| source
stringclasses 26
values |
---|---|---|
CREATE TABLE table_56768 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was steve bartalo picked?
| SELECT MAX("Pick") FROM table_56768 WHERE "Player" = 'steve bartalo' | wikisql |
CREATE TABLE table_27332038_1 (
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who directed the episode that elaine ko wrote?
| SELECT directed_by FROM table_27332038_1 WHERE written_by = "Elaine Ko" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description 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,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which users have the most favourites?.
| SELECT COUNT(v.Id) AS UserFaves, u.Reputation FROM Users AS u INNER JOIN Votes AS v ON v.UserId = u.Id AND v.VoteTypeId = 5 GROUP BY u.Id, u.Reputation ORDER BY UserFaves DESC | sede |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the courses that are HISTART 8 -credit Courses ?
| SELECT DISTINCT name, number FROM course WHERE department = 'HISTART' AND credits = 8 | advising |
CREATE TABLE table_53688 (
"Rank" real,
"Name" text,
"Nation" text,
"Total Points" real,
"Placings" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the placing of the nation of East Germany?
| SELECT COUNT("Placings") FROM table_53688 WHERE "Nation" = 'east germany' | wikisql |
CREATE TABLE table_31788 (
"Division" text,
"League Apps" real,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"Total Apps" real,
"Total Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which league goals has FA cup apps of 2?
| SELECT "League Goals" FROM table_31788 WHERE "FA Cup Apps" = '2' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
YLJGDM number,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
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 wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
YLJGDM number,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 自二零零三年六月十五日开始,截止到二零一一年二月二十三日,来医疗机构5513920的科室61946看病的患者中,住院就诊的人数是多少
| SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '5513920' AND wdmzjzjlb.JZKSDM = '61946' AND wdmzjzjlb.RYDJSJ BETWEEN '2003-06-15' AND '2011-02-23' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '5513920' AND bdmzjzjlb.JZKSDM = '61946' AND bdmzjzjlb.RYDJSJ BETWEEN '2003-06-15' AND '2011-02-23' | 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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
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,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many upvoted, accepted, u+a, (acc=1,up=2,acc+up=3).
| SELECT u.DisplayName, u.Id, p.PostTypeId, p.OwnerUserId, p.AcceptedAnswerId, p.Score, p.ParentId, p.Body, p.Title, aa.PostTypeId, aa.AcceptedAnswerId, aa.OwnerUserId, aa.Title, aa.Body, aa.Score, CASE WHEN p.Score > 0 THEN 2 ELSE 0 END + CASE WHEN NOT aa.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END AS "uu", CASE WHEN aa.AcceptedAnswerId > 0 AND p.Score > 0 THEN 3 WHEN aa.AcceptedAnswerId IS NULL AND p.Score > 0 THEN 2 WHEN aa.AcceptedAnswerId > 0 AND p.Score = 0 THEN 1 ELSE 0 END AS "au" FROM Posts AS p, Users AS u, Posts AS aa WHERE p.PostTypeId = 2 AND p.OwnerUserId IN ('##SOid##') AND p.OwnerUserId = u.Id AND p.ParentId = aa.Id ORDER BY p.Score DESC | sede |
CREATE TABLE table_21700 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the part 4 for the verb whose part 3 is borgen?
| SELECT "Part 4" FROM table_21700 WHERE "Part 3" = 'borgen' | wikisql |
CREATE TABLE table_30140 (
"Institution" text,
"City" text,
"State" text,
"Team Name" text,
"Affiliation" text,
"Enrollment" real,
"Home Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many states were there when there was an enrollment of 2789?
| SELECT COUNT("State") FROM table_30140 WHERE "Enrollment" = '2789' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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 TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when did patient 81461 receive the last prescription in their current hospital visit for vecuronium bromide?
| SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'vecuronium bromide' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_23 (
muklom VARCHAR,
halang VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Muklom has a Halang of w c i ?
| SELECT muklom FROM table_name_23 WHERE halang = "wɯ¹cʰi¹" | sql_create_context |
CREATE TABLE table_name_24 (
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what place is the golfer with a score of 68-69-73-70=280?
| SELECT place FROM table_name_24 WHERE score = 68 - 69 - 73 - 70 = 280 | sql_create_context |
CREATE TABLE table_name_33 (
status VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What status has 15/04/1967 as the date?
| SELECT status FROM table_name_33 WHERE date = "15/04/1967" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return a scatter chart about the correlation between Team_ID and School_ID , and group by attribute ACC_Home.
| SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Home | nvbench |
CREATE TABLE table_40925 (
"From" real,
"Goal" text,
"Round 1" text,
"Round 2" text,
"Round 3" text,
"Round 4" text,
"Round 5" text,
"Round 6+" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Round 1 from 1977 where Round 3 is Double and Round 4 is Double?
| SELECT "Round 1" FROM table_40925 WHERE "Round 4" = 'double' AND "From" = '1977' AND "Round 3" = 'double' | wikisql |
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 time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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 treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- count the number of people who had been admitted in 2105 to hospital.
| SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) = '2105' | eicu |
CREATE TABLE table_14097 (
"Club" text,
"League/Division" text,
"Home Ground" text,
"Location" text,
"Position in 2012-13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club has a league/division of fourth division?
| SELECT "Club" FROM table_14097 WHERE "League/Division" = 'fourth division' | wikisql |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_Type_Code CHAR(15),
Service_Type_Description VARCHAR(255)
)
CREATE TABLE Order_Items (
Order_Item_ID INTEGER,
Order_ID INTEGER,
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Marketing_Regions (
Marketing_Region_Code CHAR(15),
Marketing_Region_Name VARCHAR(255),
Marketing_Region_Descriptrion VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Addresses (
Address_ID VARCHAR(100),
Line_1 VARCHAR(255),
Line_2 VARCHAR(255),
City_Town VARCHAR(255),
State_County VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_ID INTEGER,
Order_Item_ID INTEGER,
Product_ID INTEGER,
Order_Quantity INTEGER,
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Clients (
Client_ID INTEGER,
Address_ID INTEGER,
Customer_Email_Address VARCHAR(255),
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Invoices (
Invoice_ID INTEGER,
Order_ID INTEGER,
payment_method_code CHAR(15),
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255),
Order_Item_ID INTEGER
)
CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Product_Description VARCHAR(255),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Performers (
Performer_ID INTEGER,
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give me a bar chart for how many actual delivery date of each actual delivery date, I want to sort by the Y from low to high.
| SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY COUNT(Actual_Delivery_Date) | nvbench |
CREATE TABLE table_name_88 (
avg_g VARCHAR,
att_cmp_int VARCHAR,
effic VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players had an Att-Cmp-Int of 143 269 16, and an efficiency of less than 116.9?
| SELECT COUNT(avg_g) FROM table_name_88 WHERE att_cmp_int = "143–269–16" AND effic < 116.9 | sql_create_context |
CREATE TABLE table_11734041_7 (
position VARCHAR,
years_for_rockets VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the positions for the rockets in 2008?
| SELECT position FROM table_11734041_7 WHERE years_for_rockets = "2008" | sql_create_context |
CREATE TABLE table_70542 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team opponent had a loss with their pitcher Dotson (8-6)?
| SELECT "Opponent" FROM table_70542 WHERE "Loss" = 'dotson (8-6)' | wikisql |
CREATE TABLE table_44705 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team for the New Zealand breakers?
| SELECT "Report" FROM table_44705 WHERE "Away team" = 'new zealand breakers' | wikisql |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000, and count them by a bar chart
| SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000 | nvbench |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,
VAL_UNIT text,
DOSE_UNIT text,
DOSE_FORM text,
SPEC text,
USE_FRE text,
EACH_DOSAGE text,
QTY number,
UNIVALENT number,
AMOUNT number,
SELF_PAY_PRO number,
RER_SOL number,
SELF_PAY_AMO number,
UP_LIMIT_AMO number,
OVE_SELF_AMO number,
EXP_OCC_DATE time,
RECIPE_BILL_ID text,
FLX_MED_ORG_ID text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
REF_STA_FLG number,
DATA_ID text,
SYNC_TIME time,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
TRADE_TYPE number,
STA_FLG number,
STA_DATE time,
REIMBURS_TYPE number,
FXBZ number,
REMOTE_SETTLE_FLG text
)
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 number,
ILL_PAY number,
CIVIL_SUBSIDY number,
PER_SOL number,
PER_EXP number,
DATA_ID text,
SYNC_TIME time,
OUT_HOSP_DATE time,
CLINIC_ID text,
MED_TYPE number,
INSURED_STS text,
INSURED_IDENTITY number,
TRADE_TYPE number,
RECIPE_BILL_ID text,
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
RECEIVER_DEAL_ID text,
SENDER_REVOKE_ID text,
RECEIVER_REVOKE_ID text,
SENDER_OFFSET_ID text,
RECEIVER_OFFSET_ID text,
LAS_OVE_PAY number,
OVE_ADD_PAY number,
SUP_ADD_PAY number,
CKC102 number,
CASH_PAY number,
COM_ACC_PAY number,
ENT_ACC_PAY number,
ENT_PAY number,
COM_PAY number,
OLDC_FUND_PAY number,
SPE_FUND_PAY number
)
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 number,
FLX_MED_ORG_ID text,
MED_SER_ORG_NO text,
CLINIC_TYPE text,
MED_TYPE number,
CLINIC_ID text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
INPT_AREA_BED text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
MAIN_COND_DES text,
INSU_TYPE text,
IN_HOSP_DAYS number,
MED_AMOUT number,
FERTILITY_STS number,
DATA_ID text,
SYNC_TIME time,
REIMBURSEMENT_FLG number,
HOSP_LEV number,
HOSP_STS number,
INSURED_IDENTITY number,
SERVANT_FLG text,
TRADE_TYPE number,
INSURED_STS text,
REMOTE_SETTLE_FLG text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 在2000-01-05到2007-11-28内,医院0323169入院诊断疾病结果与出院诊断疾病结果不同的次数是多少
| SELECT (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '0323169' AND IN_HOSP_DATE BETWEEN '2000-01-05' AND '2007-11-28') - (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '0323169' AND IN_HOSP_DATE BETWEEN '2000-01-05' AND '2007-11-28' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD) | css |
CREATE TABLE table_768 (
"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.
-- How many results have Jere Cooper as incumbent?
| SELECT "Result" FROM table_768 WHERE "Incumbent" = 'Jere Cooper' | wikisql |
CREATE TABLE table_name_8 (
nationalist VARCHAR,
undecided__no_answer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nationalist share of the poll for the response in which Undecided/No Answer received 29.2%?
| SELECT nationalist FROM table_name_8 WHERE undecided__no_answer = "29.2%" | sql_create_context |
CREATE TABLE table_58252 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score for the Date of April 23?
| SELECT "Score" FROM table_58252 WHERE "Date" = 'april 23' | wikisql |
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,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- so how many days have passed since patient 002-34744's last depression - mild diagnosis during their current hospital visit?
| SELECT 1 * (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 = '002-34744' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'depression - mild' ORDER BY diagnosis.diagnosistime DESC LIMIT 1 | eicu |
CREATE TABLE table_32390 (
"Player" text,
"Home Town" text,
"College/Prior" text,
"Drafting Team" text,
"Graduated" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did Omar Gonzalez graduate?
| SELECT SUM("Graduated") FROM table_32390 WHERE "Player" = 'omar gonzalez' | wikisql |
CREATE TABLE batting_postseason (
year number,
round text,
player_id text,
team_id text,
league_id text,
g number,
ab number,
r number,
h number,
double number,
triple number,
hr number,
rbi number,
sb number,
cs number,
bb number,
so number,
ibb number,
hbp number,
sh number,
sf number,
g_idp number
)
CREATE TABLE fielding_outfield (
player_id text,
year number,
stint number,
glf number,
gcf number,
grf number
)
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE manager_half (
player_id text,
year number,
team_id text,
league_id text,
inseason number,
half number,
g number,
w number,
l number,
rank number
)
CREATE TABLE team_half (
year number,
league_id text,
team_id text,
half number,
div_id text,
div_win text,
rank number,
g number,
w number,
l number
)
CREATE TABLE park (
park_id text,
park_name text,
park_alias text,
city text,
state text,
country text
)
CREATE TABLE appearances (
year number,
team_id text,
league_id text,
player_id text,
g_all number,
gs number,
g_batting number,
g_defense number,
g_p number,
g_c number,
g_1b number,
g_2b number,
g_3b number,
g_ss number,
g_lf number,
g_cf number,
g_rf number,
g_of number,
g_dh number,
g_ph number,
g_pr number
)
CREATE TABLE player_college (
player_id text,
college_id text,
year number
)
CREATE TABLE team (
year number,
league_id text,
team_id text,
franchise_id text,
div_id text,
rank number,
g number,
ghome number,
w number,
l number,
div_win text,
wc_win text,
lg_win text,
ws_win text,
r number,
ab number,
h number,
double number,
triple number,
hr number,
bb number,
so number,
sb number,
cs number,
hbp number,
sf number,
ra number,
er number,
era number,
cg number,
sho number,
sv number,
ipouts number,
ha number,
hra number,
bba number,
soa number,
e number,
dp number,
fp number,
name text,
park text,
attendance number,
bpf number,
ppf number,
team_id_br text,
team_id_lahman45 text,
team_id_retro text
)
CREATE TABLE player (
player_id text,
birth_year number,
birth_month number,
birth_day number,
birth_country text,
birth_state text,
birth_city text,
death_year number,
death_month number,
death_day number,
death_country text,
death_state text,
death_city text,
name_first text,
name_last text,
name_given text,
weight number,
height number,
bats text,
throws text,
debut text,
final_game text,
retro_id text,
bbref_id text
)
CREATE TABLE pitching_postseason (
player_id text,
year number,
round text,
team_id text,
league_id text,
w number,
l number,
g number,
gs number,
cg number,
sho number,
sv number,
ipouts number,
h number,
er number,
hr number,
bb number,
so number,
baopp text,
era number,
ibb number,
wp number,
hbp number,
bk number,
bfp number,
gf number,
r number,
sh number,
sf number,
g_idp number
)
CREATE TABLE manager_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots number,
needed number,
votes number,
inducted text,
category text,
needed_note text
)
CREATE TABLE postseason (
year number,
round text,
team_id_winner text,
league_id_winner text,
team_id_loser text,
league_id_loser text,
wins number,
losses number,
ties number
)
CREATE TABLE player_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE team_franchise (
franchise_id text,
franchise_name text,
active text,
na_assoc text
)
CREATE TABLE fielding (
player_id text,
year number,
stint number,
team_id text,
league_id text,
pos text,
g number,
gs number,
inn_outs number,
po number,
a number,
e number,
dp number,
pb number,
wp number,
sb number,
cs number,
zr number
)
CREATE TABLE pitching (
player_id text,
year number,
stint number,
team_id text,
league_id text,
w number,
l number,
g number,
gs number,
cg number,
sho number,
sv number,
ipouts number,
h number,
er number,
hr number,
bb number,
so number,
baopp number,
era number,
ibb number,
wp number,
hbp number,
bk number,
bfp number,
gf number,
r number,
sh number,
sf number,
g_idp number
)
CREATE TABLE all_star (
player_id text,
year number,
game_num number,
game_id text,
team_id text,
league_id text,
gp number,
starting_pos number
)
CREATE TABLE college (
college_id text,
name_full text,
city text,
state text,
country text
)
CREATE TABLE batting (
player_id text,
year number,
stint number,
team_id text,
league_id text,
g number,
ab number,
r number,
h number,
double number,
triple number,
hr number,
rbi number,
sb number,
cs number,
bb number,
so number,
ibb number,
hbp number,
sh number,
sf number,
g_idp number
)
CREATE TABLE home_game (
year number,
league_id text,
team_id text,
park_id text,
span_first text,
span_last text,
games number,
openings number,
attendance number
)
CREATE TABLE fielding_postseason (
player_id text,
year number,
team_id text,
league_id text,
round text,
pos text,
g number,
gs number,
inn_outs number,
po number,
a number,
e number,
dp number,
tp number,
pb number,
sb number,
cs number
)
CREATE TABLE manager (
player_id text,
year number,
team_id text,
league_id text,
inseason number,
g number,
w number,
l number,
rank number,
plyr_mgr text
)
CREATE TABLE manager_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which states have more than 2 parks?
| SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2 | spider |
CREATE TABLE table_31496 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Lisladeen poor law union?
| SELECT "Poor law union" FROM table_31496 WHERE "Townland" = 'Lisladeen' | wikisql |
CREATE TABLE table_24929 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many viewers tuned in for season 2?
| SELECT "U.S. viewers (million)" FROM table_24929 WHERE "No. in season" = '2' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
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 varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Prof. Emily Harrington teaches what courses ?
| SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Emily Harrington%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id | advising |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE area (
course_id int,
area varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Have I taken any ULCS courses ?
| SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%ULCS%' AND student_record.student_id = 1 | advising |
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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- calculate the total number of patients from catholic belief.
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CATHOLIC" | mimicsql_data |
CREATE TABLE table_name_90 (
rank INTEGER,
code__iata_icao_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of airport with a (IATA/ICAO) of bcm/lrbc code and an amount of 240,735 in 2010?
| SELECT MIN(rank) FROM table_name_90 WHERE code__iata_icao_ = "bcm/lrbc" AND 2010 > 240 OFFSET 735 | sql_create_context |
CREATE TABLE table_46087 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record of the Montreal Canadiens Home game on March 23?
| SELECT "Record" FROM table_46087 WHERE "Home" = 'montreal canadiens' AND "Date" = 'march 23' | wikisql |
CREATE TABLE table_22309 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Canadian air date" text,
"U.S. air date" text,
"Production code" real,
"Canadian viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the air date in the U.S. for the episode that had 1.452 million Canadian viewers?
| SELECT "U.S. air date" FROM table_22309 WHERE "Canadian viewers (million)" = '1.452' | wikisql |
CREATE TABLE table_35493 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponen" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surface has a Date of january 2, 2006?
| SELECT "Surface" FROM table_35493 WHERE "Date" = 'january 2, 2006' | wikisql |
CREATE TABLE table_name_3 (
time VARCHAR,
rider VARCHAR,
team VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Team of honda 250cc, and a Rank larger than 2, and a Rider of chris palmer is what time?
| SELECT time FROM table_name_3 WHERE team = "honda 250cc" AND rank > 2 AND rider = "chris palmer" | sql_create_context |
CREATE TABLE table_14778 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date on Catalog 540,934-2?
| SELECT "Date" FROM table_14778 WHERE "Catalog" = '540,934-2' | wikisql |
CREATE TABLE artwork (
artwork_id number,
type text,
name text
)
CREATE TABLE nomination (
artwork_id number,
festival_id number,
result text
)
CREATE TABLE festival_detail (
festival_id number,
festival_name text,
chair_name text,
location text,
year number,
num_of_audience number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names of festivals that have nominated artworks of type 'Program Talent Show'.
| SELECT T3.festival_name FROM nomination AS T1 JOIN artwork AS T2 ON T1.artwork_id = T2.artwork_id JOIN festival_detail AS T3 ON T1.festival_id = T3.festival_id WHERE T2.type = "Program Talent Show" | spider |
CREATE TABLE table_202_179 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many laps did juan pablo montoya complete in the 2005 belgian grand prix ?
| SELECT "laps" FROM table_202_179 WHERE "driver" = 'juan pablo montoya' | squall |
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id 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,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of patients whose diagnoses short title is parox ventric tachycard and procedure long title is insertion of endotracheal tube?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.short_title = "Parox ventric tachycard" AND procedures.long_title = "Insertion of endotracheal tube" | mimicsql_data |
CREATE TABLE table_26794530_1 (
points VARCHAR,
final_placing VARCHAR,
races VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When there were 30 races and the final placing was 13th, how many points were scored?
| SELECT points FROM table_26794530_1 WHERE final_placing = "13th" AND races = 30 | sql_create_context |
CREATE TABLE table_11303072_5 (
batting_partners VARCHAR,
runs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the batting partners with runs of 226?
| SELECT batting_partners FROM table_11303072_5 WHERE runs = "226" | sql_create_context |
CREATE TABLE table_24192031_2 (
age VARCHAR,
height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How old is the person with the height of m (ft 3 4 in)?
| SELECT age FROM table_24192031_2 WHERE height = "m (ft 3⁄4 in)" | sql_create_context |
CREATE TABLE table_name_6 (
year INTEGER,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years did he play in santiago de compostela?
| SELECT SUM(year) FROM table_name_6 WHERE city = "santiago de compostela" | sql_create_context |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
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 COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return a histogram on how many students are in each department?, and sort in desc by the Y-axis.
| SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) DESC | nvbench |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- provide the number of patients categorized under chemistry lab test who have been diagnosed with contusion of face, scalp, and neck except eye(s).
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Contusion face/scalp/nck" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
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 text,
MED_DIRE_NM text,
MED_EXP_BILL_ID text,
MED_EXP_DET_ID text,
MED_INV_ITEM_TYPE text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_SELF_AMO number,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
QTY number,
RECIPE_BILL_ID text,
REF_STA_FLG number,
REIMBURS_TYPE number,
REMOTE_SETTLE_FLG text,
RER_SOL number,
SELF_PAY_AMO number,
SELF_PAY_PRO number,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
SPEC text,
STA_DATE time,
STA_FLG number,
SYNC_TIME time,
TRADE_TYPE number,
UNIVALENT number,
UP_LIMIT_AMO number,
USE_FRE text,
VAL_UNIT text
)
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SERVANT_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
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,
FLX_MED_ORG_ID text,
ILL_PAY number,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
LAS_OVE_PAY number,
MED_AMOUT number,
MED_SAFE_PAY_ID text,
MED_TYPE number,
OLDC_FUND_PAY number,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_ADD_PAY number,
OVE_PAY number,
PERSON_ID text,
PER_ACC_PAY number,
PER_EXP number,
PER_SOL number,
RECEIVER_DEAL_ID text,
RECEIVER_OFFSET_ID text,
RECEIVER_REVOKE_ID text,
RECIPE_BILL_ID text,
REF_SLT_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
SENDER_OFFSET_ID text,
SENDER_REVOKE_ID text,
SPE_FUND_PAY number,
SUP_ADD_PAY number,
SYNC_TIME time,
TRADE_TYPE number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 来医疗机构7149475看病的人里,非本地的患者人数是多少
| SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7149475' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2' | css |
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE statements (
statement_id number,
statement_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the project id and detail for the project with at least two documents?
| SELECT T1.project_id, T1.project_details FROM projects AS T1 JOIN documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2 | spider |
CREATE TABLE table_65169 (
"Album#" text,
"English Title" text,
"Chinese (Traditional)" text,
"Chinese (Simplified)" text,
"Release date" text,
"Label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the simplified Chinese name for the 9th album?
| SELECT "Chinese (Simplified)" FROM table_65169 WHERE "Album#" = '9th' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
ZSEBZ number,
ZZBZ number,
ZZYSGH text,
mzjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
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 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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 患者的门诊诊断为疾病E91.673的苯妥因的参考值范围下限是什么?上限是什么?
| SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND 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 WHERE mzjzjlb.JZZDBM = 'E91.673' AND jyjgzbb.JCZBMC = '苯妥因' | css |
CREATE TABLE table_1341663_19 (
candidates VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What other cadidate ran against Dave Treen?
| SELECT candidates FROM table_1341663_19 WHERE incumbent = "Dave Treen" | 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the marital status and age of Stephanie Suchan?
| SELECT demographic.marital_status, demographic.age FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- keyphrases used by angli liu
| SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'angli liu' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_50971 (
"University" text,
"Location" text,
"Established" real,
"Endowment as of 2008" text,
"Campus Area (acres)" real,
"Kiplinger's Top 100 Values" text,
"Enrollment as of 2008" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Kiplinger's Top 100 value of the university that was established in 1851?
| SELECT "Kiplinger's Top 100 Values" FROM table_50971 WHERE "Established" = '1851' | 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,
label text,
fluid 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients have stayed in the hospital for more than 15 days with home health care discharge location?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.days_stay > "15" | mimicsql_data |
CREATE TABLE table_203_253 (
id number,
"model" text,
"frame" text,
"years mfg'd" text,
"caliber(s)" text,
"production" text,
"barrel" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last year of manufacture for these revolvers ?
| SELECT MAX("years mfg'd") FROM table_203_253 | squall |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE 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,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the courses offered this semester .
| SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department | advising |
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,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID number,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
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 text,
MED_DIRE_NM text,
MED_EXP_BILL_ID text,
MED_EXP_DET_ID text,
MED_INV_ITEM_TYPE text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_SELF_AMO number,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
QTY number,
RECIPE_BILL_ID text,
REF_STA_FLG number,
REIMBURS_TYPE number,
REMOTE_SETTLE_FLG text,
RER_SOL number,
SELF_PAY_AMO number,
SELF_PAY_PRO number,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
SPEC text,
STA_DATE time,
STA_FLG number,
SYNC_TIME time,
TRADE_TYPE number,
UNIVALENT number,
UP_LIMIT_AMO number,
USE_FRE text,
VAL_UNIT text
)
CREATE TABLE gwyjzb (
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,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID number,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
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,
FLX_MED_ORG_ID text,
ILL_PAY number,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
LAS_OVE_PAY number,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_SAFE_PAY_ID text,
MED_TYPE number,
OLDC_FUND_PAY number,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_ADD_PAY number,
OVE_PAY number,
PERSON_ID text,
PER_ACC_PAY number,
PER_EXP number,
PER_SOL number,
RECEIVER_DEAL_ID text,
RECEIVER_OFFSET_ID text,
RECEIVER_REVOKE_ID text,
RECIPE_BILL_ID text,
REF_SLT_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
SENDER_OFFSET_ID text,
SENDER_REVOKE_ID text,
SPE_FUND_PAY number,
SUP_ADD_PAY number,
SYNC_TIME time,
TRADE_TYPE number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 病人柏凌波有多少次西药是在2006年12月19日到2012年5月9日间买的?
| SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '柏凌波' AND t_kc22.STA_DATE BETWEEN '2006-12-19' AND '2012-05-09' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERSON_NM = '柏凌波' AND t_kc22.STA_DATE BETWEEN '2006-12-19' AND '2012-05-09' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_2973 (
"April 2013 Cum. Rank" real,
"Name" text,
"Rank (all) 2012" real,
"Rank (all) 2013" real,
"2013 Rank (oil companies)" text,
"2013 rev (bil. USD )" text,
"2013 Profit (mil. USD )" real,
"Assets (bil. USD )" text,
"Market cap March 15 (mil. USD )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many companies named cenovus energy?
| SELECT COUNT("Rank (all) 2013") FROM table_2973 WHERE "Name" = 'Cenovus Energy' | wikisql |
CREATE TABLE table_174491_1 (
fis_nordic_world_ski_championships VARCHAR,
country VARCHAR,
holmenkollen VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did the man from Norway who won the Holmenkollen in 1958 win the FIS Nordic World Ski Championships?
| SELECT fis_nordic_world_ski_championships FROM table_174491_1 WHERE country = "Norway" AND holmenkollen = "1958" | sql_create_context |
CREATE TABLE table_8965 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How did Tim Herron place?
| SELECT "Place" FROM table_8965 WHERE "Player" = 'tim herron' | wikisql |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of rooms for each bed type Visualize by bar chart, and show in ascending by the bars.
| SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType | nvbench |
CREATE TABLE table_14520977_1 (
date VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date when result is l 13 10 ot
| SELECT date FROM table_14520977_1 WHERE result = "L 13–10 OT" | sql_create_context |
CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
Registered BOOLEAN,
SSN INTEGER
)
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patient INTEGER,
PrepNurse INTEGER,
Physician INTEGER,
Start DATETIME,
End DATETIME,
ExaminationRoom TEXT
)
CREATE TABLE Prescribes (
Physician INTEGER,
Patient INTEGER,
Medication INTEGER,
Date DATETIME,
Appointment INTEGER,
Dose VARCHAR(30)
)
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
Stay INTEGER,
DateUndergoes DATETIME,
Physician INTEGER,
AssistingNurse INTEGER
)
CREATE TABLE Procedures (
Code INTEGER,
Name VARCHAR(30),
Cost REAL
)
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room INTEGER,
StayStart DATETIME,
StayEnd DATETIME
)
CREATE TABLE Department (
DepartmentID INTEGER,
Name VARCHAR(30),
Head INTEGER
)
CREATE TABLE Trained_In (
Physician INTEGER,
Treatment INTEGER,
CertificationDate DATETIME,
CertificationExpires DATETIME
)
CREATE TABLE Block (
BlockFloor INTEGER,
BlockCode INTEGER
)
CREATE TABLE Medication (
Code INTEGER,
Name VARCHAR(30),
Brand VARCHAR(30),
Description VARCHAR(30)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of the physicians who are trained in a procedure that costs more than 5000, and sort how many name from low to high order.
| SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) | nvbench |
CREATE TABLE table_name_42 (
position VARCHAR,
channel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position when the channel shows channel 4?
| SELECT position FROM table_name_42 WHERE channel = "channel 4" | sql_create_context |
CREATE TABLE table_56490 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lap total for the grid under 15 that retired due to transmission?
| SELECT SUM("Laps") FROM table_56490 WHERE "Grid" < '15' AND "Time/Retired" = 'transmission' | wikisql |
CREATE TABLE table_name_32 (
born_in_a_non_eu_state__millions_ VARCHAR,
total_population__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people were born in a non EU state (in millions), when the Total population (in millions) was 62.008?
| SELECT born_in_a_non_eu_state__millions_ FROM table_name_32 WHERE total_population__millions_ = 62.008 | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
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,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
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 PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Average scores of last month's questions and answers.
| SELECT 1 AS No, 'Questions' AS "column", COUNT(Id) AS Total, AVG(CAST(Score AS FLOAT)) AS "average_score", STDEV(Score) AS "score_std_deviation" FROM Posts AS Q WHERE Q.ParentId IS NULL AND Q.CreationDate > DATEADD(m, -1, GETDATE()) UNION SELECT 2 AS No, 'Answers' AS "column", COUNT(Id) AS Total, AVG(CAST(Score AS FLOAT)) AS Average, STDEV(Score) AS Deviation FROM Posts AS A WHERE NOT A.ParentId IS NULL AND A.CreationDate > DATEADD(m, -1, GETDATE()) | sede |
CREATE TABLE table_44525 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the pick was below 42 and the player was Chris Horton, what's the highest Overall pick found?
| SELECT MAX("Overall") FROM table_44525 WHERE "Name" = 'chris horton' AND "Pick" < '42' | wikisql |
CREATE TABLE table_34836 (
"Locomotive" text,
"Pre-conversion" text,
"Entered service (T)" text,
"Re-entered service (P)" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who owns the item that was a T326 before conversion and re-entered service on 11 September 1985?
| SELECT "Owner" FROM table_34836 WHERE "Re-entered service (P)" = '11 september 1985' AND "Pre-conversion" = 't326' | 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,
FLX_MED_ORG_ID text,
ILL_PAY number,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
LAS_OVE_PAY number,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_SAFE_PAY_ID text,
MED_TYPE number,
OLDC_FUND_PAY number,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_ADD_PAY number,
OVE_PAY number,
PERSON_ID text,
PER_ACC_PAY number,
PER_EXP number,
PER_SOL number,
RECEIVER_DEAL_ID text,
RECEIVER_OFFSET_ID text,
RECEIVER_REVOKE_ID text,
RECIPE_BILL_ID text,
REF_SLT_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
SENDER_OFFSET_ID text,
SENDER_REVOKE_ID text,
SPE_FUND_PAY number,
SUP_ADD_PAY number,
SYNC_TIME time,
TRADE_TYPE number
)
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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_DIRE_CD text,
MED_DIRE_NM text,
MED_EXP_BILL_ID text,
MED_EXP_DET_ID text,
MED_INV_ITEM_TYPE text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
OVE_SELF_AMO number,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
QTY number,
RECIPE_BILL_ID text,
REF_STA_FLG number,
REIMBURS_TYPE number,
REMOTE_SETTLE_FLG text,
RER_SOL number,
SELF_PAY_AMO number,
SELF_PAY_PRO number,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
SPEC text,
STA_DATE time,
STA_FLG number,
SYNC_TIME time,
TRADE_TYPE number,
UNIVALENT number,
UP_LIMIT_AMO number,
USE_FRE text,
VAL_UNIT text
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
IN_HOSP_DATE time,
IN_HOSP_DAYS number,
MAIN_COND_DES text,
MED_AMOUT number,
MED_CLINIC_ID text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
MED_SER_ORG_NO text,
MED_TYPE number,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
OUT_HOSP_DATE time,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
PERSON_AGE number,
PERSON_ID text,
PERSON_NM text,
PERSON_SEX number,
REIMBURSEMENT_FLG number,
REMOTE_SETTLE_FLG text,
SERVANT_FLG text,
SOC_SRT_CARD text,
SYNC_TIME time,
TRADE_TYPE number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 吸入用布地奈德混悬液在医疗就诊97469537322中开出的医疗发票项目有多少类别?
| SELECT t_kc22.MED_INV_ITEM_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '97469537322' AND t_kc22.SOC_SRT_DIRE_NM = '吸入用布地奈德混悬液' | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the daily maximum value of the anion gap of patient 009-5351?
| SELECT MAX(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 = '009-5351')) AND lab.labname = 'anion gap' GROUP BY STRFTIME('%y-%m-%d', lab.labresulttime) | eicu |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each party, use a bar chart to show the number of its delegates, list Y in asc order.
| SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY COUNT(T2.Party) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is admission location and primary disease of subject name steven sepulveda?
| SELECT demographic.admission_location, demographic.diagnosis FROM demographic WHERE demographic.name = "Steven Sepulveda" | 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
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,
drugstarttime time,
drugstoptime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- calculate the difference between the total input and the output on last month/15 for patient 002-41152.
| SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '15') - (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '15') | eicu |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE 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 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(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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_ID decimal(5,0),
REGION_NAME varchar(25)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees who was hired before 2002-06-21, show me about the correlation between salary and department_id in a scatter chart.
| SELECT SALARY, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_55366 (
"Title" text,
"Original story author" text,
"Director" text,
"Original U.S. air-date" text,
"Original Canadian air-date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Original Canadian air-date that was directed by Michael Tolkin?
| SELECT "Original Canadian air-date" FROM table_55366 WHERE "Director" = 'michael tolkin' | wikisql |
CREATE TABLE table_name_31 (
score VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score of the Semifinal 1?
| SELECT score FROM table_name_31 WHERE round = "semifinal 1" | sql_create_context |
CREATE TABLE table_56949 (
"Place" real,
"Player Name" text,
"Yards" text,
"TD's" real,
"Long" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the long of the player with 16 yards and less than 1 TD?
| SELECT SUM("Long") FROM table_56949 WHERE "Yards" = '16' AND "TD's" < '1' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,
VAL_UNIT text,
DOSE_UNIT text,
DOSE_FORM text,
SPEC text,
USE_FRE text,
EACH_DOSAGE text,
QTY number,
UNIVALENT number,
AMOUNT number,
SELF_PAY_PRO number,
RER_SOL number,
SELF_PAY_AMO number,
UP_LIMIT_AMO number,
OVE_SELF_AMO number,
EXP_OCC_DATE time,
RECIPE_BILL_ID text,
FLX_MED_ORG_ID text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
REF_STA_FLG number,
DATA_ID text,
SYNC_TIME time,
PRESCRIPTION_CODE text,
PRESCRIPTION_ID text,
TRADE_TYPE number,
STA_FLG number,
STA_DATE time,
REIMBURS_TYPE number,
FXBZ number,
REMOTE_SETTLE_FLG text
)
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 number,
ILL_PAY number,
CIVIL_SUBSIDY number,
PER_SOL number,
PER_EXP number,
DATA_ID text,
SYNC_TIME time,
OUT_HOSP_DATE time,
CLINIC_ID text,
MED_TYPE number,
INSURED_STS text,
INSURED_IDENTITY number,
TRADE_TYPE number,
RECIPE_BILL_ID text,
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
REIMBURS_FLG number,
SENDER_DEAL_ID text,
RECEIVER_DEAL_ID text,
SENDER_REVOKE_ID text,
RECEIVER_REVOKE_ID text,
SENDER_OFFSET_ID text,
RECEIVER_OFFSET_ID text,
LAS_OVE_PAY number,
OVE_ADD_PAY number,
SUP_ADD_PAY number,
CKC102 number,
CASH_PAY number,
COM_ACC_PAY number,
ENT_ACC_PAY number,
ENT_PAY number,
COM_PAY number,
OLDC_FUND_PAY number,
SPE_FUND_PAY number
)
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 number,
FLX_MED_ORG_ID text,
MED_SER_ORG_NO text,
CLINIC_TYPE text,
MED_TYPE number,
CLINIC_ID text,
IN_DIAG_DIS_CD text,
IN_DIAG_DIS_NM text,
OUT_DIAG_DIS_CD text,
OUT_DIAG_DIS_NM text,
INPT_AREA_BED text,
MED_ORG_DEPT_CD text,
MED_ORG_DEPT_NM text,
OUT_DIAG_DOC_CD text,
OUT_DIAG_DOC_NM text,
MAIN_COND_DES text,
INSU_TYPE text,
IN_HOSP_DAYS number,
MED_AMOUT number,
FERTILITY_STS number,
DATA_ID text,
SYNC_TIME time,
REIMBURSEMENT_FLG number,
HOSP_LEV number,
HOSP_STS number,
INSURED_IDENTITY number,
SERVANT_FLG text,
TRADE_TYPE number,
INSURED_STS text,
REMOTE_SETTLE_FLG text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 在00年12月1日到02年9月23日内科室662因煤尘肺(炭末肺)住院花费的平均费用是多少钱?
| SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '662' AND IN_HOSP_DATE BETWEEN '2000-12-01' AND '2002-09-23' AND IN_DIAG_DIS_NM = '煤尘肺(炭末肺)' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_26051 (
"Episode #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code (order they were made) #" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest episode# with the writer Paul West?
| SELECT MAX("Episode #") FROM table_26051 WHERE "Written by" = 'Paul West' | wikisql |
CREATE TABLE table_name_12 (
style VARCHAR,
results VARCHAR,
choreographer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Style of the dance Choreographed by Nacho Pop with result of safe?
| SELECT style FROM table_name_12 WHERE results = "safe" AND choreographer = "nacho pop" | sql_create_context |
CREATE TABLE table_48876 (
"Model" text,
"Length Over All" text,
"Beam" text,
"Sail Area" text,
"Crew" text,
"Comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Model has a Sail Area of 24.5 m ?
| SELECT "Model" FROM table_48876 WHERE "Sail Area" = '24.5 m²' | 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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text
)
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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
ZSEBZ number,
ZZBZ number,
ZZYSGH text,
mzjzjlb_id number
)
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 病患50606376在2011-11-27之后做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码
| SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id WHERE hz_info.RYBH = '50606376' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2011-11-27') | css |
CREATE TABLE table_203_300 (
id number,
"year" number,
"tournament" text,
"venue" text,
"result" text,
"extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in what year did yelena slesarenko accumulate the most ` top 5 ' finishes ?
| SELECT "year" FROM table_203_300 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_38654 (
"Discipline" text,
"Peter" real,
"Adam" real,
"Jade" real,
"Plat'num" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Peter's score in kendo that has a plat'num less than 3?
| SELECT MIN("Peter") FROM table_38654 WHERE "Discipline" = 'kendo' AND "Plat'num" < '3' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients died of acute subdural hamatoma?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" | mimicsql_data |
CREATE TABLE table_train_122 (
"id" int,
"metabolic_disease" bool,
"stroke" bool,
"renal_disease" bool,
"huntington_disease" bool,
"hepatic_disease" bool,
"psychiatric_disease" bool,
"multiple_sclerosis" bool,
"hyperlipidemia" bool,
"cardiovascular_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"alzheimer_dementia" bool,
"psychosis" bool,
"total_cholesterol" int,
"subdural_hematoma" bool,
"ldl" int,
"gastrointestinal_disease" bool,
"neurological_disease" bool,
"seizure_disorder" bool,
"brain_tumor" bool,
"parkinson_disease" bool,
"normal_pressure_hydrocephalus" bool,
"triglyceride_tg" float,
"supranuclear_palsy" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- significant neurologic disease: any significant neurologic disease, such as parkinson's disease, stroke, huntington's disease, normal pressure hydrocephalus, brain tumor, progressive supranuclear palsy, subdural hematoma, multiple sclerosis, seizure disorder, or other significant deficits ( other than alzheimer's dementia )
| SELECT * FROM table_train_122 WHERE neurological_disease = 1 OR (parkinson_disease = 1 OR stroke = 1 OR huntington_disease = 1 OR normal_pressure_hydrocephalus = 1 OR brain_tumor = 1 OR supranuclear_palsy = 1 OR subdural_hematoma = 1 OR multiple_sclerosis = 1 OR seizure_disorder = 1 AND alzheimer_dementia = 0) | criteria2sql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 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 TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the top four of the most frequent procedures last year?
| 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 DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 4) | mimic_iii |
CREATE TABLE table_54478 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Event is at the Time 1:16?
| SELECT "Event" FROM table_54478 WHERE "Time" = '1:16' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 列出患者58482069的出院科室名称中不包含室在医院3718001中的住院就诊记录都有哪几条?
| SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.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 AND person_info_hz_info.YLJGDM = hz_info.YLJGDM 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 AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.RYBH = person_info.RYBH WHERE person_info.RYBH = '58482069' AND hz_info.YLJGDM = '3718001' AND NOT zyjzjlb.CYKSMC LIKE '%室%' | css |
CREATE TABLE table_name_98 (
date VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game when the Mavericks were the home team?
| SELECT date FROM table_name_98 WHERE home = "mavericks" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
ZZYSGH text,
QTJZYSGH text,
JZZDBM text,
JZZDSM text,
MZZYZDZZBM text,
MZZYZDZZMC text,
SG number,
TZ number,
TW number,
SSY number,
SZY number,
XL number,
HXPLC number,
ML number,
JLSJ time
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM text,
CYBQMC text,
CYCWH text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text,
MZBMLX number,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYSJ time,
CYSJ time,
CYZTDM number
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text,
YQMC text,
CKZFWDX text,
CKZFWXX number,
CKZFWSX number,
JLDW text
)
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_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
JYKSBM text,
JYKSMC text,
BGJGDM text,
BGJGMC text,
SQRQ time,
CJRQ time,
JYRQ time,
BGSJ time,
BBDM text,
BBMC text,
JYBBH text,
BBZT number,
BBCJBW text,
JSBBSJ time,
JYXMMC text,
JYXMDM text,
JYSQJGMC text,
JYJGMC text,
JSBBRQSJ time,
JYJSQM text,
JYJSGH text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 门诊就诊21018594065是在哪一年的几月几日
| SELECT JZKSRQ FROM mzjzjlb WHERE JZLSH = '21018594065' | css |
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 TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
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 text,
charttime time
)
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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- has patient 83466 ever undergone a excise lg intestine les the previous year?
| SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'excise lg intestine les') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83466) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_train_194 (
"id" int,
"organ_transplantation" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"substance_dependence" bool,
"diastolic_blood_pressure_dbp" int,
"alcohol_abuse" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- age 21 _ 60
| SELECT * FROM table_train_194 WHERE age >= 21 AND age <= 60 | criteria2sql |
Subsets and Splits