instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_10015132_1 ( position VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the player from Baylor play?
SELECT position FROM table_10015132_1 WHERE school_club_team = "Baylor"
sql_create_context
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,...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '云雅容' AND t_kc21.MED_SER_ORG_NO = '0201692' AND t_kc21.IN_DIAG_DIS_NM LIKE '%紧张%'
css
CREATE TABLE table_name_48 ( height VARCHAR, club VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of val rie dionne at Club Sainte-Foy?
SELECT height FROM table_name_48 WHERE club = "sainte-foy" AND name = "valérie dionne"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
SELECT KH, KLX FROM mzjzjlb WHERE JZLSH = '04835754334'
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, F...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '32284795' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1441.3)
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-39724')) AND STRFTIME('%y', medication.drugstarttime) <= '2104'
eicu
CREATE TABLE table_name_2 ( ranking INTEGER, nationality VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of ranking when the nationalits is England with more than 53 goals?
SELECT SUM(ranking) FROM table_name_2 WHERE nationality = "england" AND goals > 53
sql_create_context
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 ) CRE...
SELECT COUNT(s.userId) FROM (SELECT u.Id AS userId, COUNT(p.Id) AS answerCount FROM Users AS u JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 GROUP BY u.Id) AS s WHERE s.AnswerCount >= '##minAnswers##'
sede
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 ...
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_...
mimic_iii
CREATE TABLE table_2508633_6 ( pick__number INTEGER, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most pick number for illinois
SELECT MAX(pick__number) FROM table_2508633_6 WHERE college = "Illinois"
sql_create_context
CREATE TABLE table_name_38 ( frequency_mhz INTEGER, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Frequency MHz is the highest one that has a City of license of byron, ga?
SELECT MAX(frequency_mhz) FROM table_name_38 WHERE city_of_license = "byron, ga"
sql_create_context
CREATE TABLE table_20603 ( "Country" text, "Donor payment" text, "Children per donor" text, "Donor anonymity" text, "Allowed recipients" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the possible children per donor levels for countries where t...
SELECT "Children per donor" FROM table_20603 WHERE "Allowed recipients" = 'no data'
wikisql
CREATE TABLE table_19174 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 2-0 is the 1st leg what are the home (2nd leg)?
SELECT "Home (2nd leg)" FROM table_19174 WHERE "1st Leg" = '2-0'
wikisql
CREATE TABLE table_12017 ( "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 an Away team of melbourne?
SELECT "Home team" FROM table_12017 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_36064 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Rebounds" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest amount of 12 games and less than 48 rebounds?
SELECT MIN("Rank") FROM table_36064 WHERE "Games" = '12' AND "Rebounds" < '48'
wikisql
CREATE TABLE table_5174 ( "Rank" text, "Film" text, "Director(s)" text, "Writer(s)" text, "Production Company" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the nominated film, Badmouth?
SELECT "Director(s)" FROM table_5174 WHERE "Rank" = 'nominated' AND "Film" = 'badmouth'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_i...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY COUNT(date_of_transaction)
nvbench
CREATE TABLE table_44318 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the person with a 1:10.771 qual 2?
SELECT "Name" FROM table_44318 WHERE "Qual 2" = '1:10.771'
wikisql
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_52882 ( "Nationality" text, "Metric" text, "Imperial" text, "Name" text, "Lifespan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the nationality with the metric height of 2.36m named sun ming-ming?
SELECT "Nationality" FROM table_52882 WHERE "Metric" = '2.36m' AND "Name" = 'sun ming-ming'
wikisql
CREATE TABLE table_203_864 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- gene sarazen and denny shute are both from which country ?
SELECT "country" FROM table_203_864 WHERE "player" = 'gene sarazen'
squall
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 numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '秦霞雰' AND t_kc22.STA_DATE BETWEEN '2002-06-24' AND '2015-12-19' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_204_206 ( id number, "saros" number, "member" number, "date" text, "time\n(greatest)\nutc" text, "type" text, "location\nlat,long" text, "gamma" number, "mag." number, "width\n(km)" number, "duration\n(min:sec)" text, "ref" number ) -- Using valid SQL...
SELECT COUNT("saros") FROM table_204_206 WHERE "duration\n(min:sec)" >= 4
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, u...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
eicu
CREATE TABLE table_name_8 ( championship VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the championship during the match with the opponent of richard fromberg?
SELECT championship FROM table_name_8 WHERE opponent = "richard fromberg"
sql_create_context
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD...
css
CREATE TABLE table_name_15 ( date VARCHAR, score VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the Fifa World Cup with a Score of 1-0?
SELECT date FROM table_name_15 WHERE score = "1-0" AND competition = "fifa world cup"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT MIN(t.TagName) AS "tagname", AVG(p.Score) AS avgScore, COUNT(p.Id) AS nposts FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 GROUP BY pt.TagId HAVING COUNT(*) >= 30 ORDER BY AVG(p.Score) DESC LIMIT 50
sede
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT c.CreationDate, c.Id AS "comment_link" FROM Comments AS c WHERE c.Text LIKE '%`%' ORDER BY c.CreationDate DESC
sede
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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50804" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2114"
mimicsql_data
CREATE TABLE table_58296 ( "Team" text, "Make" text, "Driver" text, "Sponsor" text, "Car Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team does bobby hillin jr. (r) drive a buick regal for?
SELECT "Team" FROM table_58296 WHERE "Make" = 'buick regal' AND "Driver" = 'bobby hillin jr. (r)'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREAT...
SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY MAX(Age) DESC
nvbench
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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.admityear < "2146"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE table_name_81 ( rank INTEGER, publication VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Rank, when Publication is Dagsavisen, and when Year is less than 2005?
SELECT MAX(rank) FROM table_name_81 WHERE publication = "dagsavisen" AND year < 2005
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND procedures.short_title = "Cystoscopy NEC"
mimicsql_data
CREATE TABLE table_name_67 ( report VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who reported the game on 6 october?
SELECT report FROM table_name_67 WHERE date = "6 october"
sql_create_context
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, F...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '凤高翰' AND t_kc22.STA_DATE BETWEEN '2010-05-21' AND '2019-08-03' AND t_kc22.SELF_PAY_PRO < 0.48 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERS...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '16815496' AND jybgb.BGRQ BETWEEN '2006-09-29' AND '2016-...
css
CREATE TABLE table_42965 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record when the Nuggets are the home team?
SELECT "Record" FROM table_42965 WHERE "Home" = 'nuggets'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
SELECT DisplayName FROM Users WHERE Reputation = 31337
sede
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241) AND prescriptions.drug = 'meropenem' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname va...
SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'luke zettlemoyer' AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'siggraph' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_53286 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the attendance for when the washingt...
SELECT "Attendance" FROM table_53286 WHERE "Visitor" = 'washington wizards'
wikisql
CREATE TABLE first_notification_of_loss ( customer_id VARCHAR ) CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of users who do not have a first notification of loss record.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id
sql_create_context
CREATE TABLE table_name_42 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game played on 17 July 2008?
SELECT result FROM table_name_42 WHERE date = "17 july 2008"
sql_create_context
CREATE TABLE table_46792 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Played" FROM table_46792 WHERE "Points against" = '271'
wikisql
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 ...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'drsl/dslmb fus post/post') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 98235) AND STRFTIME('%y', ...
mimic_iii
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '邹阳旭' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '邹阳旭' GROUP BY gyb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT zyb.MED_SER_ORG_NO FROM zyb WHERE zyb.PERSON_NM = '邹阳旭' GROUP BY zyb.MED_...
css
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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_28 ( state_ranked_in_partisan_order VARCHAR, percentage_republicans VARCHAR, republican__democratic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state has 67% Republicans and a ratio of 24/12 of Republicans to Democrats?
SELECT state_ranked_in_partisan_order FROM table_name_28 WHERE percentage_republicans = "67%" AND republican__democratic = "24/12"
sql_create_context
CREATE TABLE table_name_23 ( frequency VARCHAR, branding VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Frequency's Branding is Your Cure for Corporate Radio?
SELECT frequency FROM table_name_23 WHERE branding = "your cure for corporate radio"
sql_create_context
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, ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8313730' AND t_kc21.IN_HOSP_DATE BETWEEN '2019-08-10' AND '2021-08-28' AND t_kc21.SERVANT_FLG = '公务员'
css
CREATE TABLE table_60515 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year was the match at Sopot with a Score of 2 6, 6 2, 6 3?
SELECT COUNT("Year") FROM table_60515 WHERE "Location" = 'sopot' AND "Score" = '2–6, 6–2, 6–3'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2203" AND diagnoses.icd9_code = "2662"
mimicsql_data
CREATE TABLE table_name_44 ( year INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average year when shri. shambu nath khajuria won the padma shri awards?
SELECT AVG(year) FROM table_name_44 WHERE name = "shri. shambu nath khajuria"
sql_create_context
CREATE TABLE table_train_121 ( "id" int, "depression" bool, "suicidality" bool, "neurodegenerative_disease" bool, "unstable_asthmatic_condition" bool, "vitamin_k_deficiency" bool, "renal_disease" bool, "cerebrovascular_disease" bool, "hepatic_disease" bool, "liver_disease" bool, ...
SELECT * FROM table_train_121 WHERE neurodegenerative_disease = 1 OR parkinson_disease = 1 OR lewy_body_dementia = 1 OR cerebrovascular_disease = 1
criteria2sql
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Visua...
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title
nvbench
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, F...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '卫若兰' AND qtb.MED_SER_ORG_NO = '6106826' AND qtb.OUT_DIAG_DOC_NM LIKE '谢%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '卫若兰' AND gyb.MED_SER_ORG_NO = '6106826' AND gyb.OUT_DIAG_DOC_NM LIKE '谢%' UNION ...
css
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( progr...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE table_name_72 ( binibining_pilipinas_world VARCHAR, second_runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Binibining Pilipinas-World has a Second runner-up of sonia santiago?
SELECT binibining_pilipinas_world FROM table_name_72 WHERE second_runner_up = "sonia santiago"
sql_create_context
CREATE TABLE table_name_79 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Carlton's away team opponent?
SELECT away_team FROM table_name_79 WHERE home_team = "carlton"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '51816664' AND t_kc22.STA_DATE BETWEEN '2011-09-07' AND '2018-07-17' AND t_kc22.t_kc21_MED_SER_ORG_NO = '6788679' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_53735 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver has 45 laps?
SELECT "Driver" FROM table_53735 WHERE "Laps" = '45'
wikisql
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, H...
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '41356793399'
css
CREATE TABLE table_71492 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years does plateau school serve?
SELECT "Years" FROM table_71492 WHERE "Name" = 'plateau school'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '58163756741'
css
CREATE TABLE table_train_163 ( "id" int, "pulse_oximetry" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "allergy_to_adhesive" bool, "creatinine_clearance_cl" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- pulse oxim...
SELECT * FROM table_train_163 WHERE pulse_oximetry < 90
criteria2sql
CREATE TABLE table_40841 ( "Western Title" text, "Chinese Title" text, "Pinyin" text, "Released Date" text, "Genre" text, "Game Modes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pinyin for the Chinese title ?
SELECT "Pinyin" FROM table_40841 WHERE "Chinese Title" = '直感一笔'
wikisql
CREATE TABLE table_204_212 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the only wager that is not hair ?
SELECT "wager" FROM table_204_212 WHERE "wager" <> 'hair'
squall
CREATE TABLE table_32228 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest round number that had an overall pick up 92?
SELECT MIN("Round") FROM table_32228 WHERE "Overall" = '92'
wikisql
CREATE TABLE table_204_851 ( id number, "serial number" number, "river" text, "name" text, "area (km2)" number, "district" text, "co-ordinate" text, "altitude (m)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many are in the pala...
SELECT COUNT(*) FROM table_204_851 WHERE "district" = 'palakkad'
squall
CREATE TABLE table_name_39 ( goals VARCHAR, latest_cap VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Latest cap of september 5, 2011 had how many goals?
SELECT goals FROM table_name_39 WHERE latest_cap = "september 5, 2011"
sql_create_context
CREATE TABLE table_30563 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many college/junior/club teams are from Sweden?
SELECT COUNT("College/junior/club team") FROM table_30563 WHERE "Nationality" = 'Sweden'
wikisql
CREATE TABLE table_name_47 ( game INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date of October 1 has what average game?
SELECT AVG(game) FROM table_name_47 WHERE date = "october 1"
sql_create_context
CREATE TABLE Project_outcomes ( project_id VARCHAR, outcome_code VARCHAR ) CREATE TABLE Projects ( project_details VARCHAR, project_id VARCHAR ) CREATE TABLE Research_outcomes ( outcome_code VARCHAR, outcome_description VARCHAR ) -- Using valid SQLite, answer the following questions for the ...
SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'
sql_create_context
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...
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 = 'N83.862' AND jyjgzbb.JCZBDM = '258272'
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%rajasthan, india%' OR UPPER(Location) LIKE '%Rajasthan, India%' OR Location LIKE '%rajasthan, india%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 25
sede
CREATE TABLE table_75650 ( "Borough or Census Area" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which borou...
SELECT "Borough or Census Area" FROM table_75650 WHERE "Median household income" = '$59,596'
wikisql
CREATE TABLE table_54486 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did the Utah Jazz Player from Southern Methodist, Play?
SELECT "Years for Jazz" FROM table_54486 WHERE "School/Club Team" = 'southern methodist'
wikisql
CREATE TABLE table_name_87 ( airline VARCHAR, iata VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What airline has a IATA of BX?
SELECT airline FROM table_name_87 WHERE iata = "bx"
sql_create_context
CREATE TABLE table_65768 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Ends" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest goal for a GEO nat., that ended after 2010?
SELECT MAX("Goals") FROM table_65768 WHERE "Nat." = 'geo' AND "Ends" > '2010'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'agitation - mild') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagno...
eicu
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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2165.0" AND procedures.icd9_code = "3523"
mimicsql_data
CREATE TABLE table_59893 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the UEFA Cup against Panathinaikos?
SELECT "Date" FROM table_59893 WHERE "Competition" = 'uefa cup' AND "Opponent" = 'panathinaikos'
wikisql
CREATE TABLE table_name_11 ( lane INTEGER, rank INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total lanes that have a rank larger than 22?
SELECT SUM(lane) FROM table_name_11 WHERE rank > 22
sql_create_context
CREATE TABLE table_name_34 ( set_1 VARCHAR, set_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Set 1 when Set 3 was 25 15?
SELECT set_1 FROM table_name_34 WHERE set_3 = "25–15"
sql_create_context
CREATE TABLE table_15063 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "Career Win-Loss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value in 2009 when 1R is in 2007?
SELECT "2009" FROM table_15063 WHERE "2007" = '1r'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "43" AND demographic.days_stay > "23"
mimicsql_data
CREATE TABLE table_35367 ( "Region" text, "Total Population" real, "Catholic" real, "% Catholic" text, "% of global Catholic pop." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the catholic when the % catholic is 1.39%?
SELECT "Catholic" FROM table_35367 WHERE "% Catholic" = '1.39%'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND lab.labname = 'crp' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIM...
eicu
CREATE TABLE table_54049 ( "Year" text, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text, "Purse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Winner in the Year of 2000?
SELECT "Winner" FROM table_54049 WHERE "Year" = '2000'
wikisql
CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text,...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', medication.drugstarttime) >= '2105' GROUP BY medication.drugn...
eicu
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,...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '70821376' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_19 ( yard_name VARCHAR, ship_types_delivered VARCHAR, total_vessels_built_for_usmc VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the yard name when the ship types delivered is n3 type, v4 type and the total vessels built ...
SELECT yard_name FROM table_name_19 WHERE ship_types_delivered = "n3 type, v4 type" AND total_vessels_built_for_usmc = "13 ships for usmc"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, pa...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'lithium' AND STRFTIME('%y', lab.labresulttime) <= '2100')
eicu
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT SALARY, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE Faculty ( rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ranks do we have for faculty?
SELECT DISTINCT rank FROM Faculty
sql_create_context