instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE farm (
farm_id number,
year number,
total_horses number,
working_horses number,
total_cattle number,
oxen number,
bulls number,
cows number,
pigs number,
sheep_and_goats number
)
CREATE TABLE farm_competition (
competition_id number,
year number,
theme t... | SELECT T2.year, T1.official_name FROM city AS T1 JOIN farm_competition AS T2 ON T1.city_id = T2.host_city_id | spider |
CREATE TABLE table_33289 (
"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.
-- On what date did the home team score 5.8 (38)?
| SELECT "Date" FROM table_33289 WHERE "Home team score" = '5.8 (38)' | wikisql |
CREATE TABLE table_29777 (
"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.
-- Who wa... | SELECT "Team" FROM table_29777 WHERE "Score" = 'W 94–88 (OT)' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name... | SELECT Id AS "comment_link", CreationDate, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##UserId##' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_88 (
part_4 VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the part 4 entry for class 7b?
| SELECT part_4 FROM table_name_88 WHERE class = "7b" | sql_create_context |
CREATE TABLE table_name_42 (
total_atms INTEGER,
bank_type VARCHAR,
on_site_atms VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum total ATMs with new private sector banks as the bank type, and the on-site ATMs are greater than 1883?
| SELECT MIN(total_atms) FROM table_name_42 WHERE bank_type = "new private sector banks" AND on_site_atms > 1883 | sql_create_context |
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, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'occupational th... | eicu |
CREATE TABLE table_48554 (
"Player" text,
"No.(s)" real,
"Height in Ft." text,
"Position" text,
"Years with Spurs" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT POSITION HAD SPURS IN 2009-2012?
| SELECT "Position" FROM table_48554 WHERE "Years with Spurs" = '2009-2012' | wikisql |
CREATE TABLE table_203_362 (
id number,
"school" text,
"location" text,
"outright titles" number,
"shared titles" number,
"runners-up" number,
"total finals" number,
"last title" number,
"last final" number
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "school" FROM table_203_362 WHERE "school" <> 'coleraine academical institution' AND "outright titles" = (SELECT "outright titles" FROM table_203_362 WHERE "school" = 'coleraine academical institution') | 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 Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC | nvbench |
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 SQRGH, SQRXM FROM jybgb WHERE BGDH = '38996454394' | css |
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 songs are on prophets vs. profits ?
| SELECT COUNT("title") FROM table_203_37 | squall |
CREATE TABLE table_name_67 (
weight__kg_ INTEGER,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest weight for the Farnley Stakes race?
| SELECT MAX(weight__kg_) FROM table_name_67 WHERE race = "farnley stakes" | sql_create_context |
CREATE TABLE table_56906 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the away team with the home... | SELECT "Away team score" FROM table_56906 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE table_10422 (
"Team" text,
"Established" real,
"Big Ten Conference Titles" real,
"National Titles" real,
"Venue" text,
"Opened" real,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of big t... | SELECT MIN("Big Ten Conference Titles") FROM table_10422 WHERE "Capacity" = '60,670' AND "National Titles" > '5' | wikisql |
CREATE TABLE table_66022 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Elevation (m) has a Prominence (m) larger than 1,754?
| SELECT SUM("Elevation (m)") FROM table_66022 WHERE "Prominence (m)" > '1,754' | wikisql |
CREATE TABLE table_54101 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"Career SR" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "1998" FROM table_54101 WHERE "2007" = '3r' | wikisql |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cine... | SELECT Name, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name ORDER BY Name DESC | 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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | mimicsql_data |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hosp... | eicu |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSBM = '310' AND zzmzjzjlb.JZKSRQ BETWEEN '2000-11-09' AND '2015-03-17' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSBM = '310' AND fzzmzjzjlb.JZKSRQ BETWEEN '2000-11-09' AND '2015-03-17' | css |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Magnesium, Urine" | mimicsql_data |
CREATE TABLE table_56240 (
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What race has a Pole Position... | SELECT "Race" FROM table_56240 WHERE "Pole Position" = 'jacques laffite' | wikisql |
CREATE TABLE table_17243 (
"Date of Issue" text,
"Theme" text,
"Denomination" text,
"Design" text,
"Illustration" text,
"Printing Process" text,
"Paper Type" text,
"First Day Cover Cancellation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Design" FROM table_17243 WHERE "Theme" = 'Jasper National Park' | wikisql |
CREATE TABLE table_1008 (
"Player" text,
"Position" text,
"Games started" text,
"Hometown" text,
"Height" text,
"Weight" real,
"Class" text,
"Prior experience" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is hugh white's weight?
| SELECT MAX("Weight") FROM table_1008 WHERE "Player" = 'Hugh White' | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "41" AND procedures.icd9_code = "3723" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2170" AND diagnoses.short_title = "Malig neo bladder NEC" | mimicsql_data |
CREATE TABLE table_name_10 (
margin_of_victory VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Juli's winning margin on Aug 24, 1986?
| SELECT margin_of_victory FROM table_name_10 WHERE date = "aug 24, 1986" | sql_create_context |
CREATE TABLE table_name_76 (
gold INTEGER,
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest gold a team with less than 3 silver and more than 5 bronze medals has?
| SELECT MAX(gold) FROM table_name_76 WHERE silver < 3 AND bronze > 5 | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures ... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_78492 (
"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.
-- On what date was a game played at Windy Hill?
| SELECT "Date" FROM table_78492 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE table_77453 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has a Home Team of rochester, and a Game of game 5?
| SELECT "Result" FROM table_77453 WHERE "Home Team" = 'rochester' AND "Game" = 'game 5' | wikisql |
CREATE TABLE table_32461 (
"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 venue featured the home side of st kilda?
| SELECT "Venue" FROM table_32461 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_29626583_1 (
position VARCHAR,
affiliation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position for the university of akron michigan bucks affiliation
| SELECT position FROM table_29626583_1 WHERE affiliation = "University of Akron Michigan Bucks" | 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 zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '姜娟秀' AND hz_info.YLJGDM = '5351150' AND zyjzjlb.JZKSMC LIKE '%康复%' | css |
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 COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTI... | eicu |
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE domain_conference (
cid int... | SELECT conference.name FROM conference, keyword, publication, publication_keyword WHERE keyword.keyword = 'Relational Database' AND publication_keyword.kid = keyword.kid AND publication.cid = conference.cid AND publication.pid = publication_keyword.pid GROUP BY conference.name ORDER BY COUNT(DISTINCT (publication.title... | academic |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID | nvbench |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport... | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL... | atis |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other gastrostomy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23224) AND STRFTI... | mimic_iii |
CREATE TABLE table_12803 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average round of player dave pulkkinen, who had a draft after 1969?
| SELECT AVG("Round") FROM table_12803 WHERE "Player" = 'dave pulkkinen' AND "Draft" > '1969' | wikisql |
CREATE TABLE table_11908801_1 (
nickname VARCHAR,
meaning VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nickname that means god holds my life?
| SELECT nickname FROM table_11908801_1 WHERE meaning = "God Holds My Life" | sql_create_context |
CREATE TABLE table_6313 (
"Model" text,
"Codename" text,
"Capacities (GB)" text,
"NAND type" text,
"Interface" text,
"Form factor" text,
"Controller" text,
"Seq. read/write MB/s" text,
"Rnd 4KB read/write IOPS (K)" text,
"Introduced" text
)
-- Using valid SQLite, answer the fol... | SELECT "Controller" FROM table_6313 WHERE "Interface" = 'pcie 2.0 × 8' | wikisql |
CREATE TABLE table_18407 (
"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.
-- how many party with district being tennessee 1
| SELECT COUNT("Party") FROM table_18407 WHERE "District" = 'Tennessee 1' | wikisql |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy... | css |
CREATE TABLE table_1903 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position of the Atl... | SELECT MAX("Position") FROM table_1903 WHERE "Team" = 'Atl. Colegiales' | wikisql |
CREATE TABLE table_18828487_1 (
champion VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much does the champion get for stadthalle dinslaken, dinslaken?
| SELECT champion FROM table_18828487_1 WHERE venue = "Stadthalle Dinslaken, Dinslaken" | sql_create_context |
CREATE TABLE table_name_98 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total number who attended during week 11?
| SELECT COUNT(attendance) FROM table_name_98 WHERE week = 11 | sql_create_context |
CREATE TABLE table_74808 (
"Year" real,
"Driver" text,
"Nation of citizenship" text,
"Racing series" text,
"Type of vehicle" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Nation of citizenship has a stock car vehicle with a year of 2012?
| SELECT "Nation of citizenship" FROM table_74808 WHERE "Type of vehicle" = 'stock car' AND "Year" = '2012' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture' AND STRFTIME('%y', microbiologyevents.charttime) <= '2104') | mimic_iii |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_20947 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Bills points" real,
"Opponents" real,
"Bills first downs" real,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many... | SELECT COUNT("Opponents") FROM table_20947 WHERE "Game" = '13' | wikisql |
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.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ... | css |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_11149 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which biggest interview score had an evening gown stat of 9.286?
| SELECT MAX("Interview") FROM table_11149 WHERE "Evening Gown" = '9.286' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "34" AND diagnoses.icd9_code = "261" | mimicsql_data |
CREATE TABLE table_32769 (
"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 largest crowd for an away Carlton g... | SELECT MAX("Crowd") FROM table_32769 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2795059' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-04-20' AND '2016-08-16' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 7541.4 UNION SELECT gyb.MED_ORG_DEPT_CD FRO... | css |
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 wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '王清妍' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2004-06-1... | css |
CREATE TABLE table_name_26 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance on week 7?
| SELECT attendance FROM table_name_26 WHERE week = 7 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_location = "** INFO NOT AVAILABLE **" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" | mimicsql_data |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | 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 INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE table_53691 (
"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.
-- Who was the away team at Western Oval?
| SELECT "Away team" FROM table_53691 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE customers (
good_or_bad_customer VARCHAR,
coupon_id VARCHAR
)
CREATE TABLE discount_coupons (
coupon_id VARCHAR,
coupon_amount VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Are the customers holding coupons with amount 500 bad or good?... | SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_IN_DIAG_DIS_CD = 'L29.482' | css |
CREATE TABLE table_204_225 (
id number,
"rank" number,
"country/territory" text,
"miss supranational" number,
"1st runner-up" number,
"2nd runner-up" number,
"3rd runner-up" number,
"4th runner-up" number,
"semifinalists" number,
"total" number
)
-- Using valid SQLite, answer t... | SELECT "country/territory" FROM table_204_225 WHERE id = (SELECT id FROM table_204_225 WHERE "country/territory" = 'turkey') - 1 | squall |
CREATE TABLE table_13081 (
"Date (dd.mm.yyyy)" text,
"Soviet Unit" text,
"Aircraft flown" text,
"Enemy Aircraft" text,
"Axis Unit" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the victory when the Soviet Unit was 73 giap, and ... | SELECT "Date (dd.mm.yyyy)" FROM table_13081 WHERE "Soviet Unit" = '73 giap' AND "Enemy Aircraft" = 'bf.109g-? w.nr.?' | wikisql |
CREATE TABLE table_2445 (
"Round" real,
"Date" text,
"Home Team" text,
"Score" text,
"Away Team" text,
"Attendance" real,
"Stadium" text,
"Match Details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 3 - 1 hughes 64' is the score w... | SELECT "Stadium" FROM table_2445 WHERE "Score" = '3 - 1 Hughes 64' | wikisql |
CREATE TABLE table_2071644_2 (
weight__kg_m_ VARCHAR,
flange_width__mm_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weights are there when the flange with is 304?
| SELECT COUNT(weight__kg_m_) FROM table_2071644_2 WHERE flange_width__mm_ = 304 | sql_create_context |
CREATE TABLE table_name_99 (
games INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many average games did Nick Rimando have?
| SELECT AVG(games) FROM table_name_99 WHERE player = "nick rimando" | sql_create_context |
CREATE TABLE table_name_19 (
gold VARCHAR,
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much gold does the tank have that has 3 silver and more than 3 bronze?
| SELECT COUNT(gold) FROM table_name_19 WHERE silver = 3 AND bronze > 3 | sql_create_context |
CREATE TABLE table_20744 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the home team score w... | SELECT "Home team score" FROM table_20744 WHERE "Away team score" = '18.12 (120)' | wikisql |
CREATE TABLE table_33365 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Partner" text,
"Opponents in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date shows corrado barazzutti's partner?
| SELECT "Date" FROM table_33365 WHERE "Partner" = 'corrado barazzutti' | wikisql |
CREATE TABLE university (
LOCATION VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find how many school locations have the word 'NY'.
| SELECT COUNT(*) FROM university WHERE LOCATION LIKE "%NY%" | sql_create_context |
CREATE TABLE table_23590 (
"Title" text,
"Author" text,
"Reader" text,
"Format" text,
"Company" text,
"Release Date" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many notes were read by reader varma, idria indira varma?
| SELECT COUNT("Notes") FROM table_23590 WHERE "Reader" = 'Varma, Idria Indira Varma' | wikisql |
CREATE TABLE table_name_92 (
opponent_in_the_final VARCHAR,
outcome VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Opponent in the final with an outcome of winner on 14-may-2007?
| SELECT opponent_in_the_final FROM table_name_92 WHERE outcome = "winner" AND date = "14-may-2007" | 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.expire_flag, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris" | mimicsql_data |
CREATE TABLE table_name_16 (
name VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the name with area of eketahuna
| SELECT name FROM table_name_16 WHERE area = "eketahuna" | sql_create_context |
CREATE TABLE table_15833 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest top-5 when the top-25 is less than 4, cuts made is more than 3 ... | SELECT MAX("Top-5") FROM table_15833 WHERE "Top-25" < '4' AND "Cuts made" > '3' AND "Wins" < '0' | wikisql |
CREATE TABLE table_15331868_1 (
won INTEGER,
difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number won with a difference of 1?
| SELECT MAX(won) FROM table_15331868_1 WHERE difference = "1" | sql_create_context |
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 t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')... | eicu |
CREATE TABLE table_10398 (
"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 did Yannick Dalmas do?
| SELECT "Laps" FROM table_10398 WHERE "Driver" = 'yannick dalmas' | 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 prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "MOR10L" | mimicsql_data |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | 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 = 7698)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirato... | mimic_iii |
CREATE TABLE table_67870 (
"Member countries" text,
"Population" real,
"Area (km\u00b2)" real,
"GDP (billion US$)" real,
"GDP per capita (US$)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population of the place that has an area (km )... | SELECT SUM("Population") FROM table_67870 WHERE "Area (km\u00b2)" = '30,528' AND "GDP (billion US$)" > '58.316' | wikisql |
CREATE TABLE table_58438 (
"CDP name" text,
"County" text,
"Pop. (2010)" real,
"Land ( sq mi )" real,
"Water (sq mi)" real,
"Coordinates" text,
"FIPS code" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the CDP nam... | SELECT "CDP name" FROM table_58438 WHERE "FIPS code" = '3659708' | wikisql |
CREATE TABLE table_64514 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average enrollment of the I... | SELECT AVG("Enrollment") FROM table_64514 WHERE "IHSAA Class" = 'a' AND "Location" = 'wolcott' | wikisql |
CREATE TABLE table_15088557_1 (
stage VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In how many stages did Jose Vicente Garcia Acosta won?
| SELECT COUNT(stage) FROM table_15088557_1 WHERE winner = "Jose Vicente Garcia Acosta" | sql_create_context |
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id ... | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
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 AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "EMERGENCY" | mimicsql_data |
CREATE TABLE table_59262 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MAX("Losses") FROM table_59262 WHERE "Position" < '6' AND "Wins" > '11' AND "Points" = '36' AND "Played" > '30' | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "1/2 NS" | mimicsql_data |
CREATE TABLE table_49441 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the game against Ayr United?
| SELECT "Result" FROM table_49441 WHERE "Opponent" = 'ayr united' | wikisql |
CREATE TABLE table_name_29 (
date VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Location Attendance is 'TD Banknorth Garden 18,624'?
| SELECT date FROM table_name_29 WHERE location_attendance = "td banknorth garden 18,624" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE semester (
semester_id int,
... | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.number = 344 AND c... | advising |
CREATE TABLE table_204_358 (
id number,
"species" text,
"common name" text,
"ncbi accession #" text,
"ncbi name" text,
"length" text,
"sequence identity" text,
"sequence similarity" text,
"years since divergence from human (mya)" number
)
-- Using valid SQLite, answer the following... | SELECT "years since divergence from human (mya)" FROM table_204_358 WHERE "common name" = 'zebra finch' | squall |
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 RYTJDM, RYTJMC FROM zyjzjlb WHERE JZLSH = '13547641005' | css |
CREATE TABLE review (
rid int,
business_id varchar,
user_id varchar,
rating float,
text longtext,
year int,
month varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar... | SELECT name FROM business WHERE rating = 3.5 | yelp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.