instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_25207 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race time" text,
"Average speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Manufacturer" FROM table_25207 WHERE "Driver" = 'Cale Yarborough' AND "Year" = '1984' | wikisql |
CREATE TABLE table_13982 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Place has an English translation of lullaby for my b... | SELECT MAX("Place") FROM table_13982 WHERE "English translation" = 'lullaby for my beloved' | wikisql |
CREATE TABLE table_name_4 (
venue VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue features collingwood as the home side?
| SELECT venue FROM table_name_4 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_31090 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least number for p... | SELECT MIN("No.") FROM table_31090 WHERE "Production code" = '3X6266' | wikisql |
CREATE TABLE table_204_538 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the co driver of the first place driver ?
| SELECT "co-driver" FROM table_204_538 WHERE "pos." = 1 | squall |
CREATE TABLE table_24575253_4 (
division_five VARCHAR,
division_one VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When westcott is in division one how many leagues are in division 5?
| SELECT COUNT(division_five) FROM table_24575253_4 WHERE division_one = "Westcott" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64538) AND prescriptions.drug = 'terazosin' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-5 month') | mimic_iii |
CREATE TABLE table_name_76 (
d3_compatible VARCHAR,
availability VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the D3 compatible for availability of yes for wode jukebox
| SELECT d3_compatible FROM table_name_76 WHERE availability = "yes" AND name = "wode jukebox" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' ... | eicu |
CREATE TABLE table_75524 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round number for the player who came from team Missouri?
| SELECT MAX("Round") FROM table_75524 WHERE "School/Club Team" = 'missouri' | wikisql |
CREATE TABLE table_name_72 (
last VARCHAR,
total VARCHAR,
first VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the last when the first was January 2001 and more than 26 total?
| SELECT last FROM table_name_72 WHERE total > 26 AND first = "january 2001" | sql_create_context |
CREATE TABLE table_29547777_1 (
original_performer VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the original performer when the episode is casting?
| SELECT original_performer FROM table_29547777_1 WHERE episode = "Casting" | sql_create_context |
CREATE TABLE table_33313 (
"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.
-- Who was the home team that scored 10.12 (72)?
| SELECT "Home team" FROM table_33313 WHERE "Home team score" = '10.12 (72)' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT SUM(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 = 30171)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE Subjects (
subject_name VARCHAR,
subject_id VARCHAR
)
CREATE TABLE Courses (
subject_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the subject ID, subject name, and the corresponding number of available courses for each subject.
| SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname var... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number <> 646 AND instructor.name LIKE '%William Iii%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i... | advising |
CREATE TABLE table_33856 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the celebrity who finished in 7th place?
| SELECT "Celebrity" FROM table_33856 WHERE "Finished" = '7th' | wikisql |
CREATE TABLE table_70227 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class has a Year of 1968?
| SELECT "Class" FROM table_70227 WHERE "Year" = '1968' | wikisql |
CREATE TABLE customers (
customer_name VARCHAR,
payment_method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of customers who did not pay with Cash.
| SELECT customer_name FROM customers WHERE payment_method <> 'Cash' | sql_create_context |
CREATE TABLE table_name_15 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people were in attendance on the game on April 8, 2007?
| SELECT attendance FROM table_name_15 WHERE date = "april 8, 2007" | sql_create_context |
CREATE TABLE table_name_28 (
competition VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the competition when the score is 2-1?
| SELECT competition FROM table_name_28 WHERE score = "2-1" | sql_create_context |
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(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '水雯华' AND IN_HOSP_DATE BETWEEN '2001-12-24' AND '2008-04-20' | css |
CREATE TABLE table_name_79 (
gold INTEGER,
rank VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Gold when the rank is less than 3 and the bronze is less than 1?
| SELECT AVG(gold) FROM table_name_79 WHERE rank < 3 AND bronze < 1 | 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 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 WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2131" | mimicsql_data |
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 SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
)
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
)
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
)
-- Using valid SQLit... | SELECT T1.result FROM acceptance AS T1 JOIN submission AS T2 ON T1.submission_id = T2.submission_id ORDER BY T2.scores DESC LIMIT 1 | spider |
CREATE TABLE table_name_21 (
opponents VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the opponents for partner of yvonne meusburger
| SELECT opponents FROM table_name_21 WHERE partner = "yvonne meusburger" | sql_create_context |
CREATE TABLE table_55412 (
"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 did the team score when playing against an ... | SELECT "Home team score" FROM table_55412 WHERE "Away team score" = '13.8 (86)' | 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 WHERE demographic.gender = "M" AND diagnoses.long_title = "Injury to femoral nerve" | mimicsql_data |
CREATE TABLE table_1765 (
"Ending" text,
"American" text,
"British" text,
"Australian" text,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the endings of examples achilles, appendices, f ces
| SELECT "Ending" FROM table_1765 WHERE "Examples" = 'Achilles, appendices, fæces' | wikisql |
CREATE TABLE table_31942 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the result for 2010 fifa world cup qualification
| SELECT "Result" FROM table_31942 WHERE "Competition" = '2010 fifa world cup qualification' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | 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 = '021-100763' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE table_12002388_1 (
playoffs VARCHAR,
reg_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What playoff result happened during the season in which they finished 1st, southern?
| SELECT playoffs FROM table_12002388_1 WHERE reg_season = "1st, Southern" | sql_create_context |
CREATE TABLE table_name_71 (
channel VARCHAR,
play_by_play VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which channel has Joel Meyers as the Play by play commentator?
| SELECT channel FROM table_name_71 WHERE play_by_play = "joel meyers" | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Albumin/Creatinine, Urine" | mimicsql_data |
CREATE TABLE table_name_64 (
week_1 VARCHAR,
week_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week 1 had a week 2 of Mandy Lynn?
| SELECT week_1 FROM table_name_64 WHERE week_2 = "mandy lynn" | sql_create_context |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
prod... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY COUNT(date_account_opened) | nvbench |
CREATE TABLE table_8186 (
"Club" text,
"Sport" text,
"Founded" real,
"League" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of League has a Venue of billesley common?
| SELECT "League" FROM table_8186 WHERE "Venue" = 'billesley common' | wikisql |
CREATE TABLE table_203_756 (
id number,
"year" number,
"title" text,
"role" text,
"network" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- role played at least twice
| SELECT "role" FROM table_203_756 GROUP BY "role" HAVING COUNT(*) >= 2 | squall |
CREATE TABLE table_18268930_1 (
population_served INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the minimal number of population served?
| SELECT MIN(population_served) FROM table_18268930_1 | sql_create_context |
CREATE TABLE table_73829 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" text,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of typ... | SELECT "Type" FROM table_73829 WHERE "Cyrillic Name Other Names" = 'Бока' | wikisql |
CREATE TABLE table_name_41 (
channel VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Channel has an Opponent of washington redskins?
| SELECT channel FROM table_name_41 WHERE opponent = "washington redskins" | sql_create_context |
CREATE TABLE table_name_75 (
head_coach VARCHAR,
shirt_sponsor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the head coach for the team that has finke as the shirt sponsor?
| SELECT head_coach FROM table_name_75 WHERE shirt_sponsor = "finke" | sql_create_context |
CREATE TABLE table_40234 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | SELECT SUM("Cultural and Educational Panel") FROM table_40234 WHERE "Administrative Panel" > '1' AND "Agricultural Panel" = '11' AND "University of Dublin" < '3' | 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 DisplayName, Reputation, Id AS "user_link" FROM Users WHERE UPPER(Location) LIKE '%ISRAEL%' ORDER BY 2 DESC | sede |
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide number
)
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id ... | SELECT publisher FROM book_club WHERE year = 1989 INTERSECT SELECT publisher FROM book_club WHERE year = 1990 | spider |
CREATE TABLE table_69480 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the call sign is wpib, what is lowest ERP W?
| SELECT MIN("ERP W") FROM table_69480 WHERE "Call sign" = 'wpib' | wikisql |
CREATE TABLE table_name_26 (
date VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the episode that aired at 7:30 pm ET?
| SELECT date FROM table_name_26 WHERE time = "7:30 pm et" | sql_create_context |
CREATE TABLE table_200_35 (
id number,
"party" text,
"active voters" number,
"inactive voters" number,
"total voters" number,
"percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- as of october 25 , 2005 , how many active voters does the d... | SELECT "active voters" FROM table_200_35 WHERE "party" = 'democratic' | squall |
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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "74032" | mimicsql_data |
CREATE TABLE table_name_59 (
home_team VARCHAR,
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home Team, when Date is 18 February 1956, and when Away Team is Blackburn Rovers?
| SELECT home_team FROM table_name_59 WHERE date = "18 february 1956" AND away_team = "blackburn rovers" | sql_create_context |
CREATE TABLE table_name_12 (
year INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the sum of year for 5th result
| SELECT SUM(year) FROM table_name_12 WHERE result = "5th" | sql_create_context |
CREATE TABLE table_77755 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of TDs when the Avg is larger than 8.5 and the Rec is less than 1?
| SELECT MAX("TD's") FROM table_77755 WHERE "Avg." > '8.5' AND "Rec." < '1' | wikisql |
CREATE TABLE table_name_80 (
week_6 VARCHAR,
week_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Week 6 has a Week 2 of see notes 2 , 3 , 4?
| SELECT week_6 FROM table_name_80 WHERE week_2 = "see notes 2 , 3 , 4" | sql_create_context |
CREATE TABLE table_203_793 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year did he score more goals than any other ye... | SELECT "date" FROM table_203_793 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_20460 (
"Member State sorted by GDP" text,
"GDP in s billion of USD (2012)" text,
"GDP % of EU (2012)" text,
"Annual change % of GDP (2012)" text,
"GDP per capita in PPP US$ (2012)" real,
"Public Debt % of GDP (2013 Q1)" text,
"Deficit (-)/ Surplus (+) % of GDP (2012)" tex... | SELECT "Annual change % of GDP (2012)" FROM table_20460 WHERE "GDP % of EU (2012)" = '20.5%' | 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 jybgb.BBCJBW 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.person_info_XM = '沈玉堂' AND jybgb.BGRQ BETWEEN '2002-06-12' AND '2006-08-24... | css |
CREATE TABLE table_204_261 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which countries won more total medals than bulgaria ?
| SELECT "nation" FROM table_204_261 WHERE "total" > (SELECT "total" FROM table_204_261 WHERE "nation" = 'bulgaria') | squall |
CREATE TABLE table_47958 (
"Cycle" real,
"Premiere date" text,
"Winner" text,
"Runner-up" text,
"Number of contestants" text,
"International Destinations" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Cycle, when the Number ... | SELECT MAX("Cycle") FROM table_47958 WHERE "Number of contestants" = '11' AND "Premiere date" = 'september 3, 2012' | wikisql |
CREATE TABLE table_16801 (
"House Name" text,
"Composition" text,
"Named after" text,
"Founded" real,
"Colours" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the green house?
| SELECT "House Name" FROM table_16801 WHERE "Colours" = 'Green' | wikisql |
CREATE TABLE table_name_38 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team for punt road oval?
| SELECT home_team FROM table_name_38 WHERE venue = "punt road oval" | sql_create_context |
CREATE TABLE table_name_8 (
decision VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the decision on the date march 18?
| SELECT decision FROM table_name_8 WHERE date = "march 18" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price 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 school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Ag... | SELECT Party, COUNT(*) FROM driver GROUP BY Party ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_10 (
peak VARCHAR,
prom__m_ VARCHAR,
height__m_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the peak which is prom less than 147 and height less than 619
| SELECT peak FROM table_name_10 WHERE prom__m_ < 147 AND height__m_ < 619 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
CREATE TABLE table_10417 (
"7:00 PM" text,
"8:00 PM" text,
"8:30 PM" text,
"9:00 PM" text,
"9:30 PM" text,
"10:00 PM" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 10:00 PM when the 8:00 PM is tout le monde en parle?
| SELECT "10:00 PM" FROM table_10417 WHERE "8:00 PM" = 'tout le monde en parle' | wikisql |
CREATE TABLE table_47446 (
"Series Sorted" text,
"Title" text,
"Doctor" text,
"Featuring" text,
"Released" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the featuring when the series sorted is 6eb/b?
| SELECT "Featuring" FROM table_47446 WHERE "Series Sorted" = '6eb/b' | wikisql |
CREATE TABLE table_15294880_2 (
team_classification VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the winner was Alessandro Ballan, how many total team classifications were there?
| SELECT COUNT(team_classification) FROM table_15294880_2 WHERE winner = "Alessandro Ballan" | sql_create_context |
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number text,
time_slot_id text
)
CREATE TABLE time_slot (
time_slot_id text,
day text,
start_hr number,
start_min number,
end_hr number,
end_min number
)
CREATE TABLE... | SELECT COUNT(*), dept_name FROM student GROUP BY dept_name | spider |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2186.0" AND procedures.icd9_code = "4610" | mimicsql_data |
CREATE TABLE table_name_4 (
pole_position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the pole position of Round 9
| SELECT pole_position FROM table_name_4 WHERE round = 9 | sql_create_context |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '43929858' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.ME... | css |
CREATE TABLE table_24070 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Sun Devils points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many opponents led to an exactly 7-0 record?
| SELECT COUNT("Opponent") FROM table_24070 WHERE "Record" = '7-0' | wikisql |
CREATE TABLE table_204_258 (
id number,
"location" text,
"frequency" number,
"call sign" text,
"network" text,
"call sign meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the last frequency on the chart ?
| SELECT "frequency" FROM table_204_258 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_204_734 (
id number,
"first name" text,
"surname" text,
"death year" number,
"beginning of\nservice" text,
"end of\nservice" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what first name is just previous to ... | SELECT "first name" FROM table_204_734 WHERE id = (SELECT id FROM table_204_734 WHERE "first name" = 'kempf') - 1 | squall |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment tex... | SELECT Users.DisplayName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Votes.VoteTypeId = 2 AND Posts.CommunityOwnedDate IS NULL AND Ta... | sede |
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 Year, AVG(MAX(Score)) FROM wine | nvbench |
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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7734587' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-02-19' AND '2021-08-21' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7734587' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-02-19' AND '2021-08-21' AND t_kc21.MED_ORG_DEPT_CD = '42244' | css |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '8867' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-10-20' AND '2013-08-27' AND t_kc21.IN_DIAG_DIS_CD = 'O01.280' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | SELECT Tags FROM Posts WHERE Id = 1 | sede |
CREATE TABLE table_65080 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the soap opera when the years are 2000 2004, 2005 ?
| SELECT "Soap Opera" FROM table_65080 WHERE "Years" = '2000–2004, 2005—' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admissi... | mimic_iii |
CREATE TABLE table_221375_1 (
municipalities INTEGER,
province_of_1936 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most municipalities for alto alentejo province (partly ribatejo)
| SELECT MAX(municipalities) FROM table_221375_1 WHERE province_of_1936 = "Alto Alentejo Province (partly Ribatejo)" | sql_create_context |
CREATE TABLE table_52368 (
"Party" text,
"Leader" text,
"Votes" real,
"Percentage" text,
"Seats" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of votes for the Party of Labour?
| SELECT MIN("Votes") FROM table_52368 WHERE "Party" = 'labour' | wikisql |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DI... | atis |
CREATE TABLE table_11173827_1 (
english_title VARCHAR,
premiere VARCHAR,
finale VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the english title where the premiere is less than 30.0 and the finale is bigger than 36.0?
| SELECT english_title FROM table_11173827_1 WHERE premiere < 30.0 AND finale > 36.0 | sql_create_context |
CREATE TABLE table_name_46 (
name VARCHAR,
street_address VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Street Address of 980 n. michigan avenue is what name?
| SELECT name FROM table_name_46 WHERE street_address = "980 n. michigan avenue" | 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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1... | eicu |
CREATE TABLE table_18159601_1 (
collegiate_institution VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the collegiate institution in queens
| SELECT collegiate_institution FROM table_18159601_1 WHERE city = "Queens" | sql_create_context |
CREATE TABLE table_name_8 (
bb_pop VARCHAR,
riaa VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the BB Pop for the song with RIAA of G that was in a year earlier than 1961?
| SELECT bb_pop FROM table_name_8 WHERE riaa = "g" AND year < 1961 | sql_create_context |
CREATE TABLE table_name_61 (
date VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where attendance is 79,431 what is date?
| SELECT date FROM table_name_61 WHERE attendance = "79,431" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAc... | SELECT Posts.Id AS "post_link", DATEDIFF(day, Posts.CreationDate, CreationDate) AS "time_taken_to_accept_in_days", ROUND(DATEDIFF(day, Posts.CreationDate, CreationDate) / 12.0, 0) AS "in_months", ROUND(DATEDIFF(day, Posts.CreationDate, CreationDate) / 365.0, 1) AS "and_in_years" FROM Posts JOIN Votes ON Posts.Id = Vote... | sede |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_... | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT inputevents_cv.charttime 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 = 4401)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ... | mimic_iii |
CREATE TABLE table_70289 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game when the record was 9 5 2?
| SELECT "Date" FROM table_70289 WHERE "Record" = '9–5–2' | wikisql |
CREATE TABLE table_27833469_1 (
series__number VARCHAR,
season__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series number for the episode number 10 of the season?
| SELECT series__number FROM table_27833469_1 WHERE season__number = "10" | sql_create_context |
CREATE TABLE table_55032 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has an Outcome of winner, and a Date of 5 november 2011?
| SELECT "Opponent" FROM table_55032 WHERE "Outcome" = 'winner' AND "Date" = '5 november 2011' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.