instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "DIAZ5" | mimicsql_data |
CREATE TABLE table_63733 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team when the college is virginia tech?
| SELECT "Team" FROM table_63733 WHERE "College" = 'virginia tech' | wikisql |
CREATE TABLE body_builder (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all information about each body builder.
| SELECT * FROM body_builder | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.age < "50" | mimicsql_data |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewRejectionReasons (
Id ... | SELECT Users.Id, DisplayName, EmailHash, Reputation, Location, GROUP_CONCAT(CAST(Tags AS TEXT), CHAR(32)) AS Tags FROM Users INNER JOIN PostHistory AS ph ON ph.UserId = Users.Id INNER JOIN Posts ON Posts.Id = ph.PostId WHERE LOWER(Tags) LIKE LOWER('%##skill1##%') AND LOWER(Tags) LIKE LOWER('%##skill2##%') AND LOWER(Loc... | sede |
CREATE TABLE table_56358 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings( $ )" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is the player ranked 2?
| SELECT "Country" FROM table_56358 WHERE "Rank" = '2' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell" | mimicsql_data |
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 | nvbench |
CREATE TABLE table_29675 (
"Week #" text,
"Theme" text,
"Song Choice" text,
"Original Artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the original artist of the Top 12 Men theme?
| SELECT "Original Artist" FROM table_29675 WHERE "Theme" = 'Top 12 Men' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE table_292 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position did the player from the hometown of Dallas, TX play?
| SELECT "Position" FROM table_292 WHERE "Hometown" = 'Dallas, TX' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '牙体缺损' GROUP BY person_info.JGDM | css |
CREATE TABLE table_71570 (
"Rank" real,
"Name" text,
"Nationality" text,
"Score" text,
"Perfection" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a perfection percentage of 73.24%?
| SELECT "Name" FROM table_71570 WHERE "Perfection" = '73.24%' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year 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_... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%colloquium%' OR course.name LIKE '%colloquium%') AND (course.description LIKE '%The Arab-Israeli Middle Eastern Literature%' OR course.name LIKE '%The Arab-Israeli Middle Eastern Literature%') AND course.course_id = course_offer... | advising |
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,
... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-10390' AND patient.hospitaldischargetime IS NULL) | eicu |
CREATE TABLE route (
train_id number,
station_id number
)
CREATE TABLE weekly_weather (
station_id number,
day_of_week text,
high_temperature number,
low_temperature number,
precipitation number,
wind_speed_mph number
)
CREATE TABLE train (
id number,
train_number number,
n... | SELECT train_number, name FROM train ORDER BY time | spider |
CREATE TABLE table_18278508_4 (
status VARCHAR,
main_contestant VARCHAR,
date_performed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the status for karanvir bohra and date performed being july 30
| SELECT status FROM table_18278508_4 WHERE main_contestant = "Karanvir Bohra" AND date_performed = "July 30" | sql_create_context |
CREATE TABLE table_name_30 (
transfer_window VARCHAR,
transfer_fee VARCHAR,
moving_to VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Transfer window, when the Transfer fee is 'free', and when the item 'Moving to' is Norwich City?
| SELECT transfer_window FROM table_name_30 WHERE transfer_fee = "free" AND moving_to = "norwich city" | sql_create_context |
CREATE TABLE table_36844 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum for December against the vancouver canucks earlier than game 33?
| SELECT SUM("December") FROM table_36844 WHERE "Opponent" = 'vancouver canucks' AND "Game" < '33' | wikisql |
CREATE TABLE table_train_36 (
"id" int,
"do_not_resuscitate_dnr" bool,
"active_infection" bool,
"sepsis" bool,
"vasospastic_diathesis" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- therap... | SELECT * FROM table_train_36 WHERE do_not_resuscitate_dnr = 1 | criteria2sql |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters | nvbench |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHA... | SELECT Budget_Type_Description, COUNT(Budget_Type_Description) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY Budget_Type_Description ORDER BY COUNT(Budget_Type_Description) DESC | nvbench |
CREATE TABLE table_23302 (
"Rank" real,
"No." real,
"Pos" text,
"Player" text,
"Premier League" real,
"FA Cup" real,
"League Cup" real,
"Champions League" real,
"Club World Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT COUNT("Club World Cup") FROM table_23302 WHERE "Player" = 'Djibril Cisse' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE MED_CLINIC_ID = '02068561850' | css |
CREATE TABLE table_39130 (
"2004/ 05" text,
"2005/ 06" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year had a dnq of 11
| SELECT "2005/ 06" FROM table_39130 WHERE "2010/ 11" = 'dnq' | wikisql |
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.days_stay > "2" | mimicsql_data |
CREATE TABLE table_21058836_1 (
record VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for game 9?
| SELECT record FROM table_21058836_1 WHERE game = 9 | sql_create_context |
CREATE TABLE table_name_45 (
draws INTEGER,
season VARCHAR,
losses VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Draws with less than 18 losses for north melbourne later than 1926?
| SELECT MAX(draws) FROM table_name_45 WHERE losses < 18 AND team = "north melbourne" AND season > 1926 | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15821) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_4489 (
"Region" text,
"Operator" text,
"Licence award date" text,
"On air date" text,
"Closure date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the license award date for the ensemble from South Wales and the Severn E... | SELECT "Licence award date" FROM table_4489 WHERE "On air date" = 'july 2001' AND "Region" = 'south wales and the severn estuary' | wikisql |
CREATE TABLE table_name_54 (
authority VARCHAR,
roll VARCHAR,
decile VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What authority controls the school in Levin that has a decile of 6, and a roll of 226?
| SELECT authority FROM table_name_54 WHERE decile = 6 AND area = "levin" AND roll = 226 | sql_create_context |
CREATE TABLE table_41978 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze has a Silver of 15, and a Gold smaller than 20?
| SELECT SUM("Bronze") FROM table_41978 WHERE "Silver" = '15' AND "Gold" < '20' | wikisql |
CREATE TABLE table_name_46 (
game INTEGER,
score VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game is the lowest one that has a Score of 2 3 ot, and Points larger than 76?
| SELECT MIN(game) FROM table_name_46 WHERE score = "2–3 ot" AND points > 76 | sql_create_context |
CREATE TABLE table_name_38 (
time VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time with a Score that is 80-34?
| SELECT time FROM table_name_38 WHERE score = "80-34" | sql_create_context |
CREATE TABLE table_2985664_8 (
innings INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest value for innings?
| SELECT MIN(innings) FROM table_2985664_8 | sql_create_context |
CREATE TABLE table_35457 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points is the highest one that has a Game smaller than 43, and a January larger t... | SELECT MAX("Points") FROM table_35457 WHERE "Game" < '43' AND "January" > '8' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Influenza Virus Vaccine" | mimicsql_data |
CREATE TABLE table_name_6 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is team 1 when team 2 is gaz lec ajaccio (d3)?
| SELECT team_1 FROM table_name_6 WHERE team_2 = "gazélec ajaccio (d3)" | sql_create_context |
CREATE TABLE table_name_44 (
fate VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the fate on 27 june 1942?
| SELECT fate FROM table_name_44 WHERE date = "27 june 1942" | sql_create_context |
CREATE TABLE table_33934 (
"Year" real,
"Team" text,
"Wins" real,
"Points" real,
"Championship Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year is the highest that has a Team of walker racing, and Wins larger than 1?
| SELECT MAX("Year") FROM table_33934 WHERE "Team" = 'walker racing' AND "Wins" > '1' | wikisql |
CREATE TABLE table_name_51 (
score VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the visitor was pittsburgh?
| SELECT score FROM table_name_51 WHERE visitor = "pittsburgh" | 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 ... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE table_17361 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name t... | SELECT "High points" FROM table_17361 WHERE "Location Attendance" = 'Toyota Center 18,269' | wikisql |
CREATE TABLE table_42042 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for set 2 17-25?
| SELECT "Total" FROM table_42042 WHERE "Set 2" = '17-25' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),
login_name VARCHAR(80),
login_password VARCHAR(20),
phone_number VARCHAR(255),
town_ci... | SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id | nvbench |
CREATE TABLE table_name_55 (
dance VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 2004, what is the Dance?
| SELECT dance FROM table_name_55 WHERE year = 2004 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "9271" | mimicsql_data |
CREATE TABLE table_name_38 (
l2_cache VARCHAR,
release_price___usd__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the L2 Cache for the processor with a release price of $496?
| SELECT l2_cache FROM table_name_38 WHERE release_price___usd__ = "$496" | sql_create_context |
CREATE TABLE table_79518 (
"Position" real,
"Athlete" text,
"Compulsory" real,
"Voluntary" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the position that has a total less than 66.5m, a compulsory of 30.9 and voluntary less tha... | SELECT MIN("Position") FROM table_79518 WHERE "Total" < '66.5' AND "Compulsory" = '30.9' AND "Voluntary" < '33.7' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21_t_kc22.MED_CLINIC_ID = '90543963528' INTERSECT SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON ... | css |
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 ... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J... | css |
CREATE TABLE table_23796 (
"Interior/Roof" text,
"Black (UA)" real,
"Red (E8)" real,
"White (ZR)" real,
"Green (SW)" real,
"Totals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different total results are there for the model with parc... | SELECT COUNT("Totals") FROM table_23796 WHERE "Interior/Roof" = 'Parchment/black' | wikisql |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE View_Unit_Status (
apt_id INTEG... | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" | nvbench |
CREATE TABLE table_59501 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total attendance for H/A of A and opponents of wolverhampton wanderers?
| SELECT COUNT("Attendance") FROM table_59501 WHERE "H / A" = 'a' AND "Opponents" = 'wolverhampton wanderers' | wikisql |
CREATE TABLE table_204_395 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what venue came before gothenburg , sweden ?
| SELECT "venue" FROM table_204_395 WHERE id = (SELECT id FROM table_204_395 WHERE "venue" = 'gothenburg, sweden') - 1 | squall |
CREATE TABLE table_12724 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Home team of the Kidderminster Harriers Away game?
| SELECT "Home team" FROM table_12724 WHERE "Away team" = 'kidderminster harriers' | wikisql |
CREATE TABLE table_name_67 (
set_2 VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Set 2, when Date is May 31?
| SELECT set_2 FROM table_name_67 WHERE date = "may 31" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_78402 (
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many high assists d... | SELECT "High assists" FROM table_78402 WHERE "Team" = 'lakers' | wikisql |
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 All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC | nvbench |
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 DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'albumin 5% (25 g)') | mimic_iii |
CREATE TABLE table_48759 (
"Year" real,
"Party" text,
"Governor" text,
"Lieutenant Governor" text,
"Comptroller" text,
"Attorney General" text,
"U.S. Senate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times what the comptroller ... | SELECT COUNT("Year") FROM table_48759 WHERE "Comptroller" = 'alan hevesi' AND "Party" = 'working families' | wikisql |
CREATE TABLE head (
age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many heads of the departments are older than 56 ?
| SELECT COUNT(*) FROM head WHERE age > 56 | sql_create_context |
CREATE TABLE table_11318462_5 (
open_1st_viii VARCHAR,
u15_6th_iv VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the open 1st viii with u15 6th iv being bgs
| SELECT open_1st_viii FROM table_11318462_5 WHERE u15_6th_iv = "BGS" | 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 PostHistoryTypes (
Id number,
Name te... | SELECT t2.TagName AS "Related Tag", COUNT(t2.TagName) AS "Count" FROM PostTags AS pt1 INNER JOIN Tags AS t1 ON pt1.TagId = t1.Id INNER JOIN PostTags AS pt2 ON pt1.PostId = pt2.PostId AND pt1.TagId != pt2.TagId INNER JOIN Tags AS t2 ON pt2.TagId = t2.Id INNER JOIN Posts AS A ON pt2.PostId = A.Id WHERE t1.TagName = 'ibm-... | sede |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '93401280' AND t_kc22.STA_DATE BETWEEN '2009-11-18' AND '2017-01-22' AND t_kc22.SELF_PAY_AMO > 7898.94 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwy... | css |
CREATE TABLE table_17288825_7 (
location_attendance VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At what location and what was the attendance when Rafer Alston (10) achieved high assists?
| SELECT location_attendance FROM table_17288825_7 WHERE high_assists = "Rafer Alston (10)" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON 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 person_info_hz_info.YLJGDM = hz_info.YLJGDM AND p... | css |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHA... | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations | nvbench |
CREATE TABLE table_name_53 (
first_elected INTEGER,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which First elected has a District of south carolina 2?
| SELECT MIN(first_elected) FROM table_name_53 WHERE district = "south carolina 2" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM 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,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_1329 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had... | SELECT "High assists" FROM table_1329 WHERE "Team" = 'Cleveland' | wikisql |
CREATE TABLE table_name_82 (
province VARCHAR,
capital VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which province has muju as the capital?
| SELECT province FROM table_name_82 WHERE capital = "muju" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Alkalosis" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEG... | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY Fname DESC | nvbench |
CREATE TABLE table_49091 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when To Par is '7', and when Score is '73-72-67-75=287'?
| SELECT "Player" FROM table_49091 WHERE "To Par" = '7' AND "Score" = '73-72-67-75=287' | wikisql |
CREATE TABLE table_45129 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT AVG("Sales (billion $)") FROM table_45129 WHERE "Headquarters" = 'france' AND "Assets (billion $)" > '2,539.1' | wikisql |
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... | SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '07371082275' | css |
CREATE TABLE table_name_5 (
opponent VARCHAR,
surface VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Opponent on a Hard (i) Surface?
| SELECT opponent FROM table_name_5 WHERE surface = "hard (i)" | sql_create_context |
CREATE TABLE table_39349 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the site of the game that had an attendance of 54,040?
| SELECT "Game Site" FROM table_39349 WHERE "Attendance" = '54,040' | wikisql |
CREATE TABLE table_name_26 (
free_or_pay VARCHAR,
years VARCHAR,
provider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Free or pay has Years of 2006 and a Provider of bt tv (formerly bt vision)?
| SELECT free_or_pay FROM table_name_26 WHERE years = "2006–" AND provider = "bt tv (formerly bt vision)" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGRQ FROM jybgb WHERE jybgb.BGDH = '18586184579' | css |
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 jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '34439326471' | css |
CREATE TABLE table_21888 (
"Tie no" real,
"Home team" text,
"Score 1" text,
"Away team" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team when Burnley were the away team?
| SELECT "Home team" FROM table_21888 WHERE "Away team" = 'Burnley' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cor ath unsp vsl ntv/gft" AND prescriptions.route = "ED" | mimicsql_data |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE table_name_80 (
characters VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the characters from the movie Suppressed Duck?
| SELECT characters FROM table_name_80 WHERE title = "suppressed duck" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe tex... | SELECT 'http://stackoverflow.com/q/' + CAST(Id AS TEXT) AS URL FROM Posts WHERE OwnerUserId = 98713 AND (Body LIKE '%/tomlev2.wordpress.com/%' OR Body LIKE '%/tomlev.wordpress.com/%') ORDER BY ViewCount DESC | sede |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_42203 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Country had a Score of 75-68=143?
| SELECT "Country" FROM table_42203 WHERE "Score" = '75-68=143' | wikisql |
CREATE TABLE table_name_78 (
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silvers did Turkey get?
| SELECT silver FROM table_name_78 WHERE nation = "turkey" | sql_create_context |
CREATE TABLE table_name_33 (
grid INTEGER,
manufacturer VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Count the Grid which has a Manufacturer of aprilia, and a Rider of bradley smith?
| SELECT AVG(grid) FROM table_name_33 WHERE manufacturer = "aprilia" AND rider = "bradley smith" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.short_title = "Seroma complicting proc" | mimicsql_data |
CREATE TABLE table_30105 (
"Series #" real,
"Season #" real,
"Title" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who were the writers of the episode that had 5.56 mi... | SELECT "Written by" FROM table_30105 WHERE "U.S. viewers (millions)" = '5.56' | wikisql |
CREATE TABLE table_name_61 (
appointed_by VARCHAR,
date_appointed VARCHAR,
party VARCHAR,
province__division_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who appointed the conservative from Ontario on June 18, 1993?
| SELECT appointed_by FROM table_name_61 WHERE party = "conservative" AND province__division_ = "ontario" AND date_appointed = "june 18, 1993" | sql_create_context |
CREATE TABLE table_28238 (
"NSG Nr." real,
"Name of the nature reserve" text,
"District / Town" text,
"Area (ha)" text,
"Date established" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What town has the reserve with an area of 163,62?
| SELECT "District / Town" FROM table_28238 WHERE "Area (ha)" = '163,62' | wikisql |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths | nvbench |
CREATE TABLE table_23184448_4 (
assists VARCHAR,
minutes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of assists for 321 minutes
| SELECT COUNT(assists) FROM table_23184448_4 WHERE minutes = 321 | sql_create_context |
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... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_41503 (
"Number" real,
"Name" text,
"Builder" text,
"Type" text,
"Date" text,
"Works number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for Orangeville?
| SELECT "Date" FROM table_41503 WHERE "Name" = 'orangeville' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.