instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_78432 (
"Track" real,
"Recorded" text,
"Catalogue" text,
"Release Date" text,
"Song Title" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which song was released 12/8/70 with a time of 2:54?
| SELECT "Song Title" FROM table_78432 WHERE "Release Date" = '12/8/70' AND "Time" = '2:54' | wikisql |
CREATE TABLE table_name_32 (
surface VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of surface was the Tournament at Sunderland played on?
| SELECT surface FROM table_name_32 WHERE tournament = "sunderland" | sql_create_context |
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
CREATE TABLE table_204_243 (
id number,
"year" number,
"album" text,
"song" text,
"duration" text,
"artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was the song healing or the song boys and girls with trax ?
| SELECT "song" FROM table_204_243 WHERE "song" IN ('"healing"', '"boys & girls"') AND "artist" = 'with trax' | squall |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID... | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID | nvbench |
CREATE TABLE table_name_57 (
music VARCHAR,
results VARCHAR,
choreographer_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which music led to a safe result and was choreographed by Jason Gilkison?
| SELECT music FROM table_name_57 WHERE results = "safe" AND choreographer_s_ = "jason gilkison" | sql_create_context |
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of_day text
)
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
... | SELECT name FROM program ORDER BY launch DESC LIMIT 1 | spider |
CREATE TABLE table_4518 (
"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 lowest attendance when the home team ... | SELECT MIN("Crowd") FROM table_4518 WHERE "Home team score" = '10.14 (74)' | wikisql |
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 mzjzjlb.JZLSH 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_info_mzj... | css |
CREATE TABLE table_name_93 (
winning_driver VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winning driver in 1956?
| SELECT winning_driver FROM table_name_93 WHERE year = "1956" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "S/P FALL" | 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_NM = '姜和畅' AND t_kc22.STA_DATE BETWEEN '2006-08-01' AND '2016-01-03' AND t_kc22.SELF_PAY_AMO > 7190.67 | css |
CREATE TABLE table_name_62 (
parishes INTEGER,
pastoral_region VARCHAR,
cemeteries VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Parishes in Merrimack which has 4 Cemeteries?
| SELECT MIN(parishes) FROM table_name_62 WHERE pastoral_region = "merrimack" AND cemeteries < 4 | sql_create_context |
CREATE TABLE table_name_24 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the attendance for july 16
| SELECT attendance FROM table_name_24 WHERE date = "july 16" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "SEPSIS" | mimicsql_data |
CREATE TABLE customers (
id number,
first_name text,
last_name text,
company text,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text,
support_rep_id number
)
CREATE TABLE playlists (
id number,
name text
)
... | SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' | spider |
CREATE TABLE table_name_82 (
binary VARCHAR,
pairing VARCHAR,
binomial VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Pairing of (1), and a Binomial of (1) is what binary?
| SELECT binary FROM table_name_82 WHERE pairing = "θ(1)" AND binomial = "θ(1)" | sql_create_context |
CREATE TABLE table_name_84 (
label VARCHAR,
region VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Label has the Region of Australia?
| SELECT label FROM table_name_84 WHERE region = "australia" | sql_create_context |
CREATE TABLE table_80120 (
"Team" text,
"Manager" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team does David O'leary manage?
| SELECT "Team" FROM table_80120 WHERE "Manager" = 'david o''leary' | wikisql |
CREATE TABLE table_203_375 (
id number,
"name" text,
"year built" text,
"country" text,
"town" text,
"height" text,
"remarks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many metres is the mississippi aerial river transit from bottom ... | SELECT "height" FROM table_203_375 WHERE "name" = 'mississippi aerial river transit' | squall |
CREATE TABLE table_23466021_4 (
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance?
| SELECT MAX(attendance) FROM table_23466021_4 | sql_create_context |
CREATE TABLE table_37820 (
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2011/ 12 has a 2006/ 07 of ... | SELECT "2011/ 12" FROM table_37820 WHERE "2006/ 07" = 'not held' AND "2008/ 09" = 'not held' AND "2012/ 13" = 'dnq' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | WITH BountyCloses AS (SELECT COUNT(*) AS Amount FROM Votes WHERE VoteTypeId = 9), BountyAwards AS (SELECT COUNT(*) AS Amount FROM Votes INNER JOIN Posts ON (Votes.PostId = Posts.Id) WHERE VoteTypeId = 9 AND NOT Posts.ParentId IS NULL) SELECT BountyCloses.Amount AS ClosedBounties, BountyAwards.Amount AS AwardedBounties,... | sede |
CREATE TABLE table_name_81 (
name VARCHAR,
grid VARCHAR,
laps VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the driver who went 46 laps had less than 9 points and had a grid number under 12?
| SELECT name FROM table_name_81 WHERE laps = 46 AND points < 9 AND grid < 12 | sql_create_context |
CREATE TABLE table_name_41 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Laps have a Time/Retired of +23.215, and a Grid larger than 11?
| SELECT MIN(laps) FROM table_name_41 WHERE time_retired = "+23.215" AND grid > 11 | sql_create_context |
CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Primary_Conference text,
building_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest... | SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY SUM(Enrollment) DESC | nvbench |
CREATE TABLE table_10295819_1 (
singles_w_l VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Singles W-L for the players named Laurynas Grigelis?
| SELECT singles_w_l FROM table_10295819_1 WHERE player = "Laurynas Grigelis" | sql_create_context |
CREATE TABLE scientists (
ssn number,
name text
)
CREATE TABLE projects (
code text,
name text,
hours number
)
CREATE TABLE assignedto (
scientist number,
project text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name and hours of pr... | SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_38659 (
"NTFA Div 2" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Of the teams that had more than 0 byes, what was the total number of losses?
| SELECT COUNT("Losses") FROM table_38659 WHERE "Byes" < '0' | wikisql |
CREATE TABLE table_name_58 (
venue VARCHAR,
extra VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue had less than 7.4 extra and the result of 4th?
| SELECT venue FROM table_name_58 WHERE extra < 7.4 AND result = "4th" | sql_create_context |
CREATE TABLE table_16366 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the writers for the ti... | SELECT "Writer(s)" FROM table_16366 WHERE "Title" = 'Boxing Sydney' | wikisql |
CREATE TABLE table_name_55 (
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the director of the episode written by robin schwartz & robert tarlow?
| SELECT directed_by FROM table_name_55 WHERE written_by = "robin schwartz & robert tarlow" | sql_create_context |
CREATE TABLE table_51199 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the call sign for the translator with an ERP W larger than 1... | SELECT "Call sign" FROM table_51199 WHERE "ERP W" > '10' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Sex, AVG(Height) FROM people GROUP BY Sex | nvbench |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY AVG(Num_Employees) | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 15 AND date_day.month_number = 9 AND da... | atis |
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 CLINIC_ID FROM t_kc24 WHERE MED_CLINIC_ID = '36202473494' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'sodium chloride 0.9 % iv 1000 ml bag') | eicu |
CREATE TABLE table_name_78 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many were in attendance during week 12?
| SELECT attendance FROM table_name_78 WHERE week = 12 | sql_create_context |
CREATE TABLE table_44547 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Tournament, when 1996 is '1R', and when 1990 is 'SF... | SELECT "Tournament" FROM table_44547 WHERE "1996" = '1r' AND "1990" = 'sf' | wikisql |
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots text,
needed text,
votes text,
inducted text,
category text,
needed... | SELECT name_first, name_last FROM player ORDER BY birth_year DESC LIMIT 1 | thehistoryofbaseball |
CREATE TABLE table_name_60 (
date VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game played at rich stadium?
| SELECT date FROM table_name_60 WHERE game_site = "rich stadium" | sql_create_context |
CREATE TABLE table_39110 (
"Tournament" text,
"1998" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using val... | SELECT "Tournament" FROM table_39110 WHERE "2001" = '2–4' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | SELECT Id AS "post_link", Tags FROM Posts WHERE Id IN (SELECT ParentId FROM Posts WHERE ParentId IN (SELECT Q.Id FROM Posts AS Q INNER JOIN Posts AS A ON (A.ParentId = Q.Id) WHERE Q.PostTypeId = 1 AND A.PostTypeId = 2 AND Q.OwnerUserId = '##UserId##' AND A.Score <= 0 AND Q.AcceptedAnswerId IS NULL AND DATEDIFF(day, Q.C... | sede |
CREATE TABLE table_77799 (
"Player" text,
"Club" text,
"League" real,
"Play-offs" real,
"FA Cup" real,
"FA Trophy" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What mean total had a league number of 18, Richard Logan as a pla... | SELECT AVG("Total") FROM table_77799 WHERE "League" = '18' AND "Player" = 'richard logan' AND "Play-offs" < '1' | wikisql |
CREATE TABLE table_name_2 (
year VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Burning Roma the winner?
| SELECT year FROM table_name_2 WHERE winner = "burning roma" | sql_create_context |
CREATE TABLE table_57495 (
"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.
-- On what date did the home team score 22.11 (143)... | SELECT "Date" FROM table_57495 WHERE "Home team score" = '22.11 (143)' | wikisql |
CREATE TABLE table_11839306_2 (
japanese_title VARCHAR,
english_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Japanese title for Fantasy?
| SELECT japanese_title FROM table_11839306_2 WHERE english_title = "Fantasy" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sinus tachycardia' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start ... | eicu |
CREATE TABLE table_53636 (
"City" text,
"1970" real,
"1980" real,
"1990" real,
"2000" real,
"2010 est." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Of 2010 est. with less than 171,750 and 2000 less than 131,714, what is the 1970 population av... | SELECT AVG("1970") FROM table_53636 WHERE "2010 est." = '171,750' AND "2000" < '131,714' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id nu... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'partial ost... | mimic_iii |
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_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '86166671596' | css |
CREATE TABLE dependent (
essn number,
dependent_name text,
sex text,
bdate text,
relationship text
)
CREATE TABLE employee (
fname text,
minit text,
lname text,
ssn number,
bdate text,
address text,
sex text,
salary number,
super_ssn number,
dno number
)
CRE... | SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston' | spider |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, offering_instructor AS OFFERING_INSTRUCTOR_0, offering_instructor AS OFFERING_INSTRUCTOR_1, offering_instructor AS OFFERING_INSTRUCTOR_2 WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND OFFERING_INSTRUCTO... | advising |
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 COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '0869043' GROUP BY qtb.MED_ORG_DEPT_CD HAVING MIN(qtb.IN_HOSP_DAYS) > 21 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '0869043' GROUP BY gyb.MED_ORG_DEPT_CD HAVING MIN(gyb.IN_HOSP_DAYS) > 21 UNION SELECT zyb.MED... | css |
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 COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '牙体牙髓科' AND STA_DATE BETWEEN '2000-06-19' AND '2009-11-02' AND SOC_SRT_DIRE_NM = '利培酮片(薄膜衣)' | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE T... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%turkey%' OR UPPER(Location) LIKE '%TR' OR UPPER(Location) LIKE 'ISTANBUL' OR LOWER(Location) LIKE 'istanbul' OR UPPER(Location) LIKE 'IZMIR' OR LOWER(Location) LIKE 'izmir' OR UPPER(Location... | 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 demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.name = "Hector Blair" | mimicsql_data |
CREATE TABLE table_52326 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest grid for Bob Anderson?
| SELECT MIN("Grid") FROM table_52326 WHERE "Driver" = 'bob anderson' | wikisql |
CREATE TABLE table_40804 (
"Verb" text,
"Proto-Austronesian" text,
"Proto-Malayo-Polynesian" text,
"Proto-Oceanic" text,
"Proto-Polynesian" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Proto-Oceanic verb for to die, be dead?
| SELECT "Proto-Oceanic" FROM table_40804 WHERE "Verb" = 'to die, be dead' | wikisql |
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ventilator wean... | eicu |
CREATE TABLE table_25459168_2 (
pole_position VARCHAR,
supporting VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who got the pole position if the supporting is USAC National Midget Series?
| SELECT pole_position FROM table_25459168_2 WHERE supporting = "USAC National Midget Series" | sql_create_context |
CREATE TABLE table_2417445_4 (
reason_for_vacancy VARCHAR,
vacator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When frederick remann (r) is the vacator what is the reason for vacancy?
| SELECT reason_for_vacancy FROM table_2417445_4 WHERE vacator = "Frederick Remann (R)" | sql_create_context |
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,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'N83.862' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
pro... | SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in) | nvbench |
CREATE TABLE table_3970 (
"Proceed to Quarter-final" text,
"Match points" text,
"Aggregate score" text,
"Points margin" real,
"Eliminated from competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was eliminated from the competition when c... | SELECT "Eliminated from competition" FROM table_3970 WHERE "Proceed to Quarter-final" = 'Connacht' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6000894' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
CREATE TABLE table_66430 (
"Millewa" text,
"Wins" real,
"Forfeits" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Losses have a Millewa of nangiloc?
| SELECT COUNT("Losses") FROM table_66430 WHERE "Millewa" = 'nangiloc' | wikisql |
CREATE TABLE table_name_72 (
team VARCHAR,
qual_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team had a qual 1 of 59.895?
| SELECT team FROM table_name_72 WHERE qual_1 = "59.895" | sql_create_context |
CREATE TABLE table_77927 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum total of picks for drake players from the tri-cit... | SELECT SUM("Pick") FROM table_77927 WHERE "Team" = 'tri-cities blackhawks' AND "College" = 'drake' | wikisql |
CREATE TABLE table_50782 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text... | SELECT "2006" FROM table_50782 WHERE "1990" = 'grand slam tournaments' | wikisql |
CREATE TABLE table_name_44 (
class VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class's call sign is wokg?
| SELECT class FROM table_name_44 WHERE call_sign = "wokg" | sql_create_context |
CREATE TABLE table_57746 (
"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.
-- If the Away team score was 15.20 (110), what was... | SELECT "Home team" FROM table_57746 WHERE "Away team score" = '15.20 (110)' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fa... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTI... | atis |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 59275 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_2562572_19 (
settlement VARCHAR,
population__2011_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what settlement is the population 1114?
| SELECT settlement FROM table_2562572_19 WHERE population__2011_ = 1114 | sql_create_context |
CREATE TABLE table_17413485_1 (
graemes_guest VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the graemest guest of episode 1x03
| SELECT graemes_guest FROM table_17413485_1 WHERE episode = "1x03" | sql_create_context |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,... | SELECT T2.name FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T1.county = "Monterey" AND T2.price < 50 | spider |
CREATE TABLE table_29680 (
"Tournament" text,
"Games played" real,
"Points per game" text,
"Rebounds per game" text,
"Assists per game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rebounds per game did he have at the 2003 eurobasket?
| SELECT "Rebounds per game" FROM table_29680 WHERE "Tournament" = '2003 EuroBasket' | wikisql |
CREATE TABLE table_2249029_1 (
world_rank INTEGER,
asian_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most world rank for asian rank being 31
| SELECT MAX(world_rank) FROM table_2249029_1 WHERE asian_rank = 31 | sql_create_context |
CREATE TABLE table_43144 (
"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.
-- Which men's singles has a women's singles of marke... | SELECT "Men's singles" FROM table_43144 WHERE "Women's singles" = 'marketa koudelková' AND "Men's doubles" = 'jan lanik / pavel weigner' | wikisql |
CREATE TABLE table_24673888_1 (
power_kw VARCHAR,
location__transmitter_site_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power in KW of the transmitter situated in Borongan?
| SELECT power_kw FROM table_24673888_1 WHERE location__transmitter_site_ = "Borongan" | sql_create_context |
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '曹斌蔚' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2013-12-22' UNI... | css |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname va... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC | scholar |
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 PostsWithDeleted (
Id number,
PostTyp... | SELECT q.Id AS "Question Id", q.Id AS "post_link", q.OwnerUserId AS "user_link", a.Id AS "Answer Id", a.Id AS "post_link", a.OwnerUserId AS "user_link" FROM Posts AS q, Posts AS a WHERE q.OwnerUserId = '##QuestionOwnerId:int##' AND a.OwnerUserId = '##AnswerOwnerId:int##' AND a.ParentId = q.Id | sede |
CREATE TABLE table_name_38 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the away team score at Moorabbin oval?
| SELECT away_team AS score FROM table_name_38 WHERE venue = "moorabbin oval" | sql_create_context |
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE ... | SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus | spider |
CREATE TABLE table_73858 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Jockey" text,
"Winner/2nd" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the weight for 56.5 ... | SELECT "Race" FROM table_73858 WHERE "Weight (kg)" = '56.5' | wikisql |
CREATE TABLE table_29326 (
"Greek national account" text,
"1970" text,
"1980" text,
"1990" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001 1" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
... | SELECT "Greek national account" FROM table_29326 WHERE "1997" = '6.1' | wikisql |
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 demographic.admission_location, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "81254" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 17505 AND STRFTIME('%y', admissions.admittime) <= '2102' ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Year, SUM(AVG(Price)) FROM wine ORDER BY SUM(AVG(Price)) DESC | nvbench |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Visualize a... | SELECT Class, COUNT(*) FROM race GROUP BY Class | nvbench |
CREATE TABLE table_name_13 (
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the place for costantino rocca?
| SELECT place FROM table_name_13 WHERE player = "costantino rocca" | sql_create_context |
CREATE TABLE table_45455 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school or team is in a round below 5 with a pick of 2?
| SELECT "School/Club Team" FROM table_45455 WHERE "Round" < '5' AND "Pick" = '2' | wikisql |
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- L... | SELECT class FROM race GROUP BY class HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_69321 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of long Dubose, E., who had 0 losses, a gain less than 17, and an avg/g bigger than 0, had... | SELECT COUNT("Long") FROM table_69321 WHERE "Loss" = '0' AND "Gain" < '17' AND "Avg/G" > '0' AND "Name" = 'dubose, e.' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.