instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_6403 ( "Year" real, "Country" text, "Song" text, "Artist" text, "Written by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was the artist Afro-dite?
SELECT "Year" FROM table_6403 WHERE "Artist" = 'afro-dite'
wikisql
CREATE TABLE table_13854 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format was the release in form the Edsel label, and that was from the EDCD 262 catalog?
SELECT "Format" FROM table_13854 WHERE "Label" = 'edsel' AND "Catalog" = 'edcd 262'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list the top four most frequent procedures that patients have received during the same month after they have been diagnosed with pleural effusion - transudate by lab analysis until 1 year ago.
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion - transudate by lab analysis' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.treatmenttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.treatmenttime, 'start of month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 4
eicu
CREATE TABLE table_name_80 ( Group VARCHAR, song VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Group Song, when Song is ?
SELECT Group AS song FROM table_name_80 WHERE song = "换季"
sql_create_context
CREATE TABLE table_72885 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high point total against cleveland?
SELECT "High points" FROM table_72885 WHERE "Team" = 'Cleveland'
wikisql
CREATE TABLE table_63184 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the frequency when the identifier is cbf-fm-9?
SELECT "Frequency" FROM table_63184 WHERE "Identifier" = 'cbf-fm-9'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 PostTypes ( Id number, Name 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) 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 CloseReasonTypes ( 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 ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE 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 PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- All posts from Jan 1, 2019.
SELECT * FROM Posts WHERE CreationDate >= '2019-03-25'
sede
CREATE TABLE table_name_13 ( byes INTEGER, losses VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of Byes for the team that had 15 Losses, and less than 1 Win?
SELECT AVG(byes) FROM table_name_13 WHERE losses = 15 AND wins < 1
sql_create_context
CREATE TABLE table_name_66 ( actor VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What actor plays glen cole?
SELECT actor FROM table_name_66 WHERE character = "glen cole"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM 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 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 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 mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 在00年10月14日到2011年2月11日期间为病患谢芳蕙执行检测指标607066的医务人员的工号还有姓名是什么?
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 '2000-10-14' AND '2011-02-11' AND person_info.XM = '谢芳蕙' AND jyjgzbb.JCZBDM = '607066' 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 '2000-10-14' AND '2011-02-11' AND person_info.XM = '谢芳蕙' AND jyjgzbb.JCZBDM = '607066'
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE 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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- calculate the four year survival rate among the patients who were prescribed with prasugrel after having been diagnosed with klebsiella pneumoniae.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'klebsiella pneumoniae') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 4 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'prasugrel') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id
mimic_iii
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Users with most posts in top 1000.
WITH CTE_TopPosts AS (SELECT OwnerUserId FROM Posts ORDER BY Score DESC LIMIT 100000) SELECT OwnerUserId, DisplayName, COUNT(OwnerUserId) AS Count FROM CTE_TopPosts JOIN Users ON CTE_TopPosts.OwnerUserId = Users.Id GROUP BY OwnerUserId, DisplayName ORDER BY Count DESC LIMIT 1000
sede
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 ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the diagnosis code and diagnosis long title for the patient francis baseler?
SELECT diagnoses.icd9_code, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Francis Baseler"
mimicsql_data
CREATE TABLE PostHistoryTypes ( Id number, Name text ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE 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 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Question length and score distributions.
WITH Keyed AS (SELECT CAST(Posts.Score AS FLOAT) AS Score, POWER(ROUND(SQRT(LENGTH(Body)), 0), 2) AS PostLength FROM Posts WHERE PostTypeId = 1), Sized AS (SELECT PostLength, AVG(Score) AS MeanScore, COUNT(Score) AS ClusterSize FROM Keyed GROUP BY PostLength) SELECT PostLength, MeanScore, ClusterSize FROM Sized WHERE ClusterSize > 10 ORDER BY PostLength
sede
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL(19,4) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Display a pie chart for what are the first names and ids for customers who have two or more accounts?
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id
nvbench
CREATE TABLE table_name_96 ( team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2nd Leg, when Team #2 is 'San Lorenzo'?
SELECT 2 AS nd_leg FROM table_name_96 WHERE team__number2 = "san lorenzo"
sql_create_context
CREATE TABLE table_68070 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the school for eagles
SELECT "School" FROM table_68070 WHERE "Team" = 'eagles'
wikisql
CREATE TABLE table_2562572_46 ( settlement VARCHAR, cyrillic_name_other_names VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which settlement has a cyrillic and other name of (romanian: voivodin )?
SELECT settlement FROM table_2562572_46 WHERE cyrillic_name_other_names = "Војводинци (Romanian: Voivodinţ)"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname 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 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 program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the actual name of ELI 530 ?
SELECT DISTINCT name FROM course WHERE department = 'ELI' AND number = 530
advising
CREATE TABLE table_18041 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episode was watched by 11.75 million U.S. viewers?
SELECT "Title" FROM table_18041 WHERE "U.S. viewers (millions)" = '11.75'
wikisql
CREATE TABLE table_44260 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored the lowest with 8 gold medals and less than 4 silver medals?
SELECT MIN("Total") FROM table_44260 WHERE "Gold" = '8' AND "Silver" < '4'
wikisql
CREATE TABLE table_38253 ( "Election" text, "D\u00e1il" text, "Share of votes" text, "Seats" real, "Government" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 6th dail share of votes?
SELECT "Share of votes" FROM table_38253 WHERE "D\u00e1il" = '6th'
wikisql
CREATE TABLE table_49713 ( "Model number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Frequency, when Model Number is Pentium II 400?
SELECT "Frequency" FROM table_49713 WHERE "Model number" = 'pentium ii 400'
wikisql
CREATE TABLE table_18600760_8 ( township VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the township for kidder
SELECT township FROM table_18600760_8 WHERE county = "Kidder"
sql_create_context
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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- find the diagnosis icd9 code of subject id 2560.
SELECT diagnoses.icd9_code FROM diagnoses WHERE diagnoses.subject_id = "2560"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of patients whose year of birth is less than 2058 and diagnoses short title is stevens-johnson-ten syn?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2058" AND diagnoses.short_title = "Stevens-Johnson-TEN syn"
mimicsql_data
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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- provide me the number of patients who have abnormal lab test status and diagnosed for the need for prophylactic vaccination and inoculation against viral hepatitis.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Need prphyl vc vrl hepat" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_15398 ( "Date" text, "Opponent" text, "Site" text, "Score" text, "Loss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game when there was a loss of Kern (0-2)?
SELECT "Score" FROM table_15398 WHERE "Loss" = 'kern (0-2)'
wikisql
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location 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 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 program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id 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 comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) 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 program ( program_id int, name varchar, college varchar, introduction varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which CHEMBIO courses require 530 ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'CHEMBIO' AND COURSE_0.number = 530 AND COURSE_1.course_id = course_prerequisite.course_id
advising
CREATE TABLE table_23892 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (2009)" real, "Founded" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Southern Vermont College founded?
SELECT MAX("Founded") FROM table_23892 WHERE "School" = 'Southern Vermont College'
wikisql
CREATE TABLE table_74526 ( "Year" real, "Tournaments played" real, "Cuts made*" real, "Wins" real, "Top 10s" real, "Best finish" text, "Earnings ( $ )" text, "Scoring average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the scoring average for year less than 1998 and wins more than 3
SELECT "Scoring average" FROM table_74526 WHERE "Year" < '1998' AND "Wins" > '3'
wikisql
CREATE TABLE table_name_77 ( winning_constructor VARCHAR, fastest_lap VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the winning constructor for when the fastest lap was mark webber at the malaysian grand prix
SELECT winning_constructor FROM table_name_77 WHERE fastest_lap = "mark webber" AND grand_prix = "malaysian grand prix"
sql_create_context
CREATE TABLE table_1601027_1 ( earpads VARCHAR, headphone_class VARCHAR, us_msrp VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many values for earpads correspond to the headphone class Prestige and a US MSRP of $79?
SELECT COUNT(earpads) FROM table_1601027_1 WHERE headphone_class = "Prestige" AND us_msrp = "$79"
sql_create_context
CREATE TABLE table_name_71 ( first_season INTEGER, wins VARCHAR, seasons VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of First Season games with 1537 Wins and a Season greater than 109?
SELECT SUM(first_season) FROM table_name_71 WHERE wins = 1537 AND seasons > 109
sql_create_context
CREATE TABLE table_name_98 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the home team was geelong, what did the away team score?
SELECT away_team AS score FROM table_name_98 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE table_30580 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many college/junior/club teams are ther when nhl team is edmonton oilers?
SELECT COUNT("College/junior/club team") FROM table_30580 WHERE "NHL team" = 'Edmonton Oilers'
wikisql
CREATE TABLE table_name_87 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day is st kilda the home side?
SELECT date FROM table_name_87 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_29108 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first series episode number for 'the christmas watch'?
SELECT MIN("Series #") FROM table_29108 WHERE "Title" = 'The Christmas Watch'
wikisql
CREATE TABLE table_38013 ( "Name" text, "Life" text, "Age at death" text, "First contact with Hitler" text, "Relationship" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the relationship of the woman who died at 96?
SELECT "Relationship" FROM table_38013 WHERE "Age at death" = '96'
wikisql
CREATE TABLE table_3955 ( "Code" text, "District" text, "Headquarters" text, "Population (2001 Census)" real, "Population (2011 Census)" real, "Area (km\u00b2)" real, "Density in 2011 (/km\u00b2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people lived in the district whose headquarters is in Bhubaneswar in 2001?
SELECT "Population (2001 Census)" FROM table_3955 WHERE "Headquarters" = 'Bhubaneswar'
wikisql
CREATE TABLE table_11545282_4 ( years_for_jazz VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did number 54 play for the jazz
SELECT years_for_jazz FROM table_11545282_4 WHERE no = 54
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name 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 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 PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( 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 ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tags and Posts for Each Year.
SELECT T.TagName AS "tag", TIME_TO_STR(CreationDate, '%Y') AS "year", COUNT(PT.PostId) AS "number_of_posts" FROM Tags AS T, PostTags AS PT, Posts AS P WHERE T.Id = PT.TagId AND P.Id = PT.PostId GROUP BY T.TagName, TIME_TO_STR(CreationDate, '%Y') ORDER BY TIME_TO_STR(CreationDate, '%Y')
sede
CREATE TABLE table_33004 ( "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. -- What is the venue when melbourne is the away team?
SELECT "Venue" FROM table_33004 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_name_31 ( geohash_length INTEGER, lng_error VARCHAR, lng_bits VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest geohash length when there is a ng error of 0.00017, and a lng bits smaller than 20?
SELECT MAX(geohash_length) FROM table_name_31 WHERE lng_error = "±0.00017" AND lng_bits < 20
sql_create_context
CREATE TABLE table_51530 ( "Feb 2010" text, "Mar 2010" text, "May 2010" real, "Jun 2010" real, "Jul 2010" real, "Aug 2010" real, "Sep 2010" real, "Oct 2010" real, "Nov 2010" real, "Dec 2010" real, "Jan 2011" real, "Feb 2011" real, "Mar 2011" real, "Apr 2011" real, "May 2011" real, "Jun 2011" real, "Jul 2011" real, "Aug 2011" real, "Sep 2011" real, "Oct 2011" real, "Nov 2011" real, "Dec 2011" real, "Jan 2012" real, "Feb 2012" real, "Mar 2012" real, "Apr 2012" real, "May 2012" real, "Jun 2012" real, "Jul 2012" real, "Aug 2012" real, "Sep 2012" real, "Oct 2012" real, "Nov 2012" real, "Dec 2012" real, "Jan 2013" real, "Feb 2013" real, "Mar 2013" real, "Apr 2013" real, "May 2013" real, "Jun 2013" real, "Jul 2013" real, "Aug 2013" real, "Sep 2013" real, "Oct 2013" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Feb 2013 with a Feb 2010 with 37, and a Nov 2012 less than 32?
SELECT AVG("Feb 2013") FROM table_51530 WHERE "Feb 2010" = '37' AND "Nov 2012" < '32'
wikisql
CREATE TABLE table_name_70 ( score VARCHAR, surface VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the match played on hard with a person ranked 10?
SELECT score FROM table_name_70 WHERE surface = "hard" AND rank = 10
sql_create_context
CREATE TABLE table_name_86 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the away team was collingwood, what was the away team score?
SELECT away_team AS score FROM table_name_86 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_55070 ( "Rank" real, "Movie" text, "Year" real, "Studio(s)" text, "Lifetime India Distributor share" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Lifetime India Distributor share earlier than 2009?
SELECT COUNT("Lifetime India Distributor share") FROM table_55070 WHERE "Year" < '2009'
wikisql
CREATE TABLE table_10015132_3 ( years_in_toronto VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During what period did Dell Curry play for Toronto?
SELECT years_in_toronto FROM table_10015132_3 WHERE player = "Dell Curry"
sql_create_context
CREATE TABLE table_name_75 ( band VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What band has a year above 2011?
SELECT band FROM table_name_75 WHERE year > 2011
sql_create_context
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On average how large is the population of the counties?
SELECT AVG(population) FROM county
spider
CREATE TABLE table_14637853_3 ( directed_by VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who directed with original air date being november18,1995
SELECT directed_by FROM table_14637853_3 WHERE original_air_date = "November18,1995"
sql_create_context
CREATE TABLE table_40289 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Week when the winner was mary joe fern ndez 6 4, 7 5?
SELECT "Week of" FROM table_40289 WHERE "Winner" = 'mary joe fernández 6–4, 7–5'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YQBH text, YQMC text, jyjgzbb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM 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 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 jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JYKSBM text, JYKSMC text, JYLX number, JYRQ time, JYSQJGMC text, JYXMDM text, JYXMMC text, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, SQRGH text, SQRQ time, SQRXM text, YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 查出存在和检验指标记录77235231928相同的检测指标名称与检测指标结果定量单位,且检测指标结果定量小于其的检验指标记录有哪些
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '77235231928') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '77235231928') AND jyjgzbb.JCZBJGDL < (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '77235231928')
css
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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me the number of patients whose days of hospital stay is greater than 0 and procedure short title is contrast arteriogram-leg?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "0" AND procedures.short_title = "Contrast arteriogram-leg"
mimicsql_data
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 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Anonymous Feedback for a specific question and its answers. Gets: Score, Age, Views, and Anonymous Feedback for a specific post and any answers it may have. (If given an answer-post ID, it just fetches data for that answer.)
SELECT pt.PostId, p.Title, COUNT(*) AS posts, COUNT(CASE WHEN pf.VoteTypeId = 2 THEN 1 ELSE NULL END) AS Anon_up, COUNT(CASE WHEN pf.VoteTypeId = 3 THEN 1 ELSE NULL END) AS Anon_down FROM Tags AS t JOIN PostTags AS pt ON pt.TagId = t.Id JOIN PostFeedback AS pf ON pf.PostId = pt.PostId JOIN Posts AS p ON p.Id = pt.PostId WHERE t.TagName = 'postgresql' GROUP BY pt.PostId, p.Title ORDER BY posts DESC LIMIT 15
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many of the male patients were admitted on transfer from hosp/extram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM"
mimicsql_data
CREATE TABLE table_3106 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the episode that aired originally on October 18, 1991?
SELECT "Title" FROM table_3106 WHERE "Original air date" = 'October 18, 1991'
wikisql
CREATE TABLE table_name_30 ( record VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at Tiger Stadium?
SELECT record FROM table_name_30 WHERE game_site = "tiger stadium"
sql_create_context
CREATE TABLE table_name_26 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won that game on 24 July 2010?
SELECT result FROM table_name_26 WHERE date = "24 july 2010"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name 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 PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Users ( Id number, Reputation number, 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( 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 ReviewTaskTypes ( Id number, Name text, Description 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Users that only down-vote questions. A list of users who happily down-vote questions, but don't down-vote answers.
SELECT COUNT(UserId) FROM Votes AS V, Posts AS P WHERE P.PostTypeId = 2 AND P.Id = V.PostId GROUP BY V.UserId
sede
CREATE TABLE table_43823 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of game 37?
SELECT "Score" FROM table_43823 WHERE "Game" = '37'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) 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 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 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) 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 would be the average daily number of patients diagnosed with cardiac hardware malfunction - pacemaker this year?
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'cardiac hardware malfunction - pacemaker' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE table_name_22 ( director VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Director has a Rank of 12?
SELECT director FROM table_name_22 WHERE rank = 12
sql_create_context
CREATE TABLE table_13981938_1 ( vineyard_surface__2010_ VARCHAR, grand_cru VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the vineyard surface (2010) with grand cru being bienvenues-b tard-montrachet
SELECT vineyard_surface__2010_ FROM table_13981938_1 WHERE grand_cru = "Bienvenues-Bâtard-Montrachet"
sql_create_context
CREATE TABLE table_19018191_5 ( nat VARCHAR, total_apps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nat for total apps for 27
SELECT nat FROM table_19018191_5 WHERE total_apps = 27
sql_create_context
CREATE TABLE table_78342 ( "Candidate" text, "Money Raised, 2Q" text, "Loans Received, 2Q" text, "Money Spent, 2Q" text, "Total Receipts" text, "Cash On Hand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the loans received for 2Q having total receipts of $25,328,694
SELECT "Loans Received, 2Q" FROM table_78342 WHERE "Total Receipts" = '$25,328,694'
wikisql
CREATE TABLE table_40568 ( "Rank" text, "Route" text, "Avg. Daily Flts" real, "# of Airlines" real, "Distance (km)" real, "Market Share Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Airlines have a total distance of 705 (km)?
SELECT COUNT("# of Airlines") FROM table_40568 WHERE "Distance (km)" = '705'
wikisql
CREATE TABLE table_203_98 ( id number, "title" text, "year" number, "director" text, "budget" text, "gross (worldwide)" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which morgan creek film grossed the most money prior to 1994 ?
SELECT "title" FROM table_203_98 WHERE "year" < 1994 ORDER BY "gross (worldwide)" DESC LIMIT 1
squall
CREATE TABLE table_35822 ( "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 city has a game of friendly and an opponent of tunisia?
SELECT "City" FROM table_35822 WHERE "Type of game" = 'friendly' AND "Opponent" = 'tunisia'
wikisql
CREATE TABLE table_41190 ( "City" text, "Comprehension of Danish" text, "Comprehension of Swedish" text, "Comprehension of Norwegian" text, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Comprehension of Danish has an Average smaller than 6.85, and a Comprehension of Norwegian of 4.13?
SELECT "Comprehension of Danish" FROM table_41190 WHERE "Average" < '6.85' AND "Comprehension of Norwegian" = '4.13'
wikisql
CREATE TABLE table_49620 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the No. 1 of the person with a No. 2 of John?
SELECT "No. 1" FROM table_49620 WHERE "No. 2" = 'john'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE 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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when has patient 19175 had a microbiology test for the first time during a month before?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiologyevents.charttime LIMIT 1
mimic_iii
CREATE TABLE table_10874 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent of the match with an attendance larger than 59,000?
SELECT "Opponent" FROM table_10874 WHERE "Attendance" > '59,000'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category 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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname 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 area ( course_id int, area varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) 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 ta ( campus_job_id int, student_id int, location varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Are Prof. Karie Slavik and Prof. Stephen Rush the only teachers who teach MCDB 310 ?
SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%Karie Slavik%' AND NOT instructor.name LIKE '%Stephen Rush%') AND course.course_id = course_offering.course_id AND course.department = 'MCDB' AND course.number = 310 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id
advising
CREATE TABLE table_29652 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Barreto's song choice when the theme was samba?
SELECT "Song Choice" FROM table_29652 WHERE "Theme" = 'Samba'
wikisql
CREATE TABLE table_21284653_1 ( municipal_status VARCHAR, population_density VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the municipal status where the population density is 895.5?
SELECT municipal_status FROM table_21284653_1 WHERE population_density = "895.5"
sql_create_context
CREATE TABLE table_60444 ( "Year" real, "Delegate" text, "Hometown" text, "Placement in Miss Universe" text, "Other awards" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Placement in Miss Universe has a Delegate of janine mari raymundo tugonon?
SELECT "Placement in Miss Universe" FROM table_60444 WHERE "Delegate" = 'janine mari raymundo tugonon'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many words did I have to write per upvote?.
SELECT Id AS "post_link", LENGTH(Body) * 1.0 / Score AS "letters_per_upvote" FROM Posts WHERE OwnerUserId = '##user##' AND Score > 0 ORDER BY 2
sede
CREATE TABLE table_204_631 ( id number, "#" number, "title" text, "english translation" text, "original album" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of songs that were also on the bintang di surga album ?
SELECT COUNT("title") FROM table_204_631 WHERE "original album" = 'bintang di surga'
squall
CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Carole Bernhard first become a customer?
SELECT date_became_customer FROM customers WHERE first_name = "Carole" AND last_name = "Bernhard"
spider
CREATE TABLE table_9771 ( "Episode #" text, "Original airdate (UK)" text, "Episode title" text, "Doctor Who episode" text, "Webcast link" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Original airdate (UK) has a Doctor Who episode of ' the doctor dances '?
SELECT "Original airdate (UK)" FROM table_9771 WHERE "Doctor Who episode" = ' the doctor dances '
wikisql
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 instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE 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 ta ( campus_job_id int, student_id int, location varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During next Winter who will be teaching PreMajor classes ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE program_course.category LIKE '%PreMajor%' AND semester.semester = 'Winter' AND semester.year = 2017
advising
CREATE TABLE table_204_783 ( id number, "position" text, "player" text, "free agency\ntag" text, "date signed" text, "2013 team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many players play cb or og ?
SELECT COUNT("player") FROM table_204_783 WHERE "position" IN ('cb', 'og')
squall
CREATE TABLE table_14589 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the place for south africa and retief goosen
SELECT "Place" FROM table_14589 WHERE "Country" = 'south africa' AND "Player" = 'retief goosen'
wikisql
CREATE TABLE table_name_6 ( opponents VARCHAR, partner VARCHAR, outcome VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the Opponents in the match on a Hard Surface with Catherine Suire as Partner and Outcome of runner-up?
SELECT opponents FROM table_name_6 WHERE outcome = "runner-up" AND surface = "hard" AND partner = "catherine suire"
sql_create_context
CREATE TABLE table_32427 ( "Team" text, "Chassis" text, "Engine" text, "Tires" text, "Drivers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the engine for the Machinists Union Racing team?
SELECT "Engine" FROM table_32427 WHERE "Team" = 'machinists union racing'
wikisql
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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) 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. -- Search comments for given string on others' posts.
SELECT c.Id AS "comment_link", u.DisplayName FROM Comments AS c FULL OUTER JOIN Posts AS p ON c.PostId = p.Id JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Id != '##Userid##' AND Text LIKE '##SearchString##'
sede
CREATE TABLE table_name_1 ( genitive VARCHAR, ergative VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the genitive for the ergative shen?
SELECT genitive FROM table_name_1 WHERE ergative = "shen"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, WDBZ number, XL number, YLJGDM text, ZSEBZ number, ZZBZ number, ZZYSGH text ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM 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, jybgb_BBCJBW text, jybgb_BBDM text, jybgb_BBMC text, jybgb_BBZT number, jybgb_BGJGDM text, jybgb_BGJGMC text, jybgb_BGRGH text, jybgb_BGRQ time, jybgb_BGRXM text, jybgb_BGSJ time, jybgb_CJRQ time, jybgb_JSBBRQSJ time, jybgb_JSBBSJ time, jybgb_JYBBH text, jybgb_JYJGMC text, jybgb_JYJSGH text, jybgb_JYJSQM text, jybgb_JYKSBM text, jybgb_JYKSMC text, jybgb_JYLX number, jybgb_JYRQ time, jybgb_JYSQJGMC text, jybgb_JYXMDM text, jybgb_JYXMMC text, jybgb_JZLSH text, jybgb_JZLSH_MZJZJLB text, jybgb_JZLSH_ZYJZJLB text, jybgb_JZLX number, jybgb_KSBM text, jybgb_KSMC text, jybgb_SHRGH text, jybgb_SHRXM text, jybgb_SHSJ time, jybgb_SQKS text, jybgb_SQKSMC text, jybgb_SQRGH text, jybgb_SQRQ time, jybgb_SQRXM text, jybgb_YLJGDM_MZJZJLB text, jybgb_YLJGDM_ZYJZJLB text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 患者被门诊诊断为口齿病(龋齿病)的检测指标559847的参考值范围下限和上限是多少
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '口齿病(龋齿病)' AND jyjgzbb.JCZBDM = '559847'
css
CREATE TABLE table_22997 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who directed the episode that have 14.59 million viewers
SELECT "Directed by" FROM table_22997 WHERE "U.S. viewers (millions)" = '14.59'
wikisql
CREATE TABLE table_22032 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If second leg is Newell's Old Boys, what name is first leg?
SELECT "1st Leg" FROM table_22032 WHERE "Home (2nd leg)" = 'Newell''s Old Boys'
wikisql
CREATE TABLE table_name_68 ( population INTEGER, simplified VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of the population for the place simplified with an area smaller than 2,879?
SELECT SUM(population) FROM table_name_68 WHERE simplified = "上杭县" AND area < 2 OFFSET 879
sql_create_context
CREATE TABLE table_name_47 ( school_club_team VARCHAR, round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has fewer than 4 rounds for Jan Van Breda Kolff?
SELECT school_club_team FROM table_name_47 WHERE round < 4 AND player = "jan van breda kolff"
sql_create_context
CREATE TABLE table_40704 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest week with a game attended by 60,233?
SELECT MIN("Week") FROM table_40704 WHERE "Attendance" = '60,233'
wikisql
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inches number, mean_sea_level_pressure_inches number, min_sea_level_pressure_inches number, max_visibility_miles number, mean_visibility_miles number, min_visibility_miles number, max_wind_speed_mph number, mean_wind_speed_mph number, max_gust_speed_mph number, precipitation_inches number, cloud_cover number, events text, wind_dir_degrees number, zip_code number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the ids and durations of the trips with the top 3 durations?
SELECT id, duration FROM trip ORDER BY duration DESC LIMIT 3
spider
CREATE TABLE table_52456 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many attended the game at Busch Stadium (ii) when the time was 3:54?
SELECT "Attendance" FROM table_52456 WHERE "Location" = 'busch stadium (ii)' AND "Time" = '3:54'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how much does it cost for -bands lab tests?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = '-bands')
eicu
CREATE TABLE PersonFriend ( name VARCHAR, friend VARCHAR ) CREATE TABLE Person ( name VARCHAR, gender VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of females who are friends with Zach
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first drug prescribed to patient 006-149686 via the iv push route?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-149686')) AND medication.routeadmin = 'iv push' ORDER BY medication.drugstarttime LIMIT 1
eicu