instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '华云韶' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_28587 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many party classifications are there for the incumbent Mac Collins?
| SELECT COUNT("Party") FROM table_28587 WHERE "Incumbent" = 'Mac Collins' | wikisql |
CREATE TABLE table_name_87 (
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Week with a Date of Bye?
| SELECT COUNT(week) FROM table_name_87 WHERE date = "bye" | sql_create_context |
CREATE TABLE table_54958 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings( $ )" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has earnings above 358,770 and a rank smaller than 2?
| SELECT "Player" FROM table_54958 WHERE "Earnings( $ )" > '358,770' AND "Rank" < '2' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ... | advising |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,... | SELECT * FROM Tags ORDER BY Count DESC LIMIT 10 | sede |
CREATE TABLE field (
fieldid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE T... | SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'chi' | scholar |
CREATE TABLE table_39286 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On wha... | SELECT "Date" FROM table_39286 WHERE "Game" > '5' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '021-246447' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGui... | SELECT * FROM Votes WHERE UserId = 2118383 | sede |
CREATE TABLE table_3285 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many mls teams had player jamel wallace?
| SELECT COUNT("MLS Team") FROM table_3285 WHERE "Player" = 'Jamel Wallace' | wikisql |
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 WHERE demographic.age < "63" AND demographic.days_stay > "17" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-70268')) AND lab.labname = '-eos' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TI... | eicu |
CREATE TABLE table_25316812_1 (
desired_rate__p_ VARCHAR,
rate_limit__p_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the desired rate when the rate limit (p) is 50.33?
| SELECT desired_rate__p_ FROM table_25316812_1 WHERE rate_limit__p_ = "50.33" | 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 WHERE demographic.insurance = "Government" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" | mimicsql_data |
CREATE TABLE table_name_64 (
league INTEGER,
fa_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many league cup goals on average for players with over 0 FA cup and 5 league goals?
| SELECT AVG(league) AS Cup FROM table_name_64 WHERE fa_cup > 0 AND league = 5 | sql_create_context |
CREATE TABLE table_name_85 (
silver INTEGER,
bronze INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of silver medals of the team with less than 0 bronzes?
| SELECT MAX(silver) FROM table_name_85 WHERE bronze < 0 | sql_create_context |
CREATE TABLE table_14305 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the greatest competition finish with average more t... | SELECT MAX("Competition finish") FROM table_14305 WHERE "Average" > '32.9' AND "Number of dances" > '16' | wikisql |
CREATE TABLE table_15055594_6 (
fall_06 INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of students from a state during the Fall 06 semester?
| SELECT MIN(fall_06) FROM table_15055594_6 | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT p.OwnerUserId AS "user_id", p.Score AS "question_score", p.CreationDate AS "asked_on", p.Tags AS "tags", CASE WHEN p.ClosedDate IS NULL THEN 'No' ELSE 'Yes' END AS "closed", p.ViewCount AS "view_count", p.AnswerCount AS "answer_count" FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags ... | sede |
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 demographic.insurance, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "21796" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE 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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Government" | mimicsql_data |
CREATE TABLE table_7071 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Titans play the Houston Texans at LP Field before Week 13?
| SELECT "Date" FROM table_7071 WHERE "Week" < '13' AND "Game site" = 'lp field' AND "Opponent" = 'houston texans' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid numb... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '035-11300' AND STRFTIME('%y', patient.hospitaladmittime) = '2105' | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '010-26737' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '吴莹华' AND t_kc22.STA_DATE BETWEEN '2003-12-27' AND '2019-01-29' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_80347 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rank with laps of 200 and qual of 148.374
| SELECT "Rank" FROM table_80347 WHERE "Laps" = '200' AND "Qual" = '148.374' | wikisql |
CREATE TABLE table_22669044_7 (
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the high assists for december 9
| SELECT high_assists FROM table_22669044_7 WHERE date = "December 9" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
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 diagnoses_icd (
... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_1473672_6 (
player VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player was drafted by the Chicago Black Hawks?
| SELECT player FROM table_1473672_6 WHERE nhl_team = "Chicago Black Hawks" | sql_create_context |
CREATE TABLE table_20183474_1 (
total_points VARCHAR,
draw VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did the song with a draw number 3 get?
| SELECT total_points FROM table_20183474_1 WHERE draw = 3 | sql_create_context |
CREATE TABLE table_204_260 (
id number,
"date" text,
"venue" text,
"opponent" text,
"result" text,
"tournament" text,
"scored" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where did netwon score at least 3 times ?
| SELECT "venue" FROM table_204_260 WHERE "scored" >= 3 | squall |
CREATE TABLE table_42805 (
"Ship" text,
"15-inch" real,
"13.5-inch/1400lb" real,
"13.5-inch/1250lb" real,
"12-inch" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of 13.5 inch/1400 lb that has a 0 13.5 inch... | SELECT COUNT("13.5-inch/1400lb") FROM table_42805 WHERE "13.5-inch/1250lb" = '0' AND "Total" = '3' AND "15-inch" < '1' | wikisql |
CREATE TABLE table_222448_1 (
percentage_yield VARCHAR,
percent_defective VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many percentage yield figures are there when 6.7% are defective?
| SELECT COUNT(percentage_yield) FROM table_222448_1 WHERE percent_defective = "6.7%" | sql_create_context |
CREATE TABLE table_2104176_1 (
air_force_cross VARCHAR,
homeland_security_distinguished_service_medal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the air force cross when you recieve the Aerial achievement medal?
| SELECT air_force_cross FROM table_2104176_1 WHERE homeland_security_distinguished_service_medal = "Aerial Achievement Medal" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9424563' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD | css |
CREATE TABLE table_name_17 (
pop__2010_ INTEGER,
geo_id VARCHAR,
land___sqmi__ VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total population in 2010 for the township located in Mountrail which has land less than 34.424 s... | SELECT SUM(pop__2010_) FROM table_name_17 WHERE land___sqmi__ < 34.424 AND county = "mountrail" AND geo_id < 3806159940 | sql_create_context |
CREATE TABLE table_name_42 (
rank VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rank is Austria?
| SELECT rank FROM table_name_42 WHERE nation = "austria" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 T... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_36603 (
"Date" text,
"Home Team" text,
"Score" text,
"Visiting Team" text,
"Stadium" text
)
-- 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_36603 WHERE "Visiting Team" = 'edmonton drillers' AND "Date" = 'january 6, 2008' | 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 * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '沈伟祺' AND hz_info.YLJGDM = '8930086' AND mzjzjlb.JZZDSM LIKE '%颅脑%' | css |
CREATE TABLE table_name_48 (
solar VARCHAR,
year VARCHAR,
hydroelectricity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 2011 with a hydroelectricity less than 119.6, what was the solar?
| SELECT solar FROM table_name_48 WHERE year = 2011 AND hydroelectricity < 119.6 | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '83478768523' AND jybgb.KSMC LIKE '%治疗%' | css |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE procedures_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 TABL... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysthymic disorder')) | mimic_iii |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | SELECT v.CreationDate, AnswerUpVotes = COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.PostTypeId = 2 AND v.VoteTypeId = 2 AND v.CreationDate BETWEEN @startDate AND @endDate GROUP BY v.CreationDate ORDER BY v.CreationDate | sede |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,... | SELECT Posts.Id AS "post_link", DATEDIFF(day, Posts.CreationDate, CreationDate) AS "time_taken_to_accept_in_days", ROUND(DATEDIFF(day, Posts.CreationDate, CreationDate) / 12.0, 0) AS "in_months", ROUND(DATEDIFF(day, Posts.CreationDate, CreationDate) / 365.0, 1) AS "and_in_years" FROM Posts JOIN Votes ON Posts.Id = Vote... | sede |
CREATE TABLE table_name_24 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2011's tournament was Indian Wells?
| SELECT 2011 FROM table_name_24 WHERE tournament = "indian wells" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (... | SELECT ROW_NUMBER() OVER (ORDER BY Answers.Id) AS "#", Answers.Id AS "post_link" FROM Posts AS Qestions INNER JOIN Posts AS Answers ON Answers.ParentId = Qestions.Id WHERE Answers.OwnerUserId = 12578202 AND Answers.Score = 0 AND Qestions.AcceptedAnswerId IS NULL AND Qestions.Id NOT IN (63156884, 63510041, 63413561, 600... | sede |
CREATE TABLE table_11999 (
"Date" text,
"Round" text,
"Attendance" text,
"Opposition" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opposition at 11,682 excl. exhibition match?
| SELECT "Opposition" FROM table_11999 WHERE "Stadium" = '11,682 excl. exhibition match' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.icd9_code = "5771" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE m... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-202970') AND patient.unitdischargetime IS NULL) AND inta... | eicu |
CREATE TABLE table_48034 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the home stadium of Brisban... | SELECT "Ground" FROM table_48034 WHERE "Home team" = 'brisbane lions' | wikisql |
CREATE TABLE table_10295819_1 (
current_singles_ranking VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Current singles ranking for the player named Mantas Bugaili kis?
| SELECT current_singles_ranking FROM table_10295819_1 WHERE player = "Mantas Bugailiškis" | sql_create_context |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY SUM(Weight) DESC | nvbench |
CREATE TABLE table_54508 (
"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.
-- When did the away team have a score of 11.14 (80... | SELECT "Date" FROM table_54508 WHERE "Away team score" = '11.14 (80)' | wikisql |
CREATE TABLE table_27537518_4 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the October 22 record?
| SELECT record FROM table_27537518_4 WHERE date = "October 22" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '34728428' AND mzjzjlb.JZKSRQ BETWEEN '2008-08-30' AND '2013-04-07' AND mzjzjlb.YLJGDM = '9353416' | css |
CREATE TABLE table_1555 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on March 21, 2009?
| SELECT "Score" FROM table_1555 WHERE "Date" = 'March 21, 2009' | wikisql |
CREATE TABLE table_24545 (
"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 were Gentleman's odds of winner... | SELECT "Odds of winner" FROM table_24545 WHERE "Horse" = 'Gentleman' | wikisql |
CREATE TABLE table_train_94 (
"id" int,
"mini_mental_state_examination_mmse" int,
"substance_dependence" bool,
"psychiatric_disease" bool,
"modified_hachinski_ischemia_scale" int,
"smoking" bool,
"alcohol_abuse" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following question... | SELECT * FROM table_train_94 WHERE mini_mental_state_examination_mmse > 16 OR mini_mental_state_examination_mmse > 26 | criteria2sql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1685355' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '16853... | css |
CREATE TABLE table_30680 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT MIN("Total") FROM table_30680 WHERE "Style" = 'Pasodoble' | wikisql |
CREATE TABLE table_25355392_2 (
january_15_16 VARCHAR,
november_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is january 15-16 when november 3 is 153?
| SELECT january_15_16 FROM table_25355392_2 WHERE november_3 = "153" | sql_create_context |
CREATE TABLE table_43120 (
"Team" text,
"Country" text,
"Home" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the team from Stirling?
| SELECT "Team" FROM table_43120 WHERE "Home" = 'stirling' | wikisql |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season re... | SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified" | mimicsql_data |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '78964308' AND t_kc22.STA_DATE BETWEEN '2012-03-26' AND '2018-10-14' AND t_kc22.SELF_PAY_PRO < 0.65 | css |
CREATE TABLE table_1802760_3 (
reason_for_change VARCHAR,
date_of_successors_formal_installation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Why did the change happen in the state where the formal installation happen on February 14, 1859?
| SELECT reason_for_change FROM table_1802760_3 WHERE date_of_successors_formal_installation = "February 14, 1859" | sql_create_context |
CREATE TABLE WINE (
Price VARCHAR,
YEAR INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the prices of wines produced before the year of 2010?
| SELECT Price FROM WINE WHERE YEAR < 2010 | sql_create_context |
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABL... | SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" | spider |
CREATE TABLE table_name_60 (
week INTEGER,
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the lowest Week that has the Attendance smaller than 34,336?
| SELECT MIN(week) FROM table_name_60 WHERE attendance < 34 OFFSET 336 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '700' AND zyjzjlb.RYDJSJ BETWEEN '2001-04-20' AND '2005-06-26' | css |
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 MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
... | SELECT COUNT(DISTINCT Comments.UserId) FROM Posts JOIN Comments ON Posts.Id = Comments.PostId WHERE Posts.Id = 99934 GROUP BY Posts.Id | sede |
CREATE TABLE table_204_105 (
id number,
"#" number,
"name" text,
"height" text,
"weight (lbs.)" number,
"position" text,
"class" text,
"hometown" text,
"previous team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the next... | SELECT "name" FROM table_204_105 WHERE "weight (lbs.)" < (SELECT "weight (lbs.)" FROM table_204_105 WHERE "name" = 'nedeljko golubovic') ORDER BY "weight (lbs.)" DESC LIMIT 1 | squall |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | SELECT (CASE p.PostTypeId WHEN 1 THEN 'Q' WHEN 2 THEN 'A' END) AS "t", p.Id AS "post_link", p.OwnerUserId AS "user_link", p.Score AS "score", LENGTH(p.Body) AS "post_length", (CAST((p.Score) AS FLOAT)) / (CAST(LENGTH(p.Body) AS FLOAT)) AS "weighted_score" FROM Posts AS p WHERE (p.PostTypeId = 1 OR p.PostTypeId = 2) AND... | sede |
CREATE TABLE table_72649 (
"Category" text,
"Type" text,
"Attribute" text,
"Description" text,
"Bubbles" text,
"Cancelable" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the type with description being fires when the overflow state chang... | SELECT "Type" FROM table_72649 WHERE "Description" = 'Fires when the overflow state changes.' | wikisql |
CREATE TABLE table_36203 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Game of 31?
| SELECT "Opponent" FROM table_36203 WHERE "Game" = '31' | wikisql |
CREATE TABLE table_65061 (
"Year" real,
"Artist" text,
"Song" text,
"Album" text,
"Remix" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the album with the song 'party like ur 18' feat. sway?
| SELECT "Album" FROM table_65061 WHERE "Song" = 'party like ur 18" feat. sway' | wikisql |
CREATE TABLE table_name_51 (
rider VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rider had a time/retired od +19.909?
| SELECT rider FROM table_name_51 WHERE time_retired = "+19.909" | 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 demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Morgan Mcgee" | mimicsql_data |
CREATE TABLE table_25924 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Jasons team" text,
"Scores" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name all of Jason's teams that appeared on episode 6x02?
| SELECT "Jasons team" FROM table_25924 WHERE "Episode" = '6x02' | wikisql |
CREATE TABLE table_15586 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where ther... | SELECT "Drawn" FROM table_15586 WHERE "Tries against" = '45' | wikisql |
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
... | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Location_From DESC | nvbench |
CREATE TABLE table_9224 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"2012 club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the CB pos in the 2012 culb CN Sabadell?
| SELECT "Name" FROM table_9224 WHERE "Pos." = 'cb' AND "2012 club" = 'cn sabadell' | wikisql |
CREATE TABLE table_name_80 (
second VARCHAR,
third VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the second where the third of Kelly Wood (e) Anna Sloan (Jr)?
| SELECT second FROM table_name_80 WHERE third = "kelly wood (e) anna sloan (jr)" | sql_create_context |
CREATE TABLE table_name_28 (
first_elected VARCHAR,
party VARCHAR,
member VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which first election for the labor party is James Sharpe a part of?
| SELECT first_elected FROM table_name_28 WHERE party = "labor" AND member = "james sharpe" | sql_create_context |
CREATE TABLE table_3642 (
"Round" real,
"Date" text,
"Grand Prix" text,
"Circuit" text,
"MotoGP winner" text,
"Moto2 winner" text,
"125cc winner" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are all the motogp winner... | SELECT "MotoGP winner" FROM table_3642 WHERE "Circuit" = 'Catalunya' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAd... | SELECT Id AS "user_link", Reputation, LastAccessDate FROM Users WHERE Reputation >= 1000 AND EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id AND b.Name = 'Civic Duty') AND EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id AND b.Name = 'Deputy') AND EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId ... | sede |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Class, COUNT(Class) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain) GROUP BY Class | nvbench |
CREATE TABLE table_31493 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many barony's appear when Ballyvadona is the townland.
| SELECT COUNT("Barony") FROM table_31493 WHERE "Townland" = 'Ballyvadona' | wikisql |
CREATE TABLE table_9217 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the winner and score for the week of august 9?
| SELECT "Winner and score" FROM table_9217 WHERE "Week" = 'august 9' | wikisql |
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE product_characteristics (
... | SELECT color_description FROM ref_colors | spider |
CREATE TABLE table_204_443 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which game sites had an attendance lower than... | SELECT "game site" FROM table_204_443 WHERE "attendance" < 50000 | squall |
CREATE TABLE table_57622 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had a pick of 63?
| SELECT "School/Club Team" FROM table_57622 WHERE "Pick" = '63' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT COUNT(*) > 0 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 = 10211 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemid IN (... | mimic_iii |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '12922014' AND mzjzjlb.JZKSRQ BETWEEN '2017-03-21' AND '2018-10-30') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_... | css |
CREATE TABLE table_34639 (
"Poll source" text,
"Dates administered" text,
"John Oxendine" text,
"Karen Handel" text,
"Nathan Deal" text,
"Eric Johnson" text,
"Ray McBerry" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Karen Handel" FROM table_34639 WHERE "Poll source" = 'insideradvantage' AND "John Oxendine" = '15%' | wikisql |
CREATE TABLE table_52635 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which players plays at Akron College?
| SELECT "Player" FROM table_52635 WHERE "College" = 'akron' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.