instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51257" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_76902 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the opponent Vancouver Canucks?
| SELECT "Score" FROM table_76902 WHERE "Opponent" = 'vancouver canucks' | wikisql |
CREATE TABLE table_204_876 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- h... | SELECT COUNT("ecclesiastical jurisdictions") FROM table_204_876 | squall |
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.long_title = "Combined right and left heart cardiac catheterization" | mimicsql_data |
CREATE TABLE table_11677691_9 (
school VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has the player Thomas Tyner?
| SELECT school FROM table_11677691_9 WHERE player = "Thomas Tyner" | sql_create_context |
CREATE TABLE table_14363116_1 (
height INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the maximum height for yury berezhko
| SELECT MAX(height) FROM table_14363116_1 WHERE player = "Yury Berezhko" | sql_create_context |
CREATE TABLE table_203_412 (
id number,
"school" text,
"conference" text,
"record (conference)" text,
"head coach" text,
"cws appearances" text,
"cws best finish" text,
"cws record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- list eac... | SELECT "school" FROM table_203_412 WHERE "cws best finish" = 2 | squall |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Opn mitral valvuloplasty" | mimicsql_data |
CREATE TABLE table_28810 (
"Name" text,
"Sweet" text,
"Species" text,
"Gender" text,
"Attribute" text,
"Birthday" text,
"Media Debut" text,
"Voice Actor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- whatis the gender wher ethe species ... | SELECT "Gender" FROM table_28810 WHERE "Species" = 'Holland Lop' | wikisql |
CREATE TABLE table_name_35 (
jockey VARCHAR,
odds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what player scored 9/1
| SELECT jockey FROM table_name_35 WHERE odds = "9/1" | sql_create_context |
CREATE TABLE table_203_174 (
id number,
"rank" number,
"film" text,
"year" number,
"opening weekend\n(three day)" text,
"inflation-adjusted\n(2014 usd)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in terms of gross what movie is above toy sto... | SELECT "film" FROM table_203_174 WHERE "opening weekend\n(three day)" > (SELECT "opening weekend\n(three day)" FROM table_203_174 WHERE "film" = 'toy story 3') ORDER BY "opening weekend\n(three day)" LIMIT 1 | squall |
CREATE TABLE table_name_86 (
silver INTEGER,
total VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Total smaller than 10, and a Gold larger than 1 then what is the lowest silver?
| SELECT MIN(silver) FROM table_name_86 WHERE total < 10 AND gold > 1 | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '姜和畅' AND t_kc22.STA_DATE BETWEEN '2006-08-01' AND '2016-01-03' AND t_kc22.SELF_PAY_AMO > 7190.67 | css |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Hemorrhage complicating a procedure" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "92796" | 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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '多动性障碍' AND jyjgzbb.JCZBMC = '甲胎蛋白' UNION SELECT jyjgzbb.CKZFWXX, j... | css |
CREATE TABLE table_13940275_5 (
points_for VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the points for with points against being 556
| SELECT points_for FROM table_13940275_5 WHERE points_against = "556" | sql_create_context |
CREATE TABLE table_name_34 (
opponent VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has a Round of 12?
| SELECT opponent FROM table_name_34 WHERE round = "12" | sql_create_context |
CREATE TABLE table_62450 (
"Class" text,
"Number(s)" text,
"Quantity" text,
"Year(s) of Manufacture" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number was manufactured 1 in 1841?
| SELECT "Number(s)" FROM table_62450 WHERE "Quantity" = '1' AND "Year(s) of Manufacture" = '1841' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "7" | mimicsql_data |
CREATE TABLE table_name_12 (
driver VARCHAR,
constructor VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has BRM as a constructor and had more than 30 laps?
| SELECT driver FROM table_name_12 WHERE constructor = "brm" AND laps > 30 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
... | WITH AnswersPerQuestion(IdQuestion, NbAnswers, DayInWeek) AS (SELECT p1.Id AS IdQuestion, COUNT(p2.Id) AS NbAnswers, TIME_TO_STR(p1.CreationDate, 'WEEKDA%Y') AS DayInWeek FROM Posts AS p1 JOIN Posts AS p2 ON p1.Id = p2.ParentId WHERE p1.PostTypeId = 1 AND p2.PostTypeId = 2 GROUP BY p1.Id, TIME_TO_STR(p1.CreationDate, '... | sede |
CREATE TABLE table_26611679_3 (
average VARCHAR,
games_played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average for 23 games played
| SELECT average FROM table_26611679_3 WHERE games_played = 23 | sql_create_context |
CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Primary_Conference text,
building_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest... | SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY SUM(Enrollment) | nvbench |
CREATE TABLE table_name_14 (
result VARCHAR,
event VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has the Event, Strikeforce, and Method, Ko (double roundhouse kick)?
| SELECT result FROM table_name_14 WHERE event = "strikeforce" AND method = "ko (double roundhouse kick)" | sql_create_context |
CREATE TABLE table_21436373_5 (
date_year VARCHAR,
type_of_record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For what year is the type of record 'total attendance-regular season?
| SELECT date_year FROM table_21436373_5 WHERE type_of_record = "Total attendance-Regular season" | sql_create_context |
CREATE TABLE table_name_82 (
green INTEGER,
year VARCHAR,
labour VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the lowest Green with a Year larger than 2010, and a Labour larger than 29? Question 3
| SELECT MIN(green) FROM table_name_82 WHERE year > 2010 AND labour > 29 | sql_create_context |
CREATE TABLE table_13860 (
"Rank" real,
"Heat" real,
"Lane" real,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the heat when the nationality is australia and the rank is less than 1?
| SELECT AVG("Heat") FROM table_13860 WHERE "Nationality" = 'australia' AND "Rank" < '1' | wikisql |
CREATE TABLE table_298883_5 (
dimensions VARCHAR,
value VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the dimensions of the coin worth 200?
| SELECT dimensions FROM table_298883_5 WHERE value = "₩200" | sql_create_context |
CREATE TABLE table_name_89 (
road_team VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Road Team for the game ending with a score of 118-112?
| SELECT road_team FROM table_name_89 WHERE result = "118-112" | sql_create_context |
CREATE TABLE table_name_37 (
time VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time was the race for the country of france?
| SELECT time FROM table_name_37 WHERE country = "france" | sql_create_context |
CREATE TABLE table_79878 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For more than 3 events in the PGA Championship, what is the fewest number of wins?
| SELECT MIN("Wins") FROM table_79878 WHERE "Tournament" = 'pga championship' AND "Events" > '3' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2167" AND procedures.long_title = "Incision of vessel, lower limb arteries" | 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 SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9683754' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-18' AND '2005-04-20' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE f... | css |
CREATE TABLE table_29907 (
"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.
-- Which ... | SELECT "High points" FROM table_29907 WHERE "Date" = 'November 6' | wikisql |
CREATE TABLE table_name_71 (
position VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position at the venue of lyon?
| SELECT position FROM table_name_71 WHERE venue = "lyon" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length in... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_203_436 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the only year mr. wu competed in the olympic games ?
| SELECT "year" FROM table_203_436 WHERE "competition" = 'olympic games' | squall |
CREATE TABLE table_33249 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the Rams game against the Kansas City Chiefs?
| SELECT "Attendance" FROM table_33249 WHERE "Opponent" = 'kansas city chiefs' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '任成业' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 463.76) | css |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_name_72 (
total VARCHAR,
gold VARCHAR,
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of medals of Norway with a silver medal count greater than 6 and a gold medal count greater than ... | SELECT COUNT(total) FROM table_name_72 WHERE silver > 6 AND nation = "norway" AND gold > 10 | sql_create_context |
CREATE TABLE table_name_91 (
player VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player who went to school at Tampa?
| SELECT player FROM table_name_91 WHERE school_club_team = "tampa" | sql_create_context |
CREATE TABLE table_name_18 (
gold VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the gold in 1958?
| SELECT gold FROM table_name_18 WHERE year = "1958" | sql_create_context |
CREATE TABLE table_name_76 (
date VARCHAR,
results¹ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date was the Results 1:2?
| SELECT date FROM table_name_76 WHERE results¹ = "1:2" | sql_create_context |
CREATE TABLE table_24104 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record of the Wildcats after playing Florida?... | SELECT "Record" FROM table_24104 WHERE "Opponent" = 'Florida' | wikisql |
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_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '88840185' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6397.29) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '88840185' AND... | css |
CREATE TABLE table_19812 (
"Software" text,
"Version" text,
"Operating systems" text,
"Developer" text,
"License" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the software with version 1.2.2.0?
| SELECT "Software" FROM table_19812 WHERE "Version" = '1.2.2.0' | wikisql |
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 AVG(t_kc22.SELF_PAY_PRO) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '3907255' AND t_kc22.STA_DATE BETWEEN '2000-08-14' AND '2012-06-06' UNION SELECT AVG(t_kc22.SELF_PAY_PRO) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO ... | css |
CREATE TABLE table_203_724 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished with the top rank in total medals won ?
| SELECT "nation" FROM table_203_724 ORDER BY "total" DESC LIMIT 1 | squall |
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_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '严志用' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6005.61) | css |
CREATE TABLE table_16028499_2 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the team play the New York Jets?
| SELECT date FROM table_16028499_2 WHERE opponent = "New York Jets" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480') AND NOT patient.unitdischargetime IS N... | eicu |
CREATE TABLE table_5378 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has an Opponent of pittsburgh pirates, and a Date of may 5?
| SELECT "Record" FROM table_5378 WHERE "Opponent" = 'pittsburgh pirates' AND "Date" = 'may 5' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2182" | 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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "CHEST PAIN" AND demographic.admityear >= "2173" | mimicsql_data |
CREATE TABLE table_name_64 (
date VARCHAR,
type_of_game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the Euro '64 qualifying game?
| SELECT date FROM table_name_64 WHERE type_of_game = "euro '64 qualifying" | 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 * 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 = '4466465' AND NOT zyjzjlb.CYKSMC LIKE '%神外%' | css |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "72" | 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 qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '0101657' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) > 23 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '0101657' GR... | css |
CREATE TABLE table_name_37 (
money___ INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest money when the score was 69-68-67-69=273?
| SELECT MAX(money___) AS $__ FROM table_name_37 WHERE score = 69 - 68 - 67 - 69 = 273 | sql_create_context |
CREATE TABLE table_51652 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which circ... | SELECT "Circuit" FROM table_51652 WHERE "Constructor" = 'ferrari' AND "Fastest lap" = 'alberto ascari' | wikisql |
CREATE TABLE table_1341423_23 (
first_elected INTEGER,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was incumbent jim ramstad first elected?
| SELECT MIN(first_elected) FROM table_1341423_23 WHERE incumbent = "Jim Ramstad" | sql_create_context |
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 SALARY, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE bdmzjzjlb (
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 hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '68417064' AND wdmzjzjlb.JZKSRQ BETWEEN '2009-12-28' AND '2021-09-30' AND wdmzjzjlb.YLJGDM = '1278762' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON ... | 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 JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71689 AND admissions.dischtime IS NULL) AND transfers.careunit = 'sicu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight (
aircraft_code_sequence text,
... | 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 = 'ST. PAUL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUS... | atis |
CREATE TABLE table_40952 (
"Year" real,
"Date" text,
"Television" text,
"Designated Visitors" text,
"Designated Home" text,
"Stadium" text,
"City" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the visitors when the Atlanta Falcons ... | SELECT "Designated Visitors" FROM table_40952 WHERE "Designated Home" = 'atlanta falcons' | wikisql |
CREATE TABLE table_29840 (
"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.
-- Name t... | SELECT "High rebounds" FROM table_29840 WHERE "Game" = '81' | wikisql |
CREATE TABLE table_32611 (
"Couple" text,
"Score" text,
"Dance" text,
"Music" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result for Couple Kelly & Alec when they have a Score of 22 (8, 7, 7)?
| SELECT "Result" FROM table_32611 WHERE "Couple" = 'kelly & alec' AND "Score" = '22 (8, 7, 7)' | wikisql |
CREATE TABLE table_57877 (
"Mall name" text,
"Location" text,
"Retail space Sq. feet/(m\u00b2)" text,
"Stores" text,
"Year opened" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location has 140 stores?
| SELECT "Location" FROM table_57877 WHERE "Stores" = '140' | wikisql |
CREATE TABLE table_11336 (
"Manufacturer" text,
"Type" text,
"Quantity" real,
"SHT Nos." text,
"GWR Nos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What GWR is associated with 4?
| SELECT "GWR Nos." FROM table_11336 WHERE "Quantity" = '4' | wikisql |
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Ref_Address_Types (
a... | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_61702 (
"Round" text,
"Date" text,
"Matches" real,
"Clubs" text,
"New entries this round" text,
"Prize money" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is are the highest matches with 5,000 in prize money?
| SELECT MAX("Matches") FROM table_61702 WHERE "Prize money" = '£5,000' | wikisql |
CREATE TABLE table_name_20 (
visitor VARCHAR,
game__number VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed for Vistor that has a Game # that is smaller than 67 and has a Home listed as Buffalo?
| SELECT visitor FROM table_name_20 WHERE game__number < 67 AND home = "buffalo" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'furosemide 10 mg/ml inj soln' | eicu |
CREATE TABLE table_17103 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has the player Thomas Tyner?
| SELECT "School" FROM table_17103 WHERE "Player" = 'Thomas Tyner' | wikisql |
CREATE TABLE table_name_63 (
series_ep VARCHAR,
segment_c VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the series ep for segment c of luxury cars (part 1)
| SELECT series_ep FROM table_name_63 WHERE segment_c = "luxury cars (part 1)" | sql_create_context |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARC... | SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_name_73 (
rank__week_ VARCHAR,
viewers__millions_ VARCHAR,
rank__night_ VARCHAR,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weekly rank of the episode with more than 7.14mil viewers, a nightly rank of 5, and ... | SELECT rank__week_ FROM table_name_73 WHERE viewers__millions_ > 7.14 AND rank__night_ = "5" AND rating / SHARE(18 - 49) = 2.9 / 10 | sql_create_context |
CREATE TABLE table_train_186 (
"id" int,
"language" string,
"diabetic" string,
"regular_alcohol_intake" int,
"allergy_to_drug" bool,
"alcohol_abuse" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- english _ spe... | SELECT * FROM table_train_186 WHERE language = 'english' | criteria2sql |
CREATE TABLE table_28630 (
"Channel" real,
"Channel name" text,
"Callsign" text,
"Signal power" text,
"Broadcast area" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the broadcast are for channel 1?
| SELECT "Broadcast area" FROM table_28630 WHERE "Channel" = '1' | wikisql |
CREATE TABLE table_23843 (
"Seed" real,
"Player" text,
"Marseille (32 draw)" text,
"Metz (32)" text,
"Lyon (32)" text,
"Paris (48 - byes)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many items were recorded marseille (32 draw) was a 2 se... | SELECT COUNT("Marseille (32 draw)") FROM table_23843 WHERE "Seed" = '2' | wikisql |
CREATE TABLE table_28273 (
"Sr. No." real,
"Name of Road" text,
"Passes Through - District(s" text,
"Length (in km)" text,
"MDR No." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the MDR number of Rait Charhi Dharamshala?
| SELECT MIN("MDR No.") FROM table_28273 WHERE "Name of Road" = 'Rait Charhi Dharamshala' | wikisql |
CREATE TABLE table_name_83 (
europe VARCHAR,
goals VARCHAR,
avgatt VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What european country had more than 14 goals, and 52 538 avg att?
| SELECT europe FROM table_name_83 WHERE goals > 14 AND avgatt = "52 538" | sql_create_context |
CREATE TABLE table_204_195 (
id number,
"team" text,
"home city" text,
"stadium" text,
"capacity" number,
"last season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name a home city that has at least two teams .
| SELECT "home city" FROM table_204_195 GROUP BY "home city" HAVING COUNT("team") >= 2 | squall |
CREATE TABLE table_15780049_8 (
location_attendance VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the location attendance for philadelphia
| SELECT location_attendance FROM table_15780049_8 WHERE team = "Philadelphia" | 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 AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "67" | mimicsql_data |
CREATE TABLE table_30481 (
"Parent unit" text,
"Geschwader Base" text,
"Unit (Gruppe/Staffel)" text,
"Aircraft Type" text,
"Commanding Officer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the parent unit for ludwig franzisket
| SELECT "Parent unit" FROM table_30481 WHERE "Commanding Officer" = 'Ludwig Franzisket' | wikisql |
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 jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = ... | css |
CREATE TABLE table_name_47 (
opponent_in_the_final VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On October 14, 1996 who was the opponent in the final?
| SELECT opponent_in_the_final FROM table_name_47 WHERE date = "october 14, 1996" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | SELECT Users.Id AS "user_link", Reputation, COUNT(Posts.Id) AS QuestionsAskedWithoutAnswers FROM Posts LEFT JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 1 AND AnswerCount = 0 GROUP BY Users.Id, Reputation ORDER BY COUNT(Posts.Id) DESC LIMIT 10 | sede |
CREATE TABLE table_name_48 (
medal VARCHAR,
weight VARCHAR,
boxer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What medal did Michael Conlon, with a weight of fly, win?
| SELECT medal FROM table_name_48 WHERE weight = "fly" AND boxer = "michael conlon" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5187" AND prescriptions.route = "NU" | mimicsql_data |
CREATE TABLE table_18192 (
"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.
-- Name thedistrict for 1994
| SELECT "District" FROM table_18192 WHERE "First elected" = '1994' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Hyperacusis" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth extraoc mus-tend op') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_name_56 (
wicket VARCHAR,
batting_partners VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what wicket were Mahela Jayawardene and Thilan Samaraweera batting partners?
| SELECT wicket FROM table_name_56 WHERE batting_partners = "mahela jayawardene and thilan samaraweera" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.