instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_204_503 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which was held in spain , the european championships or european indoor championship... | SELECT "competition" FROM table_204_503 WHERE "venue" = 'spain' AND "competition" IN ('european championships', 'european indoor championships') | squall |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28966) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputevents_cv.itemid IN ... | mimic_iii |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
... | SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos | nvbench |
CREATE TABLE table_204_753 (
id number,
"no." number,
"name" text,
"position" text,
"date of birth (age)" text,
"signed from" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players were not signed from the academy ?
| SELECT COUNT("name") FROM table_204_753 WHERE "signed from" <> 'the academy' | squall |
CREATE TABLE table_27887723_1 (
location VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what location has team trek-livestrong?
| SELECT location FROM table_27887723_1 WHERE team = "Trek-Livestrong" | sql_create_context |
CREATE TABLE table_52564 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which label had a catalog of 54513 in 1988?
| SELECT "Label" FROM table_52564 WHERE "Date" = '1988' AND "Catalog" = '54513' | wikisql |
CREATE TABLE table_13199 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score on 27 Jan 1990 with an Away Team of Queens Park Rangers?
| SELECT "Score" FROM table_13199 WHERE "Date" = '27 jan 1990' AND "Away team" = 'queens park rangers' | wikisql |
CREATE TABLE table_name_66 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the Lions play against the Tampa Bay Buccaneers?
| SELECT date FROM table_name_66 WHERE opponent = "tampa bay buccaneers" | sql_create_context |
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 COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8693')) AND treatment.treatmentname = 'therapeutic antibacterials - peni... | eicu |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id nu... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61591) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' | mimic_iii |
CREATE TABLE table_name_35 (
date VARCHAR,
label VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date is the release when the label was Parlophone and the catalog was 582 2912?
| SELECT date FROM table_name_35 WHERE label = "parlophone" AND catalog = "582 2912" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'prolactin')) AND DATETIME(cost.chargetime, 'start of year') = DATETI... | eicu |
CREATE TABLE table_25587 (
"Region ( NUTS 2006)" text,
"Total (million \u20ac )" text,
"\u20ac per capita (2005)" real,
"PPP (million \u20ac)" real,
"PPP \u20ac per capita" real,
"% of EU average GDP (PPP)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Total (million \u20ac )" FROM table_25587 WHERE "PPP (million \u20ac)" = '21779' | wikisql |
CREATE TABLE table_38320 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date in October did the Flyers play against the Toronto Maple Leafs?
| SELECT "October" FROM table_38320 WHERE "Opponent" = 'toronto maple leafs' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "50973" | mimicsql_data |
CREATE TABLE table_19460 (
"Year" real,
"Category" text,
"English title" text,
"Original title" text,
"Author" text,
"Nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original title of europe for dummies?
| SELECT "Original title" FROM table_19460 WHERE "English title" = 'Europe for Dummies' | wikisql |
CREATE TABLE table_name_6 (
league_division VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What league is Sun Source in?
| SELECT league_division FROM table_name_6 WHERE club = "sun source" | sql_create_context |
CREATE TABLE table_19131921_1 (
frequency VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which frequency is station wlfv-fm?
| SELECT frequency FROM table_19131921_1 WHERE station = "WLFV-FM" | sql_create_context |
CREATE TABLE table_name_29 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date is associated with a venue of Luxembourg?
| SELECT date FROM table_name_29 WHERE venue = "luxembourg" | sql_create_context |
CREATE TABLE table_24034 (
"Ep." real,
"Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. Code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 5a06 is the production code what is the hig... | SELECT MAX("Ep.") FROM table_24034 WHERE "Prod. Code" = '5A06' | wikisql |
CREATE TABLE table_name_62 (
round1 INTEGER,
round5 VARCHAR,
round2 VARCHAR,
round3 VARCHAR,
total_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is round1 when round3 is less than 51, total points is less than 273, round2 is less tha... | SELECT AVG(round1) FROM table_name_62 WHERE round3 < 51 AND total_points < 273 AND round2 < 98 AND round5 < 24 | sql_create_context |
CREATE TABLE table_53131 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which time/retired has a grid of 9?
| SELECT "Time/Retired" FROM table_53131 WHERE "Grid" = '9' | wikisql |
CREATE TABLE table_1342315_4 (
first_elected VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many first elections have Claude Fuller as incumbent?
| SELECT COUNT(first_elected) FROM table_1342315_4 WHERE incumbent = "Claude Fuller" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-20631')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE stay (
stayid number,
patient number,
room number,
staystart time,
stayend time
)
CREATE TABLE patient (
ssn number,
name text,
address text,
phone text,
insuranceid number,
pcp number
)
CREATE TABLE trained_in (
physician number,
treatment number,
... | SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50801" | mimicsql_data |
CREATE TABLE table_name_4 (
class VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the class for the position of lg?
| SELECT class FROM table_name_4 WHERE position = "lg" | sql_create_context |
CREATE TABLE table_57986 (
"Number Range" text,
"Builder" text,
"Introduced" real,
"No. Built" real,
"Region" text,
"Withdrawn" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was the building withdrawn when the builder was ac cars and was i... | SELECT SUM("Withdrawn") FROM table_57986 WHERE "Builder" = 'ac cars' AND "Introduced" < '1958' | wikisql |
CREATE TABLE table_63682 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name of the swimmer with a Time of 9:04.86 in Heat 2?
| SELECT "Name" FROM table_63682 WHERE "Heat" = '2' AND "Time" = '9:04.86' | wikisql |
CREATE TABLE browser (
id number,
name text,
market_share number
)
CREATE TABLE web_client_accelerator (
id number,
name text,
operating_system text,
client text,
connection text
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id number,
browser_id number,
compa... | SELECT MAX(market_share), MIN(market_share), AVG(market_share) FROM browser | spider |
CREATE TABLE table_name_22 (
format VARCHAR,
open_standard VARCHAR,
image_support VARCHAR,
interactivity_support VARCHAR,
word_wrap_support VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Format has an Interactivity support of no, a Word wra... | SELECT format FROM table_name_22 WHERE interactivity_support = "no" AND word_wrap_support = "yes" AND image_support = "yes" AND open_standard = "yes" | sql_create_context |
CREATE TABLE table_64327 (
"Season" text,
"Date" text,
"Venue" text,
"Competition" text,
"Score" text,
"Attendance" real,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the league cup in the 2007-08 season?
| SELECT "Score" FROM table_64327 WHERE "Competition" = 'league cup' AND "Season" = '2007-08' | wikisql |
CREATE TABLE table_27911 (
"Urban settlement" text,
"Cyrillic Name" text,
"City / municipality" text,
"District" text,
"Population (1991)" real,
"Population (2002)" real,
"Population (2011)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT MIN("Population (2002)") FROM table_27911 WHERE "Population (2011)" = '30076' | wikisql |
CREATE TABLE table_name_83 (
ratt VARCHAR,
long VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the RAtt when the long is 73?
| SELECT ratt FROM table_name_83 WHERE long = "73" | sql_create_context |
CREATE TABLE table_20850527_1 (
wildcats_points INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest points scored by the Wildcats when the record was 5-1?
| SELECT MIN(wildcats_points) FROM table_20850527_1 WHERE record = "5-1" | sql_create_context |
CREATE TABLE table_name_53 (
country VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which county did the player with a total of 294 represent?
| SELECT country FROM table_name_53 WHERE total = 294 | sql_create_context |
CREATE TABLE table_name_28 (
tenure VARCHAR,
team_nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tenure for the Tritons team?
| SELECT tenure FROM table_name_28 WHERE team_nickname = "tritons" | sql_create_context |
CREATE TABLE table_26561508_1 (
written_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the writter for the episode identified by the production code 2t5954?
| SELECT written_by FROM table_26561508_1 WHERE production_code = "2T5954" | sql_create_context |
CREATE TABLE table_79500 (
"Title" text,
"Series" text,
"Director" text,
"Release date" text,
"reissue?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the release date of Forward March Hare?
| SELECT "Release date" FROM table_79500 WHERE "Title" = 'forward march hare' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
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_... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '5:00' AND course_offering.start_time >= '10:00' AND course.course_id = course_offering.course_id AND course.department = 'JUDAIC' AND course.numb... | advising |
CREATE TABLE stadium (
country VARCHAR,
opening_year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which countries do not have a stadium that was opened after 2006?
| SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006 | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE AIRPORT_0.airport_code = 'LGA' AND AIRPORT_1.airport_code = 'JFK' AND flight.from_airport = AIRPORT_0.airport_code AND flight.to_airport = AIRPORT_1.airport_code | atis |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitaldi... | eicu |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subj... | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cornea degeneration nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cornea degeneration nec' | mimic_iii |
CREATE TABLE table_name_5 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What home team plays at glenferrie oval?
| SELECT home_team FROM table_name_5 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE table_name_9 (
laps INTEGER,
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most laps for grid more than 9 and the driver being jan heylen
| SELECT MAX(laps) FROM table_name_9 WHERE grid > 9 AND driver = "jan heylen" | sql_create_context |
CREATE TABLE table_204_425 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who name is listed last ?
| SELECT "name" FROM table_204_425 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_6261 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions fo... | SELECT "Drawn" FROM table_6261 WHERE "Try bonus" = '5' AND "Points for" = '517' | wikisql |
CREATE TABLE table_name_71 (
relation VARCHAR,
type VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Relation has a Type of tv, and a Name of ohanami?
| SELECT relation FROM table_name_71 WHERE type = "tv" AND name = "ohanami" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT * 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.JZLSH = jybgb.JZLSH_MZJZJLB AND jy... | css |
CREATE TABLE wrestler (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wrestlers are there?
| SELECT COUNT(*) FROM wrestler | sql_create_context |
CREATE TABLE table_1327 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What wa... | SELECT "Score" FROM table_1327 WHERE "Date" = 'January 11' | wikisql |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
st... | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY dept_name | nvbench |
CREATE TABLE table_62220 (
"Name" text,
"Area (km\u00b2)" real,
"Pop." real,
"Pop/Area (1/km\u00b2)" real,
"No P." real,
"No C./No T." text,
"Subregion" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pop/Area (1/km ) has a No P. larger... | SELECT AVG("Pop/Area (1/km\u00b2)") FROM table_62220 WHERE "No P." > '1' AND "Name" = 'albergaria-a-velha' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate tim... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'urin tract infecti... | mimic_iii |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT zyjybgb.BBCJBW FROM zyjybgb WHERE zyjybgb.BGDH = '23715494511' UNION SELECT mzjybgb.BBCJBW FROM mzjybgb WHERE mzjybgb.BGDH = '23715494511' | css |
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 COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-754')) AND lab.labname = 'phenobarbital' AND STRFTIME('%y', lab.labresulttime) >= '2103' | eicu |
CREATE TABLE fgwyjzb (
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 AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '中医针灸科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-06-25' AND '2011-05-19' AND gwyjzb.IN_DIAG_DIS_NM = '脑梗死后遗症' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '中医针灸科' AND fgwyjzb.IN_HOSP_DA... | css |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
de... | SELECT name FROM employee ORDER BY salary LIMIT 3 | spider |
CREATE TABLE table_70608 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place did Jack McGrath start in when he received a qual score of 141.033?
| SELECT "Start" FROM table_70608 WHERE "Qual" = '141.033' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATT... | atis |
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_NM = '何晓兰' AND t_kc22.STA_DATE BETWEEN '2004-09-27' AND '2017-08-12' AND t_kc22.SOC_SRT_DIRE_NM = '硝苯地平控释片' | css |
CREATE TABLE table_name_3 (
rank INTEGER,
opposition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest ranked player who opposed Westmeath?
| SELECT MAX(rank) FROM table_name_3 WHERE opposition = "westmeath" | sql_create_context |
CREATE TABLE table_train_162 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diastolic_blood_pressure_dbp" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions f... | SELECT * FROM table_train_162 WHERE hemoglobin_a1c_hba1c < 7.5 OR hemoglobin_a1c_hba1c > 12 | criteria2sql |
CREATE TABLE table_54477 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Round is the Event cage rage 17?
| SELECT "Round" FROM table_54477 WHERE "Event" = 'cage rage 17' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mechanical ventilation') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.... | eicu |
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
... | SELECT Days, SUM(Instructor) FROM Course GROUP BY Days ORDER BY Credits | nvbench |
CREATE TABLE table_204_985 (
id number,
"season" text,
"competition" text,
"round" text,
"club" text,
"home" text,
"away" text,
"aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what season was the only round 1 ?
| SELECT "season" FROM table_204_985 WHERE "round" = '1' | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-100195')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETI... | eicu |
CREATE TABLE table_41969 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Theme when the Original artist was carole king, and a Week # ... | SELECT "Theme" FROM table_41969 WHERE "Original artist" = 'carole king' AND "Week #" = 'hollywood' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT revisions.Month, revisions."amount_of_revisions" / CAST(sum_posts."amount_of_posts" AS FLOAT) FROM (SELECT Month = DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0), 'Amount of revisions' = COUNT(Id) FROM PostHistory GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0)) AS revisions INNER JOIN (SELECT ... | sede |
CREATE TABLE table_58478 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps are there for grid 8?
| SELECT "Laps" FROM table_58478 WHERE "Grid" = '8' | wikisql |
CREATE TABLE table_25107064_2 (
stolen_ends INTEGER,
country VARCHAR,
Germany VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the stolen ends for germany
| SELECT MIN(stolen_ends) FROM table_25107064_2 WHERE country = Germany | sql_create_context |
CREATE TABLE table_35628 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze is the lowest one that has a Nation of total, and a Gold smaller than 14?
| SELECT MIN("Bronze") FROM table_35628 WHERE "Nation" = 'total' AND "Gold" < '14' | wikisql |
CREATE TABLE table_name_33 (
player VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the player from Illinois?
| SELECT player FROM table_name_33 WHERE college = "illinois" | sql_create_context |
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
CREATE TABLE classroom (
building text,
room_number text,
capacity number
)
CREATE TABLE instructor (
id text,
name text,
dept_name text,
salary number
)
CREATE TABLE teaches (
id text,
co... | SELECT T1.title FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND year = 2010 | 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 patient.age FROM patient WHERE patient.uniquepid = '013-38992' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) <= '2101') | mimic_iii |
CREATE TABLE table_48717 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Enrollment" real,
"Joined" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Joined has an Institution of abraham baldwin agricultural college, ... | SELECT MAX("Joined") FROM table_48717 WHERE "Institution" = 'abraham baldwin agricultural college' AND "Enrollment" < '3,284' | wikisql |
CREATE TABLE table_name_84 (
first_match VARCHAR,
last_match VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the first match for 11 may 2008
| SELECT first_match FROM table_name_84 WHERE last_match = "11 may 2008" | sql_create_context |
CREATE TABLE table_name_71 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has a Record of 4-5?
| SELECT date FROM table_name_71 WHERE record = "4-5" | sql_create_context |
CREATE TABLE table_name_69 (
finalist VARCHAR,
semi_finalists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Finalist has a Semi finalists of monica seles conchita mart nez?
| SELECT finalist FROM table_name_69 WHERE semi_finalists = "monica seles conchita martínez" | sql_create_context |
CREATE TABLE table_22276 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when does the train departuring at 11.35 arrive
| SELECT "Arrival" FROM table_22276 WHERE "Departure" = '11.35' | wikisql |
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
Applications text,
Software_Platform text
)
CREATE TABLE stock (
Shop_ID int,
Device_ID int,
Quantity int
)
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Dat... | SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform | nvbench |
CREATE TABLE table_name_49 (
races INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE SUM OF RACES WITH 9 POINTS?
| SELECT SUM(races) FROM table_name_49 WHERE points = "9" | sql_create_context |
CREATE TABLE table_name_72 (
icao VARCHAR,
airport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO for Seewoosagur Ramgoolam airport?
| SELECT icao FROM table_name_72 WHERE airport = "seewoosagur ramgoolam airport" | sql_create_context |
CREATE TABLE table_204_547 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"time" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the time of the last finisher ?
| SELECT "time" FROM table_204_547 ORDER BY "rank" DESC LIMIT 1 | squall |
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 SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '99340869748' | css |
CREATE TABLE table_2146364_2 (
second_place VARCHAR,
city_ VARCHAR,
_nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of second place finishes when the city & nation was Chicago, USA?
| SELECT COUNT(second_place) FROM table_2146364_2 WHERE city_ & _nation = "Chicago, USA" | sql_create_context |
CREATE TABLE table_name_48 (
attendance INTEGER,
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Attendance has an Opponent of at los angeles rams, and a Week larger than 12?
| SELECT MAX(attendance) FROM table_name_48 WHERE opponent = "at los angeles rams" AND week > 12 | sql_create_context |
CREATE TABLE table_57192 (
"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.
-- How big was the crowd when the opponent was esse... | SELECT SUM("Crowd") FROM table_57192 WHERE "Away team" = 'essendon' | wikisql |
CREATE TABLE table_43898 (
"Week" real,
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Result, when Week is 16?
| SELECT "Result" FROM table_43898 WHERE "Week" = '16' | wikisql |
CREATE TABLE table_name_81 (
result VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are incumbent William Vandever's results?
| SELECT result FROM table_name_81 WHERE incumbent = "william vandever" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id num... | SELECT Posts.Title, Posts.Score, Users.DisplayName, Users.Reputation FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Reputation WHERE Posts.Score > 0 AND Users.Reputation < 10000 AND Posts.PostTypeId = 1 | sede |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id num... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE table_55599 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Ice level reporters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the network with the play-by-play Marv Albert before 1994?
| SELECT "Network" FROM table_55599 WHERE "Play-by-play" = 'marv albert' AND "Year" < '1994' | wikisql |
CREATE TABLE table_71734 (
"Year" real,
"Date" text,
"Title" text,
"Format(s)" text,
"Award Description(s)" text,
"Result(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the Award Descriptions for the year of 1989.
| SELECT "Award Description(s)" FROM table_71734 WHERE "Year" = '1989' | wikisql |
CREATE TABLE table_68528 (
"Compound name" text,
"Colour" text,
"Tread" text,
"Driving conditions" text,
"Dry Type*" text,
"Grip" text,
"Durability" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What grip has a dry option?
| SELECT "Grip" FROM table_68528 WHERE "Dry Type*" = 'option' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
... | 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 = 9566)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | mimic_iii |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.