instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_2581397_3 (
distance VARCHAR,
weight__kg_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the weight for 56 kilograms.
| SELECT distance FROM table_2581397_3 WHERE weight__kg_ = "56" | sql_create_context |
CREATE TABLE table_78638 (
"Team" text,
"2003\u201304 Pts" text,
"2004\u201305 Pts" text,
"2001\u201302 Pts" real,
"Total Pts" real,
"Total Pld" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team has a Total Pld smaller than 114, and a 20... | SELECT "Team" FROM table_78638 WHERE "Total Pld" < '114' AND "2004\u201305 Pts" = '49' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(*) FROM t_kc24 WHERE PERSON_ID = '91746547' AND CLINIC_SLT_DATE BETWEEN '2006-04-17' AND '2016-04-16' AND MED_AMOUT <= 10 | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '喻星海' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_8 (
game_4 VARCHAR,
position VARCHAR,
game_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For which Game 4 did Michael O'Connor play wing position?
| SELECT game_4 FROM table_name_8 WHERE position = "wing" AND game_1 = "michael o'connor" | sql_create_context |
CREATE TABLE table_23286112_7 (
high_points VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has high points when toyota center 15,095 is location attendance?
| SELECT high_points FROM table_23286112_7 WHERE location_attendance = "Toyota Center 15,095" | sql_create_context |
CREATE TABLE table_18733480_1 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was team 1 when the chalkheads were team 2?
| SELECT team_1 FROM table_18733480_1 WHERE team_2 = "Chalkheads" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE T... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d... | mimic_iii |
CREATE TABLE table_69104 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which loss has an Attendance of 23,952?
| SELECT "Loss" FROM table_69104 WHERE "Attendance" = '23,952' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT procedures.long_title FROM procedures WHERE procedures.icd9_code = "331" | mimicsql_data |
CREATE TABLE table_6648 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Method of submission (chin in the eye) had what opponent?
| SELECT "Opponent" FROM table_6648 WHERE "Method" = 'submission (chin in the eye)' | wikisql |
CREATE TABLE table_name_43 (
runner_up VARCHAR,
tier VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Runner-up with the tier was tier ii, and a Winner of gigi fern ndez natalia zvereva 5 7, 6 1, 6 4?
| SELECT runner_up FROM table_name_43 WHERE tier = "tier ii" AND winner = "gigi fernández natalia zvereva 5–7, 6–1, 6–4" | sql_create_context |
CREATE TABLE table_55760 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total Bronze larger than 10, Silver larger than 28, and a Gold of 58?
| SELECT MAX("Total") FROM table_55760 WHERE "Bronze" > '10' AND "Silver" > '28' AND "Gold" = '58' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | SELECT t_kc21.MED_AMOUT FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '96029052101' | css |
CREATE TABLE table_9837 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record when Clayton Mckinney was the opponent?
| SELECT "Record" FROM table_9837 WHERE "Opponent" = 'clayton mckinney' | wikisql |
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(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_train_103 (
"id" int,
"systolic_blood_pressure_sbp" int,
"epilepsy" bool,
"diastolic_blood_pressure_dbp" int,
"heart_rate" int,
"seizure_disorder" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT * FROM table_train_103 WHERE seizure_disorder = 1 OR epilepsy = 1 | criteria2sql |
CREATE TABLE table_25604014_4 (
production_code VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code for the episode directed by Sam weisman?
| SELECT production_code FROM table_25604014_4 WHERE directed_by = "Sam Weisman" | sql_create_context |
CREATE TABLE table_name_58 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the tournament with a score of 199 ( 17)?
| SELECT date FROM table_name_58 WHERE score = "199 (–17)" | sql_create_context |
CREATE TABLE table_59327 (
"Years" text,
"Type" text,
"Original code" text,
"Current code" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the original code for victorian rules?
| SELECT "Location" FROM table_59327 WHERE "Original code" = 'victorian rules' | wikisql |
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 DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%Other%' AND student_record.student_id = 1 | advising |
CREATE TABLE table_5186 (
"Maryland Counties" text,
"Fall 05" real,
"Fall 06" real,
"Fall 07" real,
"Fall 08" real,
"Fall 09" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average value for Fall 07 when Fall 05 is 271 and Fall 09 is... | SELECT AVG("Fall 07") FROM table_5186 WHERE "Fall 05" = '271' AND "Fall 09" < '347' | wikisql |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT rid FROM rating WHERE stars <> 4 | spider |
CREATE TABLE table_17206 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nationality when the club team is Peterborough Petes (OHL)?
| SELECT "Nationality" FROM table_17206 WHERE "Club team" = 'Peterborough Petes (OHL)' | 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 diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Robert Hyden" | mimicsql_data |
CREATE TABLE table_67372 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which language do 706 females speak?
| SELECT "females" FROM table_67372 WHERE "Number" = '706' | wikisql |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY born_state | 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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COLANGITIS" AND demographic.admityear < "2125" | mimicsql_data |
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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Potassium Chl 40 mEq / 1000 mL D5 1/2 NS" | mimicsql_data |
CREATE TABLE table_name_61 (
margin_of_victory VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the margin of victory over Steve Rintoul?
| SELECT margin_of_victory FROM table_name_61 WHERE runner_s__up = "steve rintoul" | sql_create_context |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC | nvbench |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "51099" | mimicsql_data |
CREATE TABLE table_203_743 (
id number,
"version" text,
"date" text,
"development cycle" text,
"size (in kb)" number,
"download" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what version was the only alpha release ?
| SELECT "version" FROM table_203_743 WHERE "development cycle" = 'alpha' | squall |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city v... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Asian Music%' OR course.description LIKE '%Asian Music%' OR course.name LIKE '%Asian Music%') AN... | advising |
CREATE TABLE table_name_78 (
fa_cup_goals VARCHAR,
club VARCHAR,
total VARCHAR,
league_cup_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the amount of FA cups goals that were made when the total goals is greater than 16, and the league... | SELECT fa_cup_goals FROM table_name_78 WHERE total > 16 AND league_cup_goals = "1" AND club = "norwich city" | sql_create_context |
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 COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '核酸检测' AND zyjzjlb.RYDJSJ BETWEEN '2001-08-03' AND '2006-01-22' | css |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "MCV" | mimicsql_data |
CREATE TABLE table_36186 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the February for the game against the Montreal Canadiens?
| SELECT SUM("February") FROM table_36186 WHERE "Opponent" = 'montreal canadiens' | 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.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.long_title = "Opioid type dependence, unspecified" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_204_939 (
id number,
"year" number,
"chassis" text,
"engine" text,
"start" text,
"finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many engines were not cosworth 's ?
| SELECT COUNT("engine") FROM table_204_939 WHERE "engine" <> 'cosworth' | squall |
CREATE TABLE table_name_93 (
year_won VARCHAR,
player VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Year won of Davis Love III with a Total of less than 149?
| SELECT COUNT(year_won) FROM table_name_93 WHERE player = "davis love iii" AND total < 149 | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16169)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | mimic_iii |
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.admission_location, demographic.diagnosis FROM demographic WHERE demographic.name = "James Cepeda" | mimicsql_data |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '苗乐悦' AND qtb.IN_HOSP_DATE BETWEEN '2000-07-19' AND '2000-09-22' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '苗乐悦' AND gyb.IN_HOSP_DATE BETW... | css |
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 COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_72508 (
"Position" real,
"Club (City/Town)" text,
"Games Played" real,
"W-L-D" text,
"Goals For/Against" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the goals for/against with w-l-d being 3-1-1
| SELECT "Goals For/Against" FROM table_72508 WHERE "W-L-D" = '3-1-1' | wikisql |
CREATE TABLE table_12893 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Streak has a Score of 98 109?
| SELECT "Streak" FROM table_12893 WHERE "Score" = '98–109' | wikisql |
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate number,
film_id number,
type text,
market_id number,
year number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE ... | SELECT T1.title, T2.type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.film_id = T2.film_id | spider |
CREATE TABLE table_17288825_10 (
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the high assists on April 7?
| SELECT high_assists FROM table_17288825_10 WHERE date = "April 7" | sql_create_context |
CREATE TABLE table_37821 (
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2011/ 12 has a 2010/ 11 of ... | SELECT "2011/ 12" FROM table_37821 WHERE "2010/ 11" = 'a' AND "2007/ 08" = 'not held' AND "2012/ 13" = 'lq' | wikisql |
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code | nvbench |
CREATE TABLE table_39932 (
"Party" text,
"Candidate" text,
"Votes" real,
"% Share" text,
"Change" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of votes from the Labour Party?
| SELECT COUNT("Votes") FROM table_39932 WHERE "Party" = 'labour' | wikisql |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE va... | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_NAME) | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N... | eicu |
CREATE TABLE table_20539826_1 (
obama_percentage VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of the votes did Obama get in the county where 3909 people voted in total?
| SELECT obama_percentage FROM table_20539826_1 WHERE total = 3909 | sql_create_context |
CREATE TABLE table_73918 (
"Outcome" text,
"No." text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On the date October 21, 2007, what is ... | SELECT "No." FROM table_73918 WHERE "Date" = 'October 21, 2007' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-57924')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT... | eicu |
CREATE TABLE table_22815568_12 (
unemployment_rate VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the unemployment rate for 34024
| SELECT COUNT(unemployment_rate) FROM table_22815568_12 WHERE population = 34024 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" | mimicsql_data |
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE ref_product_categories (
product_category_code text,
product_category_description text,
unit_... | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" AND t3.characteristic_type_code = "Grade" | spider |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id numbe... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'temporary tracheostomy')) | mimic_iii |
CREATE TABLE table_14346353_1 (
directed_by VARCHAR,
teleplay_by VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed series #4 that was teleplayed by David Simon?
| SELECT COUNT(directed_by) FROM table_14346353_1 WHERE teleplay_by = "David Simon" AND series__number = 4 | sql_create_context |
CREATE TABLE table_203_425 (
id number,
"season" number,
"driver" text,
"equipment" text,
"position" number,
"points" number,
"races" number,
"wins" number,
"second" number,
"third" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT SUM("wins") FROM table_203_425 WHERE "points" < 400 | squall |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodici... | 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-52932')) AND DATETIME(medication.drugstarttime) <= DATETIM... | eicu |
CREATE TABLE table_name_1 (
type VARCHAR,
award VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the type that had an award for song of the year and the position of 3rd place?
| SELECT type FROM table_name_1 WHERE award = "song of the year" AND position = "3rd place" | sql_create_context |
CREATE TABLE table_name_44 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for a match where Sophie Gustafson played?
| SELECT score FROM table_name_44 WHERE player = "sophie gustafson" | sql_create_context |
CREATE TABLE table_74395 (
"#" text,
"Title" text,
"Author" text,
"Doctor" text,
"Featuring companion" text,
"Published" text,
"ISBN" text,
"Audiobook narrator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of ISBN 1-8... | SELECT "Title" FROM table_74395 WHERE "ISBN" = 'ISBN 1-84990-243-7' | wikisql |
CREATE TABLE table_name_96 (
nation VARCHAR,
silver VARCHAR,
total VARCHAR,
bronze VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nation when bronze is less than 7, gold is larger than 0, total is larger than 7, and silv... | SELECT nation FROM table_name_96 WHERE bronze < 7 AND gold > 0 AND total > 7 AND silver < 3 | sql_create_context |
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 HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY | nvbench |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | SELECT Id, Score, OwnerUserId AS "user_link", CreationDate, LastActivityDate FROM Posts WHERE Posts.ParentId = @QuestionId ORDER BY CreationDate | sede |
CREATE TABLE table_203_720 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what date did both teams score 16 points each ?
| SELECT "date" FROM table_203_720 WHERE "result" = 16 AND "result" = 16 | squall |
CREATE TABLE table_29100 (
"Series #" real,
"Episode #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of the episode written by michael glassb... | SELECT "Original airdate" FROM table_29100 WHERE "Writer" = 'Michael Glassberg' | wikisql |
CREATE TABLE table_1341423_23 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party does jim ramstad represent?
| SELECT party FROM table_1341423_23 WHERE incumbent = "Jim Ramstad" | sql_create_context |
CREATE TABLE table_203_773 (
id number,
"season" number,
"network" text,
"play-by-play" text,
"color commentator(s)" text,
"sideline reporter(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the host of play by play after ray scott ?
| SELECT "play-by-play" FROM table_203_773 WHERE "season" > (SELECT "season" FROM table_203_773 WHERE "play-by-play" = 'ray scott') ORDER BY "season" LIMIT 1 | squall |
CREATE TABLE table_name_80 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired with 22 laps and a grid of 29?
| SELECT time_retired FROM table_name_80 WHERE laps = 22 AND grid = 29 | sql_create_context |
CREATE TABLE table_61102 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the rider who went 14 laps on a Honda CBR1000rr, with a time of +1'04.877 on a grid larger than 23?
| SELECT "Rider" FROM table_61102 WHERE "Laps" = '14' AND "Grid" > '23' AND "Bike" = 'honda cbr1000rr' AND "Time" = '+1''04.877' | wikisql |
CREATE TABLE table_33889 (
"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 was the score when she was a runner-up?
| SELECT "Score" FROM table_33889 WHERE "Outcome" = 'runner-up' | wikisql |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_184334_2 (
population__2010_census_ INTEGER,
area___has__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population (2010 census) if the area is 66.11?
| SELECT MIN(population__2010_census_) FROM table_184334_2 WHERE area___has__ = "66.11" | sql_create_context |
CREATE TABLE table_1108394_47 (
_percentage VARCHAR,
the_bronx VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The candidate who received 133 votes in the Bronx won what percentage overall?
| SELECT _percentage FROM table_1108394_47 WHERE the_bronx = "133" | sql_create_context |
CREATE TABLE table_26282750_1 (
category VARCHAR,
participants_recipients VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What category was the the participant/recipient ot to?
| SELECT category FROM table_26282750_1 WHERE participants_recipients = "Otōto" | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Benign neoplasm of spinal meninges" | mimicsql_data |
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.discharge_location = "SHORT TERM HOSPITAL" AND diagnoses.short_title = "Sarcoidosis" | mimicsql_data |
CREATE TABLE table_11131 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was October 29, 2000?
| SELECT COUNT("Week") FROM table_11131 WHERE "Date" = 'october 29, 2000' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-13376')) AND NOT vitalperiodic.sao2 IS NULL AND... | eicu |
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking_status_code text,... | SELECT SUM(T2.room_count) FROM apartment_buildings AS T1 JOIN apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square" | spider |
CREATE TABLE table_1153898_1 (
ddm_class VARCHAR,
comparisons VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is wireless combo keyboard and mouse support part of the DDM class?
| SELECT ddm_class FROM table_1153898_1 WHERE comparisons = "Wireless Combo keyboard and mouse support" | sql_create_context |
CREATE TABLE table_16575609_5 (
college VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many colleges did Jon Gott attend?
| SELECT COUNT(college) FROM table_16575609_5 WHERE player = "Jon Gott" | 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.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "HESP500I" | mimicsql_data |
CREATE TABLE table_train_148 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"hematocrit_hct" float,
"serum_creatinine" float,
"albumin" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT * FROM table_train_148 WHERE albumin < 3.5 | criteria2sql |
CREATE TABLE table_211714_2 (
rank VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of rank for season 6
| SELECT COUNT(rank) FROM table_211714_2 WHERE season = 6 | sql_create_context |
CREATE TABLE table_298550_1 (
area__km²_ VARCHAR,
capital VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every entry for area if capital is Port-au-Prince?
| SELECT area__km²_ FROM table_298550_1 WHERE capital = "Port-au-Prince" | sql_create_context |
CREATE TABLE table_dev_49 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"diastolic_blood_pressure_dbp" int,
"high_density_lipoprotein_cholesterol_hdl_c" int,
"serum_creatinine" float,
"waist_circumference" int,
"triglyceride_tg" float,
"hyp... | SELECT * FROM table_dev_49 WHERE (serum_creatinine > 1.5 AND gender = 'male') OR (serum_creatinine > 1.4 AND gender = 'female') | criteria2sql |
CREATE TABLE table_13509 (
"Player" text,
"Games" real,
"Comp" real,
"Yards" real,
"Rating" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest comp for ratings less than 52.8 and yards less than 0?
| SELECT MAX("Comp") FROM table_13509 WHERE "Rating" < '52.8' AND "Yards" < '0' | wikisql |
CREATE TABLE table_2618072_1 (
original_air_date VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the original air date written by michael s. chernuchin & joe morgenstern?
| SELECT original_air_date FROM table_2618072_1 WHERE written_by = "Michael S. Chernuchin & Joe Morgenstern" | sql_create_context |
CREATE TABLE table_66521 (
"Original NFL team" text,
"Player" text,
"Pos." text,
"College" text,
"Conf." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What conference did the player with the position of rb play in?
| SELECT "Conf." FROM table_66521 WHERE "Pos." = 'rb' | wikisql |
CREATE TABLE table_204_507 (
id number,
"bridge name" text,
"location" text,
"year completed" number,
"total length" text,
"carries" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many bridges are not as long as the ellsworth street bridge ?... | SELECT COUNT("bridge name") FROM table_204_507 WHERE "total length" < (SELECT "total length" FROM table_204_507 WHERE "bridge name" = 'ellsworth street bridge') | squall |
CREATE TABLE table_name_5 (
drawn INTEGER,
win__percentage VARCHAR,
lost VARCHAR,
nationality VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Nationality of england, and a Matches smaller than 510, and a Lost of 4, and a Win % sma... | SELECT MIN(drawn) FROM table_name_5 WHERE nationality = "england" AND matches < 510 AND lost = 4 AND win__percentage < 28.6 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.