instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE d_icd_procedures (
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 procedures_icd (
row_id number,
subject_id number,... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88573) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-11' GROUP BY prescriptions.drug) AS t1 WHERE t1.c... | mimic_iii |
CREATE TABLE table_47720 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Away team has a Ground of gabba?
| SELECT "Away team" FROM table_47720 WHERE "Ground" = 'gabba' | wikisql |
CREATE TABLE table_39479 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score when Steve Stricker was runner-up?
| SELECT "Winning score" FROM table_39479 WHERE "Runner(s)-up" = 'steve stricker' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
... | SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code | nvbench |
CREATE TABLE table_203_462 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year was more successful , 2012 or 2007 ?
| SELECT "year" FROM table_203_462 WHERE "year" IN (2012, 2007) ORDER BY "regular season" LIMIT 1 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309" | mimicsql_data |
CREATE TABLE table_1637041_6 (
wins INTEGER,
starts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum number of wins in the season with 22 starts?
| SELECT MAX(wins) FROM table_1637041_6 WHERE starts = 22 | sql_create_context |
CREATE TABLE table_19180 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many home (2nd leg) had a 1st leg 1-1?
| SELECT COUNT("Home (2nd leg)") FROM table_19180 WHERE "1st Leg" = '1-1' | wikisql |
CREATE TABLE table_name_86 (
opposing_teams VARCHAR,
against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opposing Teams, when Against is less than 6?
| SELECT opposing_teams FROM table_name_86 WHERE against < 6 | sql_create_context |
CREATE TABLE table_204_870 (
id number,
"product" text,
"main functionality" text,
"input format" text,
"output format" text,
"platform" text,
"license and cost" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the ne... | SELECT "product" FROM table_204_870 WHERE id = (SELECT id FROM table_204_870 WHERE "product" = 'egonet') + 1 | squall |
CREATE TABLE table_name_79 (
australian VARCHAR,
american VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Australian for the American ?
| SELECT australian FROM table_name_79 WHERE american = "ɑ" | sql_create_context |
CREATE TABLE table_name_56 (
attendance VARCHAR,
date VARCHAR,
kickoff_time VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game with a kickoff time of cbs 1:00pm, in a week earlier than 8, on September 15, 2... | SELECT attendance FROM table_name_56 WHERE kickoff_time = "cbs 1:00pm" AND week < 8 AND date = "september 15, 2002" | sql_create_context |
CREATE TABLE results (
resultId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
grid INTEGER,
position TEXT,
positionText TEXT,
positionOrder INTEGER,
points REAL,
laps TEXT,
time TEXT,
milliseconds TEXT,
fastestLap TEXT,
rank... | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE table_name_87 (
pre_race_host VARCHAR,
lap_by_lap VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Pre-Race Host when Mike Joy was the Lap-by-lap in the Year 2005?
| SELECT pre_race_host FROM table_name_87 WHERE lap_by_lap = "mike joy" AND year = 2005 | sql_create_context |
CREATE TABLE staff (
staff_id number,
staff_gender text,
staff_name text
)
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status_code text,
order_date time
)
CREATE TABLE product_suppliers (
product_id number,
supplier_id number,
date_supplied_from ti... | SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_51127 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Lost larger than 4, and a Played larger than 14?
| SELECT AVG("Position") FROM table_51127 WHERE "Lost" > '4' AND "Played" > '14' | 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.language = "SPAN" AND demographic.religion = "GREEK ORTHODOX" | mimicsql_data |
CREATE TABLE table_9717 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Laps, when Rider is Sylvain Guintoli, and when Grid is less than 16?
| SELECT MIN("Laps") FROM table_9717 WHERE "Rider" = 'sylvain guintoli' AND "Grid" < '16' | wikisql |
CREATE TABLE table_35045 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has nashville predators as the opponent?
| SELECT "Score" FROM table_35045 WHERE "Opponent" = 'nashville predators' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Donepezil" | mimicsql_data |
CREATE TABLE table_name_54 (
week_3 VARCHAR,
week_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the cyber girl in week 3 when Ashley Lowe was the cyber girl in week 2?
| SELECT week_3 FROM table_name_54 WHERE week_2 = "ashley lowe" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '58973613' AND hz_info.YLJGDM = '3560417' AND NOT zzmzjzjlb.JZZDSM LIKE '%低钾血症%' UNION SELECT * FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM ... | css |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
a... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE table_2820584_3 (
score_in_the_final VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the final played with Fred McNair as partner?
| SELECT score_in_the_final FROM table_2820584_3 WHERE partner = "Fred McNair" | sql_create_context |
CREATE TABLE table_17709 (
"Club" text,
"Overall Record" text,
"Goals For" real,
"Goals For Avg." text,
"Goals Against" real,
"Goals Against Avg." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Dallas Burn had a 12-9-7 record and what number... | SELECT "Goals For" FROM table_17709 WHERE "Overall Record" = '12-9-7' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | SELECT MAX(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 = 13897 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevent... | mimic_iii |
CREATE TABLE table_20393 (
"N\u00b0" text,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What DAR is a... | SELECT "DAR" FROM table_20393 WHERE "N\u00b0" = '336' AND "Language" = 'Italian' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2133" AND lab.itemid = "51132" | mimicsql_data |
CREATE TABLE table_name_62 (
partner VARCHAR,
tournament_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Partner in the United Airlines Tournament (1)?
| SELECT partner FROM table_name_62 WHERE tournament_name = "united airlines tournament (1)" | sql_create_context |
CREATE TABLE table_name_22 (
opponents VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent at Ullevi?
| SELECT opponents FROM table_name_22 WHERE venue = "ullevi" | sql_create_context |
CREATE TABLE election (
Delegate VARCHAR,
District VARCHAR
)
CREATE TABLE county (
County_id VARCHAR,
Population INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many distinct delegates are from counties with population larger than 50000?
| SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id 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_tests int,
... | SELECT DISTINCT course.department, course.name, course.number 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.department = 'EPID' AND semester.semester = 'Spring' | advising |
CREATE TABLE table_4575 (
"Commodity" text,
"2001-02" text,
"2002-03" text,
"2003-04" text,
"2004-05" text,
"2005-06" text,
"2006-07" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the production in 2006-07 for the commodity that pr... | SELECT "2006-07" FROM table_4575 WHERE "2005-06" = '2,601' | wikisql |
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
)
-- Using valid SQLite, answer the fol... | SELECT total FROM body_builder ORDER BY total | spider |
CREATE TABLE table_204_169 (
id number,
"athlete" text,
"event" text,
"race 1\ntime" text,
"race 2\ntime" text,
"total\ntime" text,
"total\nrank" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long did it take for lyubomir popov to fin... | SELECT "race 1\ntime" FROM table_204_169 WHERE "athlete" = 'lyubomir popov' AND "event" = 'giant slalom' | squall |
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 decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-34744')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | eicu |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2102' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_39439 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gold medal count that has a silver medal count less than 0?
| SELECT MAX("Gold") FROM table_39439 WHERE "Silver" < '0' | wikisql |
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 medication (
medi... | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-168146')) AND lab.labname = 'acetaminophen' AND DATETIME(lab.labresulttime) <=... | eicu |
CREATE TABLE table_9184 (
"% people under 18 (2005)" text,
"Seine-Saint-Denis" text,
"Paris" text,
"Val-de-Marne" text,
"Val-d'Oise" text,
"France" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE VAL-D-OISE WITH A FRANCE OF 1.4%?
| SELECT "Val-d'Oise" FROM table_9184 WHERE "France" = '1.4%' | 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '011-55642' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_95 (
position VARCHAR,
points VARCHAR,
passenger VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position has 30 points and Reiner Stuyvenberg as a passenger?
| SELECT position FROM table_name_95 WHERE points = 30 AND passenger = "reiner stuyvenberg" | sql_create_context |
CREATE TABLE table_name_99 (
score1 VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score for the Thurrock?
| SELECT score1 FROM table_name_99 WHERE opponent = "thurrock" | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT p.Id AS "post_link", u.Id AS "user_link", p.Score, p.CreationDate, p.ViewCount, p.Tags FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Id IN ('##list##') AND p.PostTypeId = 1 ORDER BY p.Id DESC LIMIT 100 | sede |
CREATE TABLE table_name_10 (
method VARCHAR,
record VARCHAR,
round VARCHAR,
res VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What method did Mikhail Ilyukhin win the fight in round 1 when his record was 13-5?
| SELECT method FROM table_name_10 WHERE round = "1" AND res = "win" AND record = "13-5" | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate')) AND STRFTIME('%y', cost.chargetime) >= '2105' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Readi-Cat 2 (Barium Sulfate 2% Suspension)" | mimicsql_data |
CREATE TABLE table_name_15 (
judaism VARCHAR,
other VARCHAR,
buddhism VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Judaism percentage associated with Buddhism at 0.01% and Other at 0.13%?
| SELECT judaism FROM table_name_15 WHERE other = "0.13%" AND buddhism = "0.01%" | sql_create_context |
CREATE TABLE table_name_40 (
week VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks have an attendance of 64,116?
| SELECT COUNT(week) FROM table_name_40 WHERE attendance = "64,116" | sql_create_context |
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 jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '31995900098' | css |
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.short_title = "Constipation NOS" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_name_38 (
competition VARCHAR,
event VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the competition for the event team all-round in the year before 1913?
| SELECT competition FROM table_name_38 WHERE event = "team all-round" AND year < 1913 | sql_create_context |
CREATE TABLE table_52948 (
"English Name" text,
"Japanese orthography" text,
"Pronouciation" text,
"abbreviation" text,
"Provider(national government)" text,
"Foundation" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the english name of... | SELECT "English Name" FROM table_52948 WHERE "Provider(national government)" = 'ministry of defense' AND "abbreviation" = 'nda bōei-dai(防衛大)' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID | nvbench |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE table_203_574 (
id number,
"track number" number,
"russian title" text,
"english title" text,
"music" text,
"lyrics" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what it the english title of the only song done with lyrics by v. sh... | SELECT "english title" FROM table_203_574 WHERE "lyrics" = 'v. shumsky' | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'hydromorphone hcl' AND patient.uniquepid = '015-1581' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), ... | 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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mch cmp autm mplnt dfbrl') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm... | mimic_iii |
CREATE TABLE table_name_45 (
years VARCHAR,
soap_opera VARCHAR,
actor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the years that have un posto al sole as the soap opera, with riccardo polizzy carbonelli as the actor?
| SELECT years FROM table_name_45 WHERE soap_opera = "un posto al sole" AND actor = "riccardo polizzy carbonelli" | sql_create_context |
CREATE TABLE table_6681 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round that had a pick lower than 8?
| SELECT MAX("Round") FROM table_6681 WHERE "Pick #" < '8' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '60954060244' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 1 | css |
CREATE TABLE table_48976 (
"Competition" text,
"Played" real,
"Millwall wins" real,
"Drawn" real,
"West Ham wins" real,
"Millwall goals" real,
"West Ham goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins did West Ham get whe... | SELECT "West Ham wins" FROM table_48976 WHERE "Millwall wins" > '5' AND "Millwall goals" > '23' AND "Drawn" = '8' | wikisql |
CREATE TABLE table_61311 (
"Player" text,
"Club" text,
"Qualifying Goals" real,
"Finals Goals" real,
"Total Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Total Goals greater than 1 and Qualifying Goals smaller than 3?
| SELECT "Player" FROM table_61311 WHERE "Total Goals" > '1' AND "Qualifying Goals" < '3' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Venous (peripheral) insufficiency, unspecified" AND prescriptions.route = "IV" | mimicsql_data |
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT low_estimate, high_estimate FROM film_market_estimation | spider |
CREATE TABLE Certificate (
eid VARCHAR,
aid VARCHAR
)
CREATE TABLE Aircraft (
aid VARCHAR,
name VARCHAR
)
CREATE TABLE Employee (
name VARCHAR,
eid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show names for all employees who do not have ... | SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | sql_create_context |
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 (
CYBQDM text,
CYBQMC... | SELECT * FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '61020155' AND hz_info.YLJGDM = '2269328' AND NOT txmzjzjlb.JZZDSM LIKE '%病理性%' UNION SELECT * FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM A... | css |
CREATE TABLE table_name_6 (
score VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The game with a loss of smith (2-4) ended with what score?
| SELECT score FROM table_name_6 WHERE loss = "smith (2-4)" | sql_create_context |
CREATE TABLE table_203_37 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tracks were produced by milanna miles and rick long ?
| SELECT COUNT("title") FROM table_203_37 WHERE "producer(s)" = 'milann miles, rick long' | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number... | WITH tagedits_cte AS (SELECT Ph1.PostId AS pid, Ph1.Id AS phid, MIN(ph2.Id) AS MinId FROM PostHistory AS ph1 INNER JOIN PostHistory AS ph2 ON ph2.PostId = ph1.PostId WHERE (ph2.Id > ph1.Id) AND (ph1.PostHistoryTypeId IN (3, 6, 9)) AND (ph2.PostHistoryTypeId IN (3, 6, 9)) GROUP BY ph1.PostId, Ph1.Id) SELECT t.pid AS "po... | sede |
CREATE TABLE table_name_97 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is melbourne's home team score?
| SELECT home_team AS score FROM table_name_97 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height | nvbench |
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
de... | SELECT name FROM employee EXCEPT SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | spider |
CREATE TABLE table_10313 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the average Gold for total smaller 12 and bronze less than 1 and wushu with silver more than 3
| SELECT AVG("Gold") FROM table_10313 WHERE "Total" < '12' AND "Bronze" < '1' AND "Sport" = 'wushu' AND "Silver" > '3' | wikisql |
CREATE TABLE table_242785_1 (
notes VARCHAR,
main_legionary_base VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the notes for svishtov , bulgaria?
| SELECT notes FROM table_242785_1 WHERE main_legionary_base = "Svishtov , Bulgaria" | sql_create_context |
CREATE TABLE table_79126 (
"Date" text,
"Time (UTC)" text,
"Epicenter" text,
"Magnitude" text,
"Depth" text,
"Intensity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the depth of the quake that occurred at 19:48?
| SELECT "Depth" FROM table_79126 WHERE "Time (UTC)" = '19:48' | wikisql |
CREATE TABLE table_name_16 (
years_active VARCHAR,
titles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of 2nd place finishes for racers active in the year 2000 and more than 0 titles?
| SELECT AVG(2 AS nd_pl) FROM table_name_16 WHERE years_active = "2000" AND titles > 0 | sql_create_context |
CREATE TABLE table_name_67 (
score VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of T3 place?
| SELECT score FROM table_name_67 WHERE place = "t3" | sql_create_context |
CREATE TABLE table_name_3 (
time VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Time has an Opponent of josh branham?
| SELECT time FROM table_name_3 WHERE opponent = "josh branham" | sql_create_context |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player can call notre dame his alma mat... | SELECT "player" FROM table_204_93 WHERE "college" = 'notre dame' | squall |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
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 varch... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 493 | advising |
CREATE TABLE table_name_15 (
points INTEGER,
lyricist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of points for ray agius
| SELECT SUM(points) FROM table_name_15 WHERE lyricist = "ray agius" | sql_create_context |
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE table_73831 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Deli... | SELECT "Cyrillic Name Other Names" FROM table_73831 WHERE "Settlement" = 'Deliblato' | wikisql |
CREATE TABLE table_7299 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Set 3 on 30 may, and a Set 1 is 20 25?
| SELECT "Set 3" FROM table_7299 WHERE "Date" = '30 may' AND "Set 1" = '20–25' | wikisql |
CREATE TABLE table_68476 (
"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's the 1st leg score when Team 1 was Gor Mahia?
| SELECT "1st leg" FROM table_68476 WHERE "Team 1" = 'gor mahia' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
... | 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 = 15986)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... | mimic_iii |
CREATE TABLE table_30344 (
"Character" text,
"Game" text,
"Platform" text,
"Status" text,
"Mystic Arte" text,
"Character Voice" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which character is yumi kakazu the character voice?
| SELECT "Character" FROM table_30344 WHERE "Character Voice" = 'Yumi Kakazu' | wikisql |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY COUNT(*) | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id numbe... | SELECT (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 = 'chrnc hpt ... | mimic_iii |
CREATE TABLE team_half (
year number,
league_id text,
team_id text,
half number,
div_id text,
div_win text,
rank number,
g number,
w number,
l number
)
CREATE TABLE team_franchise (
franchise_id text,
franchise_name text,
active text,
na_assoc text
)
CREATE TABL... | SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990 | spider |
CREATE TABLE table_41534 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest lost number of the team wit... | SELECT MAX("Lost") FROM table_41534 WHERE "Points" < '14' AND "Played" < '18' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '精神发育迟滞' AND jyjgzbb.JCZBMC = '转铁蛋白' | css |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE locations (
location_id number,
stre... | SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") | spider |
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
-- Using valid SQLite, answer the foll... | SELECT nationality FROM ship GROUP BY nationality HAVING COUNT(*) > 2 | spider |
CREATE TABLE table_name_91 (
completed VARCHAR,
pennant_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the completed date of the destroyer with a pennant number h63?
| SELECT completed FROM table_name_91 WHERE pennant_number = "h63" | sql_create_context |
CREATE TABLE table_29209 (
"Model" text,
"Speed (GHz)" text,
"L2 Cache (MB)" real,
"L3 Cache (MB)" real,
"FSB (MHz)" real,
"TDP (W)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the maximal L3 cache for any of the models given?
| SELECT MAX("L2 Cache (MB)") FROM table_29209 | wikisql |
CREATE TABLE table_73771 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is shown for august 21-22 when november 3 is november 3, 1994?
| SELECT "August 21-22" FROM table_73771 WHERE "November 3" = 'November 3, 1994' | wikisql |
CREATE TABLE table_name_11 (
format VARCHAR,
owner VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the format for Cherry Creek Radio with frequency of 0 92.1 fm?
| SELECT format FROM table_name_11 WHERE owner = "cherry creek radio" AND frequency = "0 92.1 fm" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.