instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, could you display in ascending by the names?
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text, YQMC text, CKZFWDX text, CKZFWXX number, CKZFWSX number, JLDW text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ZZYSGH text, QTJZYSGH text, JZZDBM text, JZZDSM text, MZZYZDZZBM text, MZZYZDZZMC text, SG number, TZ number, TW number, SSY number, SZY number, XL number, HXPLC number, ML number, JLSJ time ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, JYKSBM text, JYKSMC text, BGJGDM text, BGJGMC text, SQRQ time, CJRQ time, JYRQ time, BGSJ time, BBDM text, BBMC text, JYBBH text, BBZT number, BBCJBW text, JSBBSJ time, JYXMMC text, JYXMDM text, JYSQJGMC text, JYJGMC text, JSBBRQSJ time, JYJSQM text, JYJSGH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM text, CYBQMC text, CYCWH text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text, MZBMLX number, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYSJ time, CYSJ time, CYZTDM number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 从2017年8月1日开始直到2020年3月1日内患者苏秀艾被开出的所有检验报告单的科室序列号以及名称?
(SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '苏秀艾' AND jybgb.BGRQ BETWEEN '2017-08-01' AND '2020-03-01') UNION (SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE person_info.XM = '苏秀艾' AND jybgb.BGRQ BETWEEN '2017-08-01' AND '2020-03-01')
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 参保人29762576的门诊检查费在2000年2月5日到2020年9月20日这段期间统共是多少呀?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '29762576' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-02-05' AND '2020-09-20' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_52878 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the grid associated with under 26 laps and a Time/Retired of +6.077?
SELECT AVG("Grid") FROM table_52878 WHERE "Time/Retired" = '+6.077' AND "Laps" < '26'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( 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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE 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 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE 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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Kui palju on kasutajaid kokku?.
SELECT COUNT(Id) FROM Posts WHERE CreationDate BETWEEN '2019-01-01' AND '2019-03-03'
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me the number of patients whose death status is 1 and diagnoses short title is sec neuroend tumor-liver?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Sec neuroend tumor-liver"
mimicsql_data
CREATE TABLE table_12614 ( "Team" text, "B10 Conference" text, "B10 %" real, "B10 Home" text, "B10 Road" text, "All Games" text, "All Games %" real, "All Home" text, "All Road" text, "All Neutral" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the All Home with less than 0.406% All Games?
SELECT "All Home" FROM table_12614 WHERE "All Games %" < '0.406'
wikisql
CREATE TABLE table_76319 ( "Club" text, "League" text, "Venue" text, "Capacity" text, "Location" text, "Established" real, "Championships" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the venue named nassau veterans memorial coliseum established??
SELECT MAX("Established") FROM table_76319 WHERE "Venue" = 'nassau veterans memorial coliseum'
wikisql
CREATE TABLE table_name_56 ( rank VARCHAR, nation VARCHAR, bronze VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank has 0 as the bronze, and a total less than 3, with north korea as the nation?
SELECT rank FROM table_name_56 WHERE bronze = 0 AND total < 3 AND nation = "north korea"
sql_create_context
CREATE TABLE table_name_7 ( location VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the location when the time is 3:15?
SELECT location FROM table_name_7 WHERE time = "3:15"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show me Epistemology courses of 15 credits .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Epistemology%' OR name LIKE '%Epistemology%') AND credits = 15
advising
CREATE TABLE table_63492 ( "Rank" real, "Title" text, "Release Date" text, "Franchise" text, "Developer(s)" text, "Platform" text, "Units sold (in Millions)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the platform of Super Mario All-Stars?
SELECT "Platform" FROM table_63492 WHERE "Title" = 'super mario all-stars'
wikisql
CREATE TABLE table_203_568 ( id number, "town/village" text, "population" number, "postal code" text, "municipality" text, "island" text, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many towns have a population higher than 1000 ?
SELECT COUNT("town/village") FROM table_203_568 WHERE "population" > 1000
squall
CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id text ) CREATE TABLE book_club ( book_club_id number, year number, author_or_editor text, book_title text, publisher text, category text, result text ) CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title and director for the movie with highest worldwide gross in the year 2000 or before?
SELECT title, director FROM movie WHERE year <= 2000 ORDER BY gross_worldwide DESC LIMIT 1
spider
CREATE TABLE table_49566 ( "Race" real, "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the Lakeside race where Paul Morris won?
SELECT "Date" FROM table_49566 WHERE "Race Title" = 'lakeside' AND "Winner" = 'paul morris'
wikisql
CREATE TABLE table_203_212 ( id number, "#" number, "district" text, "land area (km2)" number, "population\n(2010 census)" number, "density (persons/km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total land area of saint lucia -lrb- in square kilometers -rrb- ?
SELECT "land area (km2)" FROM table_203_212 WHERE "district" = 'saint lucia'
squall
CREATE TABLE table_name_98 ( province_region VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the Cagayan de Oro city located?
SELECT province_region FROM table_name_98 WHERE location = "cagayan de oro city"
sql_create_context
CREATE TABLE table_13741576_6 ( club VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club had 404 points against?
SELECT club FROM table_13741576_6 WHERE points_against = "404"
sql_create_context
CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gender_mf text, address_line_1 text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE student_tests_taken ( registration_id number, date_test_taken time, test_result text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the personal names and family names of the students? Sort the result in alphabetical order of the family name.
SELECT personal_name, family_name FROM students ORDER BY family_name
spider
CREATE TABLE table_7978 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event did he win with a method of submission (triangle choke) and a time of n/a?
SELECT "Event" FROM table_7978 WHERE "Res." = 'win' AND "Time" = 'n/a' AND "Method" = 'submission (triangle choke)'
wikisql
CREATE TABLE table_27823058_1 ( series__number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest series number ?
SELECT MAX(series__number) FROM table_27823058_1
sql_create_context
CREATE TABLE table_40023 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the set 5 with a 19-25 set 1?
SELECT "Set 5" FROM table_40023 WHERE "Set 1" = '19-25'
wikisql
CREATE TABLE table_63216 ( "Island" text, "Country" text, "Population" text, "Area km\u00b2" text, "Density (per km\u00b2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a density (per km ) of 6,814?
SELECT "Country" FROM table_63216 WHERE "Density (per km\u00b2)" = '6,814'
wikisql
CREATE TABLE order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_address_from time, address_type text, date_address_to time ) CREATE TABLE customer_contact_channels ( customer_id number, channel_code text, active_from_date time, active_to_date time, contact_number text ) CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE addresses ( address_id number, address_content text, city text, zip_postcode text, state_province_county text, country text, other_address_details text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are names of customers who never ordered product Latte.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'
spider
CREATE TABLE table_19222 ( "Institution" text, "Location" text, "Established" real, "Gained university status" real, "Vice-chancellor" text, "Total Number of Students" real, "Research Funding (\u00a3,000)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many members gained university status in 1900?
SELECT COUNT("Research Funding (\u00a3,000)") FROM table_19222 WHERE "Gained university status" = '1900'
wikisql
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For each phone, show its names and total number of stocks Visualize by bar chart, rank by the Y-axis in ascending please.
SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name ORDER BY SUM(T1.Num_of_stock)
nvbench
CREATE TABLE table_15001 ( "Series" text, "TV Channel" text, "Launch Date" text, "Finale Date" text, "Days" real, "The Winner" text, "The Prize" text, "The Presenter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won when the presenter was Tatiana Stefanidou?
SELECT "The Winner" FROM table_15001 WHERE "The Presenter" = 'tatiana stefanidou'
wikisql
CREATE TABLE table_name_28 ( long INTEGER, gain INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the long figure when gain is less than 0?
SELECT AVG(long) FROM table_name_28 WHERE gain < 0
sql_create_context
CREATE TABLE table_203_2 ( id number, "name" text, "mineral" text, "opened" text, "closed" text, "years connected" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many quarries opened before 1892 ?
SELECT COUNT(*) FROM table_203_2 WHERE "opened" <= 1892
squall
CREATE TABLE table_2417345_4 ( date_successor_seated VARCHAR, successor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was successor George E. Harris (R) seated?
SELECT date_successor_seated FROM table_2417345_4 WHERE successor = "George E. Harris (R)"
sql_create_context
CREATE TABLE table_63594 ( "Draw" real, "Language" text, "Artist" text, "English translation" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest draw number when there are more than 31 points, a rank greater than 6, and the English translation is listen to me?
SELECT MAX("Draw") FROM table_63594 WHERE "Points" > '31' AND "Place" > '6' AND "English translation" = 'listen to me'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label 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 labevents ( row_id number, subject_id number, hadm_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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- count the number of people who were prescribed vancomycin hcl during the same month following a diagnosis of ac vasc insuff intestine since 6 years ago.
SELECT COUNT(DISTINCT t1.subject_id) 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 = 'ac vasc insuff intestine') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vancomycin hcl' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.startdate, 'start of month')
mimic_iii
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- select * from Users where Id= 113.
SELECT * FROM Users WHERE Id = 113
sede
CREATE TABLE table_17622 ( "Number in series" real, "Broadcast Order" text, "Title" text, "Villain/s" text, "U.S. Air Date" text, "Production Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the series number of the episode titled 'The Quest'?
SELECT MAX("Number in series") FROM table_17622 WHERE "Title" = 'The Quest'
wikisql
CREATE TABLE table_name_94 ( game VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game has jones (10) as the high rebounds?
SELECT game FROM table_name_94 WHERE high_rebounds = "jones (10)"
sql_create_context
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many patients are born before 2056 and administered with si drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2056" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE table_19712 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game on October 6, 1974?
SELECT "Result" FROM table_19712 WHERE "Date" = 'October 6, 1974'
wikisql
CREATE TABLE table_name_93 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE 2010 WITH 2012 OF 2R AT MIAMI MASTERS?
SELECT 2010 FROM table_name_93 WHERE 2012 = "2r" AND tournament = "miami masters"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 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 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 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time 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 class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt 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 days ( days_code varchar, day_name varchar ) CREATE TABLE month ( month_number int, month_name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me a list of the morning flights from ATLANTA to BOSTON
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 0 AND 1200
atis
CREATE TABLE table_202_160 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what division was the team most commonly found in ?
SELECT "division" FROM table_202_160 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 按科室编码的不同和出院病名的不同计算一下医院3667285所有的记录里病人平均是多少岁
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3667285' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE table_58095 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won in 2003?
SELECT "Winner" FROM table_58095 WHERE "Year" = '2003'
wikisql
CREATE TABLE table_name_52 ( song VARCHAR, weeks_at_number_one VARCHAR, issue_date_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Song has a Weeks at number one larger than 2, and an Issue date(s) of 17 april - 8 may?
SELECT song FROM table_name_52 WHERE weeks_at_number_one > 2 AND issue_date_s_ = "17 april - 8 may"
sql_create_context
CREATE TABLE table_72576 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player for chicago black hawks
SELECT "Player" FROM table_72576 WHERE "NHL team" = 'Chicago Black Hawks'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE 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 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 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 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 code_description ( code varchar, description 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 state ( state_code text, state_name text, country_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i need a flight from NEW YORK to TORONTO THURSDAY 5 24 arriving by 1200
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days AS DAYS_0, days AS DAYS_1, flight WHERE (((DAYS_1.day_name = 'THURSDAY' AND flight.arrival_time <= 1200 AND flight.flight_days = DAYS_1.days_code) AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND DAYS_0.day_name = date_day.day_name AND flight.flight_days = DAYS_0.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONTO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
atis
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE VoteTypes ( Id number, Name 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE 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 CloseReasonTypes ( Id number, Name text, Description text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Questions counted by vote range.
SELECT COUNT(CASE WHEN UPPER(Posts.Tags) LIKE '%<OPEN-ENDED>%' THEN 1 END) AS OpenEndedCount FROM Posts JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE PostTypes.Name = 'Question'
sede
CREATE TABLE table_name_44 ( floors VARCHAR, street_address_in_detroit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many floors does the address 1828 jay street have?
SELECT floors FROM table_name_44 WHERE street_address_in_detroit = "1828 jay street"
sql_create_context
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of booking start date for the apartments that have more than two bedrooms for each weekday in a bar chart, display total number from high to low order please.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE table_36315 ( "Athlete" text, "Country" text, "Run 1" real, "Run 2" real, "Run 3" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a run 2 of 50.67?
SELECT "Athlete" FROM table_36315 WHERE "Run 2" = '50.67'
wikisql
CREATE TABLE table_27277284_28 ( ht VARCHAR, mult_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much ht does the model with 10x mult. 1 have?
SELECT ht FROM table_27277284_28 WHERE mult_1 = "10x"
sql_create_context
CREATE TABLE table_13618358_1 ( income_poverty_f VARCHAR, services_ VARCHAR, _cons_truction_b VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How low was the income where services is 72.5?
SELECT income_poverty_f FROM table_13618358_1 WHERE services_ & _cons_truction_b = "72.5"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of patients who had allo hem stem ct w/o pur and died in or before the year 2138?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.short_title = "Allo hem stem ct w/o pur"
mimicsql_data
CREATE TABLE table_7631 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "\"Coat of Cash\" Wearing Celebrity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest of Episode Number that has a Air Date on 20 july 2007?
SELECT MIN("Episode Number") FROM table_7631 WHERE "Air Date" = '20 july 2007'
wikisql
CREATE TABLE Services ( Service_ID VARCHAR, Service_Type_Code VARCHAR ) CREATE TABLE EVENTS ( event_details VARCHAR, Service_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the event details of the services that have the type code 'Marriage'?
SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage'
sql_create_context
CREATE TABLE table_name_62 ( team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st leg of bp. honv d team #2?
SELECT 1 AS st_leg FROM table_name_62 WHERE team__number2 = "bp. honvéd"
sql_create_context
CREATE TABLE table_17943 ( "Year" real, "Starts" real, "Wins (Majors)" text, "2nd" real, "3rd" real, "Earnings ($)" real, "Money list rank" text, "Scoring average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of scoring average for money list rank of 174
SELECT COUNT("Scoring average") FROM table_17943 WHERE "Money list rank" = '174'
wikisql
CREATE TABLE table_name_23 ( points INTEGER, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which gc37-01 v10 engine has the fewest points?
SELECT MIN(points) FROM table_name_23 WHERE engine = "gc37-01 v10"
sql_create_context
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the ids and details of events that have more than one participants Visualize by bar chart, and I want to show in ascending by the Y.
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID
nvbench
CREATE TABLE table_19439864_2 ( tromsø INTEGER, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the total score is 740, what is tromso?
SELECT MIN(tromsø) FROM table_19439864_2 WHERE total = 740
sql_create_context
CREATE TABLE table_2417340_4 ( successor VARCHAR, vacator VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the successor for vacant louisiana 5th
SELECT successor FROM table_2417340_4 WHERE vacator = "Vacant" AND district = "Louisiana 5th"
sql_create_context
CREATE TABLE table_45612 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team did gonzalo arconada manage?
SELECT "Team" FROM table_45612 WHERE "Outgoing manager" = 'gonzalo arconada'
wikisql
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 ) 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For each film, show the price and group them by cinema name in a stacked bar chart, and list Y from high to low order.
SELECT Name, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title, Name ORDER BY Price DESC
nvbench
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE 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 time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE month ( month_number int, month_name text ) 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 airline ( airline_code varchar, airline_name text, note text ) 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 code_description ( code varchar, description text ) 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least expensive one way ticket from ATLANTA to DENVER leaving on 10 12
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND DATE_DAY_1.day_number = 12 AND DATE_DAY_1.month_number = 10 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND flight.flight_days = DAYS_1.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND DATE_DAY_0.day_number = 12 AND DATE_DAY_0.month_number = 10 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND fare_basis.basis_days = DAYS_0.days_code AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, date_day AS DATE_DAYalias2, date_day AS DATE_DAYalias3, days AS DAYSalias2, days AS DAYSalias3, fare AS FAREalias1, fare_basis AS FARE_BASISalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE ((CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'DENVER' AND DATE_DAYalias3.day_number = 12 AND DATE_DAYalias3.month_number = 10 AND DATE_DAYalias3.year = 1991 AND DAYSalias3.day_name = DATE_DAYalias3.day_name AND FLIGHTalias1.flight_days = DAYSalias3.days_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'ATLANTA' AND DATE_DAYalias2.day_number = 12 AND DATE_DAYalias2.month_number = 10 AND DATE_DAYalias2.year = 1991 AND DAYSalias2.day_name = DATE_DAYalias2.day_name AND FARE_BASISalias1.basis_days = DAYSalias2.days_code AND FAREalias1.fare_basis_code = FARE_BASISalias1.fare_basis_code AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) AND FAREalias1.round_trip_required = 'NO')
atis
CREATE TABLE table_name_35 ( first_match VARCHAR, final_position VARCHAR, final_round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did the first match occur for the competition that ended with a final position of winners and the final round in the finals?
SELECT first_match FROM table_name_35 WHERE final_position = "winners" AND final_round = "finals"
sql_create_context
CREATE TABLE table_name_67 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was home team South Melbourne's opponents score?
SELECT away_team AS score FROM table_name_67 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the papers which have 'Olin Shivers' as an author.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers"
spider
CREATE TABLE schedule ( film_id VARCHAR, show_times_per_day INTEGER ) CREATE TABLE film ( directed_by VARCHAR, film_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show director with the largest number of show times in total.
SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1
sql_create_context
CREATE TABLE table_13592 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constituency number has a name of Timarni?
SELECT "Constituency number" FROM table_13592 WHERE "Name" = 'timarni'
wikisql
CREATE TABLE table_name_20 ( league VARCHAR, nationality VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which league's nationality was Italy when there were 62 points?
SELECT league FROM table_name_20 WHERE nationality = "italy" AND points = "62"
sql_create_context
CREATE TABLE table_name_35 ( grid VARCHAR, bike VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number for grid with a Suzuki GSX-R1000 K7 for +13.283?
SELECT COUNT(grid) FROM table_name_35 WHERE bike = "suzuki gsx-r1000 k7" AND time = "+13.283"
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, max_wind_Speed_mph INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the date and mean humidity for the top 3 days with the largest max gust speeds? Return me a bar chart.
SELECT date, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
CREATE TABLE table_66980 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the years for dannevirke south school
SELECT "Years" FROM table_66980 WHERE "Name" = 'dannevirke south school'
wikisql
CREATE TABLE table_name_92 ( draw INTEGER, points VARCHAR, match VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest draw that has points greater than 4, with a match greater than 5?
SELECT MAX(draw) FROM table_name_92 WHERE points > 4 AND match > 5
sql_create_context
CREATE TABLE table_16432543_1 ( nickname VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many nicknames does the school in Newark, DE have
SELECT COUNT(nickname) FROM table_16432543_1 WHERE location = "Newark, DE"
sql_create_context
CREATE TABLE table_71840 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country watch Tom Watson at t9 score 72-72=144?
SELECT "Country" FROM table_71840 WHERE "Place" = 't9' AND "Score" = '72-72=144' AND "Player" = 'tom watson'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) 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 PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) 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 ReviewTaskResultTypes ( 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 PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Jason Goemaat upvotes by tag.
SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC
sede
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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id 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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which useful courses are available before taking EMBA 628 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'EMBA' AND number = 628
advising
CREATE TABLE student_course_registrations ( student_id number, course_id number, registration_date time ) CREATE TABLE addresses ( address_id number, line_1 text, line_2 text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE courses ( course_id text, course_name text, course_description text, other_details text ) CREATE TABLE people ( person_id number, first_name text, middle_name text, last_name text, cell_mobile_number text, email_address text, login_name text, password text ) CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE student_course_attendance ( student_id number, course_id number, date_of_attendance time ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessment_outcome_code text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many students attend course English?
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English"
spider
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of patients whose admission year is less than 2152 and diagnoses short title is nb obs genetc/metabl cnd?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2152" AND diagnoses.short_title = "NB obs genetc/metabl cnd"
mimicsql_data
CREATE TABLE table_69301 ( "Year" real, "Artist" text, "Album / Song" text, "Award" text, "Result / Category" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which result is older than 2007?
SELECT "Result / Category" FROM table_69301 WHERE "Year" < '2007'
wikisql
CREATE TABLE table_21886 ( "Tie no" real, "Home team" text, "Score 1" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tie number featured Chelsea as the home team?
SELECT MIN("Tie no") FROM table_21886 WHERE "Home team" = 'Chelsea'
wikisql
CREATE TABLE Financial_transactions ( transaction_type VARCHAR, transaction_amount INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the transaction types and the total amount of transactions.
SELECT transaction_type, SUM(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
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_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY number, ILL_PAY number, CIVIL_SUBSIDY number, PER_SOL number, PER_EXP number, DATA_ID text, SYNC_TIME time, OUT_HOSP_DATE time, CLINIC_ID text, MED_TYPE number, INSURED_STS text, INSURED_IDENTITY number, TRADE_TYPE number, RECIPE_BILL_ID text, ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, RECEIVER_DEAL_ID text, SENDER_REVOKE_ID text, RECEIVER_REVOKE_ID text, SENDER_OFFSET_ID text, RECEIVER_OFFSET_ID text, LAS_OVE_PAY number, OVE_ADD_PAY number, SUP_ADD_PAY number, CKC102 number, CASH_PAY number, COM_ACC_PAY number, ENT_ACC_PAY number, ENT_PAY number, COM_PAY number, OLDC_FUND_PAY number, SPE_FUND_PAY number ) CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG number, FLX_MED_ORG_ID text, MED_SER_ORG_NO text, CLINIC_TYPE text, MED_TYPE number, CLINIC_ID text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, INPT_AREA_BED text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, MAIN_COND_DES text, INSU_TYPE text, IN_HOSP_DAYS number, MED_AMOUT number, FERTILITY_STS number, DATA_ID text, SYNC_TIME time, REIMBURSEMENT_FLG number, HOSP_LEV number, HOSP_STS number, INSURED_IDENTITY number, SERVANT_FLG text, TRADE_TYPE number, INSURED_STS text, REMOTE_SETTLE_FLG text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 患有精神障碍的病人在医院0440426入院期间的医疗记录中最低和最高医疗费总钱数是多少元?
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 = '0440426' AND IN_DIAG_DIS_NM = '精神障碍')
css
CREATE TABLE table_1393 ( "Television Station" text, "Frequency" text, "Site" text, "Transmitted" text, "Network" text, "Status" text, "Country of Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the site(s) for tv station 8tv?
SELECT "Site" FROM table_1393 WHERE "Television Station" = '8TV'
wikisql
CREATE TABLE table_37997 ( "Game" real, "April" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game is the lowest one that has Points smaller than 92?
SELECT MIN("Game") FROM table_37997 WHERE "Points" < '92'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text, VAL_UNIT text, DOSE_UNIT text, DOSE_FORM text, SPEC text, USE_FRE text, EACH_DOSAGE text, QTY number, UNIVALENT number, AMOUNT number, SELF_PAY_PRO number, RER_SOL number, SELF_PAY_AMO number, UP_LIMIT_AMO number, OVE_SELF_AMO number, EXP_OCC_DATE time, RECIPE_BILL_ID text, FLX_MED_ORG_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, HOSP_DOC_CD text, HOSP_DOC_NM text, REF_STA_FLG number, DATA_ID text, SYNC_TIME time, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, TRADE_TYPE number, STA_FLG number, STA_DATE time, REIMBURS_TYPE number, FXBZ number, REMOTE_SETTLE_FLG text ) CREATE TABLE t_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. -- 方光华这位患者自07.7.13起,到21.5.12止,看过病的医院总共有多少家
SELECT COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '方光华' AND IN_HOSP_DATE BETWEEN '2007-07-13' AND '2021-05-12'
css
CREATE TABLE table_13570_1 ( nucleus VARCHAR, cytoplasm VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The pink cytoplasm will have a nucleus of what color?
SELECT nucleus FROM table_13570_1 WHERE cytoplasm = "Pink"
sql_create_context
CREATE TABLE table_7763 ( "Year" real, "Team" text, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest year that a player from midfield won first team honors?
SELECT MIN("Year") FROM table_7763 WHERE "Team" = 'first team' AND "Position" = 'midfield'
wikisql
CREATE TABLE table_10980 ( "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. -- Which home team has a crowd that is bigger than 22,449?
SELECT "Home team" FROM table_10980 WHERE "Crowd" > '22,449'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 医疗就诊96400515777中,列出异地结算的所有费用明细项目
SELECT t_kc22.MED_EXP_DET_ID FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '96400515777' AND t_kc22.REMOTE_SETTLE_FLG = '异地1' OR t_kc22.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE 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 gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE area ( course_id int, area varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What classes are necessary to declare a major in MODGREEK ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%MODGREEK%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_61144 ( "Year" real, "Winner" text, "Sport" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hometown of the player who went to college at USC?
SELECT "Hometown" FROM table_61144 WHERE "College" = 'usc'
wikisql
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name, account type, and account balance corresponding to the customer with the highest credit score?
SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
spider
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE route ( train_id int, station_id int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Compare the number of the local authority by the local authority.
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority
nvbench
CREATE TABLE table_name_1 ( content VARCHAR, television_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What content is provided by the television service ewtn?
SELECT content FROM table_name_1 WHERE television_service = "ewtn"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For those employees whose first name does not contain the letter M, give me a line chart to show the hire date and the corresponding salaries, and show X-axis from high to low order.
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_12286195_1 ( original_team VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original team of the celebrity who had the result 08 fired in week 10 (2008-03-06)
SELECT original_team FROM table_12286195_1 WHERE result = "08 Fired in week 10 (2008-03-06)"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, WDBZ number, XL number, YLJGDM text, ZSEBZ number, ZZBZ number, ZZYSGH text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 门诊上一般被诊断为疾病O32.933的患者的检测指标830460数值的平均值以及最值会是怎样的数据
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'O32.933' AND jyjgzbb.JCZBDM = '830460'
css
CREATE TABLE table_3033 ( "Borough" text, "County" text, "Franchise type" text, "Members" real, "Voters in 1800" real, "Times contested" real, "Fate in 1832" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which county has a membership of 1, a franchise type of corporation and a borough of Ennis?
SELECT "County" FROM table_3033 WHERE "Members" = '1' AND "Franchise type" = 'Corporation' AND "Borough" = 'Ennis'
wikisql
CREATE TABLE table_name_29 ( partner VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the partner with a score of 6 1, 6 4?
SELECT partner FROM table_name_29 WHERE score = "6–1, 6–4"
sql_create_context