instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalp... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND microlab.culturesite = 'urine, catheter specimen... | eicu |
CREATE TABLE table_28342423_1 (
parent_unit VARCHAR,
commanding_officer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the parent unit for josef priller
| SELECT parent_unit FROM table_28342423_1 WHERE commanding_officer = "Josef Priller" | sql_create_context |
CREATE TABLE table_204_137 (
id number,
"race" number,
"race name" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"winning team" text,
"yokohama winner" text,
"jay-ten winner" text,
"report" text
)
-- Using valid SQLite, answer the following questions fo... | SELECT COUNT(*) FROM table_204_137 WHERE "winning team" = 'chevrolet' | squall |
CREATE TABLE table_204_144 (
id number,
"represent" number,
"contestant" text,
"age" number,
"height" text,
"hometown" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the height difference between contestant reyna royo and michelle krisko... | SELECT ABS((SELECT "height" FROM table_204_144 WHERE "contestant" = 'reyna royo') - (SELECT "height" FROM table_204_144 WHERE "contestant" = 'michelle krisko sugasti')) | squall |
CREATE TABLE table_name_9 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when the home team was Essendon?
| SELECT date FROM table_name_9 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_62845 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Col (m) has a Prominence (m) of 2,344?
| SELECT COUNT("Col (m)") FROM table_62845 WHERE "Prominence (m)" = '2,344' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory... | SELECT CAST((JULIANDAY(CreationDate) - JULIANDAY(q.CreationDate)) AS INT) AS SecondsDiff FROM Posts AS q INNER JOIN Posts AS r ON q.AcceptedAnswerId = r.Id WHERE YEAR(q.CreationDate) = 2017 | sede |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ... | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title | nvbench |
CREATE TABLE table_52072 (
"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.
-- Where did the away team Carlton play?
| SELECT "Venue" FROM table_52072 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality | nvbench |
CREATE TABLE table_75845 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What result has January 21, 2002 as the date?
| SELECT "Result" FROM table_75845 WHERE "Date" = 'january 21, 2002' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_23326 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the g... | SELECT "Opponent" FROM table_23326 WHERE "Date" = 'July 7' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "64" AND diagnoses.icd9_code = "28529" | mimicsql_data |
CREATE TABLE table_29301050_1 (
train_number VARCHAR,
frequency VARCHAR,
arrival_lonavla VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many trains run daily to lonavla and arrive at 12:25
| SELECT COUNT(train_number) FROM table_29301050_1 WHERE frequency = "Daily" AND arrival_lonavla = "12:25" | sql_create_context |
CREATE TABLE table_16415 (
"Romaji title" text,
"Japanese title" text,
"Release date" text,
"Reference" text,
"Oricon" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many songs have mi-chemin as their Japanese name and romanji name?
| SELECT COUNT("Romaji title") FROM table_16415 WHERE "Japanese title" = 'Mi-Chemin' | wikisql |
CREATE TABLE table_12469 (
"Year" real,
"Tournaments played" real,
"Cuts made*" real,
"Wins" real,
"Top 10s" real,
"Best finish" text,
"Earnings ( $ )" text,
"Scoring average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the la... | SELECT MAX("Year") FROM table_12469 WHERE "Best finish" = '2' AND "Scoring average" < '71.24' | wikisql |
CREATE TABLE table_name_99 (
points INTEGER,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the lowest points of game 60?
| SELECT MIN(points) FROM table_name_99 WHERE game = 60 | sql_create_context |
CREATE TABLE ALBUM (
Title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please list all album titles in alphabetical order.
| SELECT Title FROM ALBUM ORDER BY Title | sql_create_context |
CREATE TABLE table_73454 (
"Edition" text,
"Round" text,
"Date" text,
"Partnering" text,
"Against" text,
"Surface" text,
"Opponents" text,
"W\u2013L" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds were ... | SELECT COUNT("Round") FROM table_73454 WHERE "Edition" = '2006 Davis Cup Europe/Africa Group I' | wikisql |
CREATE TABLE table_68408 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Win %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 2008 at the Shanghai tournament?
| SELECT "2008" FROM table_68408 WHERE "Tournament" = 'shanghai' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Crn ath atlg vn bps grft" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE classroom (
building text,
room_number text,
capacity number
)
CREATE TABLE advisor (
s_id text,
i_id text
)
CREATE TABLE department (
dept_name text,
building text,
budget number
)
CREATE TABLE student (
... | SELECT * FROM instructor ORDER BY salary | spider |
CREATE TABLE table_16799784_14 (
diameter__km_ VARCHAR,
latitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many numbers are listed under diameter with a lattitude of 5.0n?
| SELECT COUNT(diameter__km_) FROM table_16799784_14 WHERE latitude = "5.0N" | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Ac on chr syst hrt fail" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_name_16 (
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2nd leg result when team 2 is Morocco?
| SELECT 2 AS nd_leg FROM table_name_16 WHERE team_2 = "morocco" | 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 lab (
labid numbe... | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006... | eicu |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t... | mimic_iii |
CREATE TABLE table_2124 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Current Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum enroll... | SELECT MAX("Enrollment") FROM table_2124 WHERE "Institution" = 'Concordia University' | wikisql |
CREATE TABLE table_11328 (
"Round" real,
"Pick" real,
"Name" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position is Kentucky State sitting in?
| SELECT "Position" FROM table_11328 WHERE "School" = 'kentucky state' | wikisql |
CREATE TABLE table_40091 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Nationality has a Player of keith bogans, and a Years in Orlando of 2006 ... | SELECT "Nationality" FROM table_40091 WHERE "Player" = 'keith bogans' AND "Years in Orlando" = '2006–2009' | wikisql |
CREATE TABLE table_name_39 (
player VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player had a To par of +1?
| SELECT player FROM table_name_39 WHERE to_par = "+1" | sql_create_context |
CREATE TABLE table_name_72 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for the opponent St. Louis Cardinals?
| SELECT record FROM table_name_72 WHERE opponent = "st. louis cardinals" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
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, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '49528446' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '438415-0') | css |
CREATE TABLE table_25839 (
"Model" text,
"Engine" text,
"Displacement" text,
"Max. power output" text,
"Peak torque" text,
"0\u2013100km/h,s 0-62mph,s" text,
"Top speed" text,
"CO 2 emissions" text,
"Years" text,
"Note" text,
"Engine code" text
)
-- Using valid SQLite, answ... | SELECT "Max. power output" FROM table_25839 WHERE "Model" = '2.0 TS' AND "Peak torque" = 'N·m (lb·ft) at 3,500 rpm' | wikisql |
CREATE TABLE person (
name VARCHAR,
age INTEGER
)
CREATE TABLE Person (
name VARCHAR,
age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the oldest person?
| SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM Person) | sql_create_context |
CREATE TABLE table_19163 (
"School Name" text,
"City" text,
"Students" real,
"FTE Teachers" text,
"Pupil/Teacher Ratio" text,
"School Level" text,
"Low Grade" text,
"High Grade" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many FTE... | SELECT "FTE Teachers" FROM table_19163 WHERE "Pupil/Teacher Ratio" = '19' | wikisql |
CREATE TABLE Rooms (
bedType VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of rooms for each bed type.
| SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType | sql_create_context |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
-- Using valid SQLite... | SELECT COUNT(*) FROM has_allergy WHERE allergy = "Cat" | spider |
CREATE TABLE table_70821 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Try BP" text,
"Losing BP" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Drawn for Ystrad Rhondda RFC and has Played of 22.
| SELECT "Drawn" FROM table_70821 WHERE "Played" = '22' AND "Club" = 'ystrad rhondda rfc' | 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 SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1726621' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-08-09' AND '2019-06-18' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '... | css |
CREATE TABLE table_203_482 (
id number,
"year" number,
"award" text,
"result" text,
"category" text,
"series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many nominations were received in all ?
| SELECT COUNT("award") FROM table_203_482 | squall |
CREATE TABLE table_24334261_1 (
folded INTEGER,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum folded value of the team whose stadium is Fraser Field?
| SELECT MAX(folded) FROM table_24334261_1 WHERE stadium = "Fraser Field" | sql_create_context |
CREATE TABLE table_32764 (
"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.
-- Who is the home team that scores 12.10 (82)?
| SELECT "Home team" FROM table_32764 WHERE "Home team score" = '12.10 (82)' | wikisql |
CREATE TABLE table_26982362_2 (
directed_by VARCHAR,
original_airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The episode with the original airdate October 8, 2010, is directed by who?
| SELECT directed_by FROM table_26982362_2 WHERE original_airdate = "October 8, 2010" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
Exp... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", DisplayName, WebsiteUrl, Location, Age, Reputation, Id FROM Users WHERE LOWER(Location) LIKE LOWER('%##FullCountryName##%') ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
-- Using valid SQLite, answer the following questions fo... | SELECT Snatch, Clean_Jerk FROM body_builder | nvbench |
CREATE TABLE table_63999 (
"Hampden FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Against has Wins of 11, and Losses smaller than 7?
| SELECT AVG("Against") FROM table_63999 WHERE "Wins" = '11' AND "Losses" < '7' | wikisql |
CREATE TABLE table_4850 (
"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.
-- Which away team had a score of 11.7 (73)?
| SELECT "Away team" FROM table_4850 WHERE "Away team score" = '11.7 (73)' | wikisql |
CREATE TABLE table_17289604_38 (
round_of_32 VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the results for round of 32 for Nicole Vaidi ov ?
| SELECT round_of_32 FROM table_17289604_38 WHERE athlete = "Nicole Vaidišová" | sql_create_context |
CREATE TABLE table_21378339_5 (
score VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for rebeka dremelj
| SELECT score FROM table_21378339_5 WHERE artist = "Rebeka Dremelj" | sql_create_context |
CREATE TABLE table_train_192 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"diabetic" string,
"fasting_plasma_glucose" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- diagnosis of type ii diabetes
| SELECT * FROM table_train_192 WHERE diabetic = 'ii' | criteria2sql |
CREATE TABLE table_name_13 (
length VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Length has a Year of 2000?
| SELECT length FROM table_name_13 WHERE year = 2000 | sql_create_context |
CREATE TABLE table_203_673 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games had... | SELECT COUNT(*) FROM table_203_673 WHERE "attendance" >= 40000 | squall |
CREATE TABLE table_name_80 (
score VARCHAR,
opponent VARCHAR,
game VARCHAR,
march VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which score's game was less than 69 when the march was bigger than 2 and the opponents were the New York Islanders?
| SELECT score FROM table_name_80 WHERE game < 69 AND march > 2 AND opponent = "new york islanders" | sql_create_context |
CREATE TABLE table_30448 (
"Player" text,
"Cap(s)" real,
"Goal(s)" real,
"International Debut" text,
"Club(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many items are listed under caps when burnley is the club team?
| SELECT COUNT("Cap(s)") FROM table_30448 WHERE "Club(s)" = 'Burnley' | wikisql |
CREATE TABLE table_60733 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Country is 'United States', when Place is 'T10', and when Score is '68-71=139'?
| SELECT "Player" FROM table_60733 WHERE "Country" = 'united states' AND "Place" = 't10' AND "Score" = '68-71=139' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Du... | SELECT Id, Location, Reputation FROM Users | sede |
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 t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY lab.labname) AS t1 WHER... | eicu |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_33 (
event VARCHAR,
days_held VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event has 8 as the days held?
| SELECT event FROM table_name_33 WHERE days_held = "8" | sql_create_context |
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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5034604' AND qtb.IN_HOSP_DATE BETWEEN '2005-02-20' AND '2005-06-27' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5034604' AND gyb.IN_HOSP_DATE BETWEEN '2005-02-20' AND '2005-06-27' UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '5034604' AND ... | css |
CREATE TABLE table_name_99 (
score VARCHAR,
money___$__ VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has money ($) greater than 400, with gene sarazen as the player?
| SELECT score FROM table_name_99 WHERE money___$__ > 400 AND player = "gene sarazen" | sql_create_context |
CREATE TABLE table_203_37 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long is the longest dong on prophets vs. profits ?
| SELECT "title" FROM table_203_37 ORDER BY "length" DESC LIMIT 1 | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalpe... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13531')) AND vitalperiodic.respiration > 24.0 A... | eicu |
CREATE TABLE table_name_14 (
d_42_√ VARCHAR,
d_46_√ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the D 42 when D 46 is majority ?
| SELECT d_42_√ FROM table_name_14 WHERE d_46_√ = "majority→" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTask... | SELECT ph.UserId AS "user_link", COUNT(DISTINCT RevisionGUID) AS "count" FROM PostHistory AS ph JOIN Posts AS p ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId IN (4, 5, 6) AND (ph.CreationDate >= '##Date1?2018-01-01##') AND (ph.CreationDate <= '##Date2?2018-12-31##') AND (p.OwnerUserId != ph.UserId) GROUP BY ph.UserId ... | sede |
CREATE TABLE table_71564 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game with loss of Aker (3 8)?
| SELECT "Date" FROM table_71564 WHERE "Loss" = 'aker (3–8)' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT TagName, SUM(A.Score) AS AnswerScore, SUM(Q.Score) AS QuestionScore, CAST(CAST(SUM(A.Score) AS FLOAT) / CAST(SUM(Q.Score) AS FLOAT) AS FLOAT(10, 2)) AS AQRatio FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts AS A ON A.ParentId = PostTags.PostId INNER JOIN Posts AS Q ON Q.Id = A.ParentI... | sede |
CREATE TABLE table_name_27 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue when Geelong is the away team?
| SELECT venue FROM table_name_27 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_25594271_1 (
state_country VARCHAR,
race_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the state/nation where the race number is 36
| SELECT state_country FROM table_25594271_1 WHERE race_number = "36" | sql_create_context |
CREATE TABLE table_15887683_8 (
language VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the language for fox business network
| SELECT language FROM table_15887683_8 WHERE television_service = "Fox Business Network" | sql_create_context |
CREATE TABLE table_4708 (
"Tournament" text,
"1943" text,
"1944" text,
"1945" text,
"1948" text,
"1949" text,
"1951" text,
"1954" text,
"1956\u20131968" text,
"1969" text,
"Career SR" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "1951" FROM table_4708 WHERE "Tournament" = 'sr' | wikisql |
CREATE TABLE users (
role_description VARCHAR,
role_code VARCHAR,
user_login VARCHAR
)
CREATE TABLE ROLES (
role_description VARCHAR,
role_code VARCHAR,
user_login VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the description of the mo... | SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1) | sql_create_context |
CREATE TABLE table_name_93 (
team_number VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many team numbers have john keane as the player?
| SELECT COUNT(team_number) FROM table_name_93 WHERE player = "john keane" | sql_create_context |
CREATE TABLE table_34049 (
"Callsign" text,
"Area served" text,
"Frequency" text,
"Band" text,
"On-air ID" text,
"Purpose" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Band has a Frequency of 0 99.7 in the Area of Newcastle?
| SELECT "Band" FROM table_34049 WHERE "Frequency" = '0 99.7' AND "Area served" = 'newcastle' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | SELECT u.Id, u.DisplayName, u.Location, u.Reputation, DATE(p.CreationDate) AS PostDate, COUNT(p.Id) AS Posts FROM Posts AS p, Users AS u WHERE p.OwnerUserId = u.Id AND p.PostTypeId = 2 GROUP BY DATE(p.CreationDate), u.Id, u.DisplayName, u.Location, u.Reputation HAVING COUNT(p.Id) > 20 ORDER BY COUNT(p.Id) DESC, u.Id LI... | sede |
CREATE TABLE table_4172 (
"Series #" real,
"Production Code" real,
"Title" text,
"Directed by" text,
"Written by" text,
"United States Original Airdate" text,
"Canada Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "United States Original Airdate" FROM table_4172 WHERE "Written by" = 'Mike Ferris' | wikisql |
CREATE TABLE table_70786 (
"Lithium" text,
"Sodium" text,
"Potassium" text,
"Rubidium" text,
"Caesium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the properties of lithium when caesium is ki (1.7)?
| SELECT "Lithium" FROM table_70786 WHERE "Caesium" = 'ki (1.7)' | wikisql |
CREATE TABLE table_name_30 (
continent VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Continent that also has the United States listed as a country?
| SELECT continent FROM table_name_30 WHERE country = "united states" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "7" | mimicsql_data |
CREATE TABLE table_39570 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins does the player ranked lower than 3 with earnings of $3,315,502 have?
| SELECT SUM("Wins") FROM table_39570 WHERE "Rank" > '3' AND "Earnings ( $ )" > '3,315,502' | wikisql |
CREATE TABLE table_60288 (
"Year to April" real,
"Revenue (US $million)" real,
"EBIT (US $m)" real,
"Net profit (US $m)" real,
"Earnings per share (\u00a2)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- COunt the EBIT (US $m) which has a Revenue (U... | SELECT COUNT("EBIT (US $m)") FROM table_60288 WHERE "Revenue (US $million)" > '434.8' AND "Net profit (US $m)" > '96.4' | wikisql |
CREATE TABLE table_56679 (
"Rank" real,
"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 amount of silver when gold is 2 and the rank is more than 1?
| SELECT AVG("Silver") FROM table_56679 WHERE "Gold" = '2' AND "Rank" > '1' | wikisql |
CREATE TABLE table_20299 (
"#" real,
"Advocate # 1" text,
"Advocate # 2" text,
"Root of All Evil" text,
"Poll winner" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the # for youtube
| SELECT "#" FROM table_20299 WHERE "Poll winner" = 'YouTube' | 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 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2179.0" AND procedures.icd9_code = "3972" | mimicsql_data |
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 MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.ethnicity = "WHITE" | mimicsql_data |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varc... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_... | atis |
CREATE TABLE table_31096 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Young Rider Classification" text,
"Team Classification" text,
"Aggressive Rider" text
)
-- Using valid SQLite, answer the following que... | SELECT "Team Classification" FROM table_31096 WHERE "Aggressive Rider" = 'Richie Porte' | wikisql |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY COUNT(Type) | nvbench |
CREATE TABLE table_69716 (
"Player" text,
"Games" text,
"Tries" text,
"Goals" text,
"F. Goals" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player with tries of 02 2 and points of 008 8
| SELECT "Player" FROM table_69716 WHERE "Tries" = '02 2' AND "Points" = '008 8' | 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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '78487358' AND t_kc21.MED_SER_ORG_NO = '4050783' AND t_kc21.OUT_DIAG_DOC_NM LIKE '韦%' | css |
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 jybgb WHERE jybgb.JZLSH = '00107790166' | css |
CREATE TABLE table_32994 (
"Episode Number" real,
"Title" text,
"Podcast Date" text,
"Run time" text,
"Historical References" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the podcast on November 21, 2004?
| SELECT "Title" FROM table_32994 WHERE "Podcast Date" = 'november 21, 2004' | wikisql |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '慢性支气管炎' AND jyjgzbb.JCZBDM = '4... | css |
CREATE TABLE table_200_33 (
id number,
"district" text,
"area size\n(km2)" text,
"population" text,
"density\nper km2" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the combined area size of the yamato flat inland plain and the yamato hig... | SELECT SUM("area size\n(km2)") FROM table_200_33 WHERE "district" IN ('yamato flat inland plain', 'yamato highland') | squall |
CREATE TABLE table_12988 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is moving from Treviso with a loan return?
| SELECT "Name" FROM table_12988 WHERE "Moving from" = 'treviso' AND "Type" = 'loan return' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.