instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_25823 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the scores of the Wimbledon final matches wh... | SELECT "Score in the final" FROM table_25823 WHERE "Outcome" = 'Runner-up' AND "Championship" = 'Wimbledon' | wikisql |
CREATE TABLE table_name_31 (
pick__number VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick number for the player(s) drafted in round 8?
| SELECT pick__number FROM table_name_31 WHERE round = "round 8" | sql_create_context |
CREATE TABLE table_261642_3 (
c__nf_km_ VARCHAR,
r__ω_km_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the c (nf/km) when the r ( /km) is 463.59?
| SELECT c__nf_km_ FROM table_261642_3 WHERE r__ω_km_ = "463.59" | sql_create_context |
CREATE TABLE table_79895 (
"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 Attendance high on August 28?
| SELECT MAX("Attendance") FROM table_79895 WHERE "Date" = 'august 28' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_f... | 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 WHERE ((flight.departure_time <= 1900 AND flight.departure_... | atis |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text... | SELECT COUNT(1) AS nbe_answers, Questions.OwnerUserId AS "user_link", AVG(Answers.Score) AS A_score, AVG(Questions.Score) AS Q_score FROM Posts AS Questions, Posts AS Answers WHERE Questions.PostTypeId = 1 AND Answers.PostTypeId = 2 AND Answers.ParentId = Questions.Id AND Answers.OwnerUserId = '##UserId1##' GROUP BY Qu... | sede |
CREATE TABLE table_name_71 (
decision VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the decision of the Kings game when Chicago was the visiting team?
| SELECT decision FROM table_name_71 WHERE visitor = "chicago" | sql_create_context |
CREATE TABLE table_51348 (
"Player" text,
"Span" text,
"Start" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which spans had a drop of 0?
| SELECT "Span" FROM table_51348 WHERE "Drop" = '0' | wikisql |
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 All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home | nvbench |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | SELECT jybgb.KSBM, jybgb.KSMC 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 = '27615170' AND jybgb.BGRQ BETWEEN '2013-04-02' AND '2021-... | css |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | SELECT DATE(v.CreationDate) FROM Users AS u INNER JOIN Votes AS v ON v.UserId = u.Id WHERE u.Id IN (2, 3, 66, 121, 1409, 2000, 2926) GROUP BY DATE(v.CreationDate) ORDER BY DATE(v.CreationDate) DESC | sede |
CREATE TABLE APPELLATIONS (
Area VARCHAR,
Appelation VARCHAR
)
CREATE TABLE WINE (
Appelation VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the area of the appelation that produces the highest number of wines before the year o... | SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name DESC | nvbench |
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 lab (
subject_id text,
hadm_id text,
... | SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.name = "Bessie Giordano" | mimicsql_data |
CREATE TABLE table_train_85 (
"id" int,
"mini_mental_state_examination_mmse" int,
"elevated_serum_phenylalanine" int,
"elevated_creatinine" float,
"renal_disease" bool,
"geriatric_depression_scale_gds" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the table... | SELECT * FROM table_train_85 WHERE mini_mental_state_examination_mmse < 25 | criteria2sql |
CREATE TABLE table_65346 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tie no when Wimbledon is the home team?
| SELECT "Tie no" FROM table_65346 WHERE "Home team" = 'wimbledon' | wikisql |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_des... | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_9 (
state VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which state was Dai from?
| SELECT state FROM table_name_9 WHERE name = "dai" | 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 COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '1380649' AND t_kc22.SOC_SRT_DIRE_NM = '川石斛颗粒' | css |
CREATE TABLE table_66363 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses have 11 points?... | SELECT COUNT("Losses") FROM table_66363 WHERE "Points" = '11' | wikisql |
CREATE TABLE table_63396 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a constituency of 84?
| SELECT "Name" FROM table_63396 WHERE "Constituency number" = '84' | wikisql |
CREATE TABLE table_65043 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did Marienhof run, which featured Leonore Capell and lasted 10 years?
| SELECT "Years" FROM table_65043 WHERE "Soap Opera" = 'marienhof' AND "Duration" = '10 years' AND "Actor" = 'leonore capell' | wikisql |
CREATE TABLE table_30047613_13 (
streak VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games had they won or lost in a row on May 9?
| SELECT streak FROM table_30047613_13 WHERE date = "May 9" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'opium tincture' AND DATETIME(prescriptions.startdate, 'start of y... | mimic_iii |
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE Rating (
mID VARCHAR,
stars INTEGER
)
CREATE TABLE Reviewer (
rID VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the average rating star for each movie that are not reviewed by Brittany Harris.
| SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID | sql_create_context |
CREATE TABLE table_73329 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"National Open" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What league was involved in 2010?
| SELECT "League" FROM table_73329 WHERE "Year" = '2010' | wikisql |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule... | SELECT Date, COUNT(Date) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY COUNT(Date) | nvbench |
CREATE TABLE table_name_92 (
merconorte INTEGER,
superliga VARCHAR,
interliga VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least merconorte for interliga of 2 and matches more than 260 with superliga more than 7
| SELECT MIN(merconorte) FROM table_name_92 WHERE interliga = 2 AND matches > 260 AND superliga > 7 | sql_create_context |
CREATE TABLE table_1140074_2 (
pole_position VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the pole position with location being hockenheimring
| SELECT pole_position FROM table_1140074_2 WHERE location = "Hockenheimring" | sql_create_context |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '65887975' AND t_kc22.STA_DATE BETWEEN '2014-09-01' AND '2020-01-14' AND t_kc22.SELF_PAY_PRO < 0.41 | css |
CREATE TABLE table_name_49 (
decision VARCHAR,
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the decision of the game with an attendance greater than 19,883?
| SELECT decision FROM table_name_49 WHERE attendance > 19 OFFSET 883 | sql_create_context |
CREATE TABLE table_name_59 (
winner VARCHAR,
runner_up VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner from the United States the year Kimberly Kim was runner-up?
| SELECT winner FROM table_name_59 WHERE runner_up = "kimberly kim" AND country = "united states" | sql_create_context |
CREATE TABLE table_23183195_2 (
team VARCHAR,
overall_record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team's overal record is 22-11?
| SELECT team FROM table_23183195_2 WHERE overall_record = "22-11" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND procedures.short_title = "Int insert 1-cham, rate" | mimicsql_data |
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 * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8417883' AND gwyjzb.IN_HOSP_DATE BETWEEN '2014-10-07' AND '2015-04-15' AND gwyjzb.PERSON_NM LIKE '郑%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8417883' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2014-10-07' AND '2015-04-15' AND fgwyjzb.PERSON_NM LIKE '郑%' | css |
CREATE TABLE table_name_2 (
series VARCHAR,
game INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the series standing for games over 4?
| SELECT series FROM table_name_2 WHERE game > 4 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "30390" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE Documents (
document_id INTEGER,
document_type_code VARCHAR(10),
grant_id INTEGER,
sent_date DATETIME,
response_received_date DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)... | SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY date_to DESC | nvbench |
CREATE TABLE table_29931 (
"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.
-- Name t... | SELECT COUNT("Score") FROM table_29931 WHERE "Date" = 'January 12' | wikisql |
CREATE TABLE table_40746 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which television service has italian for its language?
| SELECT "Television service" FROM table_40746 WHERE "Language" = 'italian' | wikisql |
CREATE TABLE table_name_69 (
discovery___publication_of_name VARCHAR,
species VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the discovery/publication for red deer cave people
| SELECT discovery___publication_of_name FROM table_name_69 WHERE species = "red deer cave people" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_4 (
crowd VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people watch at Western Oval venue?
| SELECT COUNT(crowd) FROM table_name_4 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE table_2603017_2 (
b___bishop VARCHAR,
bc___beast_cadet VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is b - bishop where bc - beast cadet is gr - great dove?
| SELECT b___bishop FROM table_2603017_2 WHERE bc___beast_cadet = "GR - Great Dove" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2135" | mimicsql_data |
CREATE TABLE table_29723 (
"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.
-- Who we... | SELECT "Team" FROM table_29723 WHERE "Date" = 'January 17' | wikisql |
CREATE TABLE table_203_274 (
id number,
"church name" text,
"address" text,
"community" text,
"school" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- is our lady of loretto listed above or below the holy spirit ?
| SELECT (SELECT id FROM table_203_274 WHERE "church name" = 'our lady of loretto') < (SELECT id FROM table_203_274 WHERE "church name" = 'holy spirit') | squall |
CREATE TABLE table_name_51 (
date VARCHAR,
livery VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for the Operational Livery?
| SELECT date FROM table_name_51 WHERE livery = "operational" | sql_create_context |
CREATE TABLE table_28668784_1 (
city___town VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What town holds Stadion Zlatica?
| SELECT city___town FROM table_28668784_1 WHERE stadium = "Stadion Zlatica" | 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 jyjgzbb.YQBH, jyjgzbb.YQMC 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 = jyjgzbb.BG... | css |
CREATE TABLE table_23014685_1 (
area_damaged VARCHAR,
target VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What area was damaged when King Khalid Military City was targeted?
| SELECT area_damaged FROM table_23014685_1 WHERE target = "King Khalid Military City" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | 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 = '006-65715')) AND lab.labname = 'rdw' AND DATETIME(lab.labresulttime, 'start of year') =... | eicu |
CREATE TABLE table_name_76 (
dvd_set_release_date VARCHAR,
network VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When dis cbs release the DVD set?
| SELECT dvd_set_release_date FROM table_name_76 WHERE network = "cbs" | sql_create_context |
CREATE TABLE table_50180 (
"Show" text,
"Host(s)" text,
"Flagship" text,
"Market" text,
"iHeartRadio" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Flagship of the Show Hosted by Rover (Shane French)?
| SELECT "Flagship" FROM table_50180 WHERE "Host(s)" = 'rover (shane french)' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_59092 (
"Player" text,
"Country" text,
"Year(s) Won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Year(s) Won that has the Country of united states, and the Total larger than 152?... | SELECT "Year(s) Won" FROM table_59092 WHERE "Country" = 'united states' AND "Total" > '152' | wikisql |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Year, COUNT(Year) FROM exhibition ORDER BY COUNT(Year) DESC | nvbench |
CREATE TABLE table_name_96 (
location VARCHAR,
classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of Classification of T12?
| SELECT location FROM table_name_96 WHERE classification = "t12" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_32804 (
"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 home team when the home team score i... | SELECT "Home team" FROM table_32804 WHERE "Home team score" = '12.17 (89)' | wikisql |
CREATE TABLE table_57513 (
"Date of Issue" text,
"Theme" text,
"Design" text,
"Illustration" text,
"Paper Type" text,
"First Day Cover Cancellation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of Issue with a Theme with menta... | SELECT "Date of Issue" FROM table_57513 WHERE "Theme" = 'mental health' | wikisql |
CREATE TABLE table_56 (
"Year" real,
"Game or event" text,
"Date contested" text,
"League or governing body" text,
"Sport" text,
"Winning team" text,
"Losing team" text,
"Final score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What s... | SELECT "Sport" FROM table_56 WHERE "Final score" = '3-2' | wikisql |
CREATE TABLE table_203_61 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- nigeria has the most gold medals , but who has the most medals ove... | SELECT "nation" FROM table_203_61 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE volume (
Famous_Title VARCHAR,
Artist_ID VARCHAR
)
CREATE TABLE artist (
Famous_Title VARCHAR,
Artist_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the famous titles of artists that do not have any volume.
| SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume) | sql_create_context |
CREATE TABLE table_66970 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What races were Chi-Chi Rodriguez the runner-up in?
| SELECT "Tournament" FROM table_66970 WHERE "Runner(s)-up" = 'chi-chi rodriguez' | wikisql |
CREATE TABLE table_27146868_1 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2006 when 1997 is 6.8?
| SELECT 2006 FROM table_27146868_1 WHERE 1997 = "6.8" | sql_create_context |
CREATE TABLE table_38417 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player's pick number was 25?
| SELECT "Player" FROM table_38417 WHERE "Pick #" = '25' | wikisql |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar... | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'endotracheal tube - insertion') | eicu |
CREATE TABLE table_17657 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Total viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the title t... | SELECT "Directed by" FROM table_17657 WHERE "Written by" = 'Adam Milch' | wikisql |
CREATE TABLE table_name_83 (
consistency_ VARCHAR,
_participation VARCHAR,
pareto_efficiency VARCHAR,
condorcet VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the consistency & participation when pareto efficiency is yes and condorcet is no?
| SELECT consistency_ & _participation FROM table_name_83 WHERE pareto_efficiency = "yes" AND condorcet = "no" | sql_create_context |
CREATE TABLE table_18330 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the district that has Bob Wilson as an incumbent?
| SELECT "District" FROM table_18330 WHERE "Incumbent" = 'Bob Wilson' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road | nvbench |
CREATE TABLE table_name_67 (
ranking INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest ranking for Paul Mctiernan?
| SELECT MIN(ranking) FROM table_name_67 WHERE name = "paul mctiernan" | sql_create_context |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | SELECT Name, Capacity FROM cinema ORDER BY Name DESC | nvbench |
CREATE TABLE table_name_34 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game on February 8?
| SELECT score FROM table_name_34 WHERE date = "february 8" | sql_create_context |
CREATE TABLE table_28985631_1 (
defective_year VARCHAR,
numbered_month VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the defective year for the eighth numbered month?
| SELECT defective_year FROM table_28985631_1 WHERE numbered_month = "Eighth" | sql_create_context |
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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '5161684' AND qtb.IN_HOSP_DATE BETWEEN '2000-11-17' AND '2007-11-12' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '5161684' AND gyb.IN_HOSP_DATE BETWEEN '2000-11-17' AND '2007-11-12' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '5161684' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_name_19 (
opponent VARCHAR,
result VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What opponent did they have a bye result against before week 14?
| SELECT opponent FROM table_name_19 WHERE result = "bye" AND week < 14 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME | nvbench |
CREATE TABLE table_name_11 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has theoir home games in the venue of gold coast convention centre?
| SELECT home_team FROM table_name_11 WHERE venue = "gold coast convention centre" | sql_create_context |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations | nvbench |
CREATE TABLE table_68838 (
"Original title" text,
"Title in English" text,
"Genre" text,
"Role" text,
"Directed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Genre did S ndor Sim direct?
| SELECT "Genre" FROM table_68838 WHERE "Directed by" = 'sándor simó' | wikisql |
CREATE TABLE table_16527640_2 (
rank_held_at_time_of_death VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players named paddy rowan?
| SELECT COUNT(rank_held_at_time_of_death) FROM table_16527640_2 WHERE player = "Paddy Rowan" | sql_create_context |
CREATE TABLE table_10335_1 (
current_country_of_location VARCHAR,
operational VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the current country of location with operational period of summer of 1941 to 28 june 1944
| SELECT current_country_of_location FROM table_10335_1 WHERE operational = "Summer of 1941 to 28 June 1944" | sql_create_context |
CREATE TABLE table_23799417_2 (
title VARCHAR,
original_airing VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the episode title on original air date of September 30, 2007?
| SELECT title FROM table_23799417_2 WHERE original_airing = "September 30, 2007" | sql_create_context |
CREATE TABLE table_name_17 (
foundation VARCHAR,
enterprise VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Foundation has an Enterprise of 2?
| SELECT foundation FROM table_name_17 WHERE enterprise = "2" | sql_create_context |
CREATE TABLE table_2102782_1 (
broadcast_date VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the broadcast date for run timke of 25:04
| SELECT broadcast_date FROM table_2102782_1 WHERE run_time = "25:04" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT 'site://tags/' + TargetTagName + '/synonyms|' + TargetTagName AS "vote4me", COUNT(SourceTagName) AS "synonyms" FROM TagSynonyms AS TS WHERE ApprovalDate IS NULL AND (SELECT SUM(CASE V.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 END) FROM Tags AS T, PostTags AS Pt, Posts AS P, Votes AS V, VoteTypes AS Vt WHERE T.Id =... | sede |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 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.PERSON_NM = '杨文彬' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE table_28194879_1 (
_number VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number in season of the episode whose production code is pabf05?
| SELECT _number FROM table_28194879_1 WHERE production_code = "PABF05" | sql_create_context |
CREATE TABLE table_name_96 (
wins INTEGER,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of wins of someone who has 2 losses?
| SELECT MIN(wins) FROM table_name_96 WHERE losses = 2 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | SELECT Users.DisplayName, COUNT(*) AS AcceptedAnswers FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Posts AS questions ON questions.Id = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND questions.Accept... | sede |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologyevents.... | mimic_iii |
CREATE TABLE table_53941 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT SUM("Played") FROM table_53941 WHERE "Position" < '9' AND "Draws" > '19' AND "Goals against" > '27' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
sp... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85407) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "JEHOVAH'S WITNESS" AND demographic.age < "59" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.