instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_9 (
nationality VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is the pick from round 7?
| SELECT nationality FROM table_name_9 WHERE round = 7 | sql_create_context |
CREATE TABLE table_name_5 (
daytime VARCHAR,
saturday VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Daytime which has Saturday of yes and a Name of exmouth?
| SELECT daytime FROM table_name_5 WHERE saturday = "yes" AND name = "exmouth" | sql_create_context |
CREATE TABLE table_23958917_1 (
in_service_dates VARCHAR,
owner_s___2009_ VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number for service dates for hoosier energy for petersburg
| SELECT COUNT(in_service_dates) FROM table_23958917_1 WHERE owner_s___2009_ = "Hoosier Energy" AND location = "Petersburg" | 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, SALARY FROM employees ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_75154 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wjich city had a date of october 13?
| SELECT "City" FROM table_75154 WHERE "Date" = 'october 13' | wikisql |
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
)
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT COUNT(*) FROM ship | spider |
CREATE TABLE table_name_18 (
tries VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the F. Goals with tries of 0 0 and games of 05 5
| SELECT F.goals FROM table_name_18 WHERE tries = "0 0" AND games = "05 5" | sql_create_context |
CREATE TABLE table_name_84 (
bronze INTEGER,
nation VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the lowest bronze for panama and total larger than 8
| SELECT MIN(bronze) FROM table_name_84 WHERE nation = "panama" AND total > 8 | sql_create_context |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Matthew Ronfeldt%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_i... | advising |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT department FROM course WHERE name LIKE '%Honors Anthropology%' | advising |
CREATE TABLE table_37565 (
"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 is the date of the game being played at Schaeffer Stadium?... | SELECT "Date" FROM table_37565 WHERE "Game Site" = 'schaeffer stadium' | wikisql |
CREATE TABLE table_22081847_1 (
scoring_average VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the year is 2010, what was the average score?
| SELECT scoring_average FROM table_22081847_1 WHERE year = 2010 | sql_create_context |
CREATE TABLE table_12919003_3 (
_number VARCHAR,
director VARCHAR,
viewers_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of episodes both directed by Tom Hooper and viewed by 8.08 million viewers?
| SELECT COUNT(_number) FROM table_12919003_3 WHERE director = "Tom Hooper" AND viewers_millions_ = "8.08" | sql_create_context |
CREATE TABLE table_1038 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the total points are 22 how many total touchdo... | SELECT "Touchdowns" FROM table_1038 WHERE "Points" = '22' | wikisql |
CREATE TABLE table_name_2 (
gold INTEGER,
nation VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Gold, when Nation is Hungary, and when Bronze is greater than 1?
| SELECT AVG(gold) FROM table_name_2 WHERE nation = "hungary" AND bronze > 1 | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE presc... | 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 = 92788)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'void' AND d_items.... | mimic_iii |
CREATE TABLE table_name_86 (
opponent VARCHAR,
week VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Opponent of the game after Week 3 with a Result of L 10 6?
| SELECT opponent FROM table_name_86 WHERE week > 3 AND result = "l 10–6" | sql_create_context |
CREATE TABLE table_42676 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the aggregate for the match with Sierra Leone as team 1?
| SELECT "Agg." FROM table_42676 WHERE "Team 1" = 'sierra leone' | 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 demographic.discharge_location FROM demographic WHERE demographic.subject_id = "3343" | mimicsql_data |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id IN... | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken | nvbench |
CREATE TABLE table_name_46 (
episodes VARCHAR,
rank VARCHAR,
actor_actress VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode did actor Daniel Macpherson's character have the rank of Detective Senior Constable
| SELECT episodes FROM table_name_46 WHERE rank = "detective senior constable" AND actor_actress = "daniel macpherson" | sql_create_context |
CREATE TABLE table_39181 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Series has a Date of may 2?
| SELECT "Series" FROM table_39181 WHERE "Date" = 'may 2' | wikisql |
CREATE TABLE table_name_30 (
score VARCHAR,
date VARCHAR,
venue VARCHAR,
winning_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on June 14, what was the winning score by the Devil rays in pro player stadium?
| SELECT score FROM table_name_30 WHERE venue = "pro player stadium" AND winning_team = "devil rays" AND date = "june 14" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | SELECT chartevents.charttime 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 = 17398)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2' AN... | mimic_iii |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT 24 * (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 = '010-21105... | eicu |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '陶迎秋' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 2684.97) | css |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | SELECT T2.roomname, T1.rate, T1.checkin, T1.checkout FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid GROUP BY T1.room ORDER BY T1.rate DESC LIMIT 1 | spider |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J... | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
CREATE TABLE table_54225 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which stage had a Points Classification of Francesco Moser and a g... | SELECT "Stage" FROM table_54225 WHERE "Points classification" = 'francesco moser' AND "General classification" = 'bernard hinault' | wikisql |
CREATE TABLE Songs (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many songs are there?
| SELECT COUNT(*) FROM Songs | sql_create_context |
CREATE TABLE procedures (
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.dob_year < "2090" AND lab.itemid = "51108" | 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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE >= 20 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE >= 20) | css |
CREATE TABLE table_name_9 (
category VARCHAR,
recipient_s_ VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which category did Nick Jonas win at the Kids' Choice Awards Mexico?
| SELECT category FROM table_name_9 WHERE recipient_s_ = "nick jonas" AND award = "kids' choice awards mexico" | sql_create_context |
CREATE TABLE table_16799784_9 (
year_named VARCHAR,
longitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have a longitude measure of 20.0e?
| SELECT COUNT(year_named) FROM table_16799784_9 WHERE longitude = "20.0E" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '96775087' AND t_kc22.STA_DATE BETWEEN '2001-12-08' AND '2012-06-21' AND t_kc22.SOC_SRT_DIRE_CD = '921496' | css |
CREATE TABLE table_63094 (
"Year" real,
"Organisation" text,
"Award" text,
"Nominated Work Title" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which award was given to Lianhe Zaobao?
| SELECT "Award" FROM table_63094 WHERE "Organisation" = 'lianhe zaobao' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 | eicu |
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,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB te... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 person_info.XM = '任凌霜' AND NOT ... | css |
CREATE TABLE table_69621 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of points for chassis of maserati 250f and entrant of officine alfieri maserati
| SELECT SUM("Points") FROM table_69621 WHERE "Chassis" = 'maserati 250f' AND "Entrant" = 'officine alfieri maserati' | wikisql |
CREATE TABLE table_name_23 (
attendance VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance of the match with kochi university as the away team?
| SELECT attendance FROM table_name_23 WHERE away_team = "kochi university" | sql_create_context |
CREATE TABLE table_20823568_3 (
total_placings_s_ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum number of total placings?
| SELECT MIN(total_placings_s_) FROM table_20823568_3 | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | 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 = 'DALLAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND da... | atis |
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.admission_type = "NEWBORN" | 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_ORG_DEPT_NM, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '6776631' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_CD | css |
CREATE TABLE table_32131 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which circuit did Raymond Mays win?
| SELECT "Circuit" FROM table_32131 WHERE "Winning driver" = 'raymond mays' | wikisql |
CREATE TABLE table_33810 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has 5-3 as the score, and holt (1-1) as a loss?
| SELECT "Date" FROM table_33810 WHERE "Score" = '5-3' AND "Loss" = 'holt (1-1)' | wikisql |
CREATE TABLE table_13805432_2 (
song_title VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the song title with artbeingt being pat boone
| SELECT song_title FROM table_13805432_2 WHERE artist = "Pat Boone" | sql_create_context |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Ac... | SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code | nvbench |
CREATE TABLE table_66617 (
"Title" text,
"Series" text,
"Director" text,
"Production Num." text,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was sniffles and the bookworm released?
| SELECT "Release date" FROM table_66617 WHERE "Title" = 'sniffles and the bookworm' | wikisql |
CREATE TABLE table_name_4 (
method VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Method, when Opponent is 'Chalid Arrab'?
| SELECT method FROM table_name_4 WHERE opponent = "chalid arrab" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "B12 defic anemia NEC" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_51879 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"R 54" text,
"R 53" text,
"R 52" text,
"R 51" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the D 46 which has a D 43 ... | SELECT "D 46" FROM table_51879 WHERE "D 43" = 'majority→' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_41306 (
"Team" text,
"University" text,
"Location" text,
"Year entered league" real,
"2013\u201314 division" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which university was in the Western division in 2013-14, located in Bath, ... | SELECT "University" FROM table_41306 WHERE "2013\u201314 division" = 'western' AND "Location" = 'bath' AND "Team" = 'bath spa bulldogs' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '44192397' AND t_kc22.STA_DATE BETWEEN '2016-04-29' AND '2016-04-30' AND t_kc22.SOC_SRT_DIRE_CD = '130906139' | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | SELECT SALARY, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_59565 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue has a Against smaller than 7?
| SELECT "Venue" FROM table_59565 WHERE "Against" < '7' | wikisql |
CREATE TABLE table_4912 (
"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 is the away team with the score 13.15 (93) ?... | SELECT "Away team" FROM table_4912 WHERE "Away team score" = '13.15 (93)' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_l... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 311 | advising |
CREATE TABLE table_27704991_1 (
close_ranged_weapons VARCHAR,
armor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the armor is bronze cuirass , linothorax, what are the close ranged weapons?
| SELECT close_ranged_weapons FROM table_27704991_1 WHERE armor = "Bronze cuirass , Linothorax" | sql_create_context |
CREATE TABLE product_suppliers (
product_id number,
supplier_id number,
date_supplied_from time,
date_supplied_to time,
total_amount_purchased text,
total_value_purchased number
)
CREATE TABLE department_store_chain (
dept_store_chain_id number,
dept_store_chain_name text
)
CREATE TABL... | SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code <> "Credit Card" | spider |
CREATE TABLE table_name_94 (
venue VARCHAR,
position VARCHAR,
event VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue has an Event of marathon, and a Year larger than 1995, and a Position of 4th?
| SELECT venue FROM table_name_94 WHERE event = "marathon" AND year > 1995 AND position = "4th" | 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 demographic.marital_status, demographic.admission_location FROM demographic WHERE demographic.subject_id = "15898" | mimicsql_data |
CREATE TABLE table_name_25 (
report VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What report happened on 22 september?
| SELECT report FROM table_name_25 WHERE date = "22 september" | sql_create_context |
CREATE TABLE table_name_52 (
to_par INTEGER,
player VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the to par of player meg mallon, who had a total greater than 157?
| SELECT SUM(to_par) FROM table_name_52 WHERE player = "meg mallon" AND total > 157 | sql_create_context |
CREATE TABLE table_name_87 (
entrant VARCHAR,
driver VARCHAR,
tyre VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the entrant for driver Giuseppe Farina when he had a Chassis of 625 555 D50 and a tyre of E?
| SELECT entrant FROM table_name_87 WHERE tyre = "e" AND chassis = "625 555 d50" AND driver = "giuseppe farina" | 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE Customers (
customer_id INTEGER,
customer_address_id INTEGER,
customer_status_code VARCHAR(15),
date_became_customer DATETIME,
date_of_birth DATETIME,
first_name VARCHAR(80),
last_name VARCHAR(80),
amount_outstanding DOUBLE,
email_address VARCHAR(250),
phone_number V... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
Mark... | SELECT Id FROM Posts AS p WHERE (OwnerUserId IS NULL OR (SELECT DATEDIFF(d, LastAccessDate, GETDATE()) FROM Users AS u WHERE p.OwnerUserId = u.Id) > 360) AND CommunityOwnedDate IS NULL AND CommentCount > 4 AND LastEditDate > (SELECT MAX(CreationDate) FROM Comments WHERE PostId = p.Id) | sede |
CREATE TABLE table_13259019_2 (
date VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did the team play at oakland-alameda county coliseum?
| SELECT COUNT(date) FROM table_13259019_2 WHERE game_site = "Oakland-Alameda County Coliseum" | sql_create_context |
CREATE TABLE table_32718 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what score did the match against Marcos Daniel end?
| SELECT "Score" FROM table_32718 WHERE "Opponent in the final" = 'marcos daniel' | wikisql |
CREATE TABLE table_21104 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At a longitude of 293.0e, what is the diameter, in km?
| SELECT "Diameter (km)" FROM table_21104 WHERE "Longitude" = '293.0E' | wikisql |
CREATE TABLE table_72672 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT COUNT("Title") FROM table_72672 WHERE "Production code" = '3020' | wikisql |
CREATE TABLE table_name_65 (
bronze VARCHAR,
total VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bronze medals for West Germany having a total more than 2?
| SELECT COUNT(bronze) FROM table_name_65 WHERE total > 2 AND nation = "west germany" | sql_create_context |
CREATE TABLE table_name_94 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the opponent of the game when the reocrd was 0-12?
| SELECT opponent FROM table_name_94 WHERE record = "0-12" | sql_create_context |
CREATE TABLE procedures (
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Insulins and antidiabetic agents causing adverse effects in therapeutic use" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_53625 (
"Year" real,
"Competition Description" text,
"Location" text,
"Apparatus" text,
"Score-Final" real,
"Score-Qualifying" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of qualifying scores when the final ... | SELECT COUNT("Score-Qualifying") FROM table_53625 WHERE "Score-Final" = '16.625' | wikisql |
CREATE TABLE table_26842217_12 (
result VARCHAR,
visiting_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in the game where the visiting team was Louisiana-Monroe?
| SELECT result FROM table_26842217_12 WHERE visiting_team = "Louisiana-Monroe" | sql_create_context |
CREATE TABLE table_32302 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position has a Round of 7, and a College of kansas state?
| SELECT "Position" FROM table_32302 WHERE "Round" = '7' AND "College" = 'kansas state' | wikisql |
CREATE TABLE table_dev_3 (
"id" int,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"trauma" bool,
"diabetic" string,
"creatinine_clearance_cl" float,
"surgery" bool,
"autonomic_dysfunction" bool,
"urine_protein" int,
"proteinuria" int,
"body_mass_index_bmi" float,
"NOUSE"... | SELECT * FROM table_dev_3 WHERE diabetic = 'ii' OR hemoglobin_a1c_hba1c >= 7 | criteria2sql |
CREATE TABLE table_31536 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player from United States who play in year 2003-06 in Toronto?
| SELECT "Player" FROM table_31536 WHERE "Nationality" = 'united states' AND "Years in Toronto" = '2003-06' | wikisql |
CREATE TABLE table_57077 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player was active in Jazz in 1975-79?
| SELECT "Player" FROM table_57077 WHERE "Years for Jazz" = '1975-79' | wikisql |
CREATE TABLE table_5992 (
"Player" text,
"Team" text,
"Date" text,
"Opponent" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team did the Boston Beaneaters host at the South End Grounds?
| SELECT "Opponent" FROM table_5992 WHERE "Venue" = 'south end grounds' | wikisql |
CREATE TABLE table_name_26 (
result VARCHAR,
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which had an attendance of larger than 33,435?
| SELECT result FROM table_name_26 WHERE attendance > 33 OFFSET 435 | sql_create_context |
CREATE TABLE table_24222929_3 (
original_airdate VARCHAR,
live VARCHAR,
sd_total_viewers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the episode that had 5.09 million total viewers (both Live and SD types) first air?
| SELECT original_airdate FROM table_24222929_3 WHERE live + sd_total_viewers = "5.09 million" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperio... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, expectorated' AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | eicu |
CREATE TABLE table_13812 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of Nick Taylor (a)?
| SELECT "Score" FROM table_13812 WHERE "Player" = 'nick taylor (a)' | wikisql |
CREATE TABLE table_name_35 (
rank VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank of the rower with a Time of 8:23.02?
| SELECT COUNT(rank) FROM table_name_35 WHERE time = "8:23.02" | sql_create_context |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.JZZDSM = '过敏性皮炎' GROUP BY person_info.JGDM UNION SELECT p... | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'lopressor' AND patient.uniquepid = '002-3784' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_... | eicu |
CREATE TABLE table_12828723_4 (
drawn VARCHAR,
won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the drawn when the won is 12?
| SELECT drawn FROM table_12828723_4 WHERE won = "12" | sql_create_context |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_i... | SELECT Investor_details, COUNT(Investor_details) FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100 GROUP BY Investor_details | nvbench |
CREATE TABLE table_name_17 (
gold INTEGER,
rank VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When rank is 7 and silver is less than 0, what is the total gold?
| SELECT SUM(gold) FROM table_name_17 WHERE rank = "7" AND silver < 0 | sql_create_context |
CREATE TABLE table_46905 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Game is greater than 78, and when Da... | SELECT "Score" FROM table_46905 WHERE "Game" > '78' AND "Date" = '4' | wikisql |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | SELECT ZZYSGH, QTJZYSGH FROM mzjzjlb WHERE JZLSH = '67977476641' | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '55722979' AND t_kc22.STA_DATE BETWEEN '2001-09-01' AND '2015-06-25' AND qtb.MED_SER_ORG_NO = '5394717' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_1277350_5 (
thursday_fourth_day VARCHAR,
day__see_irregularities__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Slovene word for Thursday?
| SELECT thursday_fourth_day FROM table_1277350_5 WHERE day__see_irregularities__ = "Slovene" | sql_create_context |
CREATE TABLE table_949 (
"No." text,
"Name" text,
"Livery" text,
"Arrival" real,
"Type" text,
"Configuration" text,
"Builder" text,
"Built" real,
"Status" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is th... | SELECT "Name" FROM table_949 WHERE "Builder" = 'Kerr Stuart' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.