instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_72351 (
"#" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Points" real,
"Winnings ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of points for south korea
| SELECT COUNT("Points") FROM table_72351 WHERE "Country" = 'South Korea' | wikisql |
CREATE TABLE CloseReasonTypes (
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,
DownV... | SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Posts.CreationDate, Posts.CommunityOwnedDate FROM Posts INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, 2) AND Posts.ClosedDate IS NULL AND Parent... | sede |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '77219096' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '77219096' GROUP BY gyb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT zyb.MED_SER_ORG_NO FROM zyb WHERE zyb.PERSON_ID = '77219096' GR... | css |
CREATE TABLE table_name_66 (
career_sr VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Madrid (Stuttgart) tournament with a 1996 of A has this for a Career SR?
| SELECT career_sr FROM table_name_66 WHERE 1996 = "a" AND tournament = "madrid (stuttgart)" | sql_create_context |
CREATE TABLE table_44198 (
"NTSC M" text,
"PAL B,G,H" text,
"PAL I" text,
"PAL N" text,
"PAL M" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which PAL M has a PAL I of 50HZ?
| SELECT "PAL M" FROM table_44198 WHERE "PAL I" = '50hz' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.icd9_code = "2449" | mimicsql_data |
CREATE TABLE table_204_501 (
id number,
"institution" text,
"location" text,
"nickname" text,
"founded" number,
"type" text,
"enrollment" number,
"joined" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the first school on the l... | SELECT "institution" FROM table_204_501 WHERE id = 1 | squall |
CREATE TABLE table_name_80 (
name VARCHAR,
entered_office VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the minister who has an entered office of entered office?
| SELECT name FROM table_name_80 WHERE entered_office = "entered office" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-19159' AND patient.hospitaladmitsource = 'direct admit' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_35169 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick number for the player playing tackle position, and a round less than 15?
| SELECT SUM("Pick") FROM table_35169 WHERE "Position" = 'tackle' AND "Round" < '15' | wikisql |
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER
)
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INT... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code | nvbench |
CREATE TABLE table_16227492_1 (
_number INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number for new england blazers
| SELECT MAX(_number) FROM table_16227492_1 WHERE opponent = "New England Blazers" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_AMOUT FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '54836024642' | css |
CREATE TABLE table_name_20 (
year_built INTEGER,
sub_parish__sogn_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the year built of kyrkjeb ?
| SELECT AVG(year_built) FROM table_name_20 WHERE sub_parish__sogn_ = "kyrkjebø" | sql_create_context |
CREATE TABLE Companies (
Industry VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different industries are the companies in?
| SELECT COUNT(DISTINCT Industry) FROM Companies | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92642) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) ... | mimic_iii |
CREATE TABLE table_70231 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date, when the Year is after 1978, and when the Location is Memorial Stadium (... | SELECT "Date" FROM table_70231 WHERE "Year" > '1978' AND "Location" = 'memorial stadium (baltimore)' | wikisql |
CREATE TABLE table_204_529 (
id number,
"year" number,
"personnel" text,
"album" text,
"label" text,
"peak positions\nnor" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which was the only album to be produced under the kirkelig kulturverksted... | SELECT "album" FROM table_204_529 WHERE "label" = 'kirkelig kulturverksted' | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND diagnoses.short_title = "Pressure ulcer, buttock" | mimicsql_data |
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
)
CREATE TABLE people (
people_id number,
name text,
a... | SELECT T1.total_points FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id ORDER BY T2.age LIMIT 1 | spider |
CREATE TABLE table_train_82 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions ... | SELECT * FROM table_train_82 WHERE mini_mental_state_examination_mmse >= 15 AND mini_mental_state_examination_mmse <= 26 | criteria2sql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '7248033' AND jybgb.BGRQ BETWEEN '2003-11-19' AND '2012-11-05' GROUP BY jybgb.KSBM HAVING COUNT(*) < 21) AS T | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2155" AND procedures.short_title = "Dx ultrasound-heart" | mimicsql_data |
CREATE TABLE table_39046 (
"Model" text,
"Processors Supported" text,
"FSB/HT Frequency (MHz)" text,
"Memory" text,
"PCI-Express" text,
"SATA" text,
"PATA" text,
"Sound" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the PCI-expr... | SELECT "PCI-Express" FROM table_39046 WHERE "Memory" = 'ddr2' AND "Model" = 'nforce 520' | wikisql |
CREATE TABLE table_53868 (
"Tournament" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tournament was the 2... | SELECT "Tournament" FROM table_53868 WHERE "2010" = 'olympic games' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE ((flight.airline_code = 'NW') OR (flight.airline_code = 'UA')) AND city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.arrival_time < 1200 AND flight_stop.stop_airport = airport_service.airport_co... | atis |
CREATE TABLE table_name_58 (
state VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state has the king title?
| SELECT state FROM table_name_58 WHERE title = "king" | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '65424109' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX ... | css |
CREATE TABLE table_name_89 (
completed INTEGER,
material VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the most recent statue that was made out of solid granite completed?
| SELECT MAX(completed) FROM table_name_89 WHERE material = "solid granite" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kurt Buczek" | mimicsql_data |
CREATE TABLE table_16799784_2 (
latitude VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the latitude of laima tessera
| SELECT latitude FROM table_16799784_2 WHERE name = "Laima Tessera" | sql_create_context |
CREATE TABLE table_76054 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the lowest top-5 with a top-25 larger than 4, 29 cuts a... | SELECT MIN("Top-5") FROM table_76054 WHERE "Top-25" > '4' AND "Cuts made" = '29' AND "Top-10" > '18' | wikisql |
CREATE TABLE table_25730326_2 (
points VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did William Wasmund have?
| SELECT points FROM table_25730326_2 WHERE player = "William Wasmund" | sql_create_context |
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 PendingFlags (
Id number,
FlagTypeId ... | SELECT p.PostTypeId, p.Body FROM Posts AS p WHERE p.PostTypeId IN (1, 2) | sede |
CREATE TABLE table_name_31 (
rank INTEGER,
matches VARCHAR,
total VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rank when the total is 39 in the county of dublin and the matches is less than 4?
| SELECT AVG(rank) FROM table_name_31 WHERE total = 39 AND county = "dublin" AND matches < 4 | sql_create_context |
CREATE TABLE Tasks (
task_id INTEGER,
project_id INTEGER,
task_details VARCHAR(255),
"eg Agree Objectives" VARCHAR(1)
)
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_t... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details | nvbench |
CREATE TABLE table_name_68 (
laps INTEGER,
grid VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high lap total for a grid less than 6, and a Time/Retired of halfshaft?
| SELECT MAX(laps) FROM table_name_68 WHERE grid < 6 AND time_retired = "halfshaft" | sql_create_context |
CREATE TABLE table_15945862_1 (
december VARCHAR,
january VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What December is 8.77 in January
| SELECT december FROM table_15945862_1 WHERE january = "8.77" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_4767 (
"Name" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver won the Indianapolis 500 the year the Chaparral tea... | SELECT "Winning driver" FROM table_4767 WHERE "Winning team" = 'chaparral' AND "Name" = 'indianapolis 500' | wikisql |
CREATE TABLE table_55555 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least attendance for may 6
| SELECT MIN("Attendance") FROM table_55555 WHERE "Date" = 'may 6' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.discharge_location = "DEAD/EXPIRED" | mimicsql_data |
CREATE TABLE table_204_546 (
id number,
"year" number,
"film" text,
"song" text,
"language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what language was used in only one film ?
| SELECT "language" FROM table_204_546 GROUP BY "language" HAVING COUNT("film") = 1 | squall |
CREATE TABLE table_13930 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of poles of the fi... | SELECT SUM("Poles") FROM table_13930 WHERE "Series" = 'firestone indy lights series' AND "Season" < '2009' | wikisql |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND diagnoses.long_title = "Benign neoplasm of spinal meninges" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 o... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5887 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY labevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_29 (
origin VARCHAR,
destination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From where did the train that arrived in the Anand Vihar Terminal originate?
| SELECT origin FROM table_name_29 WHERE destination = "anand vihar terminal" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '吕宏达' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '盐酸阿米替林片(薄膜)') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '吕宏达' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLIN... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.short_title = "Exc/dest hrt lesion open" | mimicsql_data |
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
... | SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY Payment_Method_Code DESC | nvbench |
CREATE TABLE table_15244 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has a decile of 8 and a roll of 705?
| SELECT "Name" FROM table_15244 WHERE "Decile" = '8' AND "Roll" = '705' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Fever presenting with conditions classified elsewhere" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_name_18 (
goals_scored INTEGER,
games_played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When less than 30 games have been played what is the average goals scored?
| SELECT AVG(goals_scored) FROM table_name_18 WHERE games_played < 30 | sql_create_context |
CREATE TABLE table_name_10 (
total_goals INTEGER,
total_apps VARCHAR,
league_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Total Goals have Total Apps of 42 (3), and League Goals smaller than 1?
| SELECT MAX(total_goals) FROM table_name_10 WHERE total_apps = "42 (3)" AND league_goals < 1 | sql_create_context |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | SELECT born_state, AVG(age) FROM head GROUP BY born_state | nvbench |
CREATE TABLE table_name_40 (
co_contestant__yaar_vs_pyaar_ VARCHAR,
total_score_week VARCHAR,
date_performed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Co-contestant (Yaar vs. Pyaar) has a Total score/week of 48/60, and a Date performed of augus... | SELECT co_contestant__yaar_vs_pyaar_ FROM table_name_40 WHERE total_score_week = "48/60" AND date_performed = "august 14" | sql_create_context |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE writes (
paperid int,
authori... | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'brian curless' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC | scholar |
CREATE TABLE table_43702 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a place of T7 and is from the United States?
| SELECT "Player" FROM table_43702 WHERE "Place" = 't7' AND "Country" = 'united states' | wikisql |
CREATE TABLE table_237036_2 (
level VARCHAR,
macroblocks_s VARCHAR,
high_10_profile VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What level has 11880 macroblocks and high 10 profile is 6000?
| SELECT level FROM table_237036_2 WHERE macroblocks_s = 11880 AND high_10_profile = 6000 | sql_create_context |
CREATE TABLE table_name_60 (
score VARCHAR,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHat was the score for Phil Mickelson when he placed t3?
| SELECT score FROM table_name_60 WHERE place = "t3" AND player = "phil mickelson" | sql_create_context |
CREATE TABLE table_name_11 (
date VARCHAR,
week VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for the game with an opponent of the Houston Oilers from before week 3?
| SELECT date FROM table_name_11 WHERE week < 3 AND opponent = "houston oilers" | sql_create_context |
CREATE TABLE table_70999 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the bleeding time with platelet count of unaffected ... | SELECT "Bleeding time" FROM table_70999 WHERE "Platelet count" = 'unaffected' AND "Condition" = 'factor xii deficiency' | wikisql |
CREATE TABLE table_train_230 (
"id" int,
"anemia" bool,
"diabetic" string,
"lactose_intolerance" bool,
"hb" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- bmi between 10 to 85 percentile
| SELECT * FROM table_train_230 WHERE body_mass_index_bmi >= 10 AND body_mass_index_bmi <= 85 | criteria2sql |
CREATE TABLE table_32016 (
"Ship" text,
"Guns" text,
"Class" text,
"Captain" text,
"Rank" text,
"Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the ship for lieutenant montagu verling
| SELECT "Ship" FROM table_32016 WHERE "Captain" = 'lieutenant montagu verling' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, state AS STATE_0, state AS STATE_1 WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ONTARIO' AND CITY_1.city_code = AIRPORT_SERVICE_1.cit... | atis |
CREATE TABLE table_52880 (
"Date(s) conducted" text,
"Cons" text,
"Plaid Cymru" text,
"Lib Dem" text,
"UKIP" text,
"Green" text,
"Others" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the lead 8.6%?
| SELECT "Date(s) conducted" FROM table_52880 WHERE "Lead" = '8.6%' | wikisql |
CREATE TABLE table_name_71 (
launch_site VARCHAR,
cospar_id_satcat_№ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the launch site of the satellite with a 2003-041a COSPAR ID?
| SELECT launch_site FROM table_name_71 WHERE cospar_id_satcat_№ = "2003-041a" | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.MAIN_COND_DES FROM qtb WHERE qtb.MED_CLINIC_ID = '85614606716' UNION SELECT gyb.MAIN_COND_DES FROM gyb WHERE gyb.MED_CLINIC_ID = '85614606716' UNION SELECT zyb.MAIN_COND_DES FROM zyb WHERE zyb.MED_CLINIC_ID = '85614606716' UNION SELECT mzb.MAIN_COND_DES FROM mzb WHERE mzb.MED_CLINIC_ID = '85614606716' | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "135" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(80)
)
CREATE TABLE Customers (
customer_id INTEG... | SELECT T3.city, COUNT(T3.city) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY T3.city ORDER BY T3.city | nvbench |
CREATE TABLE table_9702 (
"Year" real,
"Association" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest year that Indonesian Idol won?
| SELECT MIN("Year") FROM table_9702 WHERE "Nominee" = 'indonesian idol' AND "Result" = 'won' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 o... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 66015 AND STRFTIME('%y', admissions.admittime) >= '2104' | mimic_iii |
CREATE TABLE table_name_3 (
color_commentator_s_ VARCHAR,
studio_host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Color commentatorhas a Studio host of gary tanguay & eric frede?
| SELECT color_commentator_s_ FROM table_name_3 WHERE studio_host = "gary tanguay & eric frede" | sql_create_context |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_name_25 (
multiplier_1 VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the multiplier 1 for chips with a frequency of 1800MHz?
| SELECT multiplier_1 FROM table_name_25 WHERE frequency = "1800mhz" | sql_create_context |
CREATE TABLE table_name_24 (
label VARCHAR,
format VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What label uses the stereo LP for catalog scyl-934,623?
| SELECT label FROM table_name_24 WHERE format = "stereo lp" AND catalog = "scyl-934,623" | sql_create_context |
CREATE TABLE table_name_82 (
semifinalists VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHO WAS THE SEMIFINALISTS FOR THE HAMBURG TOURNAMENT?
| SELECT semifinalists FROM table_name_82 WHERE tournament = "hamburg" | sql_create_context |
CREATE TABLE table_203_860 (
id number,
"rank" number,
"city" text,
"population (2011)" number,
"population (2001)" number,
"state/territory" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- pune or surat had a 2001 population on 2,538,473 ?
| SELECT "city" FROM table_203_860 WHERE "population (2001)" = 2538473 | squall |
CREATE TABLE nurse (
employeeid number,
name text,
position text,
registered boolean,
ssn number
)
CREATE TABLE medication (
code number,
name text,
brand text,
description text
)
CREATE TABLE undergoes (
patient number,
procedures number,
stay number,
dateundergoes... | SELECT DISTINCT blockcode FROM room WHERE unavailable = 0 | spider |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers... | css |
CREATE TABLE table_16172 (
"Commodity" text,
"2001-02" real,
"2002-03" real,
"2003-04" real,
"2004-05" real,
"2005-06" real,
"2006-07" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum amount for wool for 2001-02?
| SELECT MIN("2001-02") FROM table_16172 WHERE "Commodity" = 'Wool' | wikisql |
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
)
CREA... | SELECT T2.team_id, T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY AVG(T1.attendance) DESC LIMIT 1 | spider |
CREATE TABLE table_name_75 (
school VARCHAR,
conference_joined VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has a mascot of the Blazers and in the Northeast Corner conference?
| SELECT school FROM table_name_75 WHERE conference_joined = "northeast corner" AND mascot = "blazers" | sql_create_context |
CREATE TABLE table_name_10 (
nominated_by_the_taoiseach INTEGER,
agricultural_panel VARCHAR,
administrative_panel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average number of members Nominated by the Taoiseach, when the Agricultural Pane... | SELECT AVG(nominated_by_the_taoiseach) FROM table_name_10 WHERE agricultural_panel < 1 AND administrative_panel < 0 | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id ... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Reputation, DisplayName, Location, Views, UpVotes, DownVotes FROM Users WHERE LOWER(Location) LIKE '%india' ORDER BY Reputation DESC | sede |
CREATE TABLE table_40700 (
"Date" text,
"Race Name" text,
"Location" text,
"UCI Rating" real,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Relax-Gam's average UCI Rating?
| SELECT AVG("UCI Rating") FROM table_40700 WHERE "Team" = 'relax-gam' | wikisql |
CREATE TABLE table_name_44 (
home_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What home team has a tie no of 20?
| SELECT home_team FROM table_name_44 WHERE tie_no = "20" | sql_create_context |
CREATE TABLE status (
station_id number,
bikes_available number,
docks_available number,
time text
)
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE weather (
date text,
max_te... | SELECT city FROM station GROUP BY city ORDER BY MAX(lat) DESC | spider |
CREATE TABLE table_13511 (
"Player" text,
"Games" real,
"Comp" real,
"Yards" real,
"Rating" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest yards for a rating larger than 52.8 and more than 13 games?
| SELECT MAX("Yards") FROM table_13511 WHERE "Rating" > '52.8' AND "Games" > '13' | wikisql |
CREATE TABLE table_name_77 (
myspace_band VARCHAR,
original_airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the MySpace Band with an Original Airdate of 25 march 2008?
| SELECT myspace_band FROM table_name_77 WHERE original_airdate = "25 march 2008" | sql_create_context |
CREATE TABLE table_32350 (
"Name" text,
"Took office" text,
"Left office" text,
"Party" text,
"Governor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who took office under the government of Matthew E. Welsh?
| SELECT "Took office" FROM table_32350 WHERE "Governor" = 'matthew e. welsh' | wikisql |
CREATE TABLE Staff (
Name VARCHAR,
Other_Details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names and details of all the staff members.
| SELECT Name, Other_Details FROM Staff | sql_create_context |
CREATE TABLE table_7425 (
"Player" text,
"FG Pct" real,
"3FGM" real,
"3FGA" real,
"3FG Pct" real,
"FT Pct" real,
"Off Reb" real,
"Def Reb" real,
"Total Reb" real,
"Asst" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT COUNT("3FG Pct") FROM table_7425 WHERE "FG Pct" > '43.2' AND "FT Pct" < '100' AND "Total Reb" < '102' AND "3FGM" = '1' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '04441779' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2001-06-18' AND '2013-03-01' AND t_kc22.MED_I... | css |
CREATE TABLE table_26737 (
"Series No." real,
"Episode No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"UK Ratings (BBC2 Rank)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many directors worke... | SELECT COUNT("Directed by") FROM table_26737 WHERE "UK Ratings (BBC2 Rank)" = '2.27m (5)' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2115.0" AND prescriptions.formulary_drug_cd = "GLYB5" | mimicsql_data |
CREATE TABLE table_name_36 (
games VARCHAR,
rebounds VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game had less than 270 rebounds and a rank lower than 5?
| SELECT games FROM table_name_36 WHERE rebounds < 270 AND rank < 5 | sql_create_context |
CREATE TABLE table_12243 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Population has a Medi... | SELECT MAX("Population") FROM table_12243 WHERE "Median family income" = '$53,946' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.