instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26720)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra... | mimic_iii |
CREATE TABLE table_1708050_1 (
starts VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the starts when position is 16th
| SELECT starts FROM table_1708050_1 WHERE position = "16th" | sql_create_context |
CREATE TABLE table_13885 (
"Athlete" text,
"Event" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text,
"Finals" text,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the quarterfinals when ... | SELECT "Quarterfinals" FROM table_13885 WHERE "Rank" = 'bronze' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 1 AND date_day.month_number = 6 AN... | atis |
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.gender = "F" AND prescriptions.drug = "Amitriptyline" | mimicsql_data |
CREATE TABLE table_69194 (
"Round" real,
"Circuit" text,
"Date" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Winning manufacturer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winning driver of the Cir... | SELECT "Winning driver" FROM table_69194 WHERE "Circuit" = 'lausitzring' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE table_42130 (
"Season" real,
"Date" text,
"Location" text,
"Driver" text,
"Chassis" text,
"Engine" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Driver, when the Date is October 6?
| SELECT "Driver" FROM table_42130 WHERE "Date" = 'october 6' | wikisql |
CREATE TABLE table_name_98 (
country VARCHAR,
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country is Brian Henninger from, who had a score larger than 69?
| SELECT country FROM table_name_98 WHERE score > 69 AND player = "brian henninger" | sql_create_context |
CREATE TABLE table_60190 (
"Election" text,
"First member" text,
"1st Party" text,
"Second member" text,
"2nd Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2nd Party, when Election is '1865'?
| SELECT "2nd Party" FROM table_60190 WHERE "Election" = '1865' | wikisql |
CREATE TABLE table_name_47 (
year_opened VARCHAR,
ride VARCHAR,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has the ride flight deck and a rating of less than 5?
| SELECT COUNT(year_opened) FROM table_name_47 WHERE ride = "flight deck" AND rating < 5 | sql_create_context |
CREATE TABLE table_16722 (
"Rnd" real,
"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.
-- Which race is... | SELECT "Race" FROM table_16722 WHERE "Location" = 'Kyalami' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '5573688' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 28 | css |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 19691 ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
CREATE TABLE table_3688 (
"Rank" real,
"Rider" text,
"Sat 21 Aug" text,
"Mon 23 Aug" text,
"Tues 24 Aug" text,
"Wed 25 Aug" text,
"Thurs 26 Aug" text,
"Fri 27 Aug" text,
"Sat 28 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Mon 23 Aug" FROM table_3688 WHERE "Rider" = 'Steve Linsdell 499cc Royal Enfield Seeley' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '柏慧艳' AND hz_info.YLJGDM = '0564335' AND mzjzjlb.JZKSMC LIKE '%免疫科%' | css |
CREATE TABLE table_name_36 (
gold INTEGER,
rank VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of golds for ranks of 6 and totals over 3?
| SELECT SUM(gold) FROM table_name_36 WHERE rank = "6" AND total > 3 | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT COUNT(*) FROM Posts WHERE (Score < 0 OR NOT ClosedDate IS NULL) AND PostTypeId = 1 | sede |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '9088702' AND RYDJSJ BETWEEN '2011-05-11' AND '2016-06-09' AND WDBZ > 0 | css |
CREATE TABLE table_203_127 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- largest run differ... | SELECT MAX(ABS("score" - "score")) FROM table_203_127 | squall |
CREATE TABLE table_name_18 (
lead VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which lead had a season of 2007-08?
| SELECT lead FROM table_name_18 WHERE season = "2007-08" | sql_create_context |
CREATE TABLE table_2538117_7 (
founding_date VARCHAR,
letters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the letters is , what is the founding date?
| SELECT founding_date FROM table_2538117_7 WHERE letters = "ΦΑΝ" | sql_create_context |
CREATE TABLE table_name_8 (
laps INTEGER,
grid VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of Laps with a Grid of more than 3 and Time of 39:24.967?
| SELECT MIN(laps) FROM table_name_8 WHERE grid > 3 AND time = "39:24.967" | sql_create_context |
CREATE TABLE table_203_691 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what were the number of games scheduled in november ?
| SELECT COUNT(*) FROM table_203_691 WHERE "date" = 11 | squall |
CREATE TABLE table_name_75 (
losses VARCHAR,
draw VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total losses were with less than 51 draws but more than 6 wins?
| SELECT COUNT(losses) FROM table_name_75 WHERE draw < 51 AND wins > 6 | sql_create_context |
CREATE TABLE table_38312 (
"Start month" text,
"End month" text,
"Cover" text,
"Spine" text,
"Indicia" text,
"Masthead" text,
"Number of issues" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which masthead ends on oct 69?
| SELECT "Masthead" FROM table_38312 WHERE "End month" = 'oct–69' | wikisql |
CREATE TABLE table_11053 (
"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.
-- Which venue has a Away team of hawthorn?
| SELECT "Venue" FROM table_11053 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id number,
bike_id number,
subscription_type text,
zip_code number
)
CREATE TABLE status (
station_id numb... | SELECT T1.name, T1.lat, MIN(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id | spider |
CREATE TABLE table_name_51 (
year VARCHAR,
bbc_two_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was BBC 2 13th in rank?
| SELECT year FROM table_name_51 WHERE bbc_two_rank = "13th" | sql_create_context |
CREATE TABLE table_name_74 (
airport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2008 has an Airport of julius nyerere international airport?
| SELECT AVG(2008) FROM table_name_74 WHERE airport = "julius nyerere international airport" | sql_create_context |
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype tex... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY diagnoses_icd.... | mimic_iii |
CREATE TABLE table_63392 (
"Year" real,
"Competition Description" text,
"Location" text,
"Apparatus" text,
"Rank-Final" real,
"Score-Final" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have a Rank-Final smaller than 7, and a Com... | SELECT SUM("Year") FROM table_63392 WHERE "Rank-Final" < '7' AND "Competition Description" = 'olympic games' AND "Score-Final" < '186.525' | wikisql |
CREATE TABLE table_63526 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the label for CAD 2014 CD?
| SELECT "Label" FROM table_63526 WHERE "Catalogue #" = 'cad 2014 cd' | wikisql |
CREATE TABLE papers (
paperid VARCHAR,
title VARCHAR
)
CREATE TABLE authorship (
authid VARCHAR,
paperid VARCHAR
)
CREATE TABLE authors (
fname VARCHAR,
authid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the first names of all the a... | SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Functional%" | sql_create_context |
CREATE TABLE table_name_34 (
season INTEGER,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest season with driver Farad Bathena?
| SELECT MIN(season) FROM table_name_34 WHERE driver = "farad bathena" | sql_create_context |
CREATE TABLE table_name_79 (
class VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class has a rank of 5th?
| SELECT class FROM table_name_79 WHERE rank = "5th" | sql_create_context |
CREATE TABLE gyb (
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 qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '75834844' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '75834844' GROUP BY gyb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT zyb.MED_SER_ORG_NO FROM zyb WHERE zyb.PERSON_ID = '75834844' GR... | css |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '7045795' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-02-25' AND '2009-10-24' GROUP... | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
cha... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83062) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRE... | mimic_iii |
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 SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_ID = '43928583' AND CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_name_76 (
cfl_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What CFL Team is Pascal Masson on?
| SELECT cfl_team FROM table_name_76 WHERE player = "pascal masson" | sql_create_context |
CREATE TABLE table_58476 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position is listed for the nebraska team?
| SELECT "Position" FROM table_58476 WHERE "School/Club Team" = 'nebraska' | wikisql |
CREATE TABLE table_78418 (
"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 home team that played in Victoria Pa... | SELECT "Home team" FROM table_78418 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_64992 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Matches" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many totals does cork have whose rank is larger than 2?
| SELECT SUM("Total") FROM table_64992 WHERE "County" = 'cork' AND "Rank" > '2' | wikisql |
CREATE TABLE table_11059 (
"Year" real,
"Competition" text,
"Date" text,
"Surface" text,
"Location" text,
"Score" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which surface has a Date of 24 25 apr?
| SELECT "Surface" FROM table_11059 WHERE "Date" = '24–25 apr' | wikisql |
CREATE TABLE table_27833186_1 (
rider_names VARCHAR,
best_conditioned_horse VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the Riders whose best-conditioned horse is Basia?
| SELECT rider_names FROM table_27833186_1 WHERE best_conditioned_horse = "Basia" | sql_create_context |
CREATE TABLE table_203_22 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who scored the most points ?
| SELECT "artist" FROM table_203_22 ORDER BY "points" DESC LIMIT 1 | squall |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
C... | SELECT phone, room, building FROM faculty WHERE fname = "Jerry" AND lname = "Prince" | spider |
CREATE TABLE table_204_420 (
id number,
"month" text,
"song" text,
"artist" text,
"aggregate points" number,
"total downloads" number,
"year-end chart" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which song is at the top for downloads ?... | SELECT "song" FROM table_204_420 ORDER BY "total downloads" DESC LIMIT 1 | squall |
CREATE TABLE table_name_4 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record for 21 january 2008
| SELECT record FROM table_name_4 WHERE date = "21 january 2008" | 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 COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '8721079' AND jybgb.BGRQ BETWEEN '2006-09-08' AND '2010-10-18' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 16) AS T | css |
CREATE TABLE table_name_16 (
type VARCHAR,
m809_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the type with M809 series of m814
| SELECT type FROM table_name_16 WHERE m809_series = "m814" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden ... | SELECT Id AS "comment_link", CreationDate, Score FROM Comments WHERE (LOWER(Text) LIKE '% close%') ORDER BY Comments.CreationDate DESC | sede |
CREATE TABLE table_203_139 (
id number,
"name" text,
"abbr." text,
"leader" text,
"ideology" text,
"political position" text,
"mps" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total of groups that have a populism ideology ?
| SELECT COUNT(*) FROM table_203_139 WHERE "ideology" = 'populism' | squall |
CREATE TABLE table_22447251_2 (
province VARCHAR,
_community VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which province is Villa Bison in?
| SELECT province, _community FROM table_22447251_2 WHERE hometown = "Villa Bisonó" | sql_create_context |
CREATE TABLE table_2345558_1 (
director VARCHAR,
writer_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode written by Jason Yoshimura?
| SELECT director FROM table_2345558_1 WHERE writer_s_ = "Jason Yoshimura" | sql_create_context |
CREATE TABLE table_name_31 (
annual_change VARCHAR,
rank VARCHAR,
capacity_in_use VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which yearly change was there a capacity of 78.4% and a rank smaller than 3?
| SELECT annual_change FROM table_name_31 WHERE rank < 3 AND capacity_in_use = "78.4%" | sql_create_context |
CREATE TABLE qtb (
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 qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2325366' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy... | css |
CREATE TABLE table_72934 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On October 16, 1966, what was the game site?
| SELECT "Game site" FROM table_72934 WHERE "Date" = 'October 16, 1966' | wikisql |
CREATE TABLE table_204_171 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of losses gran cochisse had against el dandy ?
| SELECT COUNT(*) FROM table_204_171 WHERE "loser" = 'gran cochisse' AND "winner" = 'el dandy' | squall |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_948 (
"No." text,
"Name" text,
"Livery" text,
"Arrival" real,
"Type" text,
"Configuration" text,
"Builder" text,
"Built" real,
"Status" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which numb... | SELECT "No." FROM table_948 WHERE "Location" = 'Engine shed' | wikisql |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the different names of friends who are yo... | SELECT DISTINCT T2.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person) | spider |
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 24 * (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 = 'hemorrhage nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions W... | mimic_iii |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Code, MIN(Price) FROM Products GROUP BY Code | nvbench |
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_items (
row_id number,
itemid number,
label text,... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'potassium chloride' | mimic_iii |
CREATE TABLE table_name_36 (
premiere VARCHAR,
episodes INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which premiere had more than 15 episodes?
| SELECT premiere FROM table_name_36 WHERE episodes > 15 | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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 ... | SELECT * FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb... | css |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "51214" | mimicsql_data |
CREATE TABLE table_46346 (
"City" text,
"Mongolian" text,
"Mongolian script" text,
"Province" text,
"Population (2008)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which mongolian has the province of municipality?
| SELECT "Mongolian" FROM table_46346 WHERE "Province" = 'municipality' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '45204934476') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '45204934476') | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Personal history of colonic polyps" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_40 (
gold INTEGER,
bronze INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of gold medals won among the nations that won more than 1 bronze?
| SELECT AVG(gold) FROM table_name_40 WHERE bronze > 1 | sql_create_context |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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 ... | SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '73... | css |
CREATE TABLE table_name_87 (
player VARCHAR,
weight VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player weighs 187 pounds?
| SELECT player FROM table_name_87 WHERE weight = 187 | sql_create_context |
CREATE TABLE table_14871601_2 (
losses INTEGER,
scored VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of losses when the scored value was 25?
| SELECT MAX(losses) FROM table_14871601_2 WHERE scored = 25 | sql_create_context |
CREATE TABLE staff (
staff_id number,
staff_gender text,
staff_name text
)
CREATE TABLE products (
product_id number,
product_type_code text,
product_name text,
product_price number
)
CREATE TABLE customers (
customer_id number,
payment_method_code text,
customer_code text,
... | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3 | spider |
CREATE TABLE table_name_9 (
city_of_license VARCHAR,
station VARCHAR,
network_affiliation VARCHAR,
format VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city of license has an independent network affiliation, a variety format and is station KKU... | SELECT city_of_license FROM table_name_9 WHERE network_affiliation = "independent" AND format = "variety" AND station = "kkup" | sql_create_context |
CREATE TABLE table_name_75 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team 1 has cbm valladolid as team 2?
| SELECT team_1 FROM table_name_75 WHERE team_2 = "cbm valladolid" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韩依然' UNION SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_i... | css |
CREATE TABLE table_65084 (
"City of license /Market" text,
"Station" text,
"Channel ( TV / RF )" text,
"Owned Since" real,
"Affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What affiliation has an owned since larger than 1991, and also ha... | SELECT "Affiliation" FROM table_65084 WHERE "Owned Since" > '1991' AND "Channel ( TV / RF )" = '42' | wikisql |
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested int,
total_budget_percent_invested real,
Budget_invested_percent text
)
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollmen... | SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC | nvbench |
CREATE TABLE bridge (
architect_id number,
id number,
name text,
location text,
length_meters number,
length_feet number
)
CREATE TABLE mill (
architect_id number,
id number,
location text,
name text,
type text,
built_year number,
notes text
)
CREATE TABLE architect... | SELECT AVG(length_feet) FROM bridge | spider |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT 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 = '035-2205' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'chloride' ... | eicu |
CREATE TABLE table_2367847_2 (
high_schools INTEGER,
district_wide VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most high schools for 31851
| SELECT MAX(high_schools) FROM table_2367847_2 WHERE district_wide = 31851 | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_79143 (
"Date" text,
"Bowl Game" text,
"Big Ten Team" text,
"Opp. Team" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opposing team in the game with a score of 21-17?
| SELECT "Opp. Team" FROM table_79143 WHERE "Score" = '21-17' | wikisql |
CREATE TABLE table_name_91 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2007 is the lowest one that has a 2004 of 78, and a 2006 smaller than 80?
| SELECT MIN(2007) FROM table_name_91 WHERE 2004 = 78 AND 2006 < 80 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7236122' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MAX(t_kc21.IN_HOSP_DAYS) < 15) AS T | css |
CREATE TABLE table_name_19 (
height__m_ VARCHAR,
nation VARCHAR,
weight__kg_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the height (m) when the nation is sweden (swe) and the weight (kg) is 102?
| SELECT height__m_ FROM table_name_19 WHERE nation = "sweden (swe)" AND weight__kg_ = "102" | sql_create_context |
CREATE TABLE table_13282157_1 (
country VARCHAR,
_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country for # 8
| SELECT country FROM table_13282157_1 WHERE _number = 8 | sql_create_context |
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 JZLSH FROM jybgb WHERE BGDH = '41456468801' | css |
CREATE TABLE table_47701 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was home, when the record was 24 16 6?
| SELECT "Home" FROM table_47701 WHERE "Record" = '24–16–6' | wikisql |
CREATE TABLE table_18064020_21 (
no_yds VARCHAR,
tfl_yds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many yards for the player with tfl-yds of 2.5-4?
| SELECT no_yds FROM table_18064020_21 WHERE tfl_yds = "2.5-4" | sql_create_context |
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_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '72363456' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7610.85) | css |
CREATE TABLE table_55075 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ngc number when the object type is lenticula... | SELECT MAX("NGC number") FROM table_55075 WHERE "Object type" = 'lenticular galaxy' AND "Constellation" = 'hydra' | wikisql |
CREATE TABLE table_47036 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At what location was the score W 82-76?
| SELECT "Location" FROM table_47036 WHERE "Score" = 'w 82-76' | 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 hz_info.person_info_XM FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE jybgb.BGDH = '04680290185' | css |
CREATE TABLE table_9790 (
"Actor" text,
"Role" text,
"Status" text,
"Number Of Episodes" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Role, when Status is '2001 - 2003, 2005 - 2009'?
| SELECT "Role" FROM table_9790 WHERE "Status" = '2001 - 2003, 2005 - 2009' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.