instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_204_265 (
id number,
"no." number,
"title (latin)" text,
"title (english translation)" text,
"subject" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many subjects are there ?
| SELECT COUNT("subject") FROM table_204_265 | squall |
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 patients (
... | SELECT AVG(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6921)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... | mimic_iii |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
X... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM mzjzjlb WHERE mzjzjlb.JZLSH = '43110591340' | css |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID | nvbench |
CREATE TABLE table_name_13 (
season INTEGER,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest season where Aisha Jefcoate was the runner-up?
| SELECT MIN(season) FROM table_name_13 WHERE runner_up = "aisha jefcoate" | sql_create_context |
CREATE TABLE table_68831 (
"District" text,
"Party" text,
"Religion" text,
"Former Experience" text,
"Assumed Office" real,
"Born In" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the delegate who has previous experience as a commissio... | SELECT "Born In" FROM table_68831 WHERE "Former Experience" = 'commissioner of health' | wikisql |
CREATE TABLE table_name_54 (
cuts_made INTEGER,
top_25 INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For top-25 values under 2, what is the average number of cuts made?
| SELECT AVG(cuts_made) FROM table_name_54 WHERE top_25 < 2 | sql_create_context |
CREATE TABLE table_47879 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of points associated with 165 laps?
| SELECT "Points" FROM table_47879 WHERE "Laps" = '165' | wikisql |
CREATE TABLE table_name_13 (
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tie no listed for the Away team of Barnet?
| SELECT tie_no FROM table_name_13 WHERE away_team = "barnet" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Anemia in neoplastic disease" | mimicsql_data |
CREATE TABLE table_23041 (
"No." real,
"Country" text,
"Local title" text,
"Format" text,
"Start Date" text,
"End Date" text,
"Episodes" real,
"Premiere/Air Dates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the television a... | SELECT "Premiere/Air Dates" FROM table_23041 WHERE "Start Date" = 'June 16' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
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 numb... | SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_CD = '923' AND STA_DATE BETWEEN '2001-01-19' AND '2021-03-03' AND SOC_SRT_DIRE_NM = '复合维生素B片' | css |
CREATE TABLE table_name_91 (
games VARCHAR,
ast_avg VARCHAR,
total_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games for the player that has an over 2.7 assist average and over 598 total assists?
| SELECT COUNT(games) FROM table_name_91 WHERE ast_avg > 2.7 AND total_assists > 598 | sql_create_context |
CREATE TABLE student_course_enrolment (
registration_id number,
student_id number,
course_id number,
date_of_enrolment time,
date_of_completion time
)
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE students (
student_id number,
date_of_registration time... | SELECT T2.date_of_enrolment FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" | spider |
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '86803950' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4134.59) | css |
CREATE TABLE table_62091 (
"Chassis code" text,
"Years" text,
"Model" text,
"Engine" text,
"Power" text,
"Torque" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the years for the 250 model?
| SELECT "Years" FROM table_62091 WHERE "Model" = '250' | wikisql |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT County, COUNT(County) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation GROUP BY County ORDER BY County DESC | nvbench |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60347) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine, body fluid') AND STRFTIME('%y-%m', labevents.charttime) <= '210... | mimic_iii |
CREATE TABLE table_45421 (
"Game" text,
"Date" text,
"Home team" text,
"Result" text,
"Road team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did Portland play game 5 at home?
| SELECT "Date" FROM table_45421 WHERE "Home team" = 'portland' AND "Game" = 'game 5' | wikisql |
CREATE TABLE table_76781 (
"Ranking" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2009 ranking for Webometrics?
| SELECT "2009" FROM table_76781 WHERE "Ranking" = 'webometrics' | wikisql |
CREATE TABLE table_name_49 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team score at victoria park?
| SELECT away_team AS score FROM table_name_49 WHERE venue = "victoria park" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" | mimicsql_data |
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
-- Using valid SQLite, answer the ... | SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY Result | nvbench |
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE... | SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington' | spider |
CREATE TABLE table_name_38 (
margin_of_victory VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the margin of victory for the win with a score of 71-69-71-70=281?
| SELECT margin_of_victory FROM table_name_38 WHERE winning_score = 71 - 69 - 71 - 70 = 281 | sql_create_context |
CREATE TABLE table_80227 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the 4 lane person from Canada?
| SELECT MIN("Heat") FROM table_80227 WHERE "Lane" = '4' AND "Nationality" = 'canada' | wikisql |
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 PostHistoryTypes (
Id numb... | SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE ViewCount >= 10 AND PostTypeId = 1 ORDER BY Score * 1000 / ViewCount DESC LIMIT 1000 | sede |
CREATE TABLE table_18461635_1 (
location VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the team in Sussex county located?
| SELECT location FROM table_18461635_1 WHERE county = "Sussex" | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | 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, flight WHERE ((((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 27 AND date_day.month_number = 8 AND... | atis |
CREATE TABLE table_29576 (
"Name/Name of Act" text,
"Age(s)" text,
"Genre" text,
"Act" text,
"Hometown" text,
"Qtr. Final (Week)" real,
"Semi Final (Week)" text,
"Position Reached" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ... | SELECT COUNT("Semi Final (Week)") FROM table_29576 WHERE "Hometown" = 'Pittsburgh, Pennsylvania' | wikisql |
CREATE TABLE table_name_93 (
player VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What T9 Player had a Score of 70-74-69-70=283?
| SELECT player FROM table_name_93 WHERE place = "t9" AND score = 70 - 74 - 69 - 70 = 283 | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_203_215 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- list the number of fukuoka marathons .
| SELECT COUNT(*) FROM table_203_215 WHERE "competition" = 'fukuoka marathon' | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND prescriptions.route = 'sl' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescr... | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '004-10432' AND STRFTIME('%y', patient.hospitaladmittime) <= '2103' | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND lab.labname = 'hgb' AND DATETIME(lab.labresulttime, 'start of mont... | eicu |
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 numb... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '34820583' AND t_kc22.STA_DATE BETWEEN '2013-07-20' AND '2018-09-21' AND t_kc22.SELF_PAY_PRO < 0.88 | 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 qtb.FLX_MED_ORG_ID FROM qtb WHERE qtb.MED_CLINIC_ID = '43267723179' UNION SELECT gyb.FLX_MED_ORG_ID FROM gyb WHERE gyb.MED_CLINIC_ID = '43267723179' UNION SELECT zyb.FLX_MED_ORG_ID FROM zyb WHERE zyb.MED_CLINIC_ID = '43267723179' UNION SELECT mzb.FLX_MED_ORG_ID FROM mzb WHERE mzb.MED_CLINIC_ID = '43267723179' | css |
CREATE TABLE table_202_83 (
id number,
"year" text,
"team" text,
"gp" number,
"gs" number,
"mpg" number,
"fg%" number,
"3p%" number,
"ft%" number,
"rpg" number,
"apg" number,
"spg" number,
"bpg" number,
"ppg" number
)
-- Using valid SQLite, answer the following ... | SELECT COUNT(*) FROM table_202_83 WHERE "ppg" >= 20 | squall |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'ringers solution,lactated' AND STRFTIME('%y', medication.drugstarttime) <= '2104') | eicu |
CREATE TABLE table_2420 (
"Political parties" text,
"% 2006" text,
"Seats 2006" real,
"% 2001" text,
"Seats 2001" real,
"% 1997" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many time was the political party the social democratic party of ... | SELECT COUNT("% 2006") FROM table_2420 WHERE "Political parties" = 'Social Democratic Party of Germany' | wikisql |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY Work_Type DESC | nvbench |
CREATE TABLE table_73467 (
"Episode Air Date" text,
"Audition City" text,
"First Audition Date" text,
"Audition Venue" text,
"Callback Date" text,
"Callback Venue" text,
"Guest Judge" text,
"Golden Tickets" real
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT COUNT("Guest Judge") FROM table_73467 WHERE "First Audition Date" = 'July 9, 2009' | wikisql |
CREATE TABLE table_61395 (
"Name" text,
"Season" text,
"Games" text,
"Goals" text,
"Assists" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were there in game 47?
| SELECT "Goals" FROM table_61395 WHERE "Games" = '47' | wikisql |
CREATE TABLE table_25383715_1 (
slno VARCHAR,
contact_person VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the SlNo no of contact person SDE (P), Thiruppattur?
| SELECT slno FROM table_25383715_1 WHERE contact_person = "SDE (P), Thiruppattur" | 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 demographic.gender, demographic.expire_flag FROM demographic WHERE demographic.name = "Estrella Carroll" | mimicsql_data |
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 numb... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '郎清俊' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 7585.12) | css |
CREATE TABLE table_8046 (
"Name" text,
"Death" text,
"Assumed Office" text,
"Left Office" text,
"Years in office" text,
"Monarch" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the person leave office who died on October 23, 188... | SELECT "Left Office" FROM table_8046 WHERE "Years in office" = '2' AND "Death" = 'october 23, 1887' | wikisql |
CREATE TABLE table_42944 (
"Year" text,
"Venue" text,
"Champion" text,
"Country" text,
"Score" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the champion in the match where C.A. Palmer was the runner-up?
| SELECT "Champion" FROM table_42944 WHERE "Runner-up" = 'c.a. palmer' | wikisql |
CREATE TABLE table_name_71 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score on April 6?
| SELECT score FROM table_name_71 WHERE date = "april 6" | sql_create_context |
CREATE TABLE table_name_28 (
progressive_ticket VARCHAR,
democratic_ticket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was on the Progressive ticket when John T. Norton was on the Democratic ticket?
| SELECT progressive_ticket FROM table_name_28 WHERE democratic_ticket = "john t. norton" | sql_create_context |
CREATE TABLE table_name_61 (
name VARCHAR,
date VARCHAR,
type VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name when the type is freighter, nationality is united kingdom on 3 may 1940?
| SELECT name FROM table_name_61 WHERE type = "freighter" AND nationality = "united kingdom" AND date = "3 may 1940" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "ENGL" AND demographic.age < "43" | mimicsql_data |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY AVG(acc_bal) DESC | nvbench |
CREATE TABLE table_34678 (
"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 record at Memorial Stadium on September 19, 1965?
| SELECT "Record" FROM table_34678 WHERE "Game Site" = 'memorial stadium' AND "Date" = 'september 19, 1965' | wikisql |
CREATE TABLE table_11765 (
"Name" text,
"Location" text,
"Elevation + Height" text,
"Delivery" text,
"Purpose" text,
"Yield" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Purpose has an Elevation + Height of 0 + metres (ft), a Location of... | SELECT "Purpose" FROM table_11765 WHERE "Elevation + Height" = '0 + metres (ft)' AND "Location" = 'bikini, namu (charlie)' AND "Yield" = '220 kt' | wikisql |
CREATE TABLE table_27462177_1 (
no_in_series VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes did Eve Weston write?
| SELECT COUNT(no_in_series) FROM table_27462177_1 WHERE written_by = "Eve Weston" | sql_create_context |
CREATE TABLE table_37839 (
"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
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Played" FROM table_37839 WHERE "Losing bonus" = '3' | wikisql |
CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
email_address text,
phone_number text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
product_category_code text,
date_product_first_available time,
date_product_discon... | SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1 | spider |
CREATE TABLE table_16474 (
"Season" text,
"Division" text,
"League Apps (Sub)" real,
"League Goals" real,
"FA Cup Apps (Sub)" text,
"FA Cup Goals" real,
"FL Cup Apps (Sub)" real,
"FL Cup Goals" real,
"Other Apps" real,
"Other Goals" real,
"Total Apps (Sub)" text,
"Total G... | SELECT MAX("League Apps (Sub)") FROM table_16474 | wikisql |
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(*) AS "all", SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS "accepted", SUM(CASE WHEN a.Score > 0 THEN 1 ELSE 0 END) AS "upvoted", SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS "zero_voted", SUM(CASE WHEN a.Score < 0 THEN 1 ELSE 0 END) AS "downvoted" FROM Posts AS a LEFT JOIN Posts AS q ON... | sede |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dod_year < "2186.0" | mimicsql_data |
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 * FROM zyjybgb WHERE zyjybgb.JZLSH = '59180800896' UNION SELECT * FROM mzjybgb WHERE mzjybgb.JZLSH = '59180800896' | css |
CREATE TABLE table_name_2 (
kana VARCHAR,
korean_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Kana of the Province with a Korean name of Chungcheong-Namdo?
| SELECT kana FROM table_name_2 WHERE korean_name = "chungcheong-namdo" | sql_create_context |
CREATE TABLE table_19570 (
"Rank" real,
"Country" text,
"International tourist arrivals (2012)" text,
"International tourist arrivals (2011)" text,
"Change (2011 to 2012)" text,
"Change (2010 to 2011)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Change (2011 to 2012)" FROM table_19570 WHERE "Change (2010 to 2011)" = '+1.0%' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 2514 AND STRFTIME('%y', admissions.admittime) >= '2104' ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT... | eicu |
CREATE TABLE table_23143607_1 (
autonomous_community VARCHAR,
television_channels VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the autonomous community with television channels tpa tpa2 rtpa internacional?
| SELECT autonomous_community FROM table_23143607_1 WHERE television_channels = "TPA TPA2 RTPA Internacional" | sql_create_context |
CREATE TABLE table_name_39 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was d. a. weibring's to par?
| SELECT to_par FROM table_name_39 WHERE player = "d. a. weibring" | sql_create_context |
CREATE TABLE table_48683 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Surface of the Court in Napoli?
| SELECT "Surface" FROM table_48683 WHERE "Tournament" = 'napoli' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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... | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 | nvbench |
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(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coagulopathy - coumadin administration' AND DATETIME(diagnosis.diagnosist... | eicu |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814) AND prescriptions.drug IN ('cefazolin', 'ns', 'neo*iv*gentamicin') AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE table_59564 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest against score for Twickenham, London with the status of Five Nations against Irel... | SELECT MIN("Against") FROM table_59564 WHERE "Venue" = 'twickenham, london' AND "Status" = 'five nations' AND "Opposing Teams" = 'ireland' | wikisql |
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 cost (
r... | 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 = 2874) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid IN (SELECT d_it... | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight te... | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS CITY' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare... | atis |
CREATE TABLE table_27615445_1 (
episode_air_date VARCHAR,
audition_city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episode air dates are there for auditioning city Rio De Janeiro?
| SELECT COUNT(episode_air_date) FROM table_27615445_1 WHERE audition_city = "Rio de Janeiro" | sql_create_context |
CREATE TABLE table_28948 (
"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.
-- What is the district with the incumbent john nicholas?
| SELECT "District" FROM table_28948 WHERE "Incumbent" = 'John Nicholas' | wikisql |
CREATE TABLE table_name_75 (
lane INTEGER,
heat VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the lanes before heat 7 that elizabeth simmonds swam?
| SELECT SUM(lane) FROM table_name_75 WHERE heat < 7 AND name = "elizabeth simmonds" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-55218')) AND medication.routeadmin = 'inhalation' AND DATE... | eicu |
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "E8120" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) <= '2103' GROUP BY procedures_icd.icd9_code) AS t1... | mimic_iii |
CREATE TABLE table_name_99 (
group VARCHAR,
island VARCHAR,
height__m_ VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What group on the island of Faray has a Height (m) of 32 and a Population of 0?
| SELECT group FROM table_name_99 WHERE height__m_ = 32 AND population = "0" AND island = "faray" | sql_create_context |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, MIN(Weight) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_name_60 (
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the place of player jim thorpe?
| SELECT place FROM table_name_60 WHERE player = "jim thorpe" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab.label = "Bilirubin, Indirect" | mimicsql_data |
CREATE TABLE table_name_6 (
director VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed Turks Fruit?
| SELECT director FROM table_name_6 WHERE original_title = "turks fruit" | sql_create_context |
CREATE TABLE table_16768 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the race name in the Monza circuit?
| SELECT "Race Name" FROM table_16768 WHERE "Circuit" = 'Monza' | wikisql |
CREATE TABLE table_25220821_4 (
wed_2_june VARCHAR,
thurs_3_june VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2 June time for the rider with time of 17' 48.58 127.111mph on 3 June?
| SELECT wed_2_june FROM table_25220821_4 WHERE thurs_3_june = "17' 48.58 127.111mph" | sql_create_context |
CREATE TABLE table_54583 (
"Team" text,
"Wins" real,
"Losses" real,
"Ties" real,
"Win Pct." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of ties for the Detroit Lions team when they have fewer than 5 wins, fewer than 3 l... | SELECT AVG("Ties") FROM table_54583 WHERE "Losses" < '3' AND "Wins" < '5' AND "Win Pct." = '0.800' AND "Team" = 'detroit lions' | wikisql |
CREATE TABLE table_61987 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT YEAR HAS A TO PAR SMALLER THAN 16, TOTAL 151?
| SELECT "Year(s) won" FROM table_61987 WHERE "To par" < '16' AND "Total" = '151' | wikisql |
CREATE TABLE table_58161 (
"Release title" text,
"Released as" text,
"Release type" text,
"Label" text,
"Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Neverchanger with the label of Latenight weeknight?
| SELECT "Year" FROM table_58161 WHERE "Label" = 'latenight weeknight' AND "Release title" = 'neverchanger' | wikisql |
CREATE TABLE table_76566 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition was held on the 26th?
| SELECT "Competition" FROM table_76566 WHERE "Date" = '26th' | wikisql |
CREATE TABLE table_name_42 (
domestic_tournament VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Domestic Tournament with Chennai Super Kings Team?
| SELECT domestic_tournament FROM table_name_42 WHERE team = "chennai super kings" | sql_create_context |
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE ... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code | nvbench |
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 (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "86" AND prescriptions.drug = "D5NS" | mimicsql_data |
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_pre... | SELECT date, SUM(cloud_cover) FROM weather | nvbench |
CREATE TABLE table_name_67 (
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Surface of the Tournament on June 11, 2006?
| SELECT surface FROM table_name_67 WHERE date = "june 11, 2006" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.