instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 ReviewTaskResults (
Id number,
ReviewTaskId number,... | SELECT UserId, UserDisplayName, COUNT(*) OVER (PARTITION BY UserId) AS No FROM (SELECT DISTINCT UserId, UserDisplayName FROM PostHistory WHERE NOT UserId IS NULL AND NOT UserDisplayName IS NULL) AS p ORDER BY No DESC, UserId | sede |
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 MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE table_27250813_1 (
title VARCHAR,
no_in_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the episode no. 16 by season?
| SELECT title FROM table_27250813_1 WHERE no_in_season = 16 | sql_create_context |
CREATE TABLE table_59947 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which building has more than 34 floors?
| SELECT "Name" FROM table_59947 WHERE "Floors" > '34' | wikisql |
CREATE TABLE table_49245 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Pablo And jar the opponent?
| SELECT "Date" FROM table_49245 WHERE "Opponent" = 'pablo andújar' | wikisql |
CREATE TABLE table_67973 (
"Year" real,
"Record" text,
"Regular Season Finish" text,
"Playoffs" text,
"Avg. Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Year larger than 1975, and a Record of 13 11 is what playoffs?
| SELECT "Playoffs" FROM table_67973 WHERE "Year" > '1975' AND "Record" = '13–11' | wikisql |
CREATE TABLE table_train_253 (
"id" int,
"pregnancy_or_lactation" bool,
"pre_eclampsia" bool,
"acute_ischemia" bool,
"pre_gestational_hypertension" bool,
"diabetic" string,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the followi... | SELECT * FROM table_train_253 WHERE pregnancy_or_lactation = 1 AND pre_eclampsia = 1 | criteria2sql |
CREATE TABLE table_44280 (
"Year" real,
"Name" text,
"Field" text,
"State" text,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the years when the winner was prof. priyambada mohanty hejmadi from orissa?
| SELECT SUM("Year") FROM table_44280 WHERE "State" = 'orissa' AND "Name" = 'prof. priyambada mohanty hejmadi' | wikisql |
CREATE TABLE table_71461 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What region is the ALCA-272 Catalog?
| SELECT "Region" FROM table_71461 WHERE "Catalog" = 'alca-272' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | SELECT Score, AVG(ViewCount) AS "average_views" FROM Posts GROUP BY Score ORDER BY Score DESC | sede |
CREATE TABLE table_24334261_1 (
founded INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum founded year of the Worcester Tornadoes?
| SELECT MAX(founded) FROM table_24334261_1 WHERE team = "Worcester Tornadoes" | sql_create_context |
CREATE TABLE table_11621915_1 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the score with date oct 1
| SELECT score FROM table_11621915_1 WHERE date = "Oct 1" | sql_create_context |
CREATE TABLE table_70045 (
"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 position went lower than 106 from the College of Virginia?
| SELECT "Position" FROM table_70045 WHERE "Overall" < '106' AND "College" = 'virginia' | wikisql |
CREATE TABLE table_name_24 (
height__ft_ INTEGER,
floors VARCHAR,
city VARCHAR,
height__m_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest height (ft) of a building in Frankfurt with a height (m) of 257 and less than 55 floors?
| SELECT MIN(height__ft_) FROM table_name_24 WHERE city = "frankfurt" AND height__m_ = 257 AND floors < 55 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Mv collision NOS-driver" | mimicsql_data |
CREATE TABLE table_277 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest 1st prize( $ ) at the South Carolin... | SELECT MAX("1st Prize( $ )") FROM table_277 WHERE "Location" = 'South Carolina' | wikisql |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Orders (
order_id INT... | SELECT product_id, COUNT(DISTINCT order_id) FROM Order_Items | nvbench |
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 microlab (
microl... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cellulitis - extr... | eicu |
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 procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jane Dillard" | mimicsql_data |
CREATE TABLE table_15887683_10 (
package_option VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of package options for music box italia
| SELECT COUNT(package_option) FROM table_15887683_10 WHERE television_service = "Music Box Italia" | sql_create_context |
CREATE TABLE table_58541 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired for damon hill?
| SELECT "Time/Retired" FROM table_58541 WHERE "Driver" = 'damon hill' | wikisql |
CREATE TABLE table_1341672_14 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the district for tim lee hall
| SELECT district FROM table_1341672_14 WHERE incumbent = "Tim Lee Hall" | sql_create_context |
CREATE TABLE table_65048 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the year of the World Half Marathon Championships with a result of 3rd?
| SELECT "Year" FROM table_65048 WHERE "Tournament" = 'world half marathon championships' AND "Result" = '3rd' | wikisql |
CREATE TABLE table_21084 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the diameter of the feature with longitude 8.0e?
| SELECT "Diameter (km)" FROM table_21084 WHERE "Longitude" = '8.0E' | wikisql |
CREATE TABLE table_name_7 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss of the game that had a record of 63-52?
| SELECT loss FROM table_name_7 WHERE record = "63-52" | sql_create_context |
CREATE TABLE table_17553 (
"Season" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many women doubles teams competed in the same ye... | SELECT COUNT("Womens doubles") FROM table_17553 WHERE "Mens singles" = 'Jamie van Hooijdonk' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,... | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '9510699' AND BGRQ BETWEEN '2005-11-03' AND '2017-01-12' GROUP BY JCZBMC, JCZBJGDW | css |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH 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 t... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM 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 = '81795336' | css |
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_proje... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BA' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring' ... | advising |
CREATE TABLE table_37332 (
"Unit" text,
"Russian" text,
"Translation" text,
"Ratio" real,
"Metric value" text,
"Avoirdupois value" text,
"Ordinary value" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which ordinary value has a Russian value... | SELECT "Ordinary value" FROM table_37332 WHERE "Russian" = 'унция' | wikisql |
CREATE TABLE d_icd_procedures (
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 labevents (
row... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77053) ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_16959 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name all the tournaments that took place in Rhode Isl... | SELECT "Tournament" FROM table_16959 WHERE "Location" = 'Rhode Island' | wikisql |
CREATE TABLE table_72876 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of ... | SELECT COUNT("Car No.") FROM table_72876 WHERE "Team" = 'Panther Racing' AND "Grid" = '9' | wikisql |
CREATE TABLE table_22837363_1 (
episodes INTEGER,
viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest amount of episodes for the season with 5.74 million viewers?
| SELECT MAX(episodes) FROM table_22837363_1 WHERE viewers__in_millions_ = "5.74" | sql_create_context |
CREATE TABLE table_name_57 (
week VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was the tournament at Cincinnati?
| SELECT week FROM table_name_57 WHERE tournament = "cincinnati" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4045580' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-07-15' AND '2011-09-29' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 7992.28) AS T | css |
CREATE TABLE table_name_28 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent on september 10, 1979?
| SELECT opponent FROM table_name_28 WHERE date = "september 10, 1979" | sql_create_context |
CREATE TABLE table_name_56 (
home VARCHAR,
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team on February 18 that had a visitor of the Chicago Black Hawks?
| SELECT home FROM table_name_56 WHERE visitor = "chicago black hawks" AND date = "february 18" | sql_create_context |
CREATE TABLE table_name_46 (
round INTEGER,
team VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the top round for the baltimore bullets with a Pick larger than 6?
| SELECT MAX(round) FROM table_name_46 WHERE team = "baltimore bullets" AND pick > 6 | sql_create_context |
CREATE TABLE table_78041 (
"Full Name" text,
"Nickname" text,
"Gender" text,
"Weight at birth" text,
"Meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Chukwubuikem Maduabuchi is what gender?
| SELECT "Gender" FROM table_78041 WHERE "Full Name" = 'chukwubuikem maduabuchi' | wikisql |
CREATE TABLE table_name_78 (
career_caps VARCHAR,
position VARCHAR,
tour_apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of career caps for a full back, when tour Apps is smaller than 29?
| SELECT COUNT(career_caps) FROM table_name_78 WHERE position = "full back" AND tour_apps < 29 | sql_create_context |
CREATE TABLE table_name_50 (
date VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date amer sulaiman won?
| SELECT date FROM table_name_50 WHERE winner = "amer sulaiman" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | SELECT * FROM Users | sede |
CREATE TABLE table_203_509 (
id number,
"year" number,
"laetare medalist" text,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times does philanthropist appear in the position column on this chart ?
| SELECT COUNT(*) FROM table_203_509 WHERE "position" = 'philanthropist' | squall |
CREATE TABLE table_14971788_1 (
date VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was week 2?
| SELECT date FROM table_14971788_1 WHERE week = 2 | sql_create_context |
CREATE TABLE table_2950964_5 (
read_by VARCHAR,
isbn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- THe audio book with ISBN 978-1-4084-6879-1 is read by whom?
| SELECT read_by FROM table_2950964_5 WHERE isbn = "isbn 978-1-4084-6879-1" | sql_create_context |
CREATE TABLE table_name_55 (
psychological_dependence INTEGER,
physical_dependence VARCHAR,
pleasure VARCHAR,
drug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Psychological Dependence, when Pleasure is less than 2.3, when Drug ... | SELECT MAX(psychological_dependence) FROM table_name_55 WHERE pleasure < 2.3 AND drug = "cannabis" AND physical_dependence < 0.8 | sql_create_context |
CREATE TABLE table_1545 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT "Assets (billion $)" FROM table_1545 WHERE "Headquarters" = 'Brazil' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT 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 = "Morbid obesity" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_26614 (
"Date Final" text,
"Tournament" text,
"Commercial Name" text,
"Category" text,
"Prize Money/ Surface" text,
"Final Match" text,
"Semifinal Matches" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played in the s... | SELECT "Semifinal Matches" FROM table_26614 WHERE "Commercial Name" = 'Buick WCT Finals' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId numb... | SELECT Id, Title, Score, creation_year, creation_month FROM (SELECT p.Id, p.Title, p.Score, YEAR(p.CreationDate) AS creation_year, MONTH(p.CreationDate) AS creation_month, RANK() OVER (PARTITION BY YEAR(p.CreationDate), MONTH(p.CreationDate) ORDER BY p.Score DESC) AS rnk FROM Posts AS p JOIN PostTags AS pt ON pt.PostId... | sede |
CREATE TABLE table_name_32 (
release_price___usd__ VARCHAR,
model_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release price (USD) of the microprocessor with a model number pentium dual-core t2330?
| SELECT release_price___usd__ FROM table_name_32 WHERE model_number = "pentium dual-core t2330" | 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2098" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
pa... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'facial bone fracture - nasal fracture' AND STRFTIME(... | eicu |
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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.long_title = "Pneumonitis due to inhalation of food or vomitus" | mimicsql_data |
CREATE TABLE table_name_32 (
overall INTEGER,
position VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest overall where the position was linebacker and the pick number was more than 9?
| SELECT MAX(overall) FROM table_name_32 WHERE position = "linebacker" AND pick__number > 9 | sql_create_context |
CREATE TABLE table_17586 (
"Rank" real,
"Peak" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Isolation (km)" real,
"Municipality" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rank where the municipality is sun... | SELECT "Rank" FROM table_17586 WHERE "Municipality" = 'Sunndal' | wikisql |
CREATE TABLE table_73524 (
"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.
-- What i... | SELECT "Score" FROM table_73524 WHERE "Date" = 'December 7' | wikisql |
CREATE TABLE table_13502 (
"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 most silver when bronze is more than 0, total is more than 1, gold is more than ... | SELECT MAX("Silver") FROM table_13502 WHERE "Bronze" > '0' AND "Total" > '1' AND "Gold" > '0' AND "Nation" = 'china (chn)' | wikisql |
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
CREATE TABLE ... | SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, last_name | nvbench |
CREATE TABLE table_name_86 (
semifinalists VARCHAR,
champions VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Semifinalists has a Champions of michael chang 6-0 6-4?
| SELECT semifinalists FROM table_name_86 WHERE champions = "michael chang 6-0 6-4" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9936726' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2018-09-28' AND '2020-09-28' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 7430.83 UNION SELECT fgwyjzb.... | css |
CREATE TABLE table_name_82 (
location___state VARCHAR,
team VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Castrol Perkins Motorsport and the winner Russell Ingall was in what location/state?
| SELECT location___state FROM table_name_82 WHERE team = "castrol perkins motorsport" AND winner = "russell ingall" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '奚丽珠' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 381.88) | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.language FROM demographic WHERE demographic.name = "Charles Deshay" | mimicsql_data |
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 jyjgzbb (
JYZBLSH text,
YLJGD... | (SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '周泰宁' AND jyb... | css |
CREATE TABLE table_52961 (
"Number & Name" text,
"Description" text,
"Livery" text,
"Owner(s)" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which description is dated 1962?
| SELECT "Description" FROM table_52961 WHERE "Date" = '1962' | wikisql |
CREATE TABLE table_name_55 (
byes VARCHAR,
draws INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many byes has a draw larger than 0?
| SELECT COUNT(byes) FROM table_name_55 WHERE draws > 0 | sql_create_context |
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Department_Store_Chain (
dept_store_chain_id INTEGER,
dept_store_chain_name VARCHAR(80)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER
)
CREATE TABLE Staff_De... | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" | nvbench |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit... | atis |
CREATE TABLE table_45480 (
"Competition" text,
"Played" real,
"Draw" real,
"Lost" real,
"Favour" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of games played where they tied more than 7 of them?
| SELECT MIN("Played") FROM table_45480 WHERE "Draw" > '7' | 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 COUNT(*) 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 = '75486371' AND mzjzjlb.JZKSRQ BETWEEN '2001-11-10' AND '2016-09-16' AND mzjzjlb.YLJGDM = '7090006' | css |
CREATE TABLE table_31618 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of gold for bronze more than 0 and total more than 100
| SELECT COUNT("Gold") FROM table_31618 WHERE "Bronze" > '0' AND "Rank" = 'total' AND "Total" > '100' | wikisql |
CREATE TABLE table_name_19 (
coach VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the coach in 1953?
| SELECT coach FROM table_name_19 WHERE year = "1953" | sql_create_context |
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.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.age < "61" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "1" AND prescriptions.route = "NU" | mimicsql_data |
CREATE TABLE table_name_96 (
week VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was the record 0-5?
| SELECT week FROM table_name_96 WHERE record = "0-5" | sql_create_context |
CREATE TABLE table_1634 (
"Period" text,
"% trains arriving within 5 mins of scheduled time (over three months)" text,
"Change over same quarter the previous year" text,
"% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text,
"Change over previous year as a whole" text
... | SELECT "Change over previous year as a whole" FROM table_1634 WHERE "Change over same quarter the previous year" = 'Up 2.8%' | wikisql |
CREATE TABLE table_33201 (
"Tournament" text,
"2007" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What value for 2013 corresponds to the US Open Tournament?
| SELECT "2013" FROM table_33201 WHERE "Tournament" = 'us open' | wikisql |
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 (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive heart failure - right-sided' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1... | eicu |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
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),... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions | nvbench |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name te... | SELECT Tags, ViewCount, CommentCount, Score, FavoriteCount FROM Posts WHERE CreationDate > '2020-07-01' ORDER BY ViewCount DESC LIMIT 100 | sede |
CREATE TABLE table_34580 (
"Position" text,
"Artist" text,
"Single" text,
"Year" text,
"Weeks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what artist won in 1953
| SELECT "Artist" FROM table_34580 WHERE "Year" = '1953' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
C... | SELECT COUNT(*) AS QuestionCount, SUM(A.TriedComments) AS TriedCount FROM (SELECT SUM(CASE WHEN C.Text LIKE '%have you tried%' OR c.Text LIKE '%you have tried%' THEN 1 ELSE 0 END) AS TriedComments, P.Id FROM Posts AS P LEFT JOIN Comments AS C ON C.PostId = P.Id WHERE P.CreationDate BETWEEN @pStartDate AND @pEndDate AND... | sede |
CREATE TABLE table_name_48 (
date VARCHAR,
stadium VARCHAR,
final_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date that a game at the Alltel Stadium had a final score of 6-20?
| SELECT date FROM table_name_48 WHERE stadium = "alltel stadium" AND final_score = "6-20" | sql_create_context |
CREATE TABLE table_70806 (
"Rank" real,
"Fastest time (s)" real,
"Wind (m/s)" real,
"Athlete" text,
"Nation" text,
"Date" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the wind speed when brenda morehead was in the ... | SELECT MIN("Wind (m/s)") FROM table_70806 WHERE "Nation" = 'united states' AND "Athlete" = 'brenda morehead' | 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 prescriptions... | 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 = "Pressure ulcer, stage IV" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
)
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
-- U... | SELECT Country, COUNT(Country) FROM member GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_100518_1 (
direction VARCHAR,
weapon VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the directions for the guardian whose weapon is kha ga (sword)?
| SELECT direction FROM table_100518_1 WHERE weapon = "Khaḍga (sword)" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '章乐悦' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID... | css |
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,
LastEditorDispl... | SELECT COUNT(*) FROM Posts WHERE Body LIKE '%<code>%' AND ParentId IN (1109022, 151777, 541966, 1016896, 6343166, 477572, 2591036, 3145089, 2201917, 5033012, 600207, 3035692, 1560788, 2091465, 531427, 2139134, 6495898, 3166501, 4605527, 2736389, 2150078, 6200533, 867518, 2471935, 3624280, 2459916, 1667278, 2795833, 231... | sede |
CREATE TABLE table_36303 (
"Season" text,
"Winner" text,
"Result" text,
"Runner-up" text,
"1st of Regular Season" text,
"Record" text,
"Champion's Coach" text,
"Finals MVP" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the runner... | SELECT "Runner-up" FROM table_36303 WHERE "Finals MVP" = 'tanel sokk' AND "Champion's Coach" = 'alar varrak' | wikisql |
CREATE TABLE table_17672 (
"Year" text,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the playoff result in 2002?
| SELECT "Playoffs" FROM table_17672 WHERE "Year" = '2002' | wikisql |
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 ... | SELECT MIN(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 = 9294)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit... | mimic_iii |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
... | SELECT Comment, COUNT(*) AS "Count" FROM PostHistory WHERE PostHistoryTypeId IN (33, 34) GROUP BY Comment HAVING COUNT(*) > 2 ORDER BY 'Count' DESC | sede |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
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 VARCHA... | SELECT Statement_Details, SUM(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY SUM(Account_Details) | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.age, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_35 (
music VARCHAR,
team VARCHAR,
points_jury VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Music for Team anna guzik & rafa kami ski that has a Points Jury of 24 (7,5,6,6)?
| SELECT music FROM table_name_35 WHERE team = "anna guzik & rafał kamiński" AND points_jury = "24 (7,5,6,6)" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_15409403_1 (
year VARCHAR,
playoffs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the playoffs reached Conference Finals?
| SELECT year FROM table_15409403_1 WHERE playoffs = "Conference Finals" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.