instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '魏倚云' | css |
CREATE TABLE table_2066296_5 (
red__e8_ VARCHAR,
interior_roof VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different results for red (e8) does the model with parchment/saddle interior/roof have?
| SELECT COUNT(red__e8_) FROM table_2066296_5 WHERE interior_roof = "Parchment/saddle" | sql_create_context |
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,
... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mz... | css |
CREATE TABLE table_1844 (
"Date(s)" text,
"Venue" text,
"City, state" text,
"Ticket price(s)" text,
"Ticket sold / available" text,
"Ticket grossing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue is in Wantagh, New York?
| SELECT "Venue" FROM table_1844 WHERE "City, state" = 'Wantagh, New York' | wikisql |
CREATE TABLE table_174151_5 (
power_provided VARCHAR,
transfer_speed__mb_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the power provided for transfer speed mb/s is 1250
| SELECT power_provided FROM table_174151_5 WHERE transfer_speed__mb_s_ = "1250" | sql_create_context |
CREATE TABLE table_name_10 (
position INTEGER,
team VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest position for Nelson, with a played entry of more than 24?
| SELECT MAX(position) FROM table_name_10 WHERE team = "nelson" AND played > 24 | sql_create_context |
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 medication (
medi... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-754')) AND intakeoutput.cellpath LIKE '%intake%' ... | eicu |
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', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL)) AND transfers.... | mimic_iii |
CREATE TABLE table_name_52 (
indicia VARCHAR,
end_month VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Indicia has anEnd month in feb-75?
| SELECT indicia FROM table_name_52 WHERE end_month = "feb-75" | sql_create_context |
CREATE TABLE table_56899 (
"Week" real,
"EASTERN #1" text,
"Eastern #2" text,
"WESTERN #1" text,
"Western #2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the wekk for eastern #2 of houston
| SELECT "Week" FROM table_56899 WHERE "Eastern #2" = 'houston' | wikisql |
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 demographic ... | SELECT procedures.short_title, prescriptions.formulary_drug_cd FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "24425" | mimicsql_data |
CREATE TABLE table_28506 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The order # is what for the week # Top 10?
| SELECT "Order #" FROM table_28506 WHERE "Week #" = 'Top 10' | wikisql |
CREATE TABLE table_23812 (
"Date of opinion poll" text,
"Conductor" text,
"Sample size" real,
"For" text,
"Against" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who conducted the poll with sample size of 2000 that shows 18% u... | SELECT "Conductor" FROM table_23812 WHERE "Undecided" = '18%' AND "Sample size" = '2000' | wikisql |
CREATE TABLE table_27755 (
"Series" real,
"Season" text,
"Played in" text,
"First Match" text,
"Tests played (sched)" text,
"Tests won by Australia" real,
"Tests won by England" real,
"Tests drawn" real,
"Series result" text,
"Holder at series end" text
)
-- Using valid SQLite,... | SELECT COUNT("Tests won by Australia") FROM table_27755 WHERE "Series" = '10' | wikisql |
CREATE TABLE table_name_68 (
date VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has a Stage of 12?
| SELECT date FROM table_name_68 WHERE stage = "12" | sql_create_context |
CREATE TABLE table_1028356_3 (
opponents VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many matches where played with Jim Pugh?
| SELECT COUNT(opponents) FROM table_1028356_3 WHERE partner = "Jim Pugh" | sql_create_context |
CREATE TABLE table_3305 (
"Season" real,
"Champion" text,
"Second" text,
"Third" text,
"Team Champion" text,
"National Trophy/Rookie" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the national trophy/rookie is Gerrard Barrabeig, what is the ... | SELECT "Second" FROM table_3305 WHERE "National Trophy/Rookie" = 'Gerrard Barrabeig' | wikisql |
CREATE TABLE table_name_40 (
qual_2 VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Qual 2 which has the name of katherine legge
| SELECT qual_2 FROM table_name_40 WHERE name = "katherine legge" | sql_create_context |
CREATE TABLE table_33328 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did South Melbourne play as the Away t... | SELECT "Date" FROM table_33328 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.long_title = "Pressure ulcer, unstageable" | mimicsql_data |
CREATE TABLE table_26606 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the final score for week 5
| SELECT "Final Score" FROM table_26606 WHERE "Week" = '5' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.short_title = "Adv eff corticosteroids" | mimicsql_data |
CREATE TABLE table_1341423_40 (
party VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the party for the district south carolina 4?
| SELECT party FROM table_1341423_40 WHERE district = "South Carolina 4" | sql_create_context |
CREATE TABLE table_name_77 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss of the game when the record was 20-16?
| SELECT loss FROM table_name_77 WHERE record = "20-16" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "STERNAL WOUND INFECTION" | mimicsql_data |
CREATE TABLE table_name_88 (
league INTEGER,
play_offs VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the lowest league for play-offs more than 0 and total of 25
| SELECT MIN(league) FROM table_name_88 WHERE play_offs > 0 AND total = 25 | sql_create_context |
CREATE TABLE table_59858 (
"Team" text,
"Average" real,
"Points" real,
"Played" real,
"1991-92" text,
"1992-93" text,
"1993-94" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1991-92 has a 1993-94 smaller than 34, and a Team of argenti... | SELECT "1991-92" FROM table_59858 WHERE "1993-94" < '34' AND "Team" = 'argentinos juniors' | wikisql |
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,
... | 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.long_title = "Diabetes with ketoacidosis, type I [juvenile type], not stated as uncontrolled" | mimicsql_data |
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 ... | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_48107 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Worldwide Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average rank for the film directed by roland emmerich under the studio of 20th centur... | SELECT AVG("Rank") FROM table_48107 WHERE "Studio" = '20th century fox' AND "Director" = 'roland emmerich' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name... | SELECT P.Title, P.Id AS "post_link", P.Score AS Score, P.FavoriteCount AS Favorites, P.ViewCount AS "views" FROM Posts AS P WHERE P.Tags LIKE '%<##tag?julia##>%' AND NOT P.CommunityOwnedDate IS NULL AND NOT P.Title IS NULL ORDER BY Score DESC LIMIT 100 | sede |
CREATE TABLE table_386 (
"Component" text,
"Integrated" text,
"Allied-Related" text,
"Allied-Unrelated" text,
"Holding" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many integrated allied-related are there?
| SELECT "Integrated" FROM table_386 WHERE "Allied-Related" = 'Many' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab.itemid = "50818" | mimicsql_data |
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 ... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '7475007' AND wdmzjzjlb.RYDJSJ BETWEEN '2009-03-06' AND '2018-12-10' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 9 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '7475007' AND bdmzjzjlb.RYDJSJ BETWEEN '2009-03-06' AND '2018-12-10' AND DATEDIFF(bd... | css |
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 patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'fever' AND STRFTIME('%y', diagnosis.diagnosistime) = '2103') | eicu |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subje... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment | nvbench |
CREATE TABLE table_76638 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did player steve jones, who had a t60 finish, win?
| SELECT "Year(s) won" FROM table_76638 WHERE "Finish" = 't60' AND "Player" = 'steve jones' | wikisql |
CREATE TABLE table_80331 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party had a member from the state of Vic and an Electorate called Wannon?
| SELECT "Party" FROM table_80331 WHERE "State" = 'vic' AND "Electorate" = 'wannon' | wikisql |
CREATE TABLE table_20217 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the interview subject when the centerfold mod... | SELECT COUNT("Interview subject") FROM table_20217 WHERE "Centerfold model" = 'Sherry Arnett' | wikisql |
CREATE TABLE table_name_59 (
d__max_ VARCHAR,
morse_taper_number VARCHAR,
c__max_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a Morse Taper number less than 3 and a C (max) of 59.5 what is the total of D (max)?
| SELECT COUNT(d__max_) FROM table_name_59 WHERE morse_taper_number < 3 AND c__max_ = 59.5 | sql_create_context |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid ... | SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'daniela witten' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom t... | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3663)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes cticu c... | mimic_iii |
CREATE TABLE table_204_525 (
id number,
"rank" number,
"player" text,
"county" text,
"tally" text,
"total" number,
"opposition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in the 197172 national hurling league , how many players from cork... | SELECT COUNT("player") FROM table_204_525 WHERE "county" = 'cork' AND "rank" <= 15 | squall |
CREATE TABLE table_79275 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text,
"Year(s) retired" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Class" FROM table_79275 WHERE "Wheel arrangement" = '2-8-2' AND "Quantity made" = '25' | wikisql |
CREATE TABLE table_name_5 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue is on the date of 8/6/03
| SELECT venue FROM table_name_5 WHERE date = "8/6/03" | sql_create_context |
CREATE TABLE table_43508 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance date of the game home team Shrewsbury Town played?
| SELECT "Attendance" FROM table_43508 WHERE "Home team" = 'shrewsbury town' | wikisql |
CREATE TABLE table_name_83 (
to_par INTEGER,
player VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest to par of player len mattiace, who has a t7 place and a score of 73-74=147?
| SELECT MAX(to_par) FROM table_name_83 WHERE place = "t7" AND score = 73 - 74 = 147 AND player = "len mattiace" | 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 C.PostId AS "post_link", C.Score, C.Text FROM Comments AS C WHERE C.UserId = '##UserId##' ORDER BY C.Score DESC LIMIT 20 | sede |
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_gender VARCHAR(1),
staff_name VARCHAR(80)
)
CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VARCHAR(80),
su... | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code | nvbench |
CREATE TABLE table_6133 (
"Year" real,
"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 is the purse when Aidan O'brien was the trainer?
| SELECT "Purse" FROM table_6133 WHERE "Trainer" = 'aidan o''brien' | wikisql |
CREATE TABLE table_23273 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the candidates in Florida 13 district?
| SELECT "Candidates" FROM table_23273 WHERE "District" = 'Florida 13' | wikisql |
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room INTEGER,
StayStart DATETIME,
StayEnd DATETIME
)
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Physician (
EmployeeID... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID | nvbench |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '4523226' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) UNION SELECT fgwyjzb.MED_ORG_D... | css |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500 DESC | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_11854 (
"Client" text,
"Windows" text,
"GNU/Linux" text,
"Mac OS X" text,
"Haiku" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Mac OSX's GNU/Linux was yes when Windows was no?
| SELECT "Mac OS X" FROM table_11854 WHERE "GNU/Linux" = 'yes' AND "Windows" = 'no' | wikisql |
CREATE TABLE table_1706942_1 (
q1_order VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Q1 figures are given for Alexander Wurz?
| SELECT COUNT(q1_order) FROM table_1706942_1 WHERE driver = "Alexander Wurz" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Vecuronium Bromide" | mimicsql_data |
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 aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... | atis |
CREATE TABLE table_name_51 (
total_rebounds VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rebounds have a Player of herb estes?
| SELECT COUNT(total_rebounds) FROM table_name_51 WHERE player = "herb estes" | sql_create_context |
CREATE TABLE table_15102 (
"Model" text,
"Seats" text,
"Period" text,
"Built" text,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what time period were 354 built?
| SELECT "Period" FROM table_15102 WHERE "Built" = '354' | wikisql |
CREATE TABLE table_43020 (
"Country" text,
"Area (km\u00b2)" text,
"Population (2011 est.)" text,
"Population density (per km\u00b2)" text,
"GDP (PPP) $M USD" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a population of 3,221,216... | SELECT "Country" FROM table_43020 WHERE "Population (2011 est.)" = '3,221,216' | wikisql |
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,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V6284" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_57 (
gold VARCHAR,
rank VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Gold medals for the country with a Rank of 1 and less than 2 Total medals?
| SELECT COUNT(gold) FROM table_name_57 WHERE rank = "1" AND total < 2 | sql_create_context |
CREATE TABLE table_19139 (
"EDO Flight" real,
"Shuttle" text,
"Mission" text,
"Launch Date" text,
"Duration" text,
"Primary Payload(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the edo flight with duration being 17 days, 15 hours, 5... | SELECT "EDO Flight" FROM table_19139 WHERE "Duration" = '17 days, 15 hours, 53 minutes, 18 seconds' | wikisql |
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER
)
CR... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "EMERGENCY" | mimicsql_data |
CREATE TABLE table_79578 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The New York Jets picked someone from what college?
| SELECT "College" FROM table_79578 WHERE "Team" = 'new york jets' | wikisql |
CREATE TABLE table_26075 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text,
"Leagues entering at this round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which leag... | SELECT "Leagues entering at this round" FROM table_26075 WHERE "Round" = 'Extra Preliminary Round' | wikisql |
CREATE TABLE table_359 (
"Launch Vehicle" text,
"Launch date" text,
"Mission" text,
"Institutional authority" text,
"Launch site" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which missions were scheduled to launch on November ... | SELECT "Mission" FROM table_359 WHERE "Launch date" = 'November 16, 2006' | wikisql |
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(... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_41514 (
"Nation" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Blank Ends when there are less than 39 en... | SELECT "Blank Ends" FROM table_41514 WHERE "Ends Won" < '39' AND "Ends Lost" > '35' AND "Stolen Ends" = '4' | wikisql |
CREATE TABLE table_2668243_17 (
candidates VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the candidates for selah r. hobbie
| SELECT candidates FROM table_2668243_17 WHERE incumbent = "Selah R. Hobbie" | sql_create_context |
CREATE TABLE table_79210 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has a rank smaller than 6, a time of 6:32.32 and notes of FB?
| SELECT "Country" FROM table_79210 WHERE "Rank" < '6' AND "Notes" = 'fb' AND "Time" = '6:32.32' | wikisql |
CREATE TABLE table_33438 (
"Country Name" text,
"1961-65" text,
"1966-70" text,
"1971-75" text,
"1976-80" text,
"1981-85" text,
"1986-90" text,
"1991-95" text,
"1996\u20132000" text,
"2001-05" text,
"2006-10" text
)
-- Using valid SQLite, answer the following questions for ... | SELECT "2001-05" FROM table_33438 WHERE "1981-85" = '-3.48%' | wikisql |
CREATE TABLE table_name_11 (
winner VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Winner, when Year is 2013?
| SELECT winner FROM table_name_11 WHERE year = 2013 | sql_create_context |
CREATE TABLE table_204_609 (
id number,
"year" number,
"car" number,
"start" number,
"qual" number,
"rank" number,
"finish" number,
"laps" number,
"led" number,
"retired" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was th... | SELECT "year" FROM table_204_609 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_2071644_1 (
moment_of_inertia_in_torsion__j___cm_4__ VARCHAR,
beam_height__mm_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the moment of intertia in torsion (j) Cm4) for the beam height (mm) 120??=
| SELECT COUNT(moment_of_inertia_in_torsion__j___cm_4__) FROM table_2071644_1 WHERE beam_height__mm_ = 120 | sql_create_context |
CREATE TABLE table_name_81 (
year VARCHAR,
points VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year had 0 points and an AGS JH23B chassis?
| SELECT year FROM table_name_81 WHERE points = 0 AND chassis = "ags jh23b" | sql_create_context |
CREATE TABLE Catalog_Structure (
catalog_level_name VARCHAR,
catalog_level_number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name and level of catalog structure with level between 5 and 10.
| SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 | sql_create_context |
CREATE TABLE table_22011138_7 (
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the POS is 3, what is the 08 points?
| SELECT 08 AS _pts FROM table_22011138_7 WHERE pos = 3 | sql_create_context |
CREATE TABLE table_name_47 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the home team when melbourne is the away team?
| SELECT home_team AS score FROM table_name_47 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '21... | mimic_iii |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Ar... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category | nvbench |
CREATE TABLE table_78617 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT AVG("Wins") FROM table_78617 WHERE "Goal Difference" > '12' AND "Club" = 'granada cf' AND "Played" > '30' | wikisql |
CREATE TABLE table_name_34 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest laps for Time/Retired of + 2 laps, and a Grid of 13?
| SELECT MAX(laps) FROM table_name_34 WHERE time_retired = "+ 2 laps" AND grid = 13 | 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 SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '8198670' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-08' AND '2002-09-20' | css |
CREATE TABLE injury_accident (
game_id VARCHAR
)
CREATE TABLE game (
id VARCHAR,
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the ids, scores, and dates of the games which caused at least two injury accidents?
| SELECT T1.id, T1.score, T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_203_554 (
id number,
"year" number,
"place" text,
"gold" text,
"silver" text,
"bronze" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the total number of times the soviet union is listed under the gold column ?
| SELECT COUNT(*) FROM table_203_554 WHERE "gold" = 'soviet union' | squall |
CREATE TABLE browser (
id VARCHAR,
name VARCHAR
)
CREATE TABLE accelerator_compatible_browser (
compatible_since_year VARCHAR,
browser_id VARCHAR,
accelerator_id VARCHAR
)
CREATE TABLE web_client_accelerator (
id VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questio... | SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer' | sql_create_context |
CREATE TABLE table_12588 (
"Outcome" text,
"Date" text,
"Category" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the tournament played on Clay Surface ag... | SELECT "Score" FROM table_12588 WHERE "Surface" = 'clay' AND "Opponent" = 'pablo martin-adalia' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_37632 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Adam Thompson play in the final?
| SELECT "Date" FROM table_37632 WHERE "Opponent in the final" = 'adam thompson' | wikisql |
CREATE TABLE table_19963 (
"Year (Ceremony)" real,
"Original title" text,
"English title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director of Pecado Mortal
| SELECT "Director" FROM table_19963 WHERE "Original title" = 'Pecado Mortal' | wikisql |
CREATE TABLE table_name_99 (
points VARCHAR,
position VARCHAR,
loses VARCHAR,
goals_scored VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points are there with more losses than 16, more goals than 44, and a smaller position than 13?
| SELECT COUNT(points) FROM table_name_99 WHERE loses > 16 AND goals_scored > 44 AND position < 13 | sql_create_context |
CREATE TABLE table_74963 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament has an Outcome of winner on 19 october 2008?
| SELECT "Tournament" FROM table_74963 WHERE "Outcome" = 'winner' AND "Date" = '19 october 2008' | wikisql |
CREATE TABLE table_31167 (
"District" real,
"Representative" text,
"Party" text,
"Residence" text,
"First Elected" text,
"Term Limited" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which party is the newark representative from
| SELECT "Party" FROM table_31167 WHERE "Residence" = 'Newark' | wikisql |
CREATE TABLE statements (
statement_id number,
statement_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE documents (
docum... | SELECT COUNT(*) FROM documents | spider |
CREATE TABLE table_name_56 (
game INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the highest Game that has the Opponent of atlanta hawks?
| SELECT MAX(game) FROM table_name_56 WHERE opponent = "atlanta hawks" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.