instruction
stringlengths 151
7.46k
| output
stringlengths 2
4.44k
| source
stringclasses 26
values |
---|---|---|
CREATE TABLE table_55184 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result when the Indianapolis Colts are the opponents?
| SELECT "Result" FROM table_55184 WHERE "Opponent" = 'indianapolis colts' | wikisql |
CREATE TABLE table_name_67 (
country VARCHAR,
season VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country does FC Atyrau represent after the 2006 season?
| SELECT country FROM table_name_67 WHERE season > 2006 AND team = "fc atyrau" | sql_create_context |
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 hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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 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
)
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 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 从07年11月16日到12年9月12日内医疗机构7339851住院时长超过18天的住院就诊记录数量是多少?
| SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '7339851' AND RYDJSJ BETWEEN '2007-11-16' AND '2012-09-12' AND DATEDIFF(CYSJ, RYSJ) > 18 | css |
CREATE TABLE table_15857 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played in the Toronto Raptors from 1995-96?
| SELECT "Player" FROM table_15857 WHERE "Years in Toronto" = '1995-96' | wikisql |
CREATE TABLE table_21949 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sub-parish (sokn) of Eikefjord?
| SELECT "Sub-Parish (Sokn)" FROM table_21949 WHERE "Location of the Church" = 'Eikefjord' | wikisql |
CREATE TABLE table_1341472_15 (
first_elected VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the first elected with district illinois 18
| SELECT first_elected FROM table_1341472_15 WHERE district = "Illinois 18" | sql_create_context |
CREATE TABLE table_79458 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" real,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest production number released on 1955-04-02 with i. freleng as the director?
| SELECT MAX("Production Number") FROM table_79458 WHERE "Director" = 'i. freleng' AND "Release date" = '1955-04-02' | wikisql |
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 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 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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description 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.
-- Orphan questions that were migrated from another site. Questions that were migrated and have no owner
| SELECT p.Id AS "post_link", p.CreationDate AS "date", p.OwnerDisplayName AS "current_user_name", ph.Comment AS "comment" FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 17 AND p.PostTypeId = 1 AND p.OwnerUserId IS NULL ORDER BY p.Id DESC LIMIT 1000 | sede |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 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)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to sort y-axis from low to high order.
| SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_name_61 (
skip VARCHAR,
third VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Skip when the Third was john morris?
| SELECT skip FROM table_name_61 WHERE third = "john morris" | sql_create_context |
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the number of documents for each location code in a bar chart.
| SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code | nvbench |
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 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_ZYJZJLB 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 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 mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 能知道在2004-09-23到2010-08-14内,患者曹婉娜在看病时是哪些工号及姓名的医生给检测指标537012的吗
| SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH WHERE jyjgzbb.JYRQ BETWEEN '2004-09-23' AND '2010-08-14' AND person_info.XM = '曹婉娜' AND jyjgzbb.JCZBDM = '537012' UNION SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jyjgzbb.JYRQ BETWEEN '2004-09-23' AND '2010-08-14' AND person_info.XM = '曹婉娜' AND jyjgzbb.JCZBDM = '537012' | css |
CREATE TABLE table_48113 (
"Province" text,
"Largest city" text,
"2nd Largest" text,
"3rd Largest" text,
"4th largest" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 3rd largest when 2nd largest in Minab?
| SELECT "3rd Largest" FROM table_48113 WHERE "2nd Largest" = 'minab' | wikisql |
CREATE TABLE table_6658 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of game was held against France with the results of 3:1?
| SELECT "Type of game" FROM table_6658 WHERE "Results\u00b9" = '3:1' AND "Opponent" = 'france' | wikisql |
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
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give the number of patients that died with a drug named pneumococcal vac polyvalent.
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "PNEUMOcoccal Vac Polyvalent" | mimicsql_data |
CREATE TABLE table_31987 (
"Year" real,
"Album" text,
"Song" text,
"Label" text,
"Catalog#" text,
"Format" text,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which song had Central Station as a label and whose album was Various - Wild Nights 4?
| SELECT "Song" FROM table_31987 WHERE "Label" = 'central station' AND "Album" = 'various - wild nights 4' | wikisql |
CREATE TABLE table_10510 (
"Season" text,
"Winner" text,
"Team" text,
"Position" text,
"Win #" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had more than 3 wins?
| SELECT "Winner" FROM table_10510 WHERE "Win #" > '3' | wikisql |
CREATE TABLE table_66500 (
"Draw" real,
"Artist" text,
"Song" text,
"Televote/SMS" text,
"Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times was the televote/sms 2.39% and the place more than 9?
| SELECT COUNT("Draw") FROM table_66500 WHERE "Televote/SMS" = '2.39%' AND "Place" > '9' | wikisql |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- from WASHINGTON to ATLANTA
| SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | atis |
CREATE TABLE table_train_119 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diastolic_blood_pressure_dbp" int,
"hypotension" bool,
"allergy_to_milk" bool,
"allergy_to_soy" bool,
"body_mass_index_bmi" float,
"plasma_creatinine" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- plasma creatinine > 2 mg / dl.
| SELECT * FROM table_train_119 WHERE plasma_creatinine > 2 | criteria2sql |
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_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 (
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_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 医院9182083所有的记录里按科室名的差异列一下医保的统筹基金和总的医疗费用之比的平均比值
| SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9182083' GROUP BY t_kc21.MED_ORG_DEPT_NM | css |
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 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 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 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
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 二零一八年二月三日到二零二零年十二月九日,去医疗机构6269787的新生儿门诊就诊的人有多少
| SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '6269787' AND JZKSRQ BETWEEN '2018-02-03' AND '2020-12-09' AND ZSEBZ > 0 | css |
CREATE TABLE table_204_177 (
id number,
"player" text,
"years played" text,
"total w-l" text,
"singles w-l" text,
"doubles w-l" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many years did an jae sung play ?
| SELECT "years played" FROM table_204_177 WHERE "player" = 'an jae-sung' | squall |
CREATE TABLE table_39203 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the week for date of bye
| SELECT "Week" FROM table_39203 WHERE "Date" = 'bye' | wikisql |
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 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 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 Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
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 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 Marketing_Regions (
Marketing_Region_Code CHAR(15),
Marketing_Region_Name VARCHAR(255),
Marketing_Region_Descriptrion VARCHAR(255),
Other_Details 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 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 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 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 Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_Type_Code CHAR(15),
Service_Type_Description VARCHAR(255)
)
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 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)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
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 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 Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar chart for what are the number of the names of the workshop groups that have bookings with status code 'stop'?, I want to list by the Y in asc.
| SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY COUNT(Store_Name) | nvbench |
CREATE TABLE table_name_45 (
drawn INTEGER,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the drawn values for teams with 2 losses?
| SELECT SUM(drawn) FROM table_name_45 WHERE lost = 2 | sql_create_context |
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
languages varchar2(20),
releasedate Date,
resolution number(10)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rating of songs for each language. Plot them as pie chart.
| SELECT languages, AVG(rating) FROM song GROUP BY languages | nvbench |
CREATE TABLE table_name_81 (
wins VARCHAR,
top_25 VARCHAR,
top_10 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Wins, when Top-25 is less than 4, and when Top-10 is less than 1?
| SELECT COUNT(wins) FROM table_name_81 WHERE top_25 < 4 AND top_10 < 1 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many patients of black/cape verdean ethnicity were primarily diagnosed with the disease colangitis
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "COLANGITIS" | mimicsql_data |
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Services (
service_id INTEGER,
organization_id INTEGER,
service_type_code CHAR(15),
service_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
date_moved_out DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Customer_Events (
Customer_Event_ID INTEGER,
customer_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
resident_id INTEGER,
thing_id INTEGER
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME
)
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
Location_Code CHAR(15)
)
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the proportion of each customer's move in date? Show me the bar chart.
| SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in | nvbench |
CREATE TABLE team_franchise (
franchise_id TEXT,
franchise_name TEXT,
active TEXT,
na_assoc TEXT
)
CREATE TABLE manager (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason INTEGER,
g INTEGER,
w INTEGER,
l INTEGER,
rank NUMERIC,
plyr_mgr TEXT
)
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE salary (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
salary INTEGER
)
CREATE TABLE all_star (
player_id TEXT,
year INTEGER,
game_num INTEGER,
game_id TEXT,
team_id TEXT,
league_id TEXT,
gp NUMERIC,
starting_pos NUMERIC
)
CREATE TABLE player_college (
player_id TEXT,
college_id TEXT,
year INTEGER
)
CREATE TABLE fielding_postseason (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
round TEXT,
pos TEXT,
g INTEGER,
gs NUMERIC,
inn_outs NUMERIC,
po INTEGER,
a INTEGER,
e INTEGER,
dp INTEGER,
tp INTEGER,
pb NUMERIC,
sb NUMERIC,
cs NUMERIC
)
CREATE TABLE manager_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes NUMERIC
)
CREATE TABLE pitching (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
w INTEGER,
l INTEGER,
g INTEGER,
gs INTEGER,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts NUMERIC,
h INTEGER,
er INTEGER,
hr INTEGER,
bb INTEGER,
so INTEGER,
baopp NUMERIC,
era NUMERIC,
ibb NUMERIC,
wp NUMERIC,
hbp NUMERIC,
bk INTEGER,
bfp NUMERIC,
gf NUMERIC,
r INTEGER,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
CREATE TABLE fielding (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
pos TEXT,
g INTEGER,
gs NUMERIC,
inn_outs NUMERIC,
po NUMERIC,
a NUMERIC,
e NUMERIC,
dp NUMERIC,
pb NUMERIC,
wp NUMERIC,
sb NUMERIC,
cs NUMERIC,
zr NUMERIC
)
CREATE TABLE team (
year INTEGER,
league_id TEXT,
team_id TEXT,
franchise_id TEXT,
div_id TEXT,
rank INTEGER,
g INTEGER,
ghome NUMERIC,
w INTEGER,
l INTEGER,
div_win TEXT,
wc_win TEXT,
lg_win TEXT,
ws_win TEXT,
r INTEGER,
ab INTEGER,
h INTEGER,
double INTEGER,
triple INTEGER,
hr INTEGER,
bb INTEGER,
so NUMERIC,
sb NUMERIC,
cs NUMERIC,
hbp NUMERIC,
sf NUMERIC,
ra INTEGER,
er INTEGER,
era NUMERIC,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts INTEGER,
ha INTEGER,
hra INTEGER,
bba INTEGER,
soa INTEGER,
e INTEGER,
dp NUMERIC,
fp NUMERIC,
name TEXT,
park TEXT,
attendance NUMERIC,
bpf INTEGER,
ppf INTEGER,
team_id_br TEXT,
team_id_lahman45 TEXT,
team_id_retro TEXT
)
CREATE TABLE home_game (
year INTEGER,
league_id TEXT,
team_id TEXT,
park_id TEXT,
span_first TEXT,
span_last TEXT,
games INTEGER,
openings INTEGER,
attendance INTEGER
)
CREATE TABLE fielding_outfield (
player_id TEXT,
year INTEGER,
stint INTEGER,
glf NUMERIC,
gcf NUMERIC,
grf NUMERIC
)
CREATE TABLE manager_award_vote (
award_id TEXT,
year INTEGER,
league_id TEXT,
player_id TEXT,
points_won INTEGER,
points_max INTEGER,
votes_first INTEGER
)
CREATE TABLE park (
park_id TEXT,
park_name TEXT,
park_alias TEXT,
city TEXT,
state TEXT,
country TEXT
)
CREATE TABLE appearances (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
g_all NUMERIC,
gs NUMERIC,
g_batting INTEGER,
g_defense NUMERIC,
g_p INTEGER,
g_c INTEGER,
g_1b INTEGER,
g_2b INTEGER,
g_3b INTEGER,
g_ss INTEGER,
g_lf INTEGER,
g_cf INTEGER,
g_rf INTEGER,
g_of INTEGER,
g_dh NUMERIC,
g_ph NUMERIC,
g_pr NUMERIC
)
CREATE TABLE batting_postseason (
year INTEGER,
round TEXT,
player_id TEXT,
team_id TEXT,
league_id TEXT,
g INTEGER,
ab INTEGER,
r INTEGER,
h INTEGER,
double INTEGER,
triple INTEGER,
hr INTEGER,
rbi INTEGER,
sb INTEGER,
cs NUMERIC,
bb INTEGER,
so INTEGER,
ibb NUMERIC,
hbp NUMERIC,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
CREATE TABLE hall_of_fame (
player_id TEXT,
yearid INTEGER,
votedby TEXT,
ballots NUMERIC,
needed NUMERIC,
votes NUMERIC,
inducted TEXT,
category TEXT,
needed_note TEXT
)
CREATE TABLE batting (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
g INTEGER,
ab NUMERIC,
r NUMERIC,
h NUMERIC,
double NUMERIC,
triple NUMERIC,
hr NUMERIC,
rbi NUMERIC,
sb NUMERIC,
cs NUMERIC,
bb NUMERIC,
so NUMERIC,
ibb NUMERIC,
hbp NUMERIC,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
CREATE TABLE player_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes TEXT
)
CREATE TABLE player (
player_id TEXT,
birth_year NUMERIC,
birth_month NUMERIC,
birth_day NUMERIC,
birth_country TEXT,
birth_state TEXT,
birth_city TEXT,
death_year NUMERIC,
death_month NUMERIC,
death_day NUMERIC,
death_country TEXT,
death_state TEXT,
death_city TEXT,
name_first TEXT,
name_last TEXT,
name_given TEXT,
weight NUMERIC,
height NUMERIC,
bats TEXT,
throws TEXT,
debut TEXT,
final_game TEXT,
retro_id TEXT,
bbref_id TEXT
)
CREATE TABLE player_award_vote (
award_id TEXT,
year INTEGER,
league_id TEXT,
player_id TEXT,
points_won NUMERIC,
points_max INTEGER,
votes_first NUMERIC
)
CREATE TABLE team_half (
year INTEGER,
league_id TEXT,
team_id TEXT,
half INTEGER,
div_id TEXT,
div_win TEXT,
rank INTEGER,
g INTEGER,
w INTEGER,
l INTEGER
)
CREATE TABLE manager_half (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason INTEGER,
half INTEGER,
g INTEGER,
w INTEGER,
l INTEGER,
rank INTEGER
)
CREATE TABLE college (
college_id TEXT,
name_full TEXT,
city TEXT,
state TEXT,
country TEXT
)
CREATE TABLE pitching_postseason (
player_id TEXT,
year INTEGER,
round TEXT,
team_id TEXT,
league_id TEXT,
w INTEGER,
l INTEGER,
g INTEGER,
gs INTEGER,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts INTEGER,
h INTEGER,
er INTEGER,
hr INTEGER,
bb INTEGER,
so INTEGER,
baopp TEXT,
era NUMERIC,
ibb NUMERIC,
wp NUMERIC,
hbp NUMERIC,
bk NUMERIC,
bfp NUMERIC,
gf INTEGER,
r INTEGER,
sh NUMERIC,
sf NUMERIC,
g_idp NUMERIC
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you draw the trend of sum attendance over the binning year?, show by the X-axis in descending.
| SELECT year, SUM(attendance) FROM home_game ORDER BY year DESC | nvbench |
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE songs (
songid number,
title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the vocal types used in song 'Le Pop'?
| SELECT type FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop" | spider |
CREATE TABLE table_79845 (
"Title" text,
"Album" text,
"Country" text,
"Peak position" real,
"Weeks on chart" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the most weeks on chart when the peak position is less than 5 and from Sweden?
| SELECT MAX("Weeks on chart") FROM table_79845 WHERE "Peak position" < '5' AND "Country" = 'sweden' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
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 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.
-- Count the number of patients died in or before year 2111 whose lab test fluid is ascites.
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_61 (
series VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the series in season 2009?
| SELECT series FROM table_name_61 WHERE season = 2009 | sql_create_context |
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst text,
packst text,
distst text
)
CREATE TABLE resultsdata15 (
sample_pk number,
commod text,
commtype text,
lab text,
pestcode text,
testclass text,
concen number,
lod number,
conunit text,
confmethod text,
confmethod2 text,
annotate text,
quantitate text,
mean text,
extract text,
determin text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum pesticide concentration ever found in a commodity?
| SELECT MAX(concen) FROM resultsdata15 | pesticide |
CREATE TABLE table_45338 (
"Year" real,
"Domestic freight" real,
"Domestic mail" real,
"International freight" real,
"International mail" real,
"Total freight and mail" real,
"Change" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the international mail with the highest number that has a change of +0,2% and less than 0 domestic mail?
| SELECT MAX("International mail") FROM table_45338 WHERE "Change" = '+0,2%' AND "Domestic mail" < '0' | wikisql |
CREATE TABLE table_name_97 (
park_and_ride_lot VARCHAR,
station_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the park & ride lot for the Temple Square station?
| SELECT park_and_ride_lot FROM table_name_97 WHERE station_name = "temple square" | sql_create_context |
CREATE TABLE table_22824319_3 (
player VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of player for 51 points
| SELECT COUNT(player) FROM table_22824319_3 WHERE points = 51 | sql_create_context |
CREATE TABLE table_name_51 (
round INTEGER,
name VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name of David Kimball, and an Overall smaller than 229 is what highest round?
| SELECT MAX(round) FROM table_name_51 WHERE name = "david kimball" AND overall < 229 | sql_create_context |
CREATE TABLE table_53964 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How is the crowd of the team Geelong?
| SELECT AVG("Crowd") FROM table_53964 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- flights from MILWAUKEE to PHOENIX on saturday or sunday AA
| SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, flight WHERE (((flight.airline_code = 'AA') AND ((flight.flight_days = DAYS_0.days_code AND DAYS_0.day_name = DATE_DAY_0.day_name AND DATE_DAY_0.year = 1991 AND DATE_DAY_0.month_number = 7 AND DATE_DAY_0.day_number = 26) OR (flight.flight_days = DAYS_1.days_code AND DAYS_1.day_name = DATE_DAY_1.day_name AND DATE_DAY_1.year = 1991 AND DATE_DAY_1.month_number = 7 AND DATE_DAY_1.day_number = 26))) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | atis |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
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 whose discharge location is snf and days of hospital stay is greater than 13?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.days_stay > "13" | mimicsql_data |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each team, how many technicians are there, and sort from high to low by the y axis.
| SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC | nvbench |
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 hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH 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 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 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.
-- 在01573441264的这次门诊就诊中,就诊状态的名字是什么?代码呢
| SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '01573441264' | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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
)
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 average age of patients whose marital status is married and discharge location is home health care?
| SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "HOME HEALTH CARE" | mimicsql_data |
CREATE TABLE table_70568 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- September 23, 1973 landed on which week of the season?
| SELECT "Week" FROM table_70568 WHERE "Date" = 'september 23, 1973' | wikisql |
CREATE TABLE table_name_34 (
location VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the method of tko?
| SELECT location FROM table_name_34 WHERE method = "tko" | sql_create_context |
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 person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
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 number,
ZSEBZ number,
ZZYSGH 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 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 hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
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 number,
ZSEBZ number,
ZZYSGH text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 列出韩安和这位病患在11年3月21日到19年12月12日内接受检查时开出的所有检验报告单中的标本采集部位
| SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '韩安和' AND jybgb.BGRQ BETWEEN '2011-03-21' AND '2019-12-12' UNION SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN fzzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_info.KLX = fzzmzjzjlb.KLX AND fzzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND fzzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '韩安和' AND jybgb.BGRQ BETWEEN '2011-03-21' AND '2019-12-12' UNION SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE person_info.XM = '韩安和' AND jybgb.BGRQ BETWEEN '2011-03-21' AND '2019-12-12' | css |
CREATE TABLE table_name_2 (
partner VARCHAR,
construction_start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Partner has a Construction Start of 2008 january?
| SELECT partner FROM table_name_2 WHERE construction_start = "2008 january" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE 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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- calculate the number of medications that patient 52898 has been prescribed in 2105.
| SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the top three most frequently used specimen tests given to patients in the same hospital visit after being diagnosed with poison-medicinal agt nos?
| SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'poison-medicinal agt nos')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime, admissions.hadm_id FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 3 | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the five most frequently prescribed drugs since 5 years ago for patients prescribed with atropine 0.1 mg/ml inj syringe at the same time?
| SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atropine 0.1 mg/ml inj syringe' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5 | eicu |
CREATE TABLE table_name_86 (
death VARCHAR,
spouse VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the date of death for the person married to Charles II?
| SELECT death FROM table_name_86 WHERE spouse = "charles ii" | sql_create_context |
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
)
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.
-- count the number of patients whose gender is f and procedure icd9 code is 4610?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "4610" | mimicsql_data |
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
)
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_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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 医疗就诊号码是70036243187的病人购买的所有药物的编号和名称及其价格去掉最便宜的药品,其余按价格降序排列如何排?
| SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '70036243187' AND AMOUNT > (SELECT MIN(AMOUNT) FROM t_kc22 WHERE MED_CLINIC_ID = '70036243187') ORDER BY AMOUNT DESC | css |
CREATE TABLE table_name_90 (
points VARCHAR,
wins VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did Carlin have when they had 3 wins?
| SELECT points FROM table_name_90 WHERE wins = "3" AND team = "carlin" | sql_create_context |
CREATE TABLE table_35942 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the final, who are the opponents of partner Simon Aspelin?
| SELECT "Opponents in the final" FROM table_35942 WHERE "Partner" = 'simon aspelin' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom 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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how much does the arterial bp [systolic] of patient 8116 vary second measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit?
| SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1 OFFSET 1) - (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1) | mimic_iii |
CREATE TABLE table_69618 (
"Representative" text,
"Years" text,
"State" text,
"Party" text,
"Lifespan" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the representative for party of whig
| SELECT "Representative" FROM table_69618 WHERE "Party" = 'whig' | wikisql |
CREATE TABLE table_16185956_1 (
status VARCHAR,
results VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of the district where the result is 63% 37%?
| SELECT status FROM table_16185956_1 WHERE results = "63% 37%" | sql_create_context |
CREATE TABLE table_name_90 (
kashmiri VARCHAR,
indonesian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Kashmiri word for the Indonesian word senin?
| SELECT kashmiri FROM table_name_90 WHERE indonesian = "senin" | sql_create_context |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many female patients followed the procedure ven cath renal dialysis?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Ven cath renal dialysis" | mimicsql_data |
CREATE TABLE table_name_68 (
city_of_license VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which City of license has a Call sign of k241an?
| SELECT city_of_license FROM table_name_68 WHERE call_sign = "k241an" | sql_create_context |
CREATE TABLE table_73366 (
"Piano" text,
"Conductor" text,
"Orchestra" text,
"Record Company" text,
"Year of Recording" real,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the orchestra when the year of recording is 1934?
| SELECT "Orchestra" FROM table_73366 WHERE "Year of Recording" = '1934' | 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.
-- 在就诊患者52907506443治疗时用了什么名称里不包含哌的药品标价多少钱?
| SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '52907506443' AND NOT SOC_SRT_DIRE_NM LIKE '%哌%' | css |
CREATE TABLE table_22098274_1 (
site VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many number of site have May 1, 2004 as the date?
| SELECT COUNT(site) FROM table_22098274_1 WHERE date = "May 1, 2004" | sql_create_context |
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 medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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 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 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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times has patient 015-56390 recieved a enteral tube intake: nasoduodenal nostril, r 10f intake in 12/last year?
| SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56390')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'enteral tube intake: nasoduodenal nostril, r 10f' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', intakeoutput.intakeoutputtime) = '12' | eicu |
CREATE TABLE table_40076 (
"Ring name" text,
"Current rank" text,
"Debut" text,
"Stable" text,
"Birthplace" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Current Rank, when Ring Name is Kimurayama Mamoru?
| SELECT "Current rank" FROM table_40076 WHERE "Ring name" = 'kimurayama mamoru' | wikisql |
CREATE TABLE table_name_52 (
nation VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the nationality of the skater with 108.8 points?
| SELECT nation FROM table_name_52 WHERE points = 108.8 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the top four most frequently diagnosed diagnoses among the patients in the 20s since 1 year ago?
| SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_45574 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of To Par, when Score is '70-75-76=221'?
| SELECT COUNT("To par") FROM table_45574 WHERE "Score" = '70-75-76=221' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname 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 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 jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
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 semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For CS , are there any upper elective courses offered ?
| SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense 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 PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense 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 PostTags (
PostId number,
TagId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
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 ReviewTaskResultTypes (
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 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 CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Number of unanswered question (zero answers) per month.
| SELECT LAST_DATE_OF_MONTH(q.CreationDate), COUNT(q.Id) AS Count FROM Posts AS q WHERE (q.PostTypeId = 1) AND (q.AnswerCount = 0) GROUP BY LAST_DATE_OF_MONTH(q.CreationDate) ORDER BY LAST_DATE_OF_MONTH(q.CreationDate) | sede |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- flights from KANSAS CITY to CLEVELAND on wednesday before 1700
| SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time < 1700 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'KANSAS CITY' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | atis |
CREATE TABLE table_63078 (
"Rank (2012)" real,
"Rank (2010)" real,
"Employer" text,
"Industry" text,
"2012 Employees (Total)" real,
"2010 Employees (Total)" real,
"2007 Employees (Total)" text,
"Head office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of 2012 Employees (Total) when 2007 Employees (Total) is 8,985, and rank (2010) is smaller than 9?
| SELECT COUNT("2012 Employees (Total)") FROM table_63078 WHERE "2007 Employees (Total)" = '8,985' AND "Rank (2010)" < '9' | wikisql |
CREATE TABLE table_36998 (
"Rank" real,
"First quarter" text,
"Second quarter" text,
"Third quarter" text,
"Fourth quarter" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a rank of 2 what is the second quarter?
| SELECT "Second quarter" FROM table_36998 WHERE "Rank" = '2' | wikisql |
CREATE TABLE table_22126 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party did hilda solis represent?
| SELECT "Party" FROM table_22126 WHERE "Incumbent" = 'Hilda Solis' | wikisql |
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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last height of patient 005-73237 in the last month.
| SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-73237') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime 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
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime 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 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how old was patient 035-18528's age during the first hospital visit?
| SELECT patient.age FROM patient WHERE patient.uniquepid = '035-18528' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_12721 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for Greg Norman
| SELECT "Score" FROM table_12721 WHERE "Player" = 'greg norman' | wikisql |
CREATE TABLE table_40579 (
"Spoofed Title" text,
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Artist with a Date that is june 1979?
| SELECT "Artist" FROM table_40579 WHERE "Date" = 'june 1979' | wikisql |
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
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many married patients have lab test item id 51214?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51214" | mimicsql_data |
CREATE TABLE table_22590 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of series for march 19, 2000
| SELECT COUNT("No. in series") FROM table_22590 WHERE "Original air date" = 'March 19, 2000' | wikisql |
CREATE TABLE table_14710 (
"Name" text,
"Line" text,
"Location" text,
"Closed" text,
"Current Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the line of the station in Toolamba that is currently demolished and closed in the late 1970s?
| SELECT "Line" FROM table_14710 WHERE "Current Status" = 'demolished' AND "Closed" = 'late 1970s' AND "Location" = 'toolamba' | wikisql |
CREATE TABLE table_30058355_3 (
thurs_25_aug VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value on Thursday August 25 for rank 3?
| SELECT thurs_25_aug FROM table_30058355_3 WHERE rank = 3 | sql_create_context |
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 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 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 hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id 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
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 显示出1623012这家医院就诊的患者任阳舒的出院科室名字没有中医的住院就诊记录
| SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '任阳舒' AND hz_info.YLJGDM = '1623012' AND NOT zyjzjlb.CYKSMC LIKE '%中医%' | css |
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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime 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
)
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 diagnosis did patient 025-53910 receive last?
| SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-53910')) ORDER BY diagnosis.diagnosistime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_69 (
location VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location for the club trophy?
| SELECT location FROM table_name_69 WHERE type = "club trophy" | sql_create_context |
CREATE TABLE table_2876467_3 (
total_top_3_placements VARCHAR,
region_represented VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many values of total top 3 placements does Taiwan have?
| SELECT COUNT(total_top_3_placements) FROM table_2876467_3 WHERE region_represented = "Taiwan" | sql_create_context |
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of the airports in the city of Goroka?
| SELECT name FROM airports WHERE city = 'Goroka' | spider |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment 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 Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense 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 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 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Questions by date - backwards.
| SELECT Id, Score, ViewCount, Title, Tags, LastActivityDate, CreationDate FROM Posts WHERE PostTypeId = 1 ORDER BY CreationDate LIMIT 50 | sede |
CREATE TABLE table_name_80 (
date VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date for the game at michie stadium west point, ny?
| SELECT date FROM table_name_80 WHERE location = "michie stadium • west point, ny" | sql_create_context |
CREATE TABLE table_name_56 (
against INTEGER,
draws VARCHAR,
losses VARCHAR,
byes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the highest Against that has the Losses larger than 9, and the Byes of 2, and the Draws larger than 0?
| SELECT MAX(against) FROM table_name_56 WHERE losses > 9 AND byes = 2 AND draws > 0 | sql_create_context |
CREATE TABLE table_name_53 (
date VARCHAR,
type VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is a Type of tko, and an Opponent of jesse brinkley
| SELECT date FROM table_name_53 WHERE type = "tko" AND opponent = "jesse brinkley" | sql_create_context |
CREATE TABLE table_name_1 (
outcome VARCHAR,
championship VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Shaun Murphy's outcome in the Premier League Snooker championship held before 2010?
| SELECT outcome FROM table_name_1 WHERE championship = "premier league snooker" AND year < 2010 | sql_create_context |
CREATE TABLE table_name_40 (
commissioned VARCHAR,
launched VARCHAR,
pennant_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which commission was launched 28 june 1934, and has a Pennant number of h.78?
| SELECT commissioned FROM table_name_40 WHERE launched = "28 june 1934" AND pennant_number = "h.78" | sql_create_context |
CREATE TABLE table_78639 (
"Team" text,
"2003\u201304 Pts" text,
"2004\u201305 Pts" text,
"2001\u201302 Pts" real,
"Total Pts" real,
"Total Pld" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Total Pts have a 2001 02 Pts smaller than 38?
| SELECT MIN("Total Pts") FROM table_78639 WHERE "2001\u201302 Pts" < '38' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 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 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
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- give me the difference between the total of the input and the output of patient 26057 on 12/27/this year.
| SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '12-27') - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', outputevents.charttime) = '12-27') | mimic_iii |
CREATE TABLE Catalog_Structure (
catalog_level_number INTEGER,
catalog_id INTEGER,
catalog_level_name VARCHAR(50)
)
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DATETIME,
date_of_latest_revision DATETIME
)
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
catalog_entry_name VARCHAR(80),
product_stock_number VARCHAR(50),
price_in_dollars DOUBLE,
price_in_euros DOUBLE,
price_in_pounds DOUBLE,
capacity VARCHAR(20),
length VARCHAR(20),
height VARCHAR(20),
width VARCHAR(20)
)
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and count them as a line chart.
| SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs | nvbench |