instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_95 ( conference_joined VARCHAR, previous_conference VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers?
SELECT conference_joined FROM table_name_95 WHERE previous_conference = "northwestern" AND mascot = "oilers"
sql_create_context
CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determin text ) CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst text, distst text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If sample 6480 is imported, which country is it originally from?
SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2
pesticide
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the title and highest price for each film Show bar chart, list from low to high by the Y.
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)
nvbench
CREATE TABLE table_17204 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club team did JArrod Maidens play for?
SELECT "Club team" FROM table_17204 WHERE "Player" = 'Jarrod Maidens'
wikisql
CREATE TABLE table_15829930_5 ( matches INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least matches for year 2008
SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show me about the distribution of All_Road and Team_ID in a bar chart, display by the y-axis in ascending.
SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
CREATE TABLE table_15441 ( "Riding" text, "Province" text, "Candidate" text, "Votes" real, "Placement" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Placement when the Candidate is Jean-Patrick Berthiaume?
SELECT "Placement" FROM table_15441 WHERE "Candidate" = 'jean-patrick berthiaume'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 ReviewTaskStates ( 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 PostTypes ( Id number, Name 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId 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 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Questions I have answered where asker has accepted another answer. Lists all questions I have proposed an answer to, and, sadly, the original asker accepted a different answer.
SELECT p.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a, Posts AS p WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 AND p.Id = a.ParentId AND p.AcceptedAnswerId != a.Id ORDER BY a.Score, a.CreationDate
sede
CREATE TABLE table_777 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winners were there in the race of 1922
SELECT COUNT("Incumbent") FROM table_777 WHERE "First elected" = '1922'
wikisql
CREATE TABLE table_15431251_1 ( title VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title for episode number 7 in the season?
SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7
sql_create_context
CREATE TABLE table_72981 ( "Outcome" text, "Edition" real, "Round" text, "Opponent Team" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the opponent was Dominika Cibulkov ?
SELECT "Score" FROM table_72981 WHERE "Opponent" = 'Dominika Cibulková'
wikisql
CREATE TABLE table_4876 ( "Place" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1?
SELECT COUNT("Goals Against") FROM table_4876 WHERE "Lost" > '7' AND "Goals For" < '27' AND "Drawn" > '1'
wikisql
CREATE TABLE table_8435 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for Billy Andrade?
SELECT "Score" FROM table_8435 WHERE "Player" = 'billy andrade'
wikisql
CREATE TABLE table_70544 ( "Production year" text, "2001" real, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average 2002 value for Sunflower, which had a 2010 value less than 5587 and a 2007 value greater than 546?
SELECT AVG("2002") FROM table_70544 WHERE "2010" < '5587' AND "Production year" = 'sunflower' AND "2007" > '546'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 在医院3990035中,根据出院诊断疾病名称不同疾病的平均病人年龄是多少,列一下
SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3990035' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3990035' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
CREATE TABLE table_27700530_15 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the most points and how many did they have on April 22?
SELECT high_points FROM table_27700530_15 WHERE date = "April 22"
sql_create_context
CREATE TABLE table_203_777 ( id number, "years" text, "building" text, "city" text, "height (ctbuh)" text, "floors" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which building held the record before the current holder ?
SELECT "building" FROM table_203_777 WHERE "years" < present_ref ORDER BY "years" DESC LIMIT 1
squall
CREATE TABLE table_name_1 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the game on July 26?
SELECT SUM(attendance) FROM table_name_1 WHERE date = "july 26"
sql_create_context
CREATE TABLE table_name_26 ( site VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the site for game of game 2
SELECT site FROM table_name_26 WHERE game = "game 2"
sql_create_context
CREATE TABLE table_dev_42 ( "id" int, "gender" string, "depression" bool, "familial_hypercholesterolemia" bool, "microalbuminuria" int, "renal_disease" bool, "diabetic" string, "estimated_glomerular_filtration_rate_egfr" int, "serum_creatinine" float, "fbg" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "a1c" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- microalbuminuria up to 300 mg / 24 hours is acceptable if serum creatinine is < 1.4 for female , < 1.5 for male and estimated gfr ( egfr ) is > 60 )
SELECT * FROM table_dev_42 WHERE microalbuminuria <= 300 OR ((gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)) AND estimated_glomerular_filtration_rate_egfr > 60
criteria2sql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE 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 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- during the previous year, what were the top three most frequently ordered lab tests for patients during the same month after the diagnosis of accid in resident instit?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'accid in resident instit') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 3)
mimic_iii
CREATE TABLE table_204_302 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total medals did brazil received ?
SELECT "total" FROM table_204_302 WHERE "nation" = 'brazil'
squall
CREATE TABLE table_name_67 ( play VARCHAR, author VARCHAR, base VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What play has a base of Athens and was written by Aeschylus?
SELECT play FROM table_name_67 WHERE author = "aeschylus" AND base = "athens"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 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 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 VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 CloseReasonTypes ( 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 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Got most down to non-CW answers.
SELECT DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, Posts.OwnerUserId AS "user_link", Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId = 3 AND Posts.PostTypeId = 2 AND Posts.CommunityOwnedDate IS NULL AND Posts.OwnerUserId > 0 GROUP BY Posts.OwnerUserId ORDER BY Count DESC, UserId LIMIT 100
sede
CREATE TABLE wedding ( church_id number, male_id number, female_id number, year number ) CREATE TABLE people ( people_id number, name text, country text, is_male text, age number ) CREATE TABLE church ( church_id number, name text, organized_by text, open_date number, continuation_of text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all church names in descending order of opening date.
SELECT name FROM church ORDER BY open_date DESC
spider
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, WDBZ number, XL number, YLJGDM text, ZSEBZ number, ZZBZ number, ZZYSGH 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 hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 查查D2聚体(肝素/EDTA)数值的平均值以及最值,是针对门诊诊断为强迫性障碍的患者的
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '强迫性障碍' AND jyjgzbb.JCZBMC = 'D2聚体(肝素/EDTA)'
css
CREATE TABLE table_name_10 ( attendance INTEGER, week INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance after week 16?
SELECT AVG(attendance) FROM table_name_10 WHERE week > 16
sql_create_context
CREATE TABLE injury_accident ( game_id VARCHAR, injury VARCHAR ) CREATE TABLE stadium ( name VARCHAR, id VARCHAR ) CREATE TABLE game ( season VARCHAR, stadium_id VARCHAR, id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'
sql_create_context
CREATE TABLE table_61959 ( "President" text, "Treasurer" text, "Secretary" text, "Social AO" text, "Academic AO" text, "Internal CO" text, "External CO" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Secretary has an Internal CO of isabel voets?
SELECT "Secretary" FROM table_61959 WHERE "Internal CO" = 'isabel voets'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of patients whose discharge location is long term care hospital and procedure long title is incision of vessel, lower limb arteries?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.long_title = "Incision of vessel, lower limb arteries"
mimicsql_data
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE 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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how much does it cost for the hospital stay of patient 29540?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29540)
mimic_iii
CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE projects ( project_id number, project_details text ) CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give the ids of documents with expenses that have the budget code 'SF'.
SELECT document_id FROM documents_with_expenses WHERE budget_type_code = 'SF'
spider
CREATE TABLE Skills_Required_To_Fix ( skill_id VARCHAR ) CREATE TABLE Skills ( skill_id VARCHAR, skill_description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which skill is used in fixing the most number of faults? List the skill id and description.
SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) CREATE TABLE VoteTypes ( 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( 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 CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE 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 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Top users under 18 by Reputation.
SELECT Id, DisplayName, Age, Reputation, CreationDate, LastAccessDate, 'http://stackoverflow.com/users/' + CAST(Id AS TEXT) AS Url FROM Users AS b WHERE (b.Age <= 18) ORDER BY b.Reputation, b.Age
sede
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, 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 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( 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 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- select * from posts limit 10;.
SELECT * FROM Posts WHERE Score > 1000
sede
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who wrote the most ACL papers in 2010
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC
scholar
CREATE TABLE table_25065 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Vacators were listed when the district was North Carolina 3rd?
SELECT COUNT("Vacator") FROM table_25065 WHERE "District" = 'North Carolina 3rd'
wikisql
CREATE TABLE table_73158 ( "School" text, "City / Town" text, "Website" text, "Size" real, "Principal" text, "Grades" text, "IDOE Profile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Bloomington High School North?
SELECT "City / Town" FROM table_73158 WHERE "School" = 'Bloomington High School North'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list the flights from SALT LAKE CITY to ST. PETERSBURG
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PETERSBURG' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
atis
CREATE TABLE table_28140141_1 ( artist VARCHAR, show VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many artists were there for the show thoroughly modern millie?
SELECT COUNT(artist) FROM table_28140141_1 WHERE show = "Thoroughly Modern Millie"
sql_create_context
CREATE TABLE table_20849830_1 ( result VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game with the record of 3-1?
SELECT result FROM table_20849830_1 WHERE record = "3-1"
sql_create_context
CREATE TABLE table_name_28 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player scored 76-68=144?
SELECT player FROM table_name_28 WHERE score = 76 - 68 = 144
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 自二零零八年十一月二十七日开始,截止到二零一九年二月二十一日,患者奚美丽通过医疗机构4566860做了多少次检查
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '奚美丽' AND t_kc22.STA_DATE BETWEEN '2008-11-27' AND '2019-02-21' AND gwyjzb.MED_SER_ORG_NO = '4566860' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERSON_NM = '奚美丽' AND t_kc22.STA_DATE BETWEEN '2008-11-27' AND '2019-02-21' AND fgwyjzb.MED_SER_ORG_NO = '4566860' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many unmarried patients have dialys route of drug administration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is minimum age of patients whose primary disease is coronary artery disease\coronary artery bypass graft with mvr; ? maze and admission year is greater than or equal to 2146?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.admityear >= "2146"
mimicsql_data
CREATE TABLE table_46830 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Game of 19?
SELECT "Record" FROM table_46830 WHERE "Game" = '19'
wikisql
CREATE TABLE table_name_75 ( class VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the class of the HMS Heartsease?
SELECT class FROM table_name_75 WHERE name = "hms heartsease"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me the number of patients whose admission type is elective and procedure icd9 code is 3613?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3613"
mimicsql_data
CREATE TABLE table_61774 ( "Year [e ] (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Main Language(s)" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original title for the film used in nomination of street days?
SELECT "Original title" FROM table_61774 WHERE "Film title used in nomination" = 'street days'
wikisql
CREATE TABLE table_name_58 ( points_against VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Points against for the ystradgynlais rfc club?
SELECT points_against FROM table_name_58 WHERE club = "ystradgynlais rfc"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the comparison about the sum of Weight over the Sex , and group by attribute Sex, and could you show Sex in desc order?
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_name_55 ( round VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Name of john goodyear?
SELECT round FROM table_name_55 WHERE name = "john goodyear"
sql_create_context
CREATE TABLE table_name_22 ( birth VARCHAR, ceased_to_be_duke_of_girona VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE BIRTH DATE THAT HAS Ceased to be Duke of Girona OF 21 NOVEMBER 1582?
SELECT birth FROM table_name_22 WHERE ceased_to_be_duke_of_girona = "21 november 1582"
sql_create_context
CREATE TABLE table_name_37 ( italian VARCHAR, french VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the italian word for the french word 'mer
SELECT italian FROM table_name_37 WHERE french = "mer"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY number, ILL_PAY number, CIVIL_SUBSIDY number, PER_SOL number, PER_EXP number, DATA_ID text, SYNC_TIME time, OUT_HOSP_DATE time, CLINIC_ID text, MED_TYPE number, INSURED_STS text, INSURED_IDENTITY number, TRADE_TYPE number, RECIPE_BILL_ID text, ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, RECEIVER_DEAL_ID text, SENDER_REVOKE_ID text, RECEIVER_REVOKE_ID text, SENDER_OFFSET_ID text, RECEIVER_OFFSET_ID text, LAS_OVE_PAY number, OVE_ADD_PAY number, SUP_ADD_PAY number, CKC102 number, CASH_PAY number, COM_ACC_PAY number, ENT_ACC_PAY number, ENT_PAY number, COM_PAY number, OLDC_FUND_PAY number, SPE_FUND_PAY number ) CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text, VAL_UNIT text, DOSE_UNIT text, DOSE_FORM text, SPEC text, USE_FRE text, EACH_DOSAGE text, QTY number, UNIVALENT number, AMOUNT number, SELF_PAY_PRO number, RER_SOL number, SELF_PAY_AMO number, UP_LIMIT_AMO number, OVE_SELF_AMO number, EXP_OCC_DATE time, RECIPE_BILL_ID text, FLX_MED_ORG_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, HOSP_DOC_CD text, HOSP_DOC_NM text, REF_STA_FLG number, DATA_ID text, SYNC_TIME time, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, TRADE_TYPE number, STA_FLG number, STA_DATE time, REIMBURS_TYPE number, FXBZ number, REMOTE_SETTLE_FLG text ) CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG number, FLX_MED_ORG_ID text, MED_SER_ORG_NO text, CLINIC_TYPE text, MED_TYPE number, CLINIC_ID text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, INPT_AREA_BED text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, MAIN_COND_DES text, INSU_TYPE text, IN_HOSP_DAYS number, MED_AMOUT number, FERTILITY_STS number, DATA_ID text, SYNC_TIME time, REIMBURSEMENT_FLG number, HOSP_LEV number, HOSP_STS number, INSURED_IDENTITY number, SERVANT_FLG text, TRADE_TYPE number, INSURED_STS text, REMOTE_SETTLE_FLG text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 自二零一零年四月五日开始,截止到二零一三年四月九日,患者孔岚翠的病历里有多少种疾病
SELECT COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_NM = '孔岚翠' AND IN_HOSP_DATE BETWEEN '2010-04-05' AND '2013-04-09'
css
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of professors with a PhD degree in each department Show bar chart, I want to display by the Y from low to high.
SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY COUNT(*)
nvbench
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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is admission time and lab test name of subject id 22377?
SELECT demographic.admittime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "22377"
mimicsql_data
CREATE TABLE table_11951237_3 ( season__number INTEGER, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the season # where production code is k1505?
SELECT MIN(season__number) FROM table_11951237_3 WHERE production_code = "K1505"
sql_create_context
CREATE TABLE table_name_13 ( nationality VARCHAR, ranking VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality has a ranking less than 7 with tony stenson as the name?
SELECT nationality FROM table_name_13 WHERE ranking < 7 AND name = "tony stenson"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is discharge time and procedure icd9 code of subject id 65759?
SELECT demographic.dischtime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "65759"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE 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. -- give me the number of patients whose days of hospital stay is greater than 1 and procedure short title is hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "1" AND procedures.short_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_55647 ( "Player" text, "Pos." text, "From" real, "School/Country" text, "Rebs" real, "Asts" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year a SG has over 650 assists?
SELECT MIN("From") FROM table_55647 WHERE "Pos." = 'sg' AND "Asts" > '650'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) CREATE TABLE 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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 之前患者62748683的就诊医院是哪里
SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '62748683' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '62748683'
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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. -- Which patients have hispanic or latino-puerto rican ethnic background?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
mimicsql_data
CREATE TABLE table_298883_5 ( reverse VARCHAR, value VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is on the reverse side of the 100 coin?
SELECT reverse FROM table_298883_5 WHERE value = "₩100"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY number, ILL_PAY number, CIVIL_SUBSIDY number, PER_SOL number, PER_EXP number, DATA_ID text, SYNC_TIME time, OUT_HOSP_DATE time, CLINIC_ID text, MED_TYPE number, INSURED_STS text, INSURED_IDENTITY number, TRADE_TYPE number, RECIPE_BILL_ID text, ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, RECEIVER_DEAL_ID text, SENDER_REVOKE_ID text, RECEIVER_REVOKE_ID text, SENDER_OFFSET_ID text, RECEIVER_OFFSET_ID text, LAS_OVE_PAY number, OVE_ADD_PAY number, SUP_ADD_PAY number, CKC102 number, CASH_PAY number, COM_ACC_PAY number, ENT_ACC_PAY number, ENT_PAY number, COM_PAY number, OLDC_FUND_PAY number, SPE_FUND_PAY number ) CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text, VAL_UNIT text, DOSE_UNIT text, DOSE_FORM text, SPEC text, USE_FRE text, EACH_DOSAGE text, QTY number, UNIVALENT number, AMOUNT number, SELF_PAY_PRO number, RER_SOL number, SELF_PAY_AMO number, UP_LIMIT_AMO number, OVE_SELF_AMO number, EXP_OCC_DATE time, RECIPE_BILL_ID text, FLX_MED_ORG_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, HOSP_DOC_CD text, HOSP_DOC_NM text, REF_STA_FLG number, DATA_ID text, SYNC_TIME time, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, TRADE_TYPE number, STA_FLG number, STA_DATE time, REIMBURS_TYPE number, FXBZ number, REMOTE_SETTLE_FLG text ) CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG number, FLX_MED_ORG_ID text, MED_SER_ORG_NO text, CLINIC_TYPE text, MED_TYPE number, CLINIC_ID text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, INPT_AREA_BED text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, MAIN_COND_DES text, INSU_TYPE text, IN_HOSP_DAYS number, MED_AMOUT number, FERTILITY_STS number, DATA_ID text, SYNC_TIME time, REIMBURSEMENT_FLG number, HOSP_LEV number, HOSP_STS number, INSURED_IDENTITY number, SERVANT_FLG text, TRADE_TYPE number, INSURED_STS text, REMOTE_SETTLE_FLG text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 医疗记录中医院0869256的出院诊断,统计其急性支气管炎的最低和最高医疗费总数目都是多少?
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '0869256' AND OUT_DIAG_DIS_NM = '急性支气管炎')
css
CREATE TABLE table_23887174_1 ( number_of_cantons__gavars_ VARCHAR, armenian_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different numbers of cantons does the province with the Armenian name have?
SELECT COUNT(number_of_cantons__gavars_) FROM table_23887174_1 WHERE armenian_name = "Վասպուրական"
sql_create_context
CREATE TABLE table_name_67 ( name VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the Players with a Rank of 18?
SELECT name FROM table_name_67 WHERE rank = 18
sql_create_context
CREATE TABLE table_name_77 ( year VARCHAR, opponent VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year for geelong player john roberts?
SELECT year FROM table_name_77 WHERE opponent = "geelong" AND player = "john roberts"
sql_create_context
CREATE TABLE table_46537 ( "Name" text, "Country" text, "Loan Club" text, "Started" text, "Ended" text, "Start Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the start source of the irl country, which ended on 13 April?
SELECT "Start Source" FROM table_46537 WHERE "Country" = 'irl' AND "Ended" = '13 april'
wikisql
CREATE TABLE table_name_68 ( country VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Time is 1:29.43.60?
SELECT country FROM table_name_68 WHERE time = "1:29.43.60"
sql_create_context
CREATE TABLE table_name_38 ( distance VARCHAR, stages VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How long was the 16 staged event in 1997?
SELECT distance FROM table_name_38 WHERE stages = "16" AND year = "1997"
sql_create_context
CREATE TABLE table_name_80 ( wu_xing___五行__ VARCHAR, korean___rr__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Wu Xing ( ) with Korean (RR) of (im)?
SELECT wu_xing___五行__ FROM table_name_80 WHERE korean___rr__ = "임 (im)"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) 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 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- max number of dupes on a question.
SELECT pl.PostId AS "post_link", COUNT(*) FROM PostLinks AS pl INNER JOIN Posts AS p ON p.Id = pl.PostId WHERE LinkTypeId = 3 GROUP BY PostId HAVING COUNT(*) > 2 ORDER BY 2 DESC
sede
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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, 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 ReviewTaskStates ( 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 PostHistoryTypes ( 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 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) 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 PostTags ( PostId number, TagId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Users' search by Name and AboutME.
SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.Reputation, u.UpVotes, u.DownVotes, u.EmailHash FROM Users AS u WHERE UPPER(u.AboutMe) LIKE UPPER('%##AboutMe##%') AND UPPER(DisplayName) LIKE UPPER('%##DisplayName##%')
sede
CREATE TABLE table_62584 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is from south africa?
SELECT "Player" FROM table_62584 WHERE "Country" = 'south africa'
wikisql
CREATE TABLE table_44728 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the upstream with the price 65 chf?
SELECT "Upstream" FROM table_44728 WHERE "Price" = '65 chf'
wikisql
CREATE TABLE table_71578 ( "Elector" text, "Order" text, "Title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Order with an Elector of Marino Bulcani?
SELECT "Order" FROM table_71578 WHERE "Elector" = 'marino bulcani'
wikisql
CREATE TABLE table_name_61 ( finish VARCHAR, to_par VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Finish has a To par of 1, and a Year(s) won of 1955?
SELECT finish FROM table_name_61 WHERE to_par = "–1" AND year_s__won = "1955"
sql_create_context
CREATE TABLE table_name_32 ( nationality VARCHAR, year VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality has a year larger than 2009 with a position of power forward?
SELECT nationality FROM table_name_32 WHERE year > 2009 AND position = "power forward"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text, VAL_UNIT text, DOSE_UNIT text, DOSE_FORM text, SPEC text, USE_FRE text, EACH_DOSAGE text, QTY number, UNIVALENT number, AMOUNT number, SELF_PAY_PRO number, RER_SOL number, SELF_PAY_AMO number, UP_LIMIT_AMO number, OVE_SELF_AMO number, EXP_OCC_DATE time, RECIPE_BILL_ID text, FLX_MED_ORG_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, HOSP_DOC_CD text, HOSP_DOC_NM text, REF_STA_FLG number, DATA_ID text, SYNC_TIME time, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, TRADE_TYPE number, STA_FLG number, STA_DATE time, REIMBURS_TYPE number, FXBZ number, REMOTE_SETTLE_FLG text ) CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG number, FLX_MED_ORG_ID text, MED_SER_ORG_NO text, CLINIC_TYPE text, MED_TYPE number, CLINIC_ID text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, INPT_AREA_BED text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, MAIN_COND_DES text, INSU_TYPE text, IN_HOSP_DAYS number, MED_AMOUT number, FERTILITY_STS number, DATA_ID text, SYNC_TIME time, REIMBURSEMENT_FLG number, HOSP_LEV number, HOSP_STS number, INSURED_IDENTITY number, SERVANT_FLG text, TRADE_TYPE number, INSURED_STS text, REMOTE_SETTLE_FLG text ) CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY number, ILL_PAY number, CIVIL_SUBSIDY number, PER_SOL number, PER_EXP number, DATA_ID text, SYNC_TIME time, OUT_HOSP_DATE time, CLINIC_ID text, MED_TYPE number, INSURED_STS text, INSURED_IDENTITY number, TRADE_TYPE number, RECIPE_BILL_ID text, ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, RECEIVER_DEAL_ID text, SENDER_REVOKE_ID text, RECEIVER_REVOKE_ID text, SENDER_OFFSET_ID text, RECEIVER_OFFSET_ID text, LAS_OVE_PAY number, OVE_ADD_PAY number, SUP_ADD_PAY number, CKC102 number, CASH_PAY number, COM_ACC_PAY number, ENT_ACC_PAY number, ENT_PAY number, COM_PAY number, OLDC_FUND_PAY number, SPE_FUND_PAY number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 医院3995688在00年7月1日到11年6月19日期间的医疗就诊记录里有哪些不是科室4512所负责的?
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3995688' AND IN_HOSP_DATE BETWEEN '2000-07-01' AND '2011-06-19') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3995688' AND IN_HOSP_DATE BETWEEN '2000-07-01' AND '2011-06-19' AND MED_ORG_DEPT_CD = '4512')
css
CREATE TABLE table_8150 ( "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. -- Where was the location attendance when Minnesota played?
SELECT "Location Attendance" FROM table_8150 WHERE "Team" = 'minnesota'
wikisql
CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, address text, city text, state text, country text, postalcode text, phone text, fax text, email text, supportrepid number ) CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text, city text, state text, country text, postalcode text, phone text, fax text, email text ) CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE invoice ( invoiceid number, customerid number, invoicedate time, billingaddress text, billingcity text, billingstate text, billingcountry text, billingpostalcode text, total number ) CREATE TABLE invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number ) CREATE TABLE playlisttrack ( playlistid number, trackid number ) CREATE TABLE mediatype ( mediatypeid number, name text ) CREATE TABLE artist ( artistid number, name text ) CREATE TABLE album ( albumid number, title text, artistid number ) CREATE TABLE genre ( genreid number, name text ) CREATE TABLE track ( trackid number, name text, albumid number, mediatypeid number, genreid number, composer text, milliseconds number, bytes number, unitprice number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of all the tracks that contain the word 'you'.
SELECT name FROM track WHERE name LIKE '%you%'
spider
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TZ number, WDBZ number, XL number, YLJGDM number, ZSEBZ number, ZZBZ number, ZZYSGH text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JYKSBM text, JYKSMC text, JYLX number, JYRQ time, JYSQJGMC text, JYXMDM text, JYXMMC text, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, SQRGH text, SQRQ time, SQRXM text, YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) CREATE TABLE 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 txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TZ number, WDBZ number, XL number, YLJGDM number, ZSEBZ number, ZZBZ number, ZZYSGH text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 被门诊诊断为R76.930这个病的蒋宏深,看看他的检测指标089733的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'R76.930' AND person_info.XM = '蒋宏深' AND jyjgzbb.JCZBDM = '089733' UNION SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN ftxmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = ftxmzjzjlb.KH AND hz_info.KLX = ftxmzjzjlb.KLX AND ftxmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND ftxmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE ftxmzjzjlb.JZZDBM = 'R76.930' AND person_info.XM = '蒋宏深' AND jyjgzbb.JCZBDM = '089733'
css
CREATE TABLE table_2031 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season did the team get in the conference finals of the playoffs?
SELECT "Regular Season" FROM table_2031 WHERE "Playoffs" = 'Conference Finals'
wikisql
CREATE TABLE table_33397 ( "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 was the crowd size when the away team scored 7.19 (61)?
SELECT COUNT("Crowd") FROM table_33397 WHERE "Away team score" = '7.19 (61)'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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. -- what is the marital status and days of hospital stay of subject id 6983?
SELECT demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_44017 ( "Team" text, "Driver" text, "Class" text, "Chassis" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver was in 8 rounds with a chassis of dallara f306?
SELECT "Driver" FROM table_44017 WHERE "Chassis" = 'dallara f306' AND "Rounds" = '8'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- get the number of urgent hospital admission patients who have prescription for calcium carbonate.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Calcium Carbonate"
mimicsql_data
CREATE TABLE table_name_8 ( points INTEGER, place INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which places have points larger than 10?
SELECT MIN(points) FROM table_name_8 WHERE place > 10
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE 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 zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) CREATE TABLE 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 患者俞嘉平大腿的各项指标检验结果的详细情况怎么样
SELECT * 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 person_info.XM = '俞嘉平' AND jybgb.BBCJBW = '大腿' UNION SELECT * 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 person_info.XM = '俞嘉平' AND jybgb.BBCJBW = '大腿'
css
CREATE TABLE table_5865 ( "Pick #" text, "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. -- What is the Position for the brandon wheat kings (wchl)?
SELECT "Position" FROM table_5865 WHERE "College/junior/club team" = 'brandon wheat kings (wchl)'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Return a bar chart about the distribution of Date_of_Birth and Height , display in desc by the names please.
SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth DESC
nvbench
CREATE TABLE table_2971 ( "April 2013 Cum. Rank" real, "Name" text, "Rank (all) 2012" real, "Rank (all) 2013" real, "2013 Rank (oil companies)" text, "2013 rev (bil. USD )" text, "2013 Profit (mil. USD )" real, "Assets (bil. USD )" text, "Market cap March 15 (mil. USD )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Forbers rank (all companies) in 2012 for cenovus energy?
SELECT "Rank (all) 2012" FROM table_2971 WHERE "Name" = 'Cenovus Energy'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is minimum age of patients whose marital status is single and primary disease is hypertension;rule out coronary artery disease\cardiac cath?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
mimicsql_data
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE 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 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 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE area ( course_id int, area 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 gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can ORALPATH 696 be used for ULCS ?
SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'ORALPATH' AND course.number = 696 AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_13183076_3 ( us_viewers__million_ VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many U.S. viewers (million) are there for the episode whose Production code is 3T7051?
SELECT us_viewers__million_ FROM table_13183076_3 WHERE production_code = "3T7051"
sql_create_context
CREATE TABLE table_71894 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" text, "Investing Dragon(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Investing Dragon(s) belong to Episode 9 with the Entrepreneur Ashley Sayed?
SELECT "Investing Dragon(s)" FROM table_71894 WHERE "Episode" = 'episode 9' AND "Entrepreneur(s)" = 'ashley sayed'
wikisql
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which advisors are advising more than 2 students?
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) > 2
spider
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 在医院6149241中,根据入院诊断疾病名称把不同疾病患者的平均年龄列一下
SELECT qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6149241' GROUP BY qtb.IN_DIAG_DIS_NM UNION SELECT gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6149241' GROUP BY gyb.IN_DIAG_DIS_NM UNION SELECT zyb.IN_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb.MED_SER_ORG_NO = '6149241' GROUP BY zyb.IN_DIAG_DIS_NM UNION SELECT mzb.IN_DIAG_DIS_NM, AVG(mzb.PERSON_AGE) FROM mzb WHERE mzb.MED_SER_ORG_NO = '6149241' GROUP BY mzb.IN_DIAG_DIS_NM
css