instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_7393 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match against roger federer on April 3, 2006?
| SELECT "Score" FROM table_7393 WHERE "Opponent" = 'roger federer' AND "Date" = 'april 3, 2006' | wikisql |
CREATE TABLE table_4044 (
"School" text,
"Gender" text,
"Age Range" text,
"Religious Affiliation" text,
"Location" text,
"School website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the cunningham hill infant school located?
| SELECT "Location" FROM table_4044 WHERE "School" = 'Cunningham Hill Infant School' | wikisql |
CREATE TABLE table_32386 (
"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 is the smallest crowd for a game when Melbo... | SELECT MIN("Crowd") FROM table_32386 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE table_203_824 (
id number,
"pick #" number,
"player" text,
"position" text,
"nationality" text,
"nhl team" text,
"college/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the next player picked after stev... | SELECT "player" FROM table_203_824 WHERE "pick #" = (SELECT "pick #" FROM table_203_824 WHERE "player" = 'steve orth') + 1 | squall |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 15 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_23 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the away team who played Footscray?
| SELECT away_team FROM table_name_23 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE resultsdata15 (
sample_pk number,
commod text,
commtype text,
lab text,
pestcode text,
testclass text,
concen number,
lod number,
conunit text,
confmethod text,
confmethod2 text,
annotate text,
quantitate text,
mean text,
extract text,
determi... | SELECT T1.variety FROM resultsdata15 AS T2 JOIN sampledata15 AS T1 ON T1.sample_pk = T2.sample_pk WHERE T2.commod = "AP" GROUP BY T1.variety ORDER BY SUM(T2.concen) DESC LIMIT 1 | pesticide |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
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 INTEGE... | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType | nvbench |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9383115' GROUP BY IN_DIAG_DIS_CD | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price DESC | nvbench |
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 gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6434630' GROUP BY gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6434630' GROUP BY fgwyjzb.IN_DIAG_DIS_CD | css |
CREATE TABLE table_name_22 (
defending_forces VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What defending forces have a population of 650?
| SELECT defending_forces FROM table_name_22 WHERE population = "650" | 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 demographic.age < "62" AND diagnoses.long_title = "Acute glomerulonephritis with other specified pathological lesion in kidney" | mimicsql_data |
CREATE TABLE table_name_88 (
score VARCHAR,
visiting_team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for Edmonton Drillers on January 6, 2008?
| SELECT score FROM table_name_88 WHERE visiting_team = "edmonton drillers" AND date = "january 6, 2008" | sql_create_context |
CREATE TABLE table_204_398 (
id number,
"title" text,
"year" number,
"publisher" text,
"developer" text,
"platforms" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which publisher worked on a title consecutively from 1982-1989 ?
| SELECT "publisher" FROM table_204_398 WHERE "year" = 1982 | squall |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0297464' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.admityear < "2162" | mimicsql_data |
CREATE TABLE table_name_84 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for Greg Norman
| SELECT score FROM table_name_84 WHERE player = "greg norman" | sql_create_context |
CREATE TABLE table_71266 (
"Year" real,
"Venue" text,
"Winner" text,
"Country" text,
"Score" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the sum of the scores before the year 2002, that had the venue of Halmstad?
| SELECT SUM("Score") FROM table_71266 WHERE "Venue" = 'halmstad' AND "Year" < '2002' | wikisql |
CREATE TABLE table_25531112_2 (
challenge VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who made the challenge in the Australian Grand Prix?
| SELECT challenge FROM table_25531112_2 WHERE event = "Australian Grand Prix" | sql_create_context |
CREATE TABLE table_name_50 (
tournament VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Tournament was laura Gildemeister the Opponent?
| SELECT tournament FROM table_name_50 WHERE opponent = "laura gildemeister" | sql_create_context |
CREATE TABLE table_train_127 (
"id" int,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"back_pain" bool,
"renal_disease" bool,
"osteoarthritis" bool,
"hamilton_depression_scale_hds" int,
"liver_disease" bool,
"painful_condition" bool,
"other_chronic_musculoskeletal... | SELECT * FROM table_train_127 WHERE mini_mental_state_examination_mmse <= 27 | criteria2sql |
CREATE TABLE DEPARTMENT (
Division VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of departments in Division 'AS'?
| SELECT COUNT(*) FROM DEPARTMENT WHERE Division = "AS" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code ... | 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 (((flight.departure_time <= 1200 AND flight.departure_time >= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND fl... | atis |
CREATE TABLE table_6335 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions fo... | SELECT "Points against" FROM table_6335 WHERE "Club" = 'porthcawl rfc' | wikisql |
CREATE TABLE table_37627 (
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Left" real,
"Nickname" text,
"Present Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of enrollment... | SELECT COUNT("Enrollment") FROM table_37627 WHERE "Nickname" = 'buccaneers' AND "Founded" < '1911' | 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 prescription... | 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.short_title = "Incision of aorta" | mimicsql_data |
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.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" | mimicsql_data |
CREATE TABLE table_14871 (
"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 the country of the player with a score of 69-74-71=214?
| SELECT "Country" FROM table_14871 WHERE "Score" = '69-74-71=214' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT chartevents.charttime 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 = 26057) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (... | mimic_iii |
CREATE TABLE table_79158 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lost h... | SELECT AVG("Lost") FROM table_79158 WHERE "Position" > '5' AND "Points 1" = '37' AND "Goals Against" < '63' | wikisql |
CREATE TABLE table_49945 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue when the score was 1 1, and the result was 2 2?
| SELECT "Venue" FROM table_49945 WHERE "Score" = '1 – 1' AND "Result" = '2 – 2' | wikisql |
CREATE TABLE table_name_40 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team plays at Punt Road Oval?
| SELECT home_team FROM table_name_40 WHERE venue = "punt road oval" | sql_create_context |
CREATE TABLE table_train_127 (
"id" int,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"back_pain" bool,
"renal_disease" bool,
"osteoarthritis" bool,
"hamilton_depression_scale_hds" int,
"liver_disease" bool,
"painful_condition" bool,
"other_chronic_musculoskeletal... | SELECT * FROM table_train_127 WHERE liver_disease = 1 OR renal_disease = 1 | criteria2sql |
CREATE TABLE table_57740 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on March 4?
| SELECT "Score" FROM table_57740 WHERE "Date" = 'march 4' | wikisql |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | (SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
... | SELECT * FROM PostTags | sede |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute cd3 count') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_T... | mimic_iii |
CREATE TABLE table_name_64 (
price VARCHAR,
upstream VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Price, when Upstream is '256 kbit'?
| SELECT price FROM table_name_64 WHERE upstream = "256 kbit" | sql_create_context |
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 zzmzjzjlb (
HXPLC number,
HZX... | SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '韩向彤' AND hz_info.YLJGDM = '9745753' AND NOT zzmzjzjlb.JZKSMC LIKE '%科室%' UNION SELECT fzzmzjz... | css |
CREATE TABLE table_name_90 (
earnings___ INTEGER,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest earnings for the golfer who has more than 37 wins?
| SELECT MAX(earnings___) AS $__ FROM table_name_90 WHERE wins > 37 | sql_create_context |
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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'aspirin' AND admissions.subject_id = 99647 AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12') AS t1 JOIN (SELECT admission... | mimic_iii |
CREATE TABLE table_52334 (
"Rank" real,
"Airline" text,
"Country" text,
"Remarks" text,
"Alliance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the airline for rank of 4
| SELECT "Airline" FROM table_52334 WHERE "Rank" = '4' | wikisql |
CREATE TABLE table_23286112_8 (
location_attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the location attendance for january 18
| SELECT location_attendance FROM table_23286112_8 WHERE date = "January 18" | sql_create_context |
CREATE TABLE table_80185 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player for fiji
| SELECT "Player" FROM table_80185 WHERE "Country" = 'fiji' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "1" AND procedures.short_title = "Cath base invasv ep test" | mimicsql_data |
CREATE TABLE football_data (
season text,
datetime time,
div text,
country text,
league text,
referee text,
hometeam text,
awayteam text,
fthg number,
ftag number,
ftr text,
hthg number,
htag number,
htr text,
psh number,
psd number,
psa number,
b3... | SELECT * FROM football_data WHERE country = "Spain" AND ftr = "A" | worldsoccerdatabase |
CREATE TABLE table_59887 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event had a total of 28?
| SELECT "Event" FROM table_59887 WHERE "Total" = '28' | wikisql |
CREATE TABLE ReviewTaskTypes (
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,
ExpiryDat... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, Location FROM Users, Badges WHERE Users.Id = Badges.UserId AND Badges.Class = 1 AND Badges.TagBased = 1 AND Badges.Name = 'c++' ORDER BY Reputation DESC | sede |
CREATE TABLE table_35950 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who came in third in England?
| SELECT "Third" FROM table_35950 WHERE "Nation" = 'england' | wikisql |
CREATE TABLE table_name_38 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Richmond's score as the home team?
| SELECT home_team AS score FROM table_name_38 WHERE home_team = "richmond" | sql_create_context |
CREATE TABLE table_name_98 (
programming VARCHAR,
channel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Programming is on Channel 26.5?
| SELECT programming FROM table_name_98 WHERE channel = 26.5 | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId ... | SELECT Id AS "user_link", * FROM Users ORDER BY Id LIMIT 100 | sede |
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 WHERE demographic.days_stay > "34" AND diagnoses.icd9_code = "261" | mimicsql_data |
CREATE TABLE region (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many regions do we have?
| SELECT COUNT(*) FROM region | sql_create_context |
CREATE TABLE Maintenance_Engineers (
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the distinct last names of all the engineers?
| SELECT DISTINCT last_name FROM Maintenance_Engineers | sql_create_context |
CREATE TABLE table_76478 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "High rebounds" FROM table_76478 WHERE "Game" = '81' | wikisql |
CREATE TABLE table_203_150 (
id number,
"season" number,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"f/laps" number,
"podiums" number,
"points" number,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT MAX("season") - MIN("season") FROM table_203_150 | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
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 jybgb (
BBCJBW text,
BBDM tex... | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX 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_in... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalpe... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', diagnosis.diagnosistime) = '2101' GROUP BY diagnosis.diagnosisname... | eicu |
CREATE TABLE table_57666 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the attendance with a result of l 26 3
| SELECT "Attendance" FROM table_57666 WHERE "Result" = 'l 26–3' | wikisql |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Guests (
gue... | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" | nvbench |
CREATE TABLE table_1277350_5 (
saturday_sixth_day VARCHAR,
day__see_irregularities__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Croatian word for Saturday?
| SELECT saturday_sixth_day FROM table_1277350_5 WHERE day__see_irregularities__ = "Croatian" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'other' AND STRFTIME('%y', microlab.culturetakentime) >= '2104') | eicu |
CREATE TABLE table_38561 (
"Season" text,
"Winner" text,
"Result" text,
"Runner-up" text,
"Final venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what Season was the Final Venue at Sandy Lane with Kiveton Park as the Winner?
| SELECT "Season" FROM table_38561 WHERE "Winner" = 'kiveton park' AND "Final venue" = 'sandy lane' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2114" AND lab.label = "Quantitative G6PD" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text... | WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT DISTINCT p1.ParentId AS "post_link" FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' | sede |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Transplant Self Medication Program" | mimicsql_data |
CREATE TABLE table_256286_61 (
type VARCHAR,
_percentage_yes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many type catagories are listed when the percentage of yes is 68.91%?
| SELECT COUNT(type) FROM table_256286_61 WHERE _percentage_yes = "68.91%" | sql_create_context |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '秦傲雪' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2014-09-06' UNI... | css |
CREATE TABLE table_name_44 (
attendance INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people went to the game with the record of 8-10?
| SELECT SUM(attendance) FROM table_name_44 WHERE record = "8-10" | sql_create_context |
CREATE TABLE table_name_74 (
elevator VARCHAR,
elector VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the elevator of Jacques D'euse?
| SELECT elevator FROM table_name_74 WHERE elector = "jacques d'euse" | sql_create_context |
CREATE TABLE table_name_35 (
table_diameter VARCHAR,
crown_height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Table diameter has a Crown height of 14.45%?
| SELECT table_diameter FROM table_name_35 WHERE crown_height = "14.45%" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId ... | SELECT Id FROM Posts | sede |
CREATE TABLE table_13619135_7 (
high_rebounds VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the high rebounder against charlotte?
| SELECT high_rebounds FROM table_13619135_7 WHERE team = "Charlotte" | sql_create_context |
CREATE TABLE table_63355 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answer the following questi... | SELECT COUNT("Total Goals") FROM table_63355 WHERE "League Cup Apps" = '2' AND "FA Cup Goals" < '0' | wikisql |
CREATE TABLE table_name_86 (
total_assets___percentage_change_ VARCHAR,
performance_return_on_capital___percentage_ VARCHAR,
performance_return_on_capital__score_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Total Assets (% Change) that has Perfor... | SELECT total_assets___percentage_change_ FROM table_name_86 WHERE performance_return_on_capital___percentage_ > 25.63 AND performance_return_on_capital__score_ > 7 | sql_create_context |
CREATE TABLE claims_processing (
claim_processing_id number,
claim_id number,
claim_outcome_code text,
claim_stage_id number,
staff_id number
)
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE claims_processing_stages (
claim_stage_id number,
next_c... | SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | SELECT DISTINCT p.Id AS "post_link", Score, crt.Name AS "close_reason_name" FROM Posts AS p JOIN PendingFlags AS pf ON p.Id = pf.PostId JOIN CloseReasonTypes AS crt ON pf.CloseReasonTypeId = crt.Id WHERE Tags LIKE '%<row>%' AND ClosedDate IS NULL ORDER BY Score | sede |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_43468 (
"Index" text,
"Name" text,
"Song" text,
"Group Song" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Group Song of Shine ?
| SELECT "Group Song" FROM table_43468 WHERE "Name" = 'shine 王幸儿' | wikisql |
CREATE TABLE table_name_57 (
tied INTEGER,
points VARCHAR,
goals_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest tie with less than 100 points and 277 goals?
| SELECT MIN(tied) FROM table_name_57 WHERE points < 100 AND goals_for = 277 | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT * FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%INDIA%' OR Location LIKE '%India%' AND Reputation >= 1000 ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_73 (
money___£__ VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the money for ireland
| SELECT money___£__ FROM table_name_73 WHERE country = "ireland" | sql_create_context |
CREATE TABLE table_name_47 (
production_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average 2006 value for wheat with a 2005 value greater than 7340?
| SELECT AVG(2006) FROM table_name_47 WHERE production_year = "wheat" AND 2005 > 7340 | sql_create_context |
CREATE TABLE table_203_506 (
id number,
"opponent" text,
"played" number,
"won" number,
"lost" number,
"drawn" number,
"% won overall" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams did they not lose to ?
| SELECT COUNT("opponent") FROM table_203_506 WHERE "lost" = 0 | squall |
CREATE TABLE table_name_96 (
athlete VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What athlete has a Grenoble place?
| SELECT athlete FROM table_name_96 WHERE place = "grenoble" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT COUNT(DISTINCT t1.subject_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 FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | mimic_iii |
CREATE TABLE table_40665 (
"Player" text,
"Club" text,
"League" real,
"FA Cup" real,
"FA Trophy" real,
"League Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which League has a Total smaller than 16, a Player of ken mckenn... | SELECT MAX("League") FROM table_40665 WHERE "Total" < '16' AND "Player" = 'ken mckenna' AND "League Cup" > '0' | wikisql |
CREATE TABLE table_54309 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Total with a Score of 3 0, and a Date of 14 oct, and has a Set 1 of 15 12?
| SELECT "Total" FROM table_54309 WHERE "Score" = '3–0' AND "Date" = '14 oct' AND "Set 1" = '15–12' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid n... | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32407') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '谢婉慧' AND IN_HOSP_DATE BETWEEN '2000-07-26' AND '2013-12-31' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_79853 (
"Title" text,
"Producer(s)" text,
"Artist(s)" text,
"Time" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long is the XXX track used by the Minnesota Vikings?
| SELECT "Time" FROM table_79853 WHERE "Team(s)" = 'minnesota vikings' AND "Artist(s)" = 'xxx' | wikisql |
CREATE TABLE table_14013 (
"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's the lowest bronze medal amount that has fewer than 0 gold?
| SELECT MIN("Bronze") FROM table_14013 WHERE "Gold" < '0' | wikisql |
CREATE TABLE table_35450 (
"Season" real,
"Game" text,
"Record" text,
"Opponent" text,
"Score" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has a Game of fcs midwest region, and a Score of 40-33?
| SELECT MAX("Season") FROM table_35450 WHERE "Game" = 'fcs midwest region' AND "Score" = '40-33' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | SELECT TIME_TO_STR(CreationDate, '%I'), COUNT(*) FROM Posts WHERE PostTypeId = 2 AND Id IN (SELECT AcceptedAnswerId FROM Posts WHERE NOT AcceptedAnswerId IS NULL) GROUP BY TIME_TO_STR(CreationDate, '%I') ORDER BY 2 DESC | sede |
CREATE TABLE table_58512 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the opponent on 1990-10-21?
| SELECT "Opponent" FROM table_58512 WHERE "Date" = '1990-10-21' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "WBC, Joint Fluid" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.