instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_16 (
avg INTEGER,
yards VARCHAR,
rec VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the lowest avg for 6 yards and rec more than 1
| SELECT MIN(avg) FROM table_name_16 WHERE yards = 6 AND rec > 1 | sql_create_context |
CREATE TABLE table_19945 (
"#" real,
"Season" real,
"Bowl game" text,
"Result" text,
"Opponent" text,
"Stadium" text,
"Location" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the stadium where the attendance w... | SELECT "Stadium" FROM table_19945 WHERE "Attendance" = '75,406' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
ro... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'swelling of limb')... | mimic_iii |
CREATE TABLE table_24544 (
"Year" real,
"Horse" text,
"Driver" text,
"Trainer" text,
"Country of owner" text,
"Odds of winner" text,
"Winning time (km rate)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning time in the yea... | SELECT "Winning time (km rate)" FROM table_24544 WHERE "Odds of winner" = '2.94' | wikisql |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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,
BGR... | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '25408740' AND mzjzjlb.JZKSRQ BETWEEN '2011-01-20' AND '2019-07-19' | css |
CREATE TABLE table_name_17 (
identifier VARCHAR,
power VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the identifier when the power is 22500 watts?
| SELECT identifier FROM table_name_17 WHERE power = "22500 watts" | sql_create_context |
CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the first player picked in round four ?
| SELECT "player" FROM table_203_676 ORDER BY "pick #" LIMIT 1 | squall |
CREATE TABLE table_30771 (
"Episode air date" text,
"Audition city" text,
"Date" text,
"Venue" text,
"Callback date" text,
"Callback venue" text,
"Golden tickets" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is there a golde... | SELECT COUNT("Golden tickets") FROM table_30771 WHERE "Callback venue" = 'RCTI Studio, Jakarta' | wikisql |
CREATE TABLE table_22384475_1 (
match_date VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the West Indies win the match?
| SELECT match_date FROM table_22384475_1 WHERE winner = "West Indies" | sql_create_context |
CREATE TABLE table_name_95 (
playing_for VARCHAR,
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is playing for when the opponent is deportes savio and the date is 2010-03-11?
| SELECT playing_for FROM table_name_95 WHERE opponent = "deportes savio" AND date = "2010-03-11" | sql_create_context |
CREATE TABLE table_name_4 (
season VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what season had a score of 1:0
| SELECT season FROM table_name_4 WHERE score = "1:0" | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | 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 ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE table_204_652 (
id number,
"title" text,
"year" number,
"director" text,
"country" text,
"genre" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many directors are in the england films ?
| SELECT COUNT("director") FROM table_204_652 WHERE "country" = 'england' | squall |
CREATE TABLE table_215 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the report for the race that Mike Spence won.
| SELECT "Report" FROM table_215 WHERE "Winning driver" = 'Mike Spence' | wikisql |
CREATE TABLE table_6360 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest game that has a drawn less than 0?
| SELECT MIN("Games") FROM table_6360 WHERE "Drawn" < '0' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Open sigmoidectomy NEC" | mimicsql_data |
CREATE TABLE table_name_80 (
appearance VARCHAR,
polyphenyl_ether VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What does Polyphenyl Ether of 3- and 4-ring oxythio look like?
| SELECT appearance FROM table_name_80 WHERE polyphenyl_ether = "3- and 4-ring oxythio" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p surgical repair of fracture - femur' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year')) | eicu |
CREATE TABLE table_2954 (
"Competition" text,
"Final position" text,
"First match" text,
"Last match" text,
"Final Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the final place for july 25, 2009
| SELECT "Final Place" FROM table_2954 WHERE "Last match" = 'July 25, 2009' | wikisql |
CREATE TABLE table_51418 (
"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 venue has the away side scoring 6.5 (41)?
| SELECT "Venue" FROM table_51418 WHERE "Away team score" = '6.5 (41)' | wikisql |
CREATE TABLE table_name_45 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What home team has coventry city as the away team?
| SELECT home_team FROM table_name_45 WHERE away_team = "coventry city" | sql_create_context |
CREATE TABLE table_name_78 (
score VARCHAR,
set_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when set 3 was 26-28?
| SELECT score FROM table_name_78 WHERE set_3 = "26-28" | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_c... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS... | atis |
CREATE TABLE table_name_45 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is team 1 when team 2 is Manchester United?
| SELECT team_1 FROM table_name_45 WHERE team_2 = "manchester united" | sql_create_context |
CREATE TABLE table_11365528_2 (
website VARCHAR,
head_coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The head coach, steve radoslavic, is related to which websites?
| SELECT website FROM table_11365528_2 WHERE head_coach = "Steve Radoslavic" | sql_create_context |
CREATE TABLE table_51994 (
"Region" text,
"Voter registration" real,
"Voter turnout" real,
"BYuT" real,
"OU-PSD" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lower turnout that has a byut of 50.7 and an ou psd smaller than 36.8?
| SELECT MIN("Voter turnout") FROM table_51994 WHERE "BYuT" = '50.7' AND "OU-PSD" < '36.8' | wikisql |
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 demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Mary Davis" | mimicsql_data |
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_diagnoses (
row_id number,
icd9_code text,
sh... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND prescriptions.route = 'iv' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_name_31 (
college VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which college had an overall pick of 9?
| SELECT college FROM table_name_31 WHERE overall = 9 | sql_create_context |
CREATE TABLE table_75739 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What lead has the third David Nedohin?
| SELECT "Lead" FROM table_75739 WHERE "Third" = 'david nedohin' | wikisql |
CREATE TABLE table_train_57 (
"id" int,
"bleeding" int,
"in_another_study" bool,
"hiv_infection" bool,
"hepatitis_c_infection" bool,
"receiving_vasopressor" bool,
"hypotension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT * FROM table_train_57 WHERE in_another_study = 1 | criteria2sql |
CREATE TABLE table_203_809 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which game did georgia score the l... | SELECT "date" FROM table_203_809 ORDER BY "result" DESC LIMIT 1 | squall |
CREATE TABLE table_27808 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "Yacht type" FROM table_27808 WHERE "Skipper" = 'Bob Oatley' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "9271" | mimicsql_data |
CREATE TABLE table_63135 (
"Match" real,
"Date" text,
"Competition or tour" text,
"Ground" text,
"Opponent" text,
"Score1" text,
"Scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the scorers on 1 August 2008, where the ground ... | SELECT "Scorers" FROM table_63135 WHERE "Ground" = 'a' AND "Date" = '1 august 2008' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'nasopharynx' AND DATETIME(microlab.cultur... | eicu |
CREATE TABLE table_77722 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the decision of the Kings game when Chicago was the visit... | SELECT "Decision" FROM table_77722 WHERE "Visitor" = 'chicago' | wikisql |
CREATE TABLE table_1745843_6 (
part_3 VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the part 3 of the verb in class 5?
| SELECT part_3 FROM table_1745843_6 WHERE class = "5" | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND diagnoses.long_title = "Abdominal pain, other specified site" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '59906964486' | css |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT meter_600, meter_100 FROM swimmer | nvbench |
CREATE TABLE table_15252 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year averaged less than 9 points?
| SELECT AVG("Year") FROM table_15252 WHERE "Points" < '9' | wikisql |
CREATE TABLE table_name_60 (
lane INTEGER,
heat VARCHAR,
mark VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most lanes used in races with more than 1 heat and a winning mark of 7.25?
| SELECT MAX(lane) FROM table_name_60 WHERE heat > 1 AND mark = "7.25" | sql_create_context |
CREATE TABLE table_18600760_10 (
land___sqmi__ VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How big is the land in square miles of Grand Forks county?
| SELECT land___sqmi__ FROM table_18600760_10 WHERE county = "Grand Forks" | sql_create_context |
CREATE TABLE table_7411 (
"Tournament" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "2006" FROM table_7411 WHERE "1995" = 'a' AND "1997" = 'a' AND "2003" = '3r' | wikisql |
CREATE TABLE Detention (
datetime_detention_start VARCHAR,
teacher_id VARCHAR
)
CREATE TABLE Teachers (
teacher_id VARCHAR,
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the start and end dates of detentions of teachers with last nam... | SELECT T1.datetime_detention_start, datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schultz" | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Troponin I" | mimicsql_data |
CREATE TABLE table_name_64 (
date VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date was Judy Rankin Runner(s)-up?
| SELECT date FROM table_name_64 WHERE runner_s__up = "judy rankin" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814 AND admissions.dischtime IS NULL)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_item... | mimic_iii |
CREATE TABLE table_203_607 (
id number,
"catalogue number" text,
"artist" text,
"release title" text,
"format" text,
"release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of titles coil released on 7 ' vinyl ?
| SELECT COUNT("release title") FROM table_203_607 WHERE "format" = '7" vinyl' | squall |
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 real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Name, Height FROM people ORDER BY Height | nvbench |
CREATE TABLE table_name_6 (
laps INTEGER,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most laps for Ayrton Senna?
| SELECT MAX(laps) FROM table_name_6 WHERE driver = "ayrton senna" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.marital_status FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number IN... | SELECT account_id, account_name FROM Accounts GROUP BY other_account_details | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.short_title = "Other phototherapy" | mimicsql_data |
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numci... | SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'Graham Neubig' AND venue.venueid = paper.venueid AND venue.venuename = 'TACL' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_31441 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the episode wr... | SELECT "Title" FROM table_31441 WHERE "Written by" = 'Glen Mazzara' | wikisql |
CREATE TABLE table_16854 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of school/club teams held by BYU?
| SELECT MIN("No.") FROM table_16854 WHERE "School/Club Team" = 'BYU' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT (UpVotes + DownVotes) AS "Total Votes" FROM Users WHERE Id = 1340599 | sede |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '60434357319' AND t_kc22.SOC_SRT_DIRE_CD = '684444' | 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 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.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "50967" | 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 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 = "Globulin" | mimicsql_data |
CREATE TABLE table_204_164 (
id number,
"branding" text,
"callsign" text,
"frequency" text,
"power (kw)" text,
"location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many stations broadcast with a power of 5kw ?
| SELECT COUNT("branding") FROM table_204_164 WHERE "power (kw)" = 5 | squall |
CREATE TABLE invoice_line_items (
order_item_id number,
invoice_number number,
product_id number,
product_title text,
product_quantity text,
product_price number,
derived_product_cost number,
derived_vat_payable number,
derived_total_cost number
)
CREATE TABLE order_items (
orde... | SELECT DISTINCT T1.customer_first_name, T1.customer_last_name, T1.phone_number FROM customers AS T1 JOIN accounts AS T2 ON T1.customer_id = T2.customer_id | spider |
CREATE TABLE table_204_317 (
id number,
"metropolitan area" text,
"country" text,
"rank" number,
"forstall\n2003 est." number,
"official population" number,
"year" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many cities are in the u... | SELECT COUNT("metropolitan area") FROM table_204_317 WHERE "country" = 'united states' | squall |
CREATE TABLE table_68771 (
"Estimate" text,
"Name" text,
"Nat." text,
"Ship type" text,
"Where sunk" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date that a ship sank in the South Atlantic?
| SELECT "Date" FROM table_68771 WHERE "Where sunk" = 'south atlantic' | wikisql |
CREATE TABLE table_60527 (
"Year" real,
"Round" real,
"Pick" real,
"Player" text,
"NBA Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest pick for a year after 2010, and a round smaller than 1?
| SELECT MAX("Pick") FROM table_60527 WHERE "Year" > '2010' AND "Round" < '1' | wikisql |
CREATE TABLE table_name_31 (
round VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round did the event UFC 86 take place?
| SELECT round FROM table_name_31 WHERE event = "ufc 86" | sql_create_context |
CREATE TABLE table_203_697 (
id number,
"player" text,
"career" text,
"nickname" text,
"team inducted as" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who had the nickname robbie ?
| SELECT "player" FROM table_203_697 WHERE "nickname" = '"robbie"' | squall |
CREATE TABLE table_13947 (
"Athlete" text,
"Class" text,
"Horse" text,
"Event" text,
"Result" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What horse was shown by with Britta N pel and got less than 71.909?
| SELECT "Horse" FROM table_13947 WHERE "Athlete" = 'britta näpel' AND "Result" < '71.909' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_203_378 (
id number,
"against" text,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"win %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of losses they have against france ?
| SELECT "lost" FROM table_203_378 WHERE "against" = 'france' | squall |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Fiber-optic bronchoscopy" | mimicsql_data |
CREATE TABLE table_name_63 (
position VARCHAR,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position has less than 6 Points?
| SELECT COUNT(position) FROM table_name_63 WHERE points < 6 | sql_create_context |
CREATE TABLE all_documents (
document_id number,
date_stored time,
document_type_code text,
document_name text,
document_description text,
other_details text
)
CREATE TABLE document_locations (
document_id number,
location_code text,
date_in_location_from time,
date_in_locaton_t... | SELECT role_code, role_name, role_description FROM roles | spider |
CREATE TABLE table_78967 (
"Date" text,
"Ship Name" text,
"Tonnage" text,
"Ship Type" text,
"Location" text,
"Disposition of Ship" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was a brig type ship located in SW Approaches?
| SELECT "Date" FROM table_78967 WHERE "Ship Type" = 'brig' AND "Location" = 'sw approaches' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '42744321971' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES... | css |
CREATE TABLE table_23354 (
"School" text,
"City / Town" text,
"Website" text,
"Size" real,
"Principal" text,
"Grades" text,
"IDOE Profile" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the school/s with is size of 604.
| SELECT "School" FROM table_23354 WHERE "Size" = '604' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '陈梦凡' AND gwyjzb.MED_SER_ORG_NO = '5107523' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '陈梦凡' AND fgwyjzb.MED_... | css |
CREATE TABLE table_18998 (
"Position" real,
"Artist" text,
"Song title" text,
"Highest position" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the points with artbeingt being dave appell
| SELECT "Points" FROM table_18998 WHERE "Artist" = 'Dave Appell' | wikisql |
CREATE TABLE table_34461 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has tim duncan (27) as the leading scorer?
| SELECT "Score" FROM table_34461 WHERE "Leading scorer" = 'tim duncan (27)' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "40" | mimicsql_data |
CREATE TABLE table_name_32 (
fastest_lap VARCHAR,
pole_position VARCHAR,
winning_driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the fastest lap when David Coulthard had pole position and Michael Schumacher as a winning driver.
| SELECT fastest_lap FROM table_name_32 WHERE pole_position = "david coulthard" AND winning_driver = "michael schumacher" | sql_create_context |
CREATE TABLE table_name_19 (
regular_season VARCHAR,
division VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHICH Regular Season has a Division of 4?
| SELECT regular_season FROM table_name_19 WHERE division = 4 | sql_create_context |
CREATE TABLE table_name_8 (
region VARCHAR,
format VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which region had a release format of CD Maxi?
| SELECT region FROM table_name_8 WHERE format = "cd maxi" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT 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.icd9_code = "412" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_41269 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the rider with more than 5 laps on a grid bigger than 29 on a Honda CBR600RR and time at +1:27.385?
| SELECT "Rider" FROM table_41269 WHERE "Laps" > '5' AND "Grid" > '29' AND "Bike" = 'honda cbr600rr' AND "Time" = '+1:27.385' | wikisql |
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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | 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 YEAR(Posts.CreationDate) AS the_year, Posts.Id FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ('r') | sede |
CREATE TABLE table_6422 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What location did game 64 take place
| SELECT "Location" FROM table_6422 WHERE "Game" = '64' | wikisql |
CREATE TABLE table_70052 (
"County" text,
"Live births 2006" real,
"GFR 2006" real,
"TFR 2006" real,
"Whites as % of Pop." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of live births in 2006 with 98.40% of the population a... | SELECT SUM("Live births 2006") FROM table_70052 WHERE "Whites as % of Pop." = '98.40%' AND "TFR 2006" > '2' | wikisql |
CREATE TABLE table_name_23 (
format VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Format of the Label with Catalog SBP 234999?
| SELECT format FROM table_name_23 WHERE catalog = "sbp 234999" | sql_create_context |
CREATE TABLE table_name_82 (
scored INTEGER,
points VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest score of the team with 19 points and less than 18 played?
| SELECT MIN(scored) FROM table_name_82 WHERE points = 19 AND played < 18 | sql_create_context |
CREATE TABLE table_1615980_4 (
no VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tournament wins were at Volvo Masters Andalucia?
| SELECT COUNT(no) FROM table_1615980_4 WHERE tournament = "Volvo Masters Andalucia" | sql_create_context |
CREATE TABLE table_54950 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text,
"Year(s) withdrawn" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Class" FROM table_54950 WHERE "Wheel arrangement" = '4-6-0' AND "Quantity made" = '14' | wikisql |
CREATE TABLE table_34837 (
"Locomotive" text,
"Pre-conversion" text,
"Entered service (T)" text,
"Re-entered service (P)" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the T328 that entered service on 18 June 1956 re-ent... | SELECT "Re-entered service (P)" FROM table_34837 WHERE "Entered service (T)" = '18 june 1956' AND "Pre-conversion" = 't328' | wikisql |
CREATE TABLE table_18047346_4 (
airport_name VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the location is Chicago, Illinois, what is the airport name?
| SELECT airport_name FROM table_18047346_4 WHERE location = "Chicago, Illinois" | sql_create_context |
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperdataset (
paperid ... | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'Luke Zettlemoyer' AND keyphrase.keyphrasename = 'Learning Algorithm' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.p... | scholar |
CREATE TABLE table_8446 (
"Name" text,
"Country" text,
"Role" text,
"Period" text,
"Teams" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team with the name Boumediene Abderahmane?
| SELECT "Teams" FROM table_8446 WHERE "Name" = 'boumediene abderahmane' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-35599')) AND NOT vitalperiodic.sao2 IS NULL | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.