instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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 = "ASIAN" AND demographic.dod_year <= "2155.0" | mimicsql_data |
CREATE TABLE table_name_49 (
wins INTEGER,
starts VARCHAR,
podiums VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average wins when the podiums is more than 1, points is 80 and starts is less than 28?
| SELECT AVG(wins) FROM table_name_49 WHERE podiums > 1 AND points = 80 AND starts < 28 | sql_create_context |
CREATE TABLE table_75309 (
"Season" text,
"Season Premiere" text,
"Season Finale" text,
"Winner" text,
"Runner-up" text,
"Number of Contestants" real,
"Winner's Country" text,
"Runner Up's Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT SUM("Number of Contestants") FROM table_75309 WHERE "Season Premiere" = 'march 1, 2009' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN area ON COURSE_0.course_id = area.course_id ... | advising |
CREATE TABLE table_23083 (
"Scorecard" real,
"Date" text,
"Venue" text,
"Team 1" text,
"Team 2" text,
"Result" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the man of the match when the Rockets won by 9 wic... | SELECT "Man of the Match" FROM table_23083 WHERE "Result" = 'Rockets won by 9 wickets' | 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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '柏泰初' AND gwyjzb.IN_HOSP_DATE BETWEEN '2015-08-27' AND '2016-11-04' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '柏泰初' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2015-08-2... | css |
CREATE TABLE table_70632 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Try bonus" FROM table_70632 WHERE "Points" = '58' | wikisql |
CREATE TABLE table_50874 (
"Show" text,
"Last Aired" real,
"Previous Network" text,
"Retitled as/Same" text,
"New/Returning/Same Network" text,
"Returning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network returns april 3, and a Show ... | SELECT "New/Returning/Same Network" FROM table_50874 WHERE "Returning" = 'april 3' AND "Show" = 'shop ''til you drop' | 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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Potassium, Whole Blood" | mimicsql_data |
CREATE TABLE table_10333 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the other team that played... | SELECT "Away team score" FROM table_10333 WHERE "Home team" = 'geelong' | 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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2875436' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-01-02' AND '2017-04-12' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2875436' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-01-02' AND '2017-04-12' AND t_kc21.IN_DIAG_DIS_CD = t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE document_types (
document_type_code text,
document_description text
)
CREATE TABLE projects (
project_id number,
organisation_id number,
project_details text
)
CREATE TABLE research_outcomes (
outcome_code text,
outcome_description text
)
CREATE TABLE grants (
grant_id nu... | SELECT date_from, date_to FROM project_staff WHERE project_id IN (SELECT project_id FROM project_staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM project_staff WHERE role_code = 'leader' | spider |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2150" | mimicsql_data |
CREATE TABLE table_train_233 (
"id" int,
"serum_bicarbonate" int,
"language" string,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"admission_blood_glucose" int,
"urine_albumin" int,
"ketoacidosis" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answe... | SELECT * FROM table_train_233 WHERE hemoglobin_a1c_hba1c >= 6.5 AND hemoglobin_a1c_hba1c <= 8 | criteria2sql |
CREATE TABLE table_name_96 (
to_par VARCHAR,
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What to par has t3 as the place and england as the country?
| SELECT to_par FROM table_name_96 WHERE place = "t3" AND country = "england" | sql_create_context |
CREATE TABLE table_name_49 (
round VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total round of the 129 pick?
| SELECT COUNT(round) FROM table_name_49 WHERE pick__number = 129 | sql_create_context |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_... | SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY purchase_details DESC | nvbench |
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 Title FROM Posts ORDER BY ClosedDate DESC LIMIT 100 | sede |
CREATE TABLE table_test_16 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"severe_hypertension" bool,
"adrenaline" bool,
"stroke" bool,
"renal_disease" bool,
"severe_uncontrolled_arterial_hypertension" bool,
"hepatic_disease" bool,
"... | SELECT * FROM table_test_16 WHERE renal_disease = 1 OR (creatinine_clearance_cl > 1.7 OR estimated_glomerular_filtration_rate_egfr < 35) | criteria2sql |
CREATE TABLE table_204_946 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many finished all 225 lap... | SELECT COUNT(*) FROM table_204_946 WHERE "laps" = 225 | squall |
CREATE TABLE table_name_44 (
height_ft__m_ VARCHAR,
floors VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is the building built in 1985 with 22 floors?
| SELECT height_ft__m_ FROM table_name_44 WHERE floors = 22 AND year = 1985 | sql_create_context |
CREATE TABLE table_name_46 (
team VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team in Game 38?
| SELECT team FROM table_name_46 WHERE game = 38 | sql_create_context |
CREATE TABLE table_37479 (
"Date" text,
"City" text,
"Result" text,
"Score" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Result of w, and a Score of 3-0?
| SELECT "Date" FROM table_37479 WHERE "Result" = 'w' AND "Score" = '3-0' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | SELECT Comments.Id AS "comment_link", Comments.UserId AS "user_link", Posts.ClosedDate AS Closed, Comments.CreationDate FROM Comments INNER JOIN Posts ON Comments.PostId = Posts.Id WHERE (LOWER(Text) LIKE '%@downvoter%' OR LOWER(Text) LIKE '%downvoter%' OR LOWER(Text) LIKE '%the downvote%' OR LOWER(Text) LIKE '%downvot... | sede |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
-- Using valid SQLite, answer the following que... | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_96 (
points INTEGER,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the lowest points in 2004?
| SELECT MIN(points) FROM table_name_96 WHERE year = 2004 | sql_create_context |
CREATE TABLE table_66921 (
"!accented mora" text,
"one mora" text,
"two-mora word" text,
"three-mora word" text,
"gloss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the one mora for the three-mora word /kaze/ [k z ]?
| SELECT "one mora" FROM table_66921 WHERE "three-mora word" = '/kaze/ [kázé]' | wikisql |
CREATE TABLE table_name_78 (
allsvenskan_titles INTEGER,
introduced VARCHAR,
stars_symbolizes VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many allsvenskan titles did club aik have after its introduction after 2000, with stars sym... | SELECT SUM(allsvenskan_titles) FROM table_name_78 WHERE stars_symbolizes = "number of swedish championship titles" AND club = "aik" AND introduced > 2000 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'upper respiratory obstruction') | eicu |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId n... | SELECT Id AS "post_link", OwnerUserId, OwnerDisplayName, CommunityOwnedDate FROM Posts WHERE Id = '##PostId##' | sede |
CREATE TABLE table_name_54 (
year INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Year was the Game on September 26?
| SELECT SUM(year) FROM table_name_54 WHERE date = "september 26" | sql_create_context |
CREATE TABLE table_name_68 (
date VARCHAR,
result VARCHAR,
location VARCHAR,
year VARCHAR,
loser VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date had a year under 1988, loser of Philadelphia Eagles, location of Giants Stadium, and a resu... | SELECT date FROM table_name_68 WHERE year < 1988 AND loser = "philadelphia eagles" AND location = "giants stadium" AND result = "21-0" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
su... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | mimic_iii |
CREATE TABLE table_name_63 (
gender VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gender for elsthorpe school
| SELECT gender FROM table_name_63 WHERE name = "elsthorpe school" | sql_create_context |
CREATE TABLE table_16916 (
"Institution" text,
"Nickname" text,
"Status" text,
"Founded" real,
"Color" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the founding of navy blue?
| SELECT "Founded" FROM table_16916 WHERE "Color" = 'Navy Blue' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_16102 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Setting" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode number of the season ... | SELECT "No. in season" FROM table_16102 WHERE "Title" = 'The Northern Uprising' | wikisql |
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '任英媛' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 2878.63) | css |
CREATE TABLE table_26383 (
"Original" text,
"IPA ( Lisbon )" text,
"IPA ( Rio de Janeiro )" text,
"IPA ( S\u00e3o Paulo )" text,
"IPA ( Santiago de Compostela )" text,
"Translation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the orig... | SELECT "Translation" FROM table_26383 WHERE "IPA ( Rio de Janeiro )" = 'ki̥ mo̞ɕˈtɾaɾɜ̃w̃ nɐ ˈtɛʁə tɕĩʑiˈtɜ̃nə' | wikisql |
CREATE TABLE table_name_9 (
qual VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the qual with a rank 9?
| SELECT qual FROM table_name_9 WHERE rank = "9" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | SELECT questions.Id AS "post_link", Votes.UserId AS "user_link", 'site://posts/' + CAST(questions.Id AS TEXT) + '/timeline|timeline' AS "Timeline link", COUNT(*) AS "Number of bounties" FROM Posts AS questions LEFT JOIN Votes AS votes ON Votes.PostId = questions.Id WHERE Votes.VoteTypeId = 8 GROUP BY questions.Id, Vote... | sede |
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.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '韩... | css |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Name, Age FROM artist ORDER BY Age | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LEVOBASE3" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.icd9_code = "3950" | mimicsql_data |
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 demographic.marital_status, demographic.dob FROM demographic WHERE demographic.subject_id = "92796" | mimicsql_data |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,... | SELECT COUNT(*) FROM jybgb WHERE jybgb.YLJGDM = '7759937' AND jybgb.BGRQ BETWEEN '2004-07-03' AND '2018-11-11' | css |
CREATE TABLE table_17118657_10 (
date VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which date is high assists Dupree (6)?
| SELECT date FROM table_17118657_10 WHERE high_assists = "Dupree (6)" | sql_create_context |
CREATE TABLE table_name_83 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2006 value with a 2011 value greater than 4113 and a 2008 value less than 7181?
| SELECT SUM(2006) FROM table_name_83 WHERE 2011 > 4113 AND 2008 < 7181 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "70" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_2527617_1 (
best_player VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the best player in the 1998 season?
| SELECT best_player FROM table_2527617_1 WHERE season = 1998 | 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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84346 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... | mimic_iii |
CREATE TABLE table_name_5 (
lower_index_kcal__nm_3 INTEGER,
lower_index_mj__nm_3 VARCHAR,
upper_index_kcal__nm_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Lower index Kcal/ Nm 3 entry, for the row with entries of an Upper index Kcal/ Nm ... | SELECT AVG(lower_index_kcal__nm_3) FROM table_name_5 WHERE lower_index_mj__nm_3 = 74.54 AND upper_index_kcal__nm_3 < 19 OFFSET 376 | sql_create_context |
CREATE TABLE table_75276 (
"Surname" text,
"First" text,
"D.O.B." text,
"Uni#" real,
"Bats" text,
"Throws" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has a last name of baron?
| SELECT "Bats" FROM table_75276 WHERE "Surname" = 'baron' | wikisql |
CREATE TABLE table_5848 (
"Year Ended" text,
"Passengers Flown" real,
"Passenger Load Factor (%)" real,
"Revenue (\u20acm)" real,
"Profit / (Loss) Before Tax (\u20acm)" text,
"Net Profit / (Loss) (\u20acm)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Profit / (Loss) Before Tax (\u20acm)" FROM table_5848 WHERE "Revenue (\u20acm)" > '1,115.8' AND "Year Ended" = '31 december 2012' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "WARF25" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "83678" | mimicsql_data |
CREATE TABLE table_name_18 (
draw INTEGER,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many draws feature artist wendy fierce?
| SELECT SUM(draw) FROM table_name_18 WHERE artist = "wendy fierce" | 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 zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '26603451' | css |
CREATE TABLE table_33684 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did Carlton score?
| SELECT "Home team score" FROM table_33684 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-3 year') | eicu |
CREATE TABLE table_30280 (
"Position" text,
"Number" real,
"Player" text,
"Super League" real,
"Champions League" real,
"Swiss Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the lowest super league for a 0 champion le... | SELECT MIN("Super League") FROM table_30280 WHERE "Champions League" = '0' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE status (
station_id VARCHAR,
bikes_available VARCHAR
)
CREATE TABLE station (
name VARCHAR,
id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the unique name for stations that have ever had 7 bikes available.
| SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7 | sql_create_context |
CREATE TABLE table_name_79 (
wounded VARCHAR,
complement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many were Wounded while in a Unit with a Complement of 83 off 9 Men?
| SELECT wounded FROM table_name_79 WHERE complement = "83 off 9 men" | sql_create_context |
CREATE TABLE table_name_38 (
season VARCHAR,
away VARCHAR,
league VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season has a regionalliga s d league, a 1-0 home, and an away of 2-3?
| SELECT season FROM table_name_38 WHERE league = "regionalliga süd" AND home = "1-0" AND away = "2-3" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | SELECT h.UserId AS "user_link", SUM(CASE WHEN PostHistoryTypeId = 6 THEN 1 ELSE 0 END) AS "retags", SUM(CASE WHEN PostHistoryTypeId = 5 THEN 1 ELSE 0 END) AS "body_edits", SUM(CASE WHEN PostHistoryTypeId = 4 THEN 1 ELSE 0 END) AS "title_edits", COUNT(DISTINCT h.CreationDate) AS "total_edits", COUNT(DISTINCT h.PostId) A... | sede |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid numbe... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
CREATE TABLE table_76538 (
"Scorer" text,
"Club" text,
"League goals" text,
"FA Cup goals" text,
"League Cup goals" real,
"Texaco Cup goals" text,
"Euro competitions" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is F... | SELECT "FA Cup goals" FROM table_76538 WHERE "Euro competitions" = '1' AND "League goals" = '11' | wikisql |
CREATE TABLE table_9768 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player had a position of OT during round 27?
| SELECT "Name" FROM table_9768 WHERE "Position" = 'ot' AND "Round" = '27' | wikisql |
CREATE TABLE table_name_59 (
premiere INTEGER,
chinese_title VARCHAR,
peak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the premiere rating for a Chinese title of , and a Peak smaller than 41?
| SELECT SUM(premiere) FROM table_name_59 WHERE chinese_title = "野蠻奶奶大戰戈師奶" AND peak < 41 | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND lab.labname = 'cpk-mb index' AND STRFTIME('%y-%m', lab.labresultt... | eicu |
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 hz_info.person_info_JGDM, hz_info.person_info_JGMC, COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '沙眼' GROUP BY hz_info.person_info_JGDM | css |
CREATE TABLE table_name_81 (
runner_up VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the runner-up for Ilhwa Chunma?
| SELECT runner_up FROM table_name_81 WHERE winner = "ilhwa chunma" | sql_create_context |
CREATE TABLE table_name_89 (
location VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the location when the record was 12-5?
| SELECT location FROM table_name_89 WHERE record = "12-5" | sql_create_context |
CREATE TABLE table_name_50 (
date VARCHAR,
streak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date when streak was won 8?
| SELECT date FROM table_name_50 WHERE streak = "won 8" | sql_create_context |
CREATE TABLE table_name_59 (
score VARCHAR,
runners_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score when TSV Siegen was the runner-up?
| SELECT score FROM table_name_59 WHERE runners_up = "tsv siegen" | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application 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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND DAYS_1.day_name = ... | atis |
CREATE TABLE table_name_67 (
name VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is in the position of Guard/Forward?
| SELECT name FROM table_name_67 WHERE position = "guard/forward" | sql_create_context |
CREATE TABLE table_name_99 (
fall_07 INTEGER,
fall_09 INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average value for Fall 07 when Fall 09 is less than 296?
| SELECT AVG(fall_07) FROM table_name_99 WHERE fall_09 < 296 | 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | mimicsql_data |
CREATE TABLE table_name_43 (
gold_medals VARCHAR,
total_medals INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gold medals for the school with less than 1 total?
| SELECT COUNT(gold_medals) FROM table_name_43 WHERE total_medals < 1 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.days_stay = "23" | mimicsql_data |
CREATE TABLE table_17563 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the followin... | SELECT "Trofeo Fast Team" FROM table_17563 WHERE "Stage" = '20' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "14" AND diagnoses.short_title = "Noninf gastroenterit NEC" | mimicsql_data |
CREATE TABLE table_204_295 (
id number,
"model" text,
"origin" text,
"type" text,
"version" text,
"in service" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the model of the only utility vehicle used by the philippin... | SELECT "model" FROM table_204_295 WHERE "origin" = 'united kingdom' | 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 diagnoses (
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.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.age < "59" | mimicsql_data |
CREATE TABLE repair_assignment (
technician_id number,
repair_id number,
machine_id number
)
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE repair (
repair_id number,
name text,
launch_date text,
not... | SELECT team, COUNT(*) FROM technician GROUP BY team | spider |
CREATE TABLE table_1676073_12 (
club VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What clubs had 608 points against?
| SELECT club FROM table_1676073_12 WHERE points_against = "608" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TA... | SELECT A.Id AS "post_link", A.CreationDate AS "answer_date" FROM Posts AS A WHERE A.PostTypeId = 2 AND (A.Body LIKE '%en.m.wikipedia.org/wiki%') ORDER BY 'answer_date' DESC | sede |
CREATE TABLE table_71931 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did she compete in tampere, finland?
| SELECT AVG("Year") FROM table_71931 WHERE "Venue" = 'tampere, finland' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 546 | advising |
CREATE TABLE table_8384 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years did Real Colorado Foxes make it to the Open Cup 1st Round?
| SELECT COUNT("Year") FROM table_8384 WHERE "Open Cup" = '1st round' | 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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hematocrit, Other Fluid" | mimicsql_data |
CREATE TABLE table_68016 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Adelaide has a Melbourne of yes, an Auckland of yes, and a Perth of yes... | SELECT "Adelaide" FROM table_68016 WHERE "Melbourne" = 'yes' AND "Auckland" = 'yes' AND "Perth" = 'yes' | wikisql |
CREATE TABLE table_203_577 (
id number,
"tenure" text,
"coach" text,
"years" number,
"record" text,
"pct." number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long was thomas stouch coach ?
| SELECT "years" FROM table_203_577 WHERE "coach" = 'thomas stouch' | squall |
CREATE TABLE table_name_96 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps did the grid 1 engine have?
| SELECT SUM(laps) FROM table_name_96 WHERE time_retired = "engine" AND grid = 1 | sql_create_context |
CREATE TABLE table_name_61 (
club VARCHAR,
sport VARCHAR,
league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club plays soccer in the nwsl?
| SELECT club FROM table_name_61 WHERE sport = "soccer" AND league = "nwsl" | sql_create_context |
CREATE TABLE table_3784 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the teams record when they played the ottawa s... | SELECT "Record" FROM table_3784 WHERE "Opponent" = 'Ottawa Senators' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.