instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_49386 (
"Missouri vs." text,
"Overall Record" text,
"at Columbia" text,
"at Opponent's Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Last 5 Meetings" FROM table_49386 WHERE "at Columbia" = 'mu, 4-2' | wikisql |
CREATE TABLE table_26957063_3 (
_percentage_identity_to_c7orf38 INTEGER,
genus_ VARCHAR,
_species VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the % identity to C7orf38 of the animal whose genus & species is Mus Musculus?
| SELECT MAX(_percentage_identity_to_c7orf38) FROM table_26957063_3 WHERE genus_ & _species = "Mus musculus" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277')) AND intakeoutput.cellpath LIKE '%intake... | eicu |
CREATE TABLE table_29955 (
"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.
-- Which ... | SELECT "Game" FROM table_29955 WHERE "High rebounds" = 'Marc Gasol (10)' | wikisql |
CREATE TABLE table_29796 (
"No(s). in series" real,
"No(s). in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code(s)" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Original air date" FROM table_29796 WHERE "U.S. viewers (millions)" = '23.2' | 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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_262476_1 (
location VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the location for golden tornadoes
| SELECT location FROM table_262476_1 WHERE nickname = "Golden Tornadoes" | sql_create_context |
CREATE TABLE table_name_54 (
location VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location where Denny Hulme was the driver?
| SELECT location FROM table_name_54 WHERE driver = "denny hulme" | sql_create_context |
CREATE TABLE table_47604 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game that took place on october 22, 1976?
| SELECT "Score" FROM table_47604 WHERE "Date" = 'october 22, 1976' | wikisql |
CREATE TABLE table_name_43 (
weight_ VARCHAR,
_height VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Weight & Height has a Player of james donaldson?
| SELECT weight_ & _height FROM table_name_43 WHERE player = "james donaldson" | sql_create_context |
CREATE TABLE table_name_2 (
district VARCHAR,
reserved_for___sc___st__none_ VARCHAR,
constituency_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district had SC reserved and 169 Constituents?
| SELECT district FROM table_name_2 WHERE reserved_for___sc___st__none_ = "sc" AND constituency_number = "169" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral | nvbench |
CREATE TABLE table_60819 (
"Player" text,
"Position" text,
"Ekstraklasa" real,
"Polish Cup" real,
"Puchat Ligi" real,
"UEFA Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Total of 3, and an Ekstraklasa s... | SELECT "Player" FROM table_60819 WHERE "Total" = '3' AND "Ekstraklasa" < '3' AND "UEFA Cup" = '2' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kelly Williams%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... | advising |
CREATE TABLE table_78364 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average Grid for a Maserati with less than 80 laps, and a Time/Retired of +2 laps?
| SELECT AVG("Grid") FROM table_78364 WHERE "Laps" < '80' AND "Constructor" = 'maserati' AND "Time/Retired" = '+2 laps' | 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 demographic.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Dona Cole" | mimicsql_data |
CREATE TABLE table_name_81 (
drawn INTEGER,
position VARCHAR,
points VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the sum of drawn when points is less than 15, lost is 8 and position is more than 6?
| SELECT SUM(drawn) FROM table_name_81 WHERE points < 15 AND lost = 8 AND position > 6 | sql_create_context |
CREATE TABLE table_name_45 (
goals_conceded VARCHAR,
wins VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of goals of the club with 4 wins and less than 0 draws?
| SELECT COUNT(goals_conceded) FROM table_name_45 WHERE wins = 4 AND draws < 0 | sql_create_context |
CREATE TABLE table_41319 (
"Medal" text,
"Name" text,
"Sport" text,
"Event" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name with an Event that is men's time trial?
| SELECT "Name" FROM table_41319 WHERE "Event" = 'men''s time trial' | wikisql |
CREATE TABLE table_28961 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Title" FROM table_28961 WHERE "Director" = 'Pamela Fryman' AND "Production code" = '2ALH07' | wikisql |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855 AND admissions.dischtime IS NULL)) AND transfers... | mimic_iii |
CREATE TABLE table_55497 (
"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's the score on january 5 with a hasek decision?
| SELECT "Score" FROM table_55497 WHERE "Decision" = 'hasek' AND "Date" = 'january 5' | wikisql |
CREATE TABLE table_30242 (
"Entrant" text,
"Constructor" text,
"Car" text,
"Driver" text,
"Co-driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the type of vehicle driven by mark higgins
| SELECT "Car" FROM table_30242 WHERE "Driver" = 'Mark Higgins' | wikisql |
CREATE TABLE table_name_41 (
position VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Position that has the Driver of bib stillwell?
| SELECT position FROM table_name_41 WHERE driver = "bib stillwell" | sql_create_context |
CREATE TABLE table_22829 (
"DMA" real,
"Market" text,
"Station" text,
"Frequency" text,
"Branding" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is dma?
| SELECT MIN("DMA") FROM table_22829 | 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_60753 (
"Date" text,
"Time" text,
"Competition" text,
"Opponent" text,
"Ground" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ground of the tim trophy competition, which had a time of 23:00 cet?
| SELECT "Ground" FROM table_60753 WHERE "Competition" = 'tim trophy' AND "Time" = '23:00 cet' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) >= '2101' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 3) | mimic_iii |
CREATE TABLE table_25391981_3 (
couple VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What couple averaged 15.5?
| SELECT couple FROM table_25391981_3 WHERE average = "15.5" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-14220' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
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 jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 WHERE hz_info.RYBH = '17320230' AND jybgb.BGRQ BETWEEN '2013-09-23' AND '2019-11-29' UNION... | css |
CREATE TABLE table_11638 (
"Route Name" text,
"Direction" text,
"Termini" text,
"Junctions" text,
"Length" text,
"Population Area" text,
"Remarks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the length of the highway with the rout... | SELECT "Length" FROM table_11638 WHERE "Route Name" = 'sh 2' | wikisql |
CREATE TABLE table_name_41 (
defending_forces VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Defending forces when the population was 120?
| SELECT defending_forces FROM table_name_41 WHERE population = "120" | sql_create_context |
CREATE TABLE diagnoses (
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2074" | mimicsql_data |
CREATE TABLE table_36584 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Men's singles from the Year of 1966?
| SELECT "Men's singles" FROM table_36584 WHERE "Year" = '1966' | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE table_name_62 (
mascot VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mascot at Hamilton Community?
| SELECT mascot FROM table_name_62 WHERE school = "hamilton community" | sql_create_context |
CREATE TABLE table_73985 (
"Name" text,
"Park" text,
"Length (ft)" real,
"Height (ft)" real,
"Speed (mph)" text,
"Opened" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How fast is the coaster that is 163 feet tall
| SELECT "Speed (mph)" FROM table_73985 WHERE "Height (ft)" = '163' | wikisql |
CREATE TABLE table_2231241_1 (
seat_no_4 VARCHAR,
election VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner of seat no 4 for the election on January 25, 1967
| SELECT seat_no_4 FROM table_2231241_1 WHERE election = "January 25, 1967" | sql_create_context |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | SELECT Name, Age FROM driver ORDER BY Age | nvbench |
CREATE TABLE table_11569 (
"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 average crowd size where the away te... | SELECT AVG("Crowd") FROM table_11569 WHERE "Away team score" = '22.12 (144)' | wikisql |
CREATE TABLE table_name_73 (
result VARCHAR,
role VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the role of Ellie Greenwich in 2005?
| SELECT result FROM table_name_73 WHERE role = "ellie greenwich" AND year = "2005" | sql_create_context |
CREATE TABLE table_name_61 (
outcome VARCHAR,
partner VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Outcome of the match with Partner Marcella Mesker and a Score of 6 4, 4 6, 4 6?
| SELECT outcome FROM table_name_61 WHERE partner = "marcella mesker" AND score = "6–4, 4–6, 4–6" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | SELECT p.PostId AS "post_link", p.IsAnonymous, v.Name FROM PostFeedback AS p JOIN VoteTypes AS v ON v.Id = p.VoteTypeId ORDER BY p.CreationDate DESC | sede |
CREATE TABLE table_33231 (
"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 home team played the away team of Richmond?... | SELECT "Home team" FROM table_33231 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CONDUCT' AND course.number = 407 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 | advising |
CREATE TABLE table_name_2 (
attendance VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when the series was at 0-1?
| SELECT attendance FROM table_name_2 WHERE series = "0-1" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) <= '2101' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59797) ORDER BY labevents.charttime LIMIT 1) | mimic_iii |
CREATE TABLE table_33392 (
"Nationality" text,
"Position" text,
"Apps" real,
"Goals" real,
"Years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Years have a Goal of 82?
| SELECT "Years" FROM table_33392 WHERE "Goals" = '82' | wikisql |
CREATE TABLE table_name_95 (
attendance INTEGER,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Attendance on Week 8?
| SELECT AVG(attendance) FROM table_name_95 WHERE week = 8 | sql_create_context |
CREATE TABLE table_51347 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the opposing team for the game on August 29?
| SELECT "Opponent" FROM table_51347 WHERE "Date" = 'august 29' | wikisql |
CREATE TABLE table_68995 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much does Jonathan Bender weigh?
| SELECT "Weight" FROM table_68995 WHERE "Player" = 'jonathan bender' | wikisql |
CREATE TABLE table_name_90 (
winning_driver VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winning driver on 30 May?
| SELECT winning_driver FROM table_name_90 WHERE date = "30 may" | 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 People_ID, Height FROM people | nvbench |
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3249384' AND t_kc21.OUT_DIAG_DIS_NM = '持久的妄想性障碍') | css |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE author (
authorid int,
autho... | SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 | scholar |
CREATE TABLE table_name_83 (
player VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player's hometown is Washington, IN?
| SELECT player FROM table_name_83 WHERE hometown = "washington, in" | sql_create_context |
CREATE TABLE table_6923 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"Conservative ticket" text,
"Liberal ticket" text,
"Free Libertarian ticket" text,
"Socialist Labor ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Socialist Labor ticket" FROM table_6923 WHERE "Liberal ticket" = 'arthur levitt' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.dischtime, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "23602" | mimicsql_data |
CREATE TABLE table_54439 (
"Party" text,
"Results 2004" text,
"CSA 5/14/09" text,
"Viavoice 5/15/09" text,
"Ifop- La Croix 5/15/09" text,
"Ipsos 5/16/09" text,
"OpinionWay 5/18/09" text,
"CSA 5/20/09" text,
"Ipsos 5/25/09" text,
"TNS-Sofres 5/26/09" text,
"OpinionWay 5/28/09"... | SELECT "Ipsos 5/25/09" FROM table_54439 WHERE "TNS-Sofres 5/28/09" = '20%' | wikisql |
CREATE TABLE table_204_933 (
id number,
"year" number,
"competition" text,
"date" text,
"location" text,
"opponent" text,
"score" text,
"result" text,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who did the austria davis cup... | SELECT "opponent" FROM table_204_933 WHERE id = (SELECT id FROM table_204_933 WHERE "year" = 1990 AND "competition" = 'world group, 1st round') + 1 | squall |
CREATE TABLE table_19581 (
"#" real,
"Title" text,
"Length" text,
"Writer" text,
"Composer" text,
"Arranger" text,
"Dialect" text,
"Mix Engineer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the arranger for the track written b... | SELECT "Arranger" FROM table_19581 WHERE "Writer" = 'Nizar Francis' | wikisql |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '4713891' AND jyjgzbb.BGRQ BETWEEN '2004-03-01' AND '2015-01... | css |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
fi... | 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 = 5849)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate' ... | mimic_iii |
CREATE TABLE table_25318033_1 (
points VARCHAR,
podiums VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points were scored when the podiums is 0 and position is 10th?
| SELECT points FROM table_25318033_1 WHERE podiums = 0 AND position = "10th" | sql_create_context |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(15),
product_name VARCHAR(80),
product_price DOUBLE
)
CREATE TABLE Customers (
customer_i... | SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY date_to | nvbench |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_CD = 'T47.X50' | css |
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 DISTINCT PostId AS "post_link", UserId AS "user_link", CreationDate FROM PostHistory WHERE PostHistoryTypeId = 19 AND UserId = '##UserId##' ORDER BY CreationDate DESC LIMIT 50 | sede |
CREATE TABLE table_24497 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is every vacator with reason for change as resigned December 31, 1959?... | SELECT "Vacator" FROM table_24497 WHERE "Reason for change" = 'Resigned December 31, 1959' | wikisql |
CREATE TABLE table_24641 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes in the series were directed by Alan ... | SELECT COUNT("No. in series") FROM table_24641 WHERE "Directed by" = 'Alan Taylor' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.long_title = "Tietze's disease" | mimicsql_data |
CREATE TABLE table_name_64 (
years VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years have a total of 395 (0)?
| SELECT years FROM table_name_64 WHERE total = "395 (0)" | sql_create_context |
CREATE TABLE table_14513 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record for april 22
| SELECT "Record" FROM table_14513 WHERE "Date" = 'april 22' | wikisql |
CREATE TABLE table_name_5 (
total VARCHAR,
set_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total when the score of set 1 is 15 11?
| SELECT total FROM table_name_5 WHERE set_1 = "15–11" | sql_create_context |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
... | SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) | nvbench |
CREATE TABLE table_204_668 (
id number,
"#" number,
"menteri besar" text,
"took office" text,
"left office" text,
"party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who took office after abdullah jaafar ?
| SELECT "menteri besar" FROM table_204_668 WHERE "took office" > (SELECT "took office" FROM table_204_668 WHERE "menteri besar" = 'abdullah jaafar') ORDER BY "took office" LIMIT 1 | squall |
CREATE TABLE table_2482547_5 (
team_s_ VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the teams with an average of 15.89?
| SELECT team_s_ FROM table_2482547_5 WHERE average = "15.89" | sql_create_context |
CREATE TABLE table_78565 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent when the attendance is 57,331?
| SELECT "Opponent" FROM table_78565 WHERE "Attendance" = '57,331' | wikisql |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '58771000' AND qtb.MED_SER_ORG_NO = '6383480' AND qtb.OUT_DIAG_DOC_NM LIKE '孙%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '58771000' AND gyb.MED_SER_ORG_NO = '6383480' AND gyb.OUT_DIAG_DOC_NM LIKE '... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.ZZYSGH = '59997347' AND zzmzjzjlb.JZKSRQ BETWEEN '2014-05-11' AND '2016-10-25' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN fzzmzjzjlb ON hz_inf... | css |
CREATE TABLE table_46630 (
"Nominative" text,
"Ergative" text,
"Dative" text,
"Genitive" text,
"Instrumental" text,
"Adverbial" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the instrumental for the dative shen?
| SELECT "Instrumental" FROM table_46630 WHERE "Dative" = 'shen' | wikisql |
CREATE TABLE table_52382 (
"Hand" text,
"1 credit" text,
"2 credits" text,
"3 credits" text,
"4 credits" text,
"5 credits" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which hand results in a 2 credits of 16?
| SELECT "Hand" FROM table_52382 WHERE "2 credits" = '16' | wikisql |
CREATE TABLE table_name_40 (
week_2 VARCHAR,
week_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the week 2 before Lara Leverence was week 3?
| SELECT week_2 FROM table_name_40 WHERE week_3 = "lara leverence" | sql_create_context |
CREATE TABLE table_name_67 (
builder VARCHAR,
wheels VARCHAR,
railway VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Builder when the wheels were 4-4-0 and the railway was GCR?
| SELECT builder FROM table_name_67 WHERE wheels = "4-4-0" AND railway = "gcr" | sql_create_context |
CREATE TABLE table_10210 (
"Rank" real,
"Stadium" text,
"Capacity" real,
"Location" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Gaelic Athletic Association stadium is located in Carrick-on-Shannon?
| SELECT "Stadium" FROM table_10210 WHERE "Location" = 'carrick-on-shannon' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
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 time_interval (
period text,
begin_time in... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1... | atis |
CREATE TABLE table_name_51 (
pick VARCHAR,
college_high_school_club VARCHAR,
round VARCHAR,
draft VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total pick number of the player from a round greater than 1, a draft before 2002, and with th... | SELECT COUNT(pick) FROM table_name_51 WHERE round > 1 AND draft < 2002 AND college_high_school_club = "western kentucky" | sql_create_context |
CREATE TABLE table_56056 (
"Year" real,
"Song Title" text,
"Movie" text,
"Music Director" text,
"Co-Singers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name of the song in Amma Cheppindi?
| SELECT "Song Title" FROM table_56056 WHERE "Movie" = 'amma cheppindi' | wikisql |
CREATE TABLE table_name_65 (
platform_s_ VARCHAR,
genre VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the platform for the game of the third-person shooter genre?
| SELECT platform_s_ FROM table_name_65 WHERE genre = "third-person shooter" | sql_create_context |
CREATE TABLE table_3908 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes we... | SELECT COUNT("Directed by") FROM table_3908 WHERE "Title" = 'I Wish I Was the Moon' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54390) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-24 month') GROUP BY prescriptions.dru... | mimic_iii |
CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Undergoes (
Patien... | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_27108 (
"Episode Number" real,
"Location" text,
"Original Airdate" text,
"Challenge Winner" text,
"Challenge" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the challenge for episode 28?
| SELECT "Challenge" FROM table_27108 WHERE "Episode Number" = '28' | wikisql |
CREATE TABLE table_name_6 (
dates_aired VARCHAR,
region_country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What dates did the episodes air in the United States?
| SELECT dates_aired FROM table_name_6 WHERE region_country = "united states" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.gender, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "42820" | mimicsql_data |
CREATE TABLE qtb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '云越彬' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 395.33) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '云越彬' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_C... | css |
CREATE TABLE table_name_97 (
against INTEGER,
losses VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number listed under against when there were 15 losses and more than 1 win?
| SELECT MAX(against) FROM table_name_97 WHERE losses = 15 AND wins > 1 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2156" | mimicsql_data |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6951170' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.