instruction
stringlengths 151
7.46k
| output
stringlengths 2
4.44k
| source
stringclasses 26
values |
---|---|---|
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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 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 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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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 TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the drug that until 11/2104 patient 88573 had been prescribed two times?
| SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88573) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-11' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2 | mimic_iii |
CREATE TABLE table_47720 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Away team has a Ground of gabba?
| SELECT "Away team" FROM table_47720 WHERE "Ground" = 'gabba' | wikisql |
CREATE TABLE table_39479 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score when Steve Stricker was runner-up?
| SELECT "Winning score" FROM table_39479 WHERE "Runner(s)-up" = 'steve stricker' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the number of cards in different card type code in a bar chart.
| SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code | nvbench |
CREATE TABLE table_203_462 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year was more successful , 2012 or 2007 ?
| SELECT "year" FROM table_203_462 WHERE "year" IN (2012, 2007) ORDER BY "regular season" LIMIT 1 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
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,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients whose year of birth is less than 2197 and procedure icd9 code is 309?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309" | mimicsql_data |
CREATE TABLE table_1637041_6 (
wins INTEGER,
starts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum number of wins in the season with 22 starts?
| SELECT MAX(wins) FROM table_1637041_6 WHERE starts = 22 | sql_create_context |
CREATE TABLE table_19180 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many home (2nd leg) had a 1st leg 1-1?
| SELECT COUNT("Home (2nd leg)") FROM table_19180 WHERE "1st Leg" = '1-1' | wikisql |
CREATE TABLE table_name_86 (
opposing_teams VARCHAR,
against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opposing Teams, when Against is less than 6?
| SELECT opposing_teams FROM table_name_86 WHERE against < 6 | sql_create_context |
CREATE TABLE table_204_870 (
id number,
"product" text,
"main functionality" text,
"input format" text,
"output format" text,
"platform" text,
"license and cost" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the next product listed after egonet ?
| SELECT "product" FROM table_204_870 WHERE id = (SELECT id FROM table_204_870 WHERE "product" = 'egonet') + 1 | squall |
CREATE TABLE table_name_79 (
australian VARCHAR,
american VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Australian for the American ?
| SELECT australian FROM table_name_79 WHERE american = "ɑ" | sql_create_context |
CREATE TABLE table_name_56 (
attendance VARCHAR,
date VARCHAR,
kickoff_time VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game with a kickoff time of cbs 1:00pm, in a week earlier than 8, on September 15, 2002?
| SELECT attendance FROM table_name_56 WHERE kickoff_time = "cbs 1:00pm" AND week < 8 AND date = "september 15, 2002" | sql_create_context |
CREATE TABLE results (
resultId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
grid INTEGER,
position TEXT,
positionText TEXT,
positionOrder INTEGER,
points REAL,
laps TEXT,
time TEXT,
milliseconds TEXT,
fastestLap TEXT,
rank TEXT,
fastestLapTime TEXT,
fastestLapSpeed TEXT,
statusId INTEGER
)
CREATE TABLE seasons (
year INTEGER,
url TEXT
)
CREATE TABLE driverStandings (
driverStandingsId INTEGER,
raceId INTEGER,
driverId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
lng REAL,
alt TEXT,
url TEXT
)
CREATE TABLE lapTimes (
raceId INTEGER,
driverId INTEGER,
lap INTEGER,
position INTEGER,
time TEXT,
milliseconds INTEGER
)
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE status (
statusId INTEGER,
status TEXT
)
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,
milliseconds INTEGER
)
CREATE TABLE constructorStandings (
constructorStandingsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE constructorResults (
constructorResultsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
status TEXT
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of all the Japanese constructors that have earned more than 5 points, and count them by a bar chart, and could you show how many name in desc order please?
| SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE table_name_87 (
pre_race_host VARCHAR,
lap_by_lap VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Pre-Race Host when Mike Joy was the Lap-by-lap in the Year 2005?
| SELECT pre_race_host FROM table_name_87 WHERE lap_by_lap = "mike joy" AND year = 2005 | sql_create_context |
CREATE TABLE staff (
staff_id number,
staff_gender text,
staff_name text
)
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status_code text,
order_date time
)
CREATE TABLE product_suppliers (
product_id number,
supplier_id number,
date_supplied_from time,
date_supplied_to time,
total_amount_purchased text,
total_value_purchased number
)
CREATE TABLE addresses (
address_id number,
address_details text
)
CREATE TABLE department_store_chain (
dept_store_chain_id number,
dept_store_chain_name text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number
)
CREATE TABLE departments (
department_id number,
dept_store_id number,
department_name text
)
CREATE TABLE customers (
customer_id number,
payment_method_code text,
customer_code text,
customer_name text,
customer_address text,
customer_phone text,
customer_email text
)
CREATE TABLE supplier_addresses (
supplier_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE suppliers (
supplier_id number,
supplier_name text,
supplier_phone text
)
CREATE TABLE products (
product_id number,
product_type_code text,
product_name text,
product_price number
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE department_stores (
dept_store_id number,
dept_store_chain_id number,
store_name text,
store_address text,
store_phone text,
store_email text
)
CREATE TABLE staff_department_assignments (
staff_id number,
department_id number,
date_assigned_from time,
job_title_code text,
date_assigned_to time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give the product id for the product that was ordered most frequently.
| SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_51127 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Lost larger than 4, and a Played larger than 14?
| SELECT AVG("Position") FROM table_51127 WHERE "Lost" > '4' AND "Played" > '14' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients whose language is span and religion is greek orthodox?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "GREEK ORTHODOX" | mimicsql_data |
CREATE TABLE table_9717 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Laps, when Rider is Sylvain Guintoli, and when Grid is less than 16?
| SELECT MIN("Laps") FROM table_9717 WHERE "Rider" = 'sylvain guintoli' AND "Grid" < '16' | wikisql |
CREATE TABLE table_35045 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has nashville predators as the opponent?
| SELECT "Score" FROM table_35045 WHERE "Opponent" = 'nashville predators' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- give me the number of urgent hospital admission patients who have prescription for donepezil.
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Donepezil" | mimicsql_data |
CREATE TABLE table_name_54 (
week_3 VARCHAR,
week_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the cyber girl in week 3 when Ashley Lowe was the cyber girl in week 2?
| SELECT week_3 FROM table_name_54 WHERE week_2 = "ashley lowe" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM number,
ZSEBZ number,
ZZYSGH 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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
CREATE TABLE fzzmzjzjlb (
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,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM number,
ZSEBZ number,
ZZYSGH text
)
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 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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 医院3560417中患者58973613门诊诊断名称中不包含低钾血症的门诊诊断记录共是哪几条?
| SELECT * FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '58973613' AND hz_info.YLJGDM = '3560417' AND NOT zzmzjzjlb.JZZDSM LIKE '%低钾血症%' UNION SELECT * FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_info.KLX = fzzmzjzjlb.KLX WHERE hz_info.RYBH = '58973613' AND hz_info.YLJGDM = '3560417' AND NOT fzzmzjzjlb.JZZDSM LIKE '%低钾血症%' | css |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what were the five most frequent specimen tests performed since 6 years ago?
| SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE table_2820584_3 (
score_in_the_final VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the final played with Fred McNair as partner?
| SELECT score_in_the_final FROM table_2820584_3 WHERE partner = "Fred McNair" | sql_create_context |
CREATE TABLE table_17709 (
"Club" text,
"Overall Record" text,
"Goals For" real,
"Goals For Avg." text,
"Goals Against" real,
"Goals Against Avg." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Dallas Burn had a 12-9-7 record and what number of goals for?
| SELECT "Goals For" FROM table_17709 WHERE "Overall Record" = '12-9-7' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE 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 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was patient 13897's daily maximum value of body weight in their first hospital encounter?
| SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13897 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') GROUP BY STRFTIME('%y-%m-%d', chartevents.charttime) | mimic_iii |
CREATE TABLE table_20393 (
"N\u00b0" text,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What DAR is available for n. 336 in Italian?
| SELECT "DAR" FROM table_20393 WHERE "N\u00b0" = '336' AND "Language" = 'Italian' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients whose admission year is less than 2133 and item id is 51132?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2133" AND lab.itemid = "51132" | mimicsql_data |
CREATE TABLE table_name_62 (
partner VARCHAR,
tournament_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Partner in the United Airlines Tournament (1)?
| SELECT partner FROM table_name_62 WHERE tournament_name = "united airlines tournament (1)" | sql_create_context |
CREATE TABLE table_name_22 (
opponents VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent at Ullevi?
| SELECT opponents FROM table_name_22 WHERE venue = "ullevi" | sql_create_context |
CREATE TABLE election (
Delegate VARCHAR,
District VARCHAR
)
CREATE TABLE county (
County_id VARCHAR,
Population INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many distinct delegates are from counties with population larger than 50000?
| SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What EPID classes are offered in Spring term ?
| SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EPID' AND semester.semester = 'Spring' | advising |
CREATE TABLE table_4575 (
"Commodity" text,
"2001-02" text,
"2002-03" text,
"2003-04" text,
"2004-05" text,
"2005-06" text,
"2006-07" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the production in 2006-07 for the commodity that produced 2,601 in 2005-06?
| SELECT "2006-07" FROM table_4575 WHERE "2005-06" = '2,601' | wikisql |
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the total scores of body builders in ascending order.
| SELECT total FROM body_builder ORDER BY total | spider |
CREATE TABLE table_204_169 (
id number,
"athlete" text,
"event" text,
"race 1\ntime" text,
"race 2\ntime" text,
"total\ntime" text,
"total\nrank" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long did it take for lyubomir popov to finish the giant slalom in race 1 ?
| SELECT "race 1\ntime" FROM table_204_169 WHERE "athlete" = 'lyubomir popov' AND "event" = 'giant slalom' | squall |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
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(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time, list by the Y from low to high please.
| SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- count the number of times patient 002-34744 had a drain 1 output ml output today.
| SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-34744')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'drain 1 output ml' AND DATETIME(intakeoutput.intakeoutputtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') | eicu |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what were the five frequent specimen tests that were conducted since 2102?
| SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2102' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_39439 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gold medal count that has a silver medal count less than 0?
| SELECT MAX("Gold") FROM table_39439 WHERE "Silver" < '0' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
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 TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the monthly minimum amount of acetaminophen of patient 006-168146 until 1 year ago?
| SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-168146')) AND lab.labname = 'acetaminophen' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY STRFTIME('%y-%m', lab.labresulttime) | eicu |
CREATE TABLE table_9184 (
"% people under 18 (2005)" text,
"Seine-Saint-Denis" text,
"Paris" text,
"Val-de-Marne" text,
"Val-d'Oise" text,
"France" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE VAL-D-OISE WITH A FRANCE OF 1.4%?
| SELECT "Val-d'Oise" FROM table_9184 WHERE "France" = '1.4%' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many hours has it been since patient 011-55642 was admitted for to the hospital?
| SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '011-55642' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_95 (
position VARCHAR,
points VARCHAR,
passenger VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position has 30 points and Reiner Stuyvenberg as a passenger?
| SELECT position FROM table_name_95 WHERE points = 30 AND passenger = "reiner stuyvenberg" | sql_create_context |
CREATE TABLE table_name_99 (
score1 VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score for the Thurrock?
| SELECT score1 FROM table_name_99 WHERE opponent = "thurrock" | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Recent questions from given users.
| SELECT p.Id AS "post_link", u.Id AS "user_link", p.Score, p.CreationDate, p.ViewCount, p.Tags FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Id IN ('##list##') AND p.PostTypeId = 1 ORDER BY p.Id DESC LIMIT 100 | sede |
CREATE TABLE table_name_10 (
method VARCHAR,
record VARCHAR,
round VARCHAR,
res VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What method did Mikhail Ilyukhin win the fight in round 1 when his record was 13-5?
| SELECT method FROM table_name_10 WHERE round = "1" AND res = "win" AND record = "13-5" | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE 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 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 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how much is the maximum hospital bill that involves a lactate lab test since 2105?
| SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate')) AND STRFTIME('%y', cost.chargetime) >= '2105' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many white-russian ethnic background patients have prescription for readi-cat 2 (barium sulfate 2% suspension)?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Readi-Cat 2 (Barium Sulfate 2% Suspension)" | mimicsql_data |
CREATE TABLE table_name_15 (
judaism VARCHAR,
other VARCHAR,
buddhism VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Judaism percentage associated with Buddhism at 0.01% and Other at 0.13%?
| SELECT judaism FROM table_name_15 WHERE other = "0.13%" AND buddhism = "0.01%" | sql_create_context |
CREATE TABLE table_name_40 (
week VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks have an attendance of 64,116?
| SELECT COUNT(week) FROM table_name_40 WHERE attendance = "64,116" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text
)
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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
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 hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 检验技师在检验报告单31995900098上的工号以及姓名是什么?
| SELECT jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '31995900098' | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many of the patients diagnosed with constipation nos had a lab test for cerebrospinal fluid (csf)?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Constipation NOS" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_name_38 (
competition VARCHAR,
event VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the competition for the event team all-round in the year before 1913?
| SELECT competition FROM table_name_38 WHERE event = "team all-round" AND year < 1913 | sql_create_context |
CREATE TABLE table_52948 (
"English Name" text,
"Japanese orthography" text,
"Pronouciation" text,
"abbreviation" text,
"Provider(national government)" text,
"Foundation" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the english name of the ministry of defense with an abbreviation of nda b ei-dai( )?
| SELECT "English Name" FROM table_52948 WHERE "Provider(national government)" = 'ministry of defense' AND "abbreviation" = 'nda bōei-dai(防衛大)' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
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(4,0)
)
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 decimal(6,0)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id.
| SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID | nvbench |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar chart for finding the number of the names of swimmers who has a result of 'win', could you display by the y-axis from high to low?
| SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE table_203_574 (
id number,
"track number" number,
"russian title" text,
"english title" text,
"music" text,
"lyrics" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what it the english title of the only song done with lyrics by v. shumsky ?
| SELECT "english title" FROM table_203_574 WHERE "lyrics" = 'v. shumsky' | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- since 114 months ago, when did patient 015-1581 last get prescribed hydromorphone hcl and potassium chloride at the same time?
| SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'hydromorphone hcl' AND patient.uniquepid = '015-1581' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-114 month')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'potassium chloride' AND patient.uniquepid = '015-1581' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-114 month')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) ORDER BY t1.drugstarttime DESC LIMIT 1 | eicu |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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 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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many days since the last time patient 31088 was diagnosed with mch cmp autm mplnt dfbrl during their current hospital encounter.
| SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mch cmp autm mplnt dfbrl') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088 AND admissions.dischtime IS NULL) ORDER BY diagnoses_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_45 (
years VARCHAR,
soap_opera VARCHAR,
actor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the years that have un posto al sole as the soap opera, with riccardo polizzy carbonelli as the actor?
| SELECT years FROM table_name_45 WHERE soap_opera = "un posto al sole" AND actor = "riccardo polizzy carbonelli" | sql_create_context |
CREATE TABLE table_6681 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round that had a pick lower than 8?
| SELECT MAX("Round") FROM table_6681 WHERE "Pick #" < '8' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
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 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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text
)
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_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 number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC 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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YQBH text,
YQMC text,
jyjgzbb_id number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 审核超过1份检验报告单的人在医疗就诊60954060244中有哪些?列出这些审核人的工号及姓名
| SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '60954060244' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 1 | css |
CREATE TABLE table_48976 (
"Competition" text,
"Played" real,
"Millwall wins" real,
"Drawn" real,
"West Ham wins" real,
"Millwall goals" real,
"West Ham goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins did West Ham get when Millwall had more than 23 goal and 5 wins, and they tied 8 times?
| SELECT "West Ham wins" FROM table_48976 WHERE "Millwall wins" > '5' AND "Millwall goals" > '23' AND "Drawn" = '8' | wikisql |
CREATE TABLE table_61311 (
"Player" text,
"Club" text,
"Qualifying Goals" real,
"Finals Goals" real,
"Total Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Total Goals greater than 1 and Qualifying Goals smaller than 3?
| SELECT "Player" FROM table_61311 WHERE "Total Goals" > '1' AND "Qualifying Goals" < '3' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many patients were diagnosed with venous (peripheral) insufficeincy, unspecified with a drug route of iv?
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Venous (peripheral) insufficiency, unspecified" AND prescriptions.route = "IV" | mimicsql_data |
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate number,
film_id number,
type text,
market_id number,
year number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the low and high estimates of film markets?
| SELECT low_estimate, high_estimate FROM film_market_estimation | spider |
CREATE TABLE Certificate (
eid VARCHAR,
aid VARCHAR
)
CREATE TABLE Aircraft (
aid VARCHAR,
name VARCHAR
)
CREATE TABLE Employee (
name VARCHAR,
eid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show names for all employees who do not have certificate of Boeing 737-800.
| SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC 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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE txmzjzjlb (
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,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TZ number,
WDBZ number,
XL number,
YLJGDM number,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB 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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
CREATE TABLE ftxmzjzjlb (
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,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TZ number,
WDBZ number,
XL number,
YLJGDM number,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 在医院2269328中,患者61020155的门诊诊断名里没有病理性的门诊就诊记录有哪些
| SELECT * FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '61020155' AND hz_info.YLJGDM = '2269328' AND NOT txmzjzjlb.JZZDSM LIKE '%病理性%' UNION SELECT * FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = ftxmzjzjlb.KH AND hz_info.KLX = ftxmzjzjlb.KLX WHERE hz_info.RYBH = '61020155' AND hz_info.YLJGDM = '2269328' AND NOT ftxmzjzjlb.JZZDSM LIKE '%病理性%' | css |
CREATE TABLE table_name_6 (
score VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The game with a loss of smith (2-4) ended with what score?
| SELECT score FROM table_name_6 WHERE loss = "smith (2-4)" | sql_create_context |
CREATE TABLE table_203_37 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tracks were produced by milanna miles and rick long ?
| SELECT COUNT("title") FROM table_203_37 WHERE "producer(s)" = 'milann miles, rick long' | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tag edits which do not change tags.
| WITH tagedits_cte AS (SELECT Ph1.PostId AS pid, Ph1.Id AS phid, MIN(ph2.Id) AS MinId FROM PostHistory AS ph1 INNER JOIN PostHistory AS ph2 ON ph2.PostId = ph1.PostId WHERE (ph2.Id > ph1.Id) AND (ph1.PostHistoryTypeId IN (3, 6, 9)) AND (ph2.PostHistoryTypeId IN (3, 6, 9)) GROUP BY ph1.PostId, Ph1.Id) SELECT t.pid AS "post_link", 'site://posts/' + CAST(t.pid AS TEXT) + '/revisions' AS "revision_history", ph1.Text AS Tags, ph2.CreationDate, ph2.Comment FROM tagedits_cte AS t INNER JOIN PostHistory AS ph1 ON t.phid = ph1.Id INNER JOIN PostHistory AS ph2 ON t.minid = ph2.Id WHERE ph1.Text = ph2.Text ORDER BY pid | sede |
CREATE TABLE table_name_97 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is melbourne's home team score?
| SELECT home_team AS score FROM table_name_97 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names of climbers and the heights of mountains they climb Show bar chart, show from low to high by the Y-axis please.
| SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height | nvbench |
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show names for all employees who do not have certificate of Boeing 737-800.
| SELECT name FROM employee EXCEPT SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | spider |
CREATE TABLE table_10313 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the average Gold for total smaller 12 and bronze less than 1 and wushu with silver more than 3
| SELECT AVG("Gold") FROM table_10313 WHERE "Total" < '12' AND "Bronze" < '1' AND "Sport" = 'wushu' AND "Silver" > '3' | wikisql |
CREATE TABLE table_242785_1 (
notes VARCHAR,
main_legionary_base VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the notes for svishtov , bulgaria?
| SELECT notes FROM table_242785_1 WHERE main_legionary_base = "Svishtov , Bulgaria" | sql_create_context |
CREATE TABLE table_79126 (
"Date" text,
"Time (UTC)" text,
"Epicenter" text,
"Magnitude" text,
"Depth" text,
"Intensity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the depth of the quake that occurred at 19:48?
| SELECT "Depth" FROM table_79126 WHERE "Time (UTC)" = '19:48' | wikisql |
CREATE TABLE table_name_16 (
years_active VARCHAR,
titles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of 2nd place finishes for racers active in the year 2000 and more than 0 titles?
| SELECT AVG(2 AS nd_pl) FROM table_name_16 WHERE years_active = "2000" AND titles > 0 | sql_create_context |
CREATE TABLE table_name_67 (
score VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of T3 place?
| SELECT score FROM table_name_67 WHERE place = "t3" | sql_create_context |
CREATE TABLE table_name_3 (
time VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Time has an Opponent of josh branham?
| SELECT time FROM table_name_3 WHERE opponent = "josh branham" | sql_create_context |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player can call notre dame his alma matter ?
| SELECT "player" FROM table_204_93 WHERE "college" = 'notre dame' | squall |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE area (
course_id int,
area 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 varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is there a lab with 493 ?
| SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 493 | advising |
CREATE TABLE table_name_15 (
points INTEGER,
lyricist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of points for ray agius
| SELECT SUM(points) FROM table_name_15 WHERE lyricist = "ray agius" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC text,
NLS number,
NLY number,
QTJZYSGH text,
SG number,
SSY number,
SZY number,
TW number,
TXBZ number,
TZ number,
WDBZ number,
XL number,
YLJGDM text,
ZSEBZ number,
ZZBZ number,
ZZYSGH text
)
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 text,
RYCWH text,
RYDJSJ time,
RYSJ time,
RYTJDM number,
RYTJMC text,
RZBQDM text,
RZBQMC text,
WDBZ number,
YLJGDM text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC 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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
SBBM text,
SHRGH text,
SHRXM text,
YLJGDM text,
YQBH text,
YQMC text
)
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
JYKSBM text,
JYKSMC text,
JYLX number,
JYRQ time,
JYSQJGMC text,
JYXMDM text,
JYXMMC text,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SHRGH text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
SQRGH text,
SQRQ time,
SQRXM text,
YLJGDM text,
YLJGDM_MZJZJLB text
)
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 hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 08728091这个患者曾有过什么异常情况?
| SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '08728091' AND jyjgzbb.JCZBJGDL < jyjgzbb.CKZFWXX OR jyjgzbb.JCZBJGDL > jyjgzbb.CKZFWSX UNION SELECT * FROM hz_info JOIN zyjzjlb JOIN jybgb JOIN jyjgzbb JOIN zyjzjlb_jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjzjlb_jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND zyjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND zyjzjlb_jybgb.BGDH = jybgb.BGDH AND zyjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND zyjzjlb_jybgb.BGDH = jybgb.BGDH WHERE hz_info.RYBH = '08728091' AND jyjgzbb.JCZBJGDL < jyjgzbb.CKZFWXX OR jyjgzbb.JCZBJGDL > jyjgzbb.CKZFWSX | css |
CREATE TABLE table_73831 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Deliblato village known as in Cyrillic?
| SELECT "Cyrillic Name Other Names" FROM table_73831 WHERE "Settlement" = 'Deliblato' | wikisql |
CREATE TABLE table_7299 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Set 3 on 30 may, and a Set 1 is 20 25?
| SELECT "Set 3" FROM table_7299 WHERE "Date" = '30 may' AND "Set 1" = '20–25' | wikisql |
CREATE TABLE table_68476 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the 1st leg score when Team 1 was Gor Mahia?
| SELECT "1st leg" FROM table_68476 WHERE "Team 1" = 'gor mahia' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is last weight of patient 15986 in this month.
| SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15986)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY chartevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_30344 (
"Character" text,
"Game" text,
"Platform" text,
"Status" text,
"Mystic Arte" text,
"Character Voice" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which character is yumi kakazu the character voice?
| SELECT "Character" FROM table_30344 WHERE "Character Voice" = 'Yumi Kakazu' | wikisql |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
Black real,
Amerindian real,
Asian real,
Multiracial real,
Hispanic real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return a bar chart on how many counties correspond to each police force?, sort by the Y-axis in asc.
| SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY COUNT(*) | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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 number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title 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 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 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 TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many patients were diagnosed with chrnc hpt c wo hpat coma but did not come back to the hospital within 2 months in the previous year?
| SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chrnc hpt c wo hpat coma') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1) - (SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chrnc hpt c wo hpat coma') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 JOIN admissions ON t2.subject_id = admissions.subject_id WHERE t2.charttime < admissions.admittime AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND DATETIME(admissions.admittime) BETWEEN DATETIME(t2.charttime) AND DATETIME(t2.charttime, '+2 month')) | mimic_iii |
CREATE TABLE team_half (
year number,
league_id text,
team_id text,
half number,
div_id text,
div_win text,
rank number,
g number,
w number,
l number
)
CREATE TABLE team_franchise (
franchise_id text,
franchise_name text,
active text,
na_assoc text
)
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots number,
needed number,
votes number,
inducted text,
category text,
needed_note text
)
CREATE TABLE appearances (
year number,
team_id text,
league_id text,
player_id text,
g_all number,
gs number,
g_batting number,
g_defense number,
g_p number,
g_c number,
g_1b number,
g_2b number,
g_3b number,
g_ss number,
g_lf number,
g_cf number,
g_rf number,
g_of number,
g_dh number,
g_ph number,
g_pr number
)
CREATE TABLE pitching (
player_id text,
year number,
stint number,
team_id text,
league_id text,
w number,
l number,
g number,
gs number,
cg number,
sho number,
sv number,
ipouts number,
h number,
er number,
hr number,
bb number,
so number,
baopp number,
era number,
ibb number,
wp number,
hbp number,
bk number,
bfp number,
gf number,
r number,
sh number,
sf number,
g_idp number
)
CREATE TABLE pitching_postseason (
player_id text,
year number,
round text,
team_id text,
league_id text,
w number,
l number,
g number,
gs number,
cg number,
sho number,
sv number,
ipouts number,
h number,
er number,
hr number,
bb number,
so number,
baopp text,
era number,
ibb number,
wp number,
hbp number,
bk number,
bfp number,
gf number,
r number,
sh number,
sf number,
g_idp number
)
CREATE TABLE manager (
player_id text,
year number,
team_id text,
league_id text,
inseason number,
g number,
w number,
l number,
rank number,
plyr_mgr text
)
CREATE TABLE fielding (
player_id text,
year number,
stint number,
team_id text,
league_id text,
pos text,
g number,
gs number,
inn_outs number,
po number,
a number,
e number,
dp number,
pb number,
wp number,
sb number,
cs number,
zr number
)
CREATE TABLE home_game (
year number,
league_id text,
team_id text,
park_id text,
span_first text,
span_last text,
games number,
openings number,
attendance number
)
CREATE TABLE park (
park_id text,
park_name text,
park_alias text,
city text,
state text,
country text
)
CREATE TABLE fielding_outfield (
player_id text,
year number,
stint number,
glf number,
gcf number,
grf number
)
CREATE TABLE manager_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE player (
player_id text,
birth_year number,
birth_month number,
birth_day number,
birth_country text,
birth_state text,
birth_city text,
death_year number,
death_month number,
death_day number,
death_country text,
death_state text,
death_city text,
name_first text,
name_last text,
name_given text,
weight number,
height number,
bats text,
throws text,
debut text,
final_game text,
retro_id text,
bbref_id text
)
CREATE TABLE player_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE college (
college_id text,
name_full text,
city text,
state text,
country text
)
CREATE TABLE player_college (
player_id text,
college_id text,
year number
)
CREATE TABLE all_star (
player_id text,
year number,
game_num number,
game_id text,
team_id text,
league_id text,
gp number,
starting_pos number
)
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE team (
year number,
league_id text,
team_id text,
franchise_id text,
div_id text,
rank number,
g number,
ghome number,
w number,
l number,
div_win text,
wc_win text,
lg_win text,
ws_win text,
r number,
ab number,
h number,
double number,
triple number,
hr number,
bb number,
so number,
sb number,
cs number,
hbp number,
sf number,
ra number,
er number,
era number,
cg number,
sho number,
sv number,
ipouts number,
ha number,
hra number,
bba number,
soa number,
e number,
dp number,
fp number,
name text,
park text,
attendance number,
bpf number,
ppf number,
team_id_br text,
team_id_lahman45 text,
team_id_retro text
)
CREATE TABLE batting (
player_id text,
year number,
stint number,
team_id text,
league_id text,
g number,
ab number,
r number,
h number,
double number,
triple number,
hr number,
rbi number,
sb number,
cs number,
bb number,
so number,
ibb number,
hbp number,
sh number,
sf number,
g_idp number
)
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
CREATE TABLE postseason (
year number,
round text,
team_id_winner text,
league_id_winner text,
team_id_loser text,
league_id_loser text,
wins number,
losses number,
ties number
)
CREATE TABLE manager_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes number
)
CREATE TABLE batting_postseason (
year number,
round text,
player_id text,
team_id text,
league_id text,
g number,
ab number,
r number,
h number,
double number,
triple number,
hr number,
rbi number,
sb number,
cs number,
bb number,
so number,
ibb number,
hbp number,
sh number,
sf number,
g_idp number
)
CREATE TABLE fielding_postseason (
player_id text,
year number,
team_id text,
league_id text,
round text,
pos text,
g number,
gs number,
inn_outs number,
po number,
a number,
e number,
dp number,
tp number,
pb number,
sb number,
cs number
)
CREATE TABLE manager_half (
player_id text,
year number,
team_id text,
league_id text,
inseason number,
half number,
g number,
w number,
l number,
rank number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Compute the total salary that the player with first name Len and last name Barker received between 1985 to 1990.
| SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990 | spider |
CREATE TABLE table_41534 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest lost number of the team with less than 14 points and less than 18 played?
| SELECT MAX("Lost") FROM table_41534 WHERE "Points" < '14' AND "Played" < '18' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
ZZYSGH text,
QTJZYSGH text,
JZZDBM text,
JZZDSM text,
MZZYZDZZBM text,
MZZYZDZZMC text,
SG number,
TZ number,
TW number,
SSY number,
SZY number,
XL number,
HXPLC number,
ML number,
JLSJ time
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM text,
CYBQMC text,
CYCWH text,
ZYBMLX number,
ZYZDBM text,
ZYZDMC text,
ZYZYZDZZBM text,
ZYZYZDZZMC text,
MZBMLX number,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM text,
RYSJ time,
CYSJ time,
CYZTDM number
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text,
YQMC text,
CKZFWDX text,
CKZFWXX number,
CKZFWSX number,
JLDW text
)
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 text,
SHRXM text,
SHSJ time,
SQKS text,
SQKSMC text,
JYKSBM text,
JYKSMC text,
BGJGDM text,
BGJGMC text,
SQRQ time,
CJRQ time,
JYRQ time,
BGSJ time,
BBDM text,
BBMC text,
JYBBH text,
BBZT number,
BBCJBW text,
JSBBSJ time,
JYXMMC text,
JYXMDM text,
JYSQJGMC text,
JYJGMC text,
JSBBRQSJ time,
JYJSQM text,
JYJSGH text
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 患有精神发育迟滞的人在门诊诊断确诊后其转铁蛋白数值的平均值以及最值数据是什么样子的?
| SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '精神发育迟滞' AND jyjgzbb.JCZBMC = '转铁蛋白' | css |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE locations (
location_id number,
street_address text,
postal_code text,
city text,
state_province text,
country_id text
)
CREATE TABLE countries (
country_id text,
country_name text,
region_id number
)
CREATE TABLE departments (
department_id number,
department_name text,
manager_id number,
location_id number
)
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE job_history (
employee_id number,
start_date time,
end_date time,
job_id text,
department_id number
)
CREATE TABLE regions (
region_id number,
region_name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.
| SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") | spider |
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the nations that have more than two ships?
| SELECT nationality FROM ship GROUP BY nationality HAVING COUNT(*) > 2 | spider |
CREATE TABLE table_name_91 (
completed VARCHAR,
pennant_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the completed date of the destroyer with a pennant number h63?
| SELECT completed FROM table_name_91 WHERE pennant_number = "h63" | sql_create_context |
CREATE TABLE table_29209 (
"Model" text,
"Speed (GHz)" text,
"L2 Cache (MB)" real,
"L3 Cache (MB)" real,
"FSB (MHz)" real,
"TDP (W)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the maximal L3 cache for any of the models given?
| SELECT MAX("L2 Cache (MB)") FROM table_29209 | wikisql |
CREATE TABLE table_73771 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is shown for august 21-22 when november 3 is november 3, 1994?
| SELECT "August 21-22" FROM table_73771 WHERE "November 3" = 'November 3, 1994' | wikisql |
CREATE TABLE table_name_11 (
format VARCHAR,
owner VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the format for Cherry Creek Radio with frequency of 0 92.1 fm?
| SELECT format FROM table_name_11 WHERE owner = "cherry creek radio" AND frequency = "0 92.1 fm" | sql_create_context |