instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_20726262_4 (
no_in_series INTEGER,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what i the maximum number in the series where the production code is 3wab07?
| SELECT MAX(no_in_series) FROM table_20726262_4 WHERE production_code = "3WAB07" | sql_create_context |
CREATE TABLE table_11700 (
"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 place had a home team score 22.19 (151)?
| SELECT "Venue" FROM table_11700 WHERE "Home team score" = '22.19 (151)' | wikisql |
CREATE TABLE table_49423 (
"Club" text,
"City" text,
"Stadium" text,
"Capacity" real,
"2007\u201308 season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the 2007-08 season for the city of Ferrara?
| SELECT "2007\u201308 season" FROM table_49423 WHERE "City" = 'ferrara' | 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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2174.0" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_61079 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score in Tie 2?
| SELECT "Score" FROM table_61079 WHERE "Tie no" = '2' | wikisql |
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 jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '48451516947' | css |
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, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
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 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.short_title = "Hx-rectal & anal malign" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_204_297 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many countries earned at lest one bronze medal ?
| SELECT COUNT("nation") FROM table_204_297 WHERE "bronze" >= 1 | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_i... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 WHERE d_icd_procedures.short_title = 'resp tract intubat ne... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid ... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 400 AND 400 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of... | advising |
CREATE TABLE table_80007 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which years have a Name of ladbrooks school?
| SELECT "Years" FROM table_80007 WHERE "Name" = 'ladbrooks school' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dup... | SELECT ROW_NUMBER() OVER (ORDER BY Views DESC) AS "#", Id AS "user_link", Views, Reputation, LastAccessDate, AboutMe FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd%' OR LOWER(Location) LIKE '%dhaka%' ORDER BY Views DESC LIMIT 100 | sede |
CREATE TABLE table_15817998_5 (
position VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the positions in the college of Alberta?
| SELECT position FROM table_15817998_5 WHERE college = "Alberta" | sql_create_context |
CREATE TABLE table_11218 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had a final stage when Claudio Chiappucci had the point... | SELECT "Trofeo Fast Team" FROM table_11218 WHERE "Points classification" = 'claudio chiappucci' AND "Stage" = 'final' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_1669 (
"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 is... | SELECT "Score" FROM table_1669 WHERE "Date" = 'January 18' | wikisql |
CREATE TABLE table_name_1 (
televote_points VARCHAR,
televotes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who received 6,131 televotes?
| SELECT televote_points FROM table_name_1 WHERE televotes = "6,131" | sql_create_context |
CREATE TABLE table_52237 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" text,
"Issue Price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year did the Royal Canadian Mint Staff create a silver dollar?
| SELECT "Year" FROM table_52237 WHERE "Artist" = 'royal canadian mint staff' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO... | mimic_iii |
CREATE TABLE table_name_86 (
final_score VARCHAR,
visiting_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score when the New York Jets were the Visiting Team?
| SELECT final_score FROM table_name_86 WHERE visiting_team = "new york jets" | sql_create_context |
CREATE TABLE table_name_25 (
branding VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Branding for the station located in Zamboanga?
| SELECT branding FROM table_name_25 WHERE location = "zamboanga" | sql_create_context |
CREATE TABLE table_name_26 (
placing VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place did russia finish in?
| SELECT COUNT(placing) FROM table_name_26 WHERE team = "russia" | sql_create_context |
CREATE TABLE table_65284 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Silver has a Total larger than 9, and a Gold of 14?
| SELECT COUNT("Silver") FROM table_65284 WHERE "Total" > '9' AND "Gold" = '14' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '022-3713' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_83 (
number_of_electorates__2009_ VARCHAR,
constituency_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of electorates in 2009 with a constituency of 193?
| SELECT COUNT(number_of_electorates__2009_) FROM table_name_83 WHERE constituency_number = "193" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "HESP500I" | mimicsql_data |
CREATE TABLE table_204_521 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time (hand)" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many athletes finished the race in less than 5:00:00 ?
| SELECT COUNT("name") FROM table_204_521 WHERE "time (hand)" < 5 | squall |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperfield (
fieldid... | SELECT DISTINCT paperid FROM paper WHERE title = 'impact of cellphone towers on birds' | scholar |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_name_67 (
loss VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game did they lose by 6 - 5?
| SELECT loss FROM table_name_67 WHERE score = "6 - 5" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname ... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HONORS' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_40492 (
"Rank" real,
"City" text,
"Airport" text,
"Passengers" real,
"Carriers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the airport with primary carrier of US Airways with a 2 ranking and more than 51,000 passenger... | SELECT "Airport" FROM table_40492 WHERE "Passengers" > '51,000' AND "Carriers" = 'us airways' AND "Rank" = '2' | 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 AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "3" | mimicsql_data |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Compl kidney transplant" AND prescriptions.route = "REPLACE" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id... | SELECT Posts.Id AS "post_link", Votes.BountyAmount, Votes.CreationDate AS BountyStart FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Votes.VoteTypeId = 8 AND Tags.TagName = '##tag##' AND Posts.AnswerCount = 0 AND... | sede |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
ro... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22973 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) | mimic_iii |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE technician (
technician_id real,
Nam... | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name | nvbench |
CREATE TABLE table_name_40 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest crowd size for away team Fitzroy?
| SELECT MIN(crowd) FROM table_name_40 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_name_90 (
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 3rd Edition for Episode 4?
| SELECT 3 AS rd_edition FROM table_name_90 WHERE episode = "4" | sql_create_context |
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 prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Ferrous Sulfate" | mimicsql_data |
CREATE TABLE table_19045 (
"Grand Cru" text,
"Region" text,
"Village" text,
"Wine style" text,
"Vineyard surface (2010)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the village with wine style being red wine and vineyard surface (2010) bei... | SELECT "Village" FROM table_19045 WHERE "Wine style" = 'Red wine' AND "Vineyard surface (2010)" = 'hectares (acres)' | wikisql |
CREATE TABLE table_10054296_1 (
headquarters VARCHAR,
member VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the headquarters of Alpha Nu Omega
| SELECT headquarters FROM table_10054296_1 WHERE member = "Alpha Nu Omega" | sql_create_context |
CREATE TABLE table_name_8 (
year INTEGER,
work VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year is the highest one that has a Work of the clone, and an Award of contigo award?
| SELECT MAX(year) FROM table_name_8 WHERE work = "the clone" AND award = "contigo award" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "JEWISH" | mimicsql_data |
CREATE TABLE table_21197135_1 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many opponents were there when the record was 6-0?
| SELECT date FROM table_21197135_1 WHERE record = "6-0" | sql_create_context |
CREATE TABLE table_8672 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team that had attendance under 2614 and a home team of Victoria?
| SELECT "Away" FROM table_8672 WHERE "Attendance" < '2614' AND "Home" = 'victoria' | wikisql |
CREATE TABLE table_29285076_2 (
location VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At what location was the March 17 race held?
| SELECT location FROM table_29285076_2 WHERE date = "March 17" | 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 COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '2768334' GROUP BY MED_ORG_DEPT_CD HAVING MAX(IN_HOSP_DAYS) < 16) AS T | css |
CREATE TABLE table_name_59 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was St Kilda's score as the Away team?
| SELECT away_team AS score FROM table_name_59 WHERE away_team = "st kilda" | sql_create_context |
CREATE TABLE table_17355408_9 (
high_assists VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the high assists in game 80?
| SELECT high_assists FROM table_17355408_9 WHERE game = 80 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "13" AND procedures.icd9_code = "4105" | mimicsql_data |
CREATE TABLE table_30011 (
"Shirt Number" real,
"Player Name" text,
"Games Played" real,
"Total Points" real,
"2-Points" real,
"3-Points" real,
"Free Throw" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least games played for 6 poi... | SELECT MIN("Games Played") FROM table_30011 WHERE "Total Points" = '6' | wikisql |
CREATE TABLE table_25342713_5 (
blocks VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players 89 points?
| SELECT COUNT(blocks) FROM table_25342713_5 WHERE points = 89 | sql_create_context |
CREATE TABLE table_202_45 (
id number,
"rank" number,
"wrestler" text,
"no. of reigns" number,
"combined days" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which professional wrestler has had the most number of reigns as nwa world heavyweight ch... | SELECT "wrestler" FROM table_202_45 ORDER BY "no. of reigns" DESC LIMIT 1 | squall |
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2166" | mimicsql_data |
CREATE TABLE table_train_150 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"hiv_infection" bool,
"hepatic_disease" bool,
"liver_disease" bool,
"abnormality" bool,
"triglyceride_tg" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT * FROM table_train_150 WHERE gender = 'female' AND pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_name_27 (
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the competition on 23 February 1929?
| SELECT competition FROM table_name_27 WHERE date = "23 february 1929" | sql_create_context |
CREATE TABLE table_867 (
"Draft Year" real,
"Player" text,
"Position" text,
"Round" real,
"Overall" real,
"NFL Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What numer pick in the draft for jerry hill?
| SELECT COUNT("Overall") FROM table_867 WHERE "Player" = 'Jerry Hill' | wikisql |
CREATE TABLE table_name_25 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue when melbourne is the away team?
| SELECT venue FROM table_name_25 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE table_15201666_3 (
derby_county INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most derby county
| SELECT MAX(derby_county) FROM table_15201666_3 | sql_create_context |
CREATE TABLE table_15816 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date had a Score of 5-2 and a Loss of Greinke (1-2)?
| SELECT "Date" FROM table_15816 WHERE "Score" = '5-2' AND "Loss" = 'greinke (1-2)' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "24" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract" | mimicsql_data |
CREATE TABLE table_57943 (
"Generation" text,
"Years" text,
"Engine" text,
"Power" text,
"Torque" text,
"Induction" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power of an engine of 1972?
| SELECT "Power" FROM table_57943 WHERE "Years" = '1972' | wikisql |
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
-- Using valid SQLite, answer the foll... | SELECT DISTINCT T1.fate FROM mission AS T1 JOIN ship AS T2 ON T1.ship_id = T2.ship_id WHERE T2.nationality = "United States" | spider |
CREATE TABLE table_30062172_3 (
gt3_winner VARCHAR,
pole_position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When tim bridgman gregor fisken is the pole position who is the gt3 winner?
| SELECT gt3_winner FROM table_30062172_3 WHERE pole_position = "Tim Bridgman Gregor Fisken" | sql_create_context |
CREATE TABLE table_26769_1 (
population__july_2009_est_ VARCHAR,
population_density_per_km² VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the population of a country with a population density of 14.3/km (/sqmi)?
| SELECT population__july_2009_est_ FROM table_26769_1 WHERE population_density_per_km² = "14.3/km² (/sqmi)" | sql_create_context |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phon... | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE written_by (
id int,
msid int,
wid int
)
CREATE TABLE tv_series (
sid int,
title text,
release_year int,
num_of_seasons int,
num_of_episodes in... | SELECT movie.title FROM actor, cast, movie WHERE actor.nationality = 'China' AND cast.aid = actor.aid AND movie.mid = cast.msid GROUP BY movie.title ORDER BY COUNT(DISTINCT (actor.name)) DESC LIMIT 1 | imdb |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-3289') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50971" | mimicsql_data |
CREATE TABLE table_7243 (
"Conference" text,
"# of Bids" real,
"Record" text,
"Win %" text,
"Round of 32" text,
"Sweet Sixteen" text,
"Elite Eight" text,
"Final Four" text,
"Championship Game" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Round of 32" FROM table_7243 WHERE "# of Bids" < '2' | wikisql |
CREATE TABLE table_10953197_6 (
no_in_season INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- give the least number of times an episode was shown from 1997-1998
| SELECT MIN(no_in_season) FROM table_10953197_6 | sql_create_context |
CREATE TABLE table_35146 (
"Tournament" text,
"1998" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Career SR" text,
"Caree... | SELECT "2012" FROM table_35146 WHERE "2007" = '0 / 4' | wikisql |
CREATE TABLE table_32115 (
"Name" text,
"Martyred" real,
"Place" text,
"Beatified" real,
"Canonised" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was John Hoan Trinh Doan / St. John Hoan, who was beatified in 1909 and canonised after 1988, ma... | SELECT MAX("Martyred") FROM table_32115 WHERE "Beatified" = '1909' AND "Name" = 'john hoan trinh doan / st. john hoan' AND "Canonised" > '1988' | wikisql |
CREATE TABLE table_15945862_1 (
july VARCHAR,
march VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- March 0.41 in July?
| SELECT july FROM table_15945862_1 WHERE march = "0.41" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
pat... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-29258')) AND intakeoutput.cellpath LIKE '%ou... | eicu |
CREATE TABLE table_name_5 (
score VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Location of brendan byrne arena had what score?
| SELECT score FROM table_name_5 WHERE location = "brendan byrne arena" | sql_create_context |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Ad... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC | nvbench |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id WHERE jybgb.JZLSH = '59894458645' AND jyjgzbb.JCRXM LIKE... | css |
CREATE TABLE table_name_44 (
director_s_ VARCHAR,
writer_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director that worked with Dana Dorian as the writer?
| SELECT director_s_ FROM table_name_44 WHERE writer_s_ = "dana dorian" | sql_create_context |
CREATE TABLE table_name_89 (
csa_cma_2009_population INTEGER,
state__province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the CSA/CMA Population in IA-IL?
| SELECT MAX(csa_cma_2009_population) FROM table_name_89 WHERE state__province = "ia-il" | sql_create_context |
CREATE TABLE table_27225944_3 (
replaced_by VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the replaced by for slaven belupo
| SELECT replaced_by FROM table_27225944_3 WHERE team = "Slaven Belupo" | sql_create_context |
CREATE TABLE table_name_35 (
capacity INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the capacity for the team ibenik?
| SELECT MIN(capacity) FROM table_name_35 WHERE team = "šibenik" | sql_create_context |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
X... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.icd9_code = "4311" | mimicsql_data |
CREATE TABLE table_204_190 (
id number,
"rank" number,
"city" text,
"county" text,
"state" text,
"percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which county has the most representation ?
| SELECT "county" FROM table_204_190 GROUP BY "county" ORDER BY SUM("percentage") DESC LIMIT 1 | squall |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT WORTH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name... | atis |
CREATE TABLE table_name_29 (
points_for VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the points when the lost was 11?
| SELECT points_for FROM table_name_29 WHERE lost = "11" | sql_create_context |
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE addresses (
address_id number,
address_content text,
city text,
zip_postcode text,
state_province_county text,
country text,
other_address_details text
)
CREATE TABLE products (
... | SELECT COUNT(*) FROM customer_orders WHERE order_details = "Second time" | spider |
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE cite (
cited in... | SELECT title FROM publication WHERE year > 2000 | academic |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 16) | 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.long_title = "29-30 completed weeks of gestation" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_29296103_10 (
runner_up VARCHAR,
tournament VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runner ups were there for the cologne , germany carpet $75,000 s32/d16 when the champion was matt doyle 1 6, 6 1, 6 2... | SELECT COUNT(runner_up) FROM table_29296103_10 WHERE tournament = "Cologne , Germany Carpet – $75,000 – S32/D16" AND champion = "Matt Doyle 1–6, 6–1, 6–2" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other preterm infants, 1,250-1,499 grams" | mimicsql_data |
CREATE TABLE table_33148 (
"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 was the game held when the away team score... | SELECT "Venue" FROM table_33148 WHERE "Away team score" = '10.12 (72)' | wikisql |
CREATE TABLE table_29658 (
"Outcome" text,
"Year" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were Petrova's opponents with Vania King?
| SELECT "Opponents" FROM table_29658 WHERE "Partner" = 'Vania King' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
s... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase (ck)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443 AN... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.