instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 demographic (
subject_id text,
hadm_id t... | SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "3343" | mimicsql_data |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT zyjzjlb.MZZYZDZZBM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '33429029356' | css |
CREATE TABLE table_69722 (
"Season" text,
"Team" text,
"Country" text,
"Division" real,
"Apps" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average apps for smederevo
| SELECT AVG("Apps") FROM table_69722 WHERE "Team" = 'smederevo' | wikisql |
CREATE TABLE table_204_433 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of names on the chart ?
| SELECT COUNT("name") FROM table_204_433 | squall |
CREATE TABLE table_name_99 (
time VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning time in 1984?
| SELECT time FROM table_name_99 WHERE year = "1984" | 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 inputevents_cv (
row_id number,
subject_id number,
... | 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 (post-mortem)') | mimic_iii |
CREATE TABLE table_64730 (
"Year" real,
"Place" text,
"Gold" text,
"Silver" text,
"Bronze" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest year the world championships were held in Thun?
| SELECT MAX("Year") FROM table_64730 WHERE "Place" = 'thun' | wikisql |
CREATE TABLE table_name_11 (
attendance VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance for Arsenal?
| SELECT attendance FROM table_name_11 WHERE home_team = "arsenal" | sql_create_context |
CREATE TABLE table_77268 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date where the round is R3?
| SELECT "Date" FROM table_77268 WHERE "Round" = 'r3' | wikisql |
CREATE TABLE table_26496 (
"Administrative division" text,
"Area (km\u00b2) 2011**" text,
"Population 2001 Census (Adjusted)" real,
"Population 2011 Census (Adjusted)" real,
"Population density (/km\u00b2 2011)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Administrative division" FROM table_26496 WHERE "Population density (/km\u00b2 2011)" = '8,552.4' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Mild intellect disabilty" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_204_651 (
id number,
"date" text,
"championship" text,
"location" text,
"category" text,
"surface" text,
"prev. result" text,
"prev. points" number,
"new points" number,
"outcome" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT "championship" FROM table_204_651 WHERE "surface" = 'grass' ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_35 (
agg VARCHAR,
team_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Agg., when Team 1 is 'Noliko Maaseik'?
| SELECT agg FROM table_name_35 WHERE team_1 = "noliko maaseik" | sql_create_context |
CREATE TABLE table_45242 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Poles do ... | SELECT "Poles" FROM table_45242 WHERE "Team" = 'team jva' | 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.admityear < "2184" AND prescriptions.drug = "Fluoxetine HCl" | mimicsql_data |
CREATE TABLE Assets_in_Events (
Asset_ID INTEGER,
Event_ID INTEGER
)
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Code CHAR(15),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4)
)
CREATE TABLE Assets (
Asset_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Produ... | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY Product_Price | nvbench |
CREATE TABLE gwyjzb (
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 gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4535136' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4535136' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_name_32 (
name VARCHAR,
time VARCHAR,
rank VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a larger rank than 3, less than 6 lanes, and a time of 1:58.15?
| SELECT name FROM table_name_32 WHERE rank > 3 AND lane < 6 AND time = "1:58.15" | sql_create_context |
CREATE TABLE table_73828 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" text,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The pooulation o... | SELECT "Population (2011)" FROM table_73828 WHERE "Cyrillic Name Other Names" = 'Јарковац' | wikisql |
CREATE TABLE table_name_75 (
money___$__ VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much money does the player with a to par less than 4 and a score of 74-72-68-73=287 have?
| SELECT money___$__ FROM table_name_75 WHERE to_par < 4 AND score = 74 - 72 - 68 - 73 = 287 | sql_create_context |
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 person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '99312004581' | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | SELECT U1.DisplayName AS MathUserName, U1.Id AS MathUserId, U1.Reputation AS MathReputation, U2.DisplayName AS PhysicsUserName, U2.Id AS PhysicsUserId, U2.Reputation AS PhysicsReputation FROM "stackexchange.math".dbo.Users AS U1, "stackexchange.physics".dbo.Users AS U2 WHERE U1.AccountId = U2.AccountId ORDER BY CASE WH... | sede |
CREATE TABLE table_name_10 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team score at Glenferrie Oval?
| SELECT home_team AS score FROM table_name_10 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE table_36470 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much February has a Game larger than 37, and an Opponent of chicago black hawks?
| SELECT COUNT("February") FROM table_36470 WHERE "Game" > '37' AND "Opponent" = 'chicago black hawks' | wikisql |
CREATE TABLE table_203_18 (
id number,
"year" number,
"film" text,
"role" text,
"co-star" text,
"director" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last movie joya ahsan played in ?
| SELECT "film" FROM table_203_18 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_name_82 (
tie_no INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tie no when the away team is solihull moors?
| SELECT SUM(tie_no) FROM table_name_82 WHERE away_team = "solihull moors" | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '36444760543' | 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 demographic.religion FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '97703801' AND qtb.MED_SER_ORG_NO = '4175966' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '97703801' AND gyb.MED_SER_ORG_NO = '4175... | css |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_37733 (
"Name" text,
"Birth date" text,
"Age as of 1 February 2014" text,
"Province or Country of birth" text,
"Province of residence" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average age as of February 1, 2014 f... | SELECT "Age as of 1 February 2014" FROM table_37733 WHERE "Province or Country of birth" = 'united states' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.BGDH = '74581993759' | css |
CREATE TABLE table_3349 (
"Urban settlement" text,
"Cyrillic Name" text,
"City / municipality" text,
"District" text,
"Population (1991)" real,
"Population (2002)" real,
"Population (2011)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name... | SELECT MIN("Population (2002)") FROM table_3349 WHERE "Urban settlement" = 'Ada' | wikisql |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NU... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE, EMP_FNAME ORDER BY EMP_FNAME DESC | nvbench |
CREATE TABLE table_name_43 (
bronze INTEGER,
points VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For clubs that have 0 gold and less than 5 points, what is the average amount of bronze medals?
| SELECT AVG(bronze) FROM table_name_43 WHERE points < 5 AND gold < 0 | sql_create_context |
CREATE TABLE table_203_406 (
id number,
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text,
"driver" text,
"rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what entrant is listed after ecurie excelsior ... | SELECT "entrant" FROM table_203_406 WHERE id > (SELECT id FROM table_203_406 WHERE "entrant" = 'ecurie excelsior') LIMIT 1 | squall |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory distress' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS... | eicu |
CREATE TABLE table_28555 (
"Episode #" real,
"Prod #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who directed the episode james clavell wrote?
| SELECT "Directed by" FROM table_28555 WHERE "Written by" = 'James Clavell' | wikisql |
CREATE TABLE table_204_694 (
id number,
"year" text,
"name" text,
"date" text,
"stages" number,
"distance" text,
"winner" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of winners before the tour wa... | SELECT COUNT("winner") FROM table_204_694 WHERE "date" <> 'cancelled' | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Thiamine" | mimicsql_data |
CREATE TABLE table_name_90 (
number VARCHAR,
position VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number for the forward position from the school/club team La Salle?
| SELECT number FROM table_name_90 WHERE position = "forward" AND school_club_team = "la salle" | 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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay > "17" | mimicsql_data |
CREATE TABLE table_36065 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rebounds does Fedor likholitov have with a rank greater than 8?
| SELECT SUM("Rebounds") FROM table_36065 WHERE "Name" = 'fedor likholitov' AND "Rank" > '8' | wikisql |
CREATE TABLE table_name_37 (
losses INTEGER,
games_played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average losses for the team(s) that played more than 8 games?
| SELECT AVG(losses) FROM table_name_37 WHERE games_played > 8 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.short_title = "Stomach ulcer NOS" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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... | (SELECT jybgb.KSBM, jybgb.KSMC 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 hz_info.RYBH = '27615170' AND jybgb.BGRQ BETWEEN '2013-04-02' AND '2021... | css |
CREATE TABLE table_dev_52 (
"id" int,
"anemia" bool,
"gender" string,
"prediabetes" bool,
"systolic_blood_pressure_sbp" int,
"metabolic_syndrome" bool,
"hemoglobin_a1c_hba1c" float,
"dyslipidemia" bool,
"dsp" int,
"renal_disease" bool,
"hepatic_disease" bool,
"elevated_tr... | SELECT * FROM table_dev_52 WHERE hepatic_disease = 1 OR renal_disease = 1 OR (serum_creatinine > 1.8 AND gender = 'male') OR (serum_creatinine > 1.6 AND gender = 'female') | criteria2sql |
CREATE TABLE table_name_83 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had a 2R categorization in 2009 and SF in 2010?
| SELECT tournament FROM table_name_83 WHERE 2009 = "2r" AND 2010 = "sf" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 prescriptions (
row_id numbe... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND microbiologyevents.spec_type_desc = 'blood culture ( myco/f lytic bottle)' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.chart... | mimic_iii |
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 jybgb.BBCJBW 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 hz_info.RYBH = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '2002-02-06' UNI... | css |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTasks (
Id num... | SELECT CAST(TIME_TO_STR(CreationDate, '%-HOUR') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%-HOUR') + 1 AS TEXT) + ' UTC' AS time_of_the_day, CAST(TIME_TO_STR(CreationDate, '%-HOUR') + 5.5 AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%-HOUR') + 6.5 AS TEXT) + ' IST' AS time_of_the_day_ist, COUNT(1) AS no_of_p... | sede |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airlin... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit... | atis |
CREATE TABLE table_41726 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what season did Omar Thomas play, with a jersey number larger tha... | SELECT "Season" FROM table_41726 WHERE "Number" > '15' AND "Name" = 'omar thomas' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2176" AND prescriptions.drug = "Montelukast Sodium" | mimicsql_data |
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Trie... | SELECT Position, AVG(Points) FROM player GROUP BY Position | nvbench |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city var... | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LACS' AND course.number = 400 AND instructor.name LIKE '%Serena Ng%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe... | advising |
CREATE TABLE table_30171 (
"Round" text,
"Main date" text,
"Number of fixtures" real,
"Clubs" text,
"New entries this round" text,
"Prize money" text,
"Player of the Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the main date... | SELECT "Main date" FROM table_30171 WHERE "Round" = 'Third Round Qualifying' | wikisql |
CREATE TABLE table_name_67 (
city VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city is located in Oklahoma?
| SELECT city FROM table_name_67 WHERE state = "oklahoma" | sql_create_context |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | SELECT zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '42916483908' | css |
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 treatment (
treat... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'bumetanide 0.25 mg/1ml 4ml sdv inj') | eicu |
CREATE TABLE table_name_29 (
played INTEGER,
position VARCHAR,
goals_against VARCHAR,
draws VARCHAR,
goals_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Played has Draws smaller than 7, and Goals for smaller than 61, and Goals against ... | SELECT MAX(played) FROM table_name_29 WHERE draws < 7 AND goals_for < 61 AND goals_against < 48 AND position = 5 | sql_create_context |
CREATE TABLE table_22717 (
"Age group" text,
"Brazil 100% (percent of the population)" text,
"White 47.73% (percent in the race/percent in the age group)" text,
"Black 7.61% (percent in the race/percent in the age group)" text,
"Yellow 1.09% (percent in the race/percent in the age group)" text,
... | SELECT "Brazil 100% (percent of the population)" FROM table_22717 WHERE "Age group" = '15-17' | wikisql |
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 patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'motor neuropathy - amyotrophic lateral sclerosis' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') | eicu |
CREATE TABLE table_44349 (
"Rank" text,
"Time" text,
"Athlete" text,
"Nation" text,
"Date" text,
"Race" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time when the race was in Kenya and Lineth Chepkurui was the athlete?
| SELECT "Time" FROM table_44349 WHERE "Nation" = 'kenya' AND "Athlete" = 'lineth chepkurui' | wikisql |
CREATE TABLE table_56064 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended games with st kilda as ... | SELECT SUM("Crowd") FROM table_56064 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_22905641_2 (
race_1_winner VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the race 1 winner of the race at Hidden Valley Raceway?
| SELECT race_1_winner FROM table_22905641_2 WHERE circuit = "Hidden Valley Raceway" | sql_create_context |
CREATE TABLE table_name_62 (
entrant VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which entrant has a Mclaren m7c Chassis?
| SELECT entrant FROM table_name_62 WHERE chassis = "mclaren m7c" | sql_create_context |
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 patients.dob FROM patients WHERE patients.subject_id = 91004 | 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 MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2013-06-02' AND '2020-05-10' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 21 | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
CR... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 47460 AND admissions.admission_location = 'clinic referral/premature' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_43752 (
"Goal" real,
"Date" text,
"Venue" text,
"Result" text,
"Competition" text,
"Scored" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the venue when the competition is friendly on 26 may 1999?
| SELECT "Venue" FROM table_43752 WHERE "Competition" = 'friendly' AND "Date" = '26 may 1999' | wikisql |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
-- Using valid SQLite... | SELECT COUNT(*) FROM allergy_type WHERE allergytype = "animal" | spider |
CREATE TABLE table_name_99 (
location VARCHAR,
opponent VARCHAR,
rules VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where has a Rules of thai boxing, and a Round of n/a, and an Opponent of everton crawford?
| SELECT location FROM table_name_99 WHERE rules = "thai boxing" AND round = "n/a" AND opponent = "everton crawford" | sql_create_context |
CREATE TABLE table_name_92 (
format VARCHAR,
region VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which format had a United States region and a date of August 11, 2009?
| SELECT format FROM table_name_92 WHERE region = "united states" AND date = "august 11, 2009" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT TIME_TO_STR(p.CreationDate, '%-HOUR') AS Hour, COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FL... | sede |
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 COUNT(*) FROM faculty WHERE sex = 'F' AND rank = "Professor" | spider |
CREATE TABLE table_30341 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Incoming manager" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many new managers replaced man... | SELECT COUNT("Incoming manager") FROM table_30341 WHERE "Manner of departure" = 'Resigned' | wikisql |
CREATE TABLE table_9251 (
"Rank" text,
"Runs" text,
"Opponent" text,
"Venue" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent played in 2001/02?
| SELECT "Opponent" FROM table_9251 WHERE "Season" = '2001/02' | wikisql |
CREATE TABLE table_28286776_50 (
club_s_ VARCHAR,
international_debut VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 2010 v australia is the interantional debut what is the club?
| SELECT club_s_ FROM table_28286776_50 WHERE international_debut = "2010 v Australia" | sql_create_context |
CREATE TABLE table_1143 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the attendance for september 19, 1976
| SELECT MIN("Attendance") FROM table_1143 WHERE "Date" = 'September 19, 1976' | wikisql |
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
cate... | SELECT director FROM movie WHERE year = 1999 OR year = 2000 | spider |
CREATE TABLE table_name_46 (
score VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Competition is 'Friendly', and when Date is '30 April'?
| SELECT score FROM table_name_46 WHERE competition = "friendly" AND date = "30 april" | sql_create_context |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_51 (
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many average 100s were there for Tim Bresnan?
| SELECT AVG(100 AS s) FROM table_name_51 WHERE player = "tim bresnan" | sql_create_context |
CREATE TABLE organizations (
organization_name VARCHAR,
organization_id VARCHAR
)
CREATE TABLE organization_contact_individuals (
organization_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of organization that has the greatest numbe... | SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_94 (
draw INTEGER,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest draw with rank 4?
| SELECT MIN(draw) FROM table_name_94 WHERE rank = 4 | sql_create_context |
CREATE TABLE table_name_91 (
venue VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the venue of the Melbourne team?
| SELECT venue FROM table_name_91 WHERE home_team = "melbourne" | sql_create_context |
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.discharge_location = "SHORT TERM HOSPITAL" AND procedures.icd9_code = "3142" | mimicsql_data |
CREATE TABLE table_name_27 (
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the location when the notes area is notes?
| SELECT location FROM table_name_27 WHERE "notes" = "notes" | sql_create_context |
CREATE TABLE table_26385 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which frequency is DYMY?
| SELECT "Frequency" FROM table_26385 WHERE "Callsign" = 'DYMY' | wikisql |
CREATE TABLE table_name_75 (
elevated VARCHAR,
cardinalatial_order_and_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Cardinal-Deacon of S. Giorgio in Velabro elevated?
| SELECT elevated FROM table_name_75 WHERE cardinalatial_order_and_title = "cardinal-deacon of s. giorgio in velabro" | sql_create_context |
CREATE TABLE table_12466 (
"College or Campus Name" text,
"Location" text,
"District" text,
"Affiliation" text,
"Estd" real,
"Weblink" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which College or campus has a website of http://www.aucev.edu.i... | SELECT "College or Campus Name" FROM table_12466 WHERE "Weblink" = 'http://www.aucev.edu.in/' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
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
)
... | SELECT meter_500, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_27783 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "LOA (Metres)" FROM table_27783 WHERE "Yacht type" = 'Simonis Voogd Maxi' | wikisql |
CREATE TABLE table_name_23 (
results VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in 2000?
| SELECT results FROM table_name_23 WHERE year = 2000 | sql_create_context |
CREATE TABLE table_887 (
"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 had ... | SELECT "High points" FROM table_887 WHERE "High rebounds" = 'Charles Oakley (9)' | wikisql |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_des... | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) | nvbench |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '66461842965' | css |
CREATE TABLE table_name_9 (
inclination VARCHAR,
mass VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Inclination has a Mass of 6.6 +1.1 1.0 m ?
| SELECT inclination FROM table_name_9 WHERE mass = "≥ 6.6 +1.1 −1.0 m⊕" | sql_create_context |
CREATE TABLE Student (
Fname VARCHAR,
Lname VARCHAR,
Major VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all students' first names and last names who majored in 600.
| SELECT Fname, Lname FROM Student WHERE Major = 600 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.