instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_11511 (
"Pick" real,
"Round" real,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has more than 3 rounds with jason odom?
| SELECT "School" FROM table_11511 WHERE "Round" > '3' AND "Player" = 'jason odom' | wikisql |
CREATE TABLE Shipments (
shipment_id INTEGER,
order_id INTEGER,
invoice_number INTEGER,
shipment_tracking_number VARCHAR(80),
shipment_date DATETIME,
other_shipment_details VARCHAR(255)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
product_id INTEGER,
order_id INTEGER,
ord... | SELECT date_order_placed, COUNT(date_order_placed) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | nvbench |
CREATE TABLE table_1341423_21 (
first_elected INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest first elected?
| SELECT MIN(first_elected) FROM table_1341423_21 | sql_create_context |
CREATE TABLE table_19534677_1 (
_number VARCHAR,
creators VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the # for bill finger edmond hamilton dick sprang , et al.
| SELECT _number FROM table_19534677_1 WHERE creators = "Bill Finger Edmond Hamilton Dick Sprang , et al." | sql_create_context |
CREATE TABLE table_3948 (
"Order" real,
"Episode" text,
"Original airdate" text,
"Timeslot" text,
"Viewers (millions)" text,
"Nightly rank" real,
"Weekly rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode had viewership of 0.... | SELECT "Episode" FROM table_3948 WHERE "Viewers (millions)" = '0.296' | wikisql |
CREATE TABLE table_44971 (
"Player" text,
"League" real,
"Title Playoff" real,
"Super Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest League, when Title Playoff is greater than 0?
| SELECT MAX("League") FROM table_44971 WHERE "Title Playoff" > '0' | wikisql |
CREATE TABLE table_name_67 (
caps INTEGER,
club_province VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many caps for alister campbell from brumbies?
| SELECT MIN(caps) FROM table_name_67 WHERE club_province = "brumbies" AND player = "alister campbell" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE ... | SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name | spider |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'polyethylene glycol 3350 17 gram oral powder packet... | eicu |
CREATE TABLE Parking_Fines (
council_tax_id VARCHAR,
cmi_cross_ref_id VARCHAR
)
CREATE TABLE CMI_Cross_References (
source_system_code VARCHAR,
master_customer_id VARCHAR,
cmi_cross_ref_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wat is th... | SELECT T1.source_system_code, T1.master_customer_id, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id | sql_create_context |
CREATE TABLE table_name_87 (
money_requested__ INTEGER,
first_aired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how much money was requested on the show which aired on 4 september 2011?
| SELECT SUM(money_requested__) AS £_ FROM table_name_87 WHERE first_aired = "4 september 2011" | sql_create_context |
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_detai... | SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM accounts AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE table_18276 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who were the candidates for district ohio 6?
| SELECT "Candidates" FROM table_18276 WHERE "District" = 'Ohio 6' | wikisql |
CREATE TABLE table_50919 (
"Episode" text,
"Air Date" text,
"Timeslot" text,
"18-49" text,
"Viewers" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of viewers for the episode that has an 18-49 of 1.8/6?
| SELECT MAX("Viewers") FROM table_50919 WHERE "18-49" = '1.8/6' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD... | css |
CREATE TABLE table_44668 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the manufacturer for Henk Vd Lagemaat?
| SELECT "Manufacturer" FROM table_44668 WHERE "Rider" = 'henk vd lagemaat' | wikisql |
CREATE TABLE department (
dno number,
division text,
dname text,
room text,
building text,
dphone number
)
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room... | SELECT T2.dname, T2.room FROM course AS T1 JOIN department AS T2 ON T1.dno = T2.dno WHERE T1.cname = "INTRODUCTION TO COMPUTER SCIENCE" | spider |
CREATE TABLE table_46322 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "Points for" FROM table_46322 WHERE "Points" = '60' AND "Club" = 'bedwas rfc' | wikisql |
CREATE TABLE table_24837 (
"Episode number" real,
"Title" text,
"Original airing on Channel 4" text,
"Time of airing on Channel 4" text,
"Original airing on E4" text,
"Time of airing on E4" text,
"Position in Channel 4s ratings a" text,
"Position in E4s ratings b" text,
"Total viewer... | SELECT "Position in E4s ratings b" FROM table_24837 WHERE "Original airing on Channel 4" = 'June 30, 2010' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_30375 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In footba... | SELECT "Replaced by" FROM table_30375 WHERE "Date of vacancy" = '8 October 2007' | wikisql |
CREATE TABLE procedures (
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.age < "83" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2131.0" AND lab.label = "Neutrophils" | mimicsql_data |
CREATE TABLE table_49648 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Rider is grid 7?
| SELECT "Rider" FROM table_49648 WHERE "Grid" = '7' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '33787678' | css |
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(20),
asset_acquired_date DATETIME,
asset_disposed_date DATETIME,
other_asset_details VARCHAR(255)
)
CREATE TA... | SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 WHERE demographic.language = "CAPE" AND demographic.age < "64" | mimicsql_data |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '67062634' AND MED_SER_ORG_NO = '7262008' AND OUT_DIAG_DIS_NM LIKE '%张力%' | css |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.icd9_code = "34590" | mimicsql_data |
CREATE TABLE table_name_41 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Nationality, when Player is 'Andrew Campbell'?
| SELECT nationality FROM table_name_41 WHERE player = "andrew campbell" | 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 demographic.religion FROM demographic WHERE demographic.name = "Paul Edwards" | mimicsql_data |
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 jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE table_name_93 (
money___ INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Money ($) player Loren Roberts has made?
| SELECT MAX(money___) AS $__ FROM table_name_93 WHERE player = "loren roberts" | sql_create_context |
CREATE TABLE table_77405 (
"Club" text,
"Chinese name" text,
"Home stadium" text,
"Capacity" real,
"Seasons in CSL" text,
"Best finish" text,
"Worst finish" text,
"Spell in level 1" text,
"Top Division Titles (Overall)" real,
"Top Division Titles (Professional)" real,
"Last T... | SELECT "Seasons in CSL" FROM table_77405 WHERE "Top Division Titles (Overall)" = '0' AND "Home stadium" = 'guiyang olympic sports center' | 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 MAX(u.Reputation), AVG(LENGTH(p.Body)) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id AND (p.PostTypeId = 1 OR p.PostTypeId = 2) GROUP BY u.Id | sede |
CREATE TABLE table_204_448 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- liverpool had 8 wins . who is next ?
| SELECT "team" FROM table_204_448 WHERE "winners" < 8 ORDER BY "winners" DESC LIMIT 1 | squall |
CREATE TABLE table_name_29 (
assists INTEGER,
games VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Assists for the Player with 13 Games and a Rank less than 3?
| SELECT SUM(assists) FROM table_name_29 WHERE games = 13 AND rank < 3 | sql_create_context |
CREATE TABLE table_1007688_1 (
typhoid_fever VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the typhoid fever number for the year 1929
| SELECT typhoid_fever FROM table_1007688_1 WHERE year = "1929" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_stop (
flight... | 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 (((flight.arrival_time <= 2400 AND flight.arrival_time >= 1850) OR flight.arrival_time = 0) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_ai... | atis |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.admityear >= "2115" | mimicsql_data |
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_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '华红英' AND t_kc22.STA_DATE BETWEEN '2017-10-15' AND '2020-11-29' AND t_kc22.t_kc21_MED_SER_ORG_NO = '3113128' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_14803 (
"Station No." real,
"Station Name" text,
"Chinese Name" text,
"Travel Time (hrs)" text,
"Distance (km)" real,
"Transfers" text,
"Location ( District )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Chinese Nam... | SELECT "Station Name" FROM table_14803 WHERE "Chinese Name" = '上地 shàngdì' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
... | SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.section_number = 202 AND course.department = 'GEOSCI' AND course.number = 511 AND semester.semester = 'Summer' AND semes... | advising |
CREATE TABLE table_name_91 (
draw INTEGER,
jury VARCHAR,
televote VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sum of draw had more than 22 in Jury and a Televote of 130?
| SELECT SUM(draw) FROM table_name_91 WHERE jury > 22 AND televote = 130 | sql_create_context |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenit... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code | nvbench |
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 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 '%Literature and Identity%' OR course.description LIKE '%Literature and Identity%' OR course.name ... | advising |
CREATE TABLE table_54892 (
"Year" real,
"Place" text,
"Event" text,
"Performance" text,
"Age (years)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest age (years) that the 1st place had a performance of 62.20m?
| SELECT MAX("Age (years)") FROM table_54892 WHERE "Place" = '1st' AND "Performance" = '62.20m' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate ti... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'epilep nec w/o intr epil')) AND DATETIME(cost.chargetime, 'star... | mimic_iii |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, AVG(Height) FROM people GROUP BY Sex | nvbench |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '03485032' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO... | css |
CREATE TABLE table_27133147_3 (
date_of_vacancy VARCHAR,
incoming_head_coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the incoming head coach is Carlos Azenha, what is the date of vacancy?
| SELECT date_of_vacancy FROM table_27133147_3 WHERE incoming_head_coach = "Carlos Azenha" | sql_create_context |
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE ... | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name DESC | nvbench |
CREATE TABLE table_train_265 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fasting_blood_glucose_fbg" float,
"diastolic_blood_pressure_dbp" int,
"hba1c" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT * FROM table_train_265 WHERE hba1c > 7 | criteria2sql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clu... | SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Tracy" AND t3.lname = "Kim" | spider |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Intraop cardiac pacemak" | mimicsql_data |
CREATE TABLE table_204_174 (
id number,
"rank" number,
"name" text,
"nationality" text,
"result" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many nationalities are there after rank 5 ?
| SELECT COUNT(DISTINCT "nationality") FROM table_204_174 WHERE "rank" > 5 | squall |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY ACC_Regular_Season | nvbench |
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 mzjzjlb (
YLJGDM text,
JZLSH ... | SELECT JZLX FROM jybgb WHERE BGDH = '14292593271' | css |
CREATE TABLE table_name_28 (
home VARCHAR,
decision VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Home team when the Visitor was Florida, with a Decision of Ramo?
| SELECT home FROM table_name_28 WHERE decision = "ramo" AND visitor = "florida" | sql_create_context |
CREATE TABLE table_name_75 (
pick__number VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many picks have an Overall of 114?
| SELECT COUNT(pick__number) FROM table_name_75 WHERE overall = 114 | sql_create_context |
CREATE TABLE table_24122653_2 (
finish VARCHAR,
vote VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the finish associated with a 3-2 vote?
| SELECT finish FROM table_24122653_2 WHERE vote = "3-2" | sql_create_context |
CREATE TABLE table_235 (
"Season" real,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tv season had a season finale of august 18, 2004?... | SELECT "TV season" FROM table_235 WHERE "Season finale" = 'August 18, 2004' | wikisql |
CREATE TABLE table_name_72 (
category VARCHAR,
nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What category was danson tang nominated?
| SELECT category FROM table_name_72 WHERE nomination = "danson tang" | sql_create_context |
CREATE TABLE table_name_57 (
notes VARCHAR,
shirt_printing VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the notes for the shirt that said Pavv before 2005?
| SELECT notes FROM table_name_57 WHERE shirt_printing = "pavv" AND year < 2005 | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,... | SELECT Posts.Id AS "post_link", CreationDate, ViewCount, Score FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE LOWER(Tags) LIKE '%hibernate%' AND LOWER(Tags.TagName) = 'hibernate' ORDER BY Score DESC, ViewCount DESC, CreationDate DESC LIMIT 50 | sede |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID | nvbench |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "3" AND procedures.icd9_code = "5451" | mimicsql_data |
CREATE TABLE table_name_67 (
category VARCHAR,
character VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what category was character Jacqui Mcqueen nominated before 2011?
| SELECT category FROM table_name_67 WHERE character = "jacqui mcqueen" AND year < 2011 | sql_create_context |
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.admityear < "2124" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
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_NM = '施弘益' AND t_kc22.STA_DATE BETWEEN '2001-01-09' AND '2013-11-22' AND t_kc22.SOC_SRT_DIRE_NM = '右佐匹克隆片' | css |
CREATE TABLE table_28601467_1 (
year INTEGER,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent year in which the winner record is Ireland 4 points?
| SELECT MAX(year) FROM table_28601467_1 WHERE winner = "Ireland 4 points" | sql_create_context |
CREATE TABLE table_name_54 (
number_1971 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1981 value of the Macedonian population with a 1971 number greater than 192 and a 1991 of 1748?
| SELECT 1981 FROM table_name_54 WHERE number_1971 > 192 AND 1991 = 1748 | sql_create_context |
CREATE TABLE table_60337 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Ends" real,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals did coe get?
| SELECT MIN("Goals") FROM table_60337 WHERE "Name" = 'coe' | wikisql |
CREATE TABLE table_27537518_4 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for the October 16 game?
| SELECT record FROM table_27537518_4 WHERE date = "October 16" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReas... | SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId GROUP BY TagName ORDER BY Rate DESC | sede |
CREATE TABLE table_name_99 (
week_11_nov_6 VARCHAR,
week_10_oct_30 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Week 11 when Week 10 had Nebraska (7-1)?
| SELECT week_11_nov_6 FROM table_name_99 WHERE week_10_oct_30 = "nebraska (7-1)" | sql_create_context |
CREATE TABLE table_1342249_42 (
result VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many results have Jere Cooper as incumbent?
| SELECT result FROM table_1342249_42 WHERE incumbent = "Jere Cooper" | 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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | 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 = 25312)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT mzjzjlb.ZZYSGH, mzjzjlb.QTJZYSGH FROM mzjzjlb WHERE mzjzjlb.JZLSH = '67977476641' | css |
CREATE TABLE table_43718 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title did George Fury win when on the Oran Park Raceway?
| SELECT "Race Title" FROM table_43718 WHERE "Winner" = 'george fury' AND "Circuit" = 'oran park raceway' | wikisql |
CREATE TABLE table_31174 (
"Player" text,
"Starts" real,
"Cuts made" real,
"Best finish" text,
"Money list rank" real,
"Earnings ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum start record for player of Jeff Brehaut?
| SELECT MAX("Starts") FROM table_31174 WHERE "Player" = 'Jeff Brehaut' | wikisql |
CREATE TABLE table_10238 (
"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 was the home team score for the game played... | SELECT "Home team score" FROM table_10238 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_203_618 (
id number,
"pick" number,
"player" text,
"team" text,
"position" text,
"school" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- selected before mark mulder ?
| SELECT "player" FROM table_203_618 WHERE "pick" = (SELECT "pick" FROM table_203_618 WHERE "player" = 'mark mulder') - 1 | squall |
CREATE TABLE table_19401346_1 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the title of the episode with production code 10018?
| SELECT title FROM table_19401346_1 WHERE production_code = 10018 | sql_create_context |
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.MED_CLINIC_ID FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '赵凯乐' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-08-29' AND '2016-10-19' UNION SELECT gyb.MED_CLINIC_ID FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '赵凯乐' AND t_kc24.CL... | css |
CREATE TABLE table_38504 (
"Borough" text,
"Components" text,
"Population" real,
"Number of Borough Councilors" real,
"Number of Municipal Councilors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which components have a borough of Lennoxville and ... | SELECT "Components" FROM table_38504 WHERE "Number of Borough Councilors" < '4' AND "Borough" = 'lennoxville' | wikisql |
CREATE TABLE table_23183195_2 (
road_record VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the road record for Vanderbilt?
| SELECT COUNT(road_record) FROM table_23183195_2 WHERE team = "Vanderbilt" | sql_create_context |
CREATE TABLE table_41662 (
"20 years" text,
"2400 kWh/kW p y" real,
"2200 kWh/kW p y" real,
"2000 kWh/kW p y" real,
"1800 kWh/kW p y" real,
"1600 kWh/kW p y" real,
"1400 kWh/kW p y" real,
"1200 kWh/kW p y" real,
"1000 kWh/kW p y" real,
"800 kWh/kW p y" real
)
-- Using valid SQL... | SELECT MAX("2000 kWh/kW p y") FROM table_41662 WHERE "2400 kWh/kW p y" < '12.5' AND "1600 kWh/kW p y" = '3.8' AND "1800 kWh/kW p y" < '3.3' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.dob_year < "1837" | mimicsql_data |
CREATE TABLE table_name_41 (
avg INTEGER,
player VARCHAR,
fumbles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Buck Pierce's highest average when there were less than 2 fumbles?
| SELECT MAX(avg) FROM table_name_41 WHERE player = "buck pierce" AND fumbles < 2 | sql_create_context |
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 varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_61530 (
"Bow number" text,
"Ship name" text,
"Launched" text,
"Commissioned" text,
"Service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the ship that was commissioned July 1948 with a bow number of ps-31 launch?
| SELECT "Launched" FROM table_61530 WHERE "Commissioned" = 'july 1948' AND "Bow number" = 'ps-31' | wikisql |
CREATE TABLE table_54118 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position for 2008, where 2012 was q1, and 2010... | SELECT "2008" FROM table_54118 WHERE "2012" = 'q1' AND "2010" = '1r' | 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 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 WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.dob_year < "2041" | mimicsql_data |
CREATE TABLE table_name_29 (
director VARCHAR,
serial_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the director for heroes of the wild
| SELECT director FROM table_name_29 WHERE serial_title = "heroes of the wild" | sql_create_context |
CREATE TABLE table_name_45 (
game INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What average game has January 30 as the date?
| SELECT AVG(game) FROM table_name_45 WHERE date = "january 30" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-3162')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-... | eicu |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '华俊迈' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2007-07-28' AND '2017-09-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_train_19 (
"id" int,
"white_blood_cell_count_wbc" int,
"active_infection" bool,
"heart_disease" bool,
"temperature" float,
"skin_lesion" bool,
"heart_rate" int,
"paco2" float,
"immature_form" int,
"respiratory_rate" int,
"age" float,
"NOUSE" float
)
-... | SELECT * FROM table_train_19 WHERE heart_disease = 1 | criteria2sql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.