instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_13 (
attendance VARCHAR,
result VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total attendance with a result of W 31-21 before week 9?
| SELECT COUNT(attendance) FROM table_name_13 WHERE result = "w 31-21" AND week < 9 | sql_create_context |
CREATE TABLE table_35557 (
"Date" text,
"Placing" text,
"Beat by" text,
"Location" text,
"Distance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who beat Chic by 8fm?
| SELECT "Beat by" FROM table_35557 WHERE "Distance" = '8fm' | wikisql |
CREATE TABLE table_19760_1 (
mind VARCHAR,
reason VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mind of the one that has qut reason?
| SELECT mind FROM table_19760_1 WHERE reason = "qut" | sql_create_context |
CREATE TABLE table_30085 (
"\u2116" real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" 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.
-- Who direct... | SELECT "Directed by" FROM table_30085 WHERE "Production code" = '3X6116' | wikisql |
CREATE TABLE table_51844 (
"Rank" real,
"Name" text,
"Wins" real,
"Losses" real,
"Pct." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of wins a manager with more than 0.526 pct., ranked higher than 37, and 947 losses has?
| SELECT MIN("Wins") FROM table_51844 WHERE "Pct." > '0.526' AND "Rank" < '37' AND "Losses" = '947' | wikisql |
CREATE TABLE table_1031 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player scored 14 touchdowns?
| SELECT "Player" FROM table_1031 WHERE "Touchdowns" = '14' | wikisql |
CREATE TABLE table_name_77 (
competition VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which competition led to a total weight of 428kg?
| SELECT competition FROM table_name_77 WHERE total = "428kg" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "RUQ PAIN" | 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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '许文德' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-05-22' AND '2007-09-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb... | css |
CREATE TABLE table_name_96 (
home_ground VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home ground for the team located in Canterbury?
| SELECT home_ground FROM table_name_96 WHERE location = "canterbury" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | SELECT p.Id AS "post_link", CASE h.Comment WHEN '2' THEN 'off topic' WHEN '3' THEN 'not constructive' WHEN '4' THEN 'not a real question' WHEN '7' THEN 'too localized' WHEN '10' THEN 'general reference' WHEN '20' THEN 'noise' ELSE h.Comment END AS Reason FROM Posts AS p INNER JOIN PostHistory AS h ON h.PostId = p.Id AN... | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_78046 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the winner when the trofeo fast team is carrera jeans-vagab... | SELECT "Winner" FROM table_78046 WHERE "Trofeo Fast Team" = 'carrera jeans-vagabond' AND "Stage" = '5' | wikisql |
CREATE TABLE table_29028 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Podiums" real,
"F/Laps" real,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How ... | SELECT COUNT("F/Laps") FROM table_29028 WHERE "Points" = '170' | wikisql |
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15),
document_type_description VARCHAR(255)
)
CREATE TABLE Circulation_History (
document_id INTEGER,
draft_number INTEGER,
copy_number INTEGER,
employee_id INTEGER
)
CREATE TABLE Document_Drafts (
document_id INTEGER,
draft_num... | SELECT receipt_date, COUNT(receipt_date) FROM Documents | nvbench |
CREATE TABLE table_65727 (
"Title" text,
"Series" text,
"Director" text,
"Characters" text,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the characters from the movie Suppressed Duck?
| SELECT "Characters" FROM table_65727 WHERE "Title" = 'suppressed duck' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_fli... | 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 = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat... | atis |
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, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_23 (
round VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Round din Ullevaal?
| SELECT round FROM table_name_23 WHERE venue = "ullevaal" | sql_create_context |
CREATE TABLE table_name_72 (
gold INTEGER,
total VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of gold medals with a total of 12 medals and less than 4 bronze medals?
| SELECT SUM(gold) FROM table_name_72 WHERE total = 12 AND bronze < 4 | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '93164034335' | css |
CREATE TABLE table_name_63 (
rank VARCHAR,
nation VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank of the Nation of Germany when the Total is more than 2?
| SELECT COUNT(rank) FROM table_name_63 WHERE nation = "germany" AND total > 2 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGD... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '3461022' AND RYDJSJ > '2003-06-23' | css |
CREATE TABLE table_203_376 (
id number,
"no." number,
"name" text,
"term of office" text,
"president(s) served under" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long did bob martinez serve as director ?
| SELECT "term of office" - "term of office" FROM table_203_376 WHERE "name" = 'bob martinez' | squall |
CREATE TABLE table_78121 (
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is at 8:00 when at 8:30 it is my thursday night movie?
| SELECT "8:00" FROM table_78121 WHERE "8:30" = 'my thursday night movie' | wikisql |
CREATE TABLE table_name_82 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on August 8?
| SELECT score FROM table_name_82 WHERE date = "august 8" | sql_create_context |
CREATE TABLE table_name_62 (
title VARCHAR,
track VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is track 6's title?
| SELECT title FROM table_name_62 WHERE track = 6 | sql_create_context |
CREATE TABLE table_14891 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average goals conceded with draw ... | SELECT AVG("Goals Conceded") FROM table_14891 WHERE "Draw" > '7' AND "Goals Scored" > '24' | wikisql |
CREATE TABLE table_name_52 (
points VARCHAR,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of points combined from the teams that played over 14 games?
| SELECT COUNT(points) FROM table_name_52 WHERE played > 14 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND demographic.age < "51" | mimicsql_data |
CREATE TABLE table_28137918_5 (
new_adherents_per_year VARCHAR,
religion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the new adherents per year for buddhism
| SELECT new_adherents_per_year FROM table_28137918_5 WHERE religion = "Buddhism" | sql_create_context |
CREATE TABLE table_name_82 (
overall INTEGER,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Overall has a Position of te, and a Round larger than 5?
| SELECT AVG(overall) FROM table_name_82 WHERE position = "te" AND round > 5 | 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.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.dod_year <= "2168.0" | mimicsql_data |
CREATE TABLE table_49269 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Longitude of the 61.0s Latitude?
| SELECT "Longitude" FROM table_49269 WHERE "Latitude" = '61.0s' | wikisql |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
... | SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY intakeoutput.celllabel) AS ... | eicu |
CREATE TABLE table_name_19 (
country VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country of the contestant with a swimsuit of 9.46?
| SELECT country FROM table_name_19 WHERE swimsuit = 9.46 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_i... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95088) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_16628 (
"Crew" real,
"Open 1st VIII" text,
"Open 2nd VIII" text,
"Open 3rd VIII" text,
"U16 1st VIII" text,
"U16 2nd VIII" text,
"U16 3rd VIII" text,
"U15 1st IV" text,
"U15 2nd IV" text,
"U15 3rd IV" text,
"U15 4th IV" text,
"U15 5th IV" text,
"U15... | SELECT "U15 3rd IV" FROM table_16628 WHERE "U15 4th IV" = 'BBC' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '金正志' AND hz_info.YLJGDM = '8629178' AND NOT zyjzjlb.CYKSMC LIKE '%胃肠%' | css |
CREATE TABLE table_44921 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the venue for the dates 7,8,10,11 Feb 1908?
| SELECT "Venue" FROM table_44921 WHERE "Date" = '7,8,10,11 feb 1908' | wikisql |
CREATE TABLE table_name_37 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the score on 22 august 2012
| SELECT score FROM table_name_37 WHERE date = "22 august 2012" | 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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.dod_year <= "2183.0" | mimicsql_data |
CREATE TABLE table_name_77 (
city_of_license VARCHAR,
class VARCHAR,
identifier VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has a C1 class and Identifier of CBCD-FM?
| SELECT city_of_license FROM table_name_77 WHERE class = "c1" AND identifier = "cbcd-fm" | sql_create_context |
CREATE TABLE table_23097214_1 (
directed_by VARCHAR,
season__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many directors directed episode 3 of the season?
| SELECT COUNT(directed_by) FROM table_23097214_1 WHERE season__number = 3 | sql_create_context |
CREATE TABLE table_9580 (
"Name" text,
"Rank" text,
"Tenure" text,
"Date of death" text,
"Cause of death" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is gunfire victim Maria Cecilia Rosa with 6 years of Tenure Date of Death?
| SELECT "Date of death" FROM table_9580 WHERE "Cause of death" = 'gunfire' AND "Tenure" = '6 years' AND "Name" = 'maria cecilia rosa' | wikisql |
CREATE TABLE table_66951 (
"Year" real,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did the Nashville Metros have the Regular Season 2nd, central?
| SELECT "Year" FROM table_66951 WHERE "Regular Season" = '2nd, central' | wikisql |
CREATE TABLE table_train_142 (
"id" int,
"allergy_to_monoclonal_antibodies" bool,
"allergic_reactions" bool,
"allergy_to_methylprednisolone" bool,
"mini_mental_state_examination_mmse" int,
"depressed_mood" bool,
"urea_cycle_disorder" bool,
"clinical_contraindication_use_valproate" bool,
... | SELECT * FROM table_train_142 WHERE body_mass_index_bmi < 38 AND body_weight > 48 | criteria2sql |
CREATE TABLE table_80442 (
"D 48 +" text,
"D 47 +" text,
"D 46 +" text,
"D 45 O" text,
"D 44 O" text,
"D 43 \u221a" text,
"D 42 \u221a" text,
"D 41 \u221a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value of D 46 +, when ... | SELECT "D 46 +" FROM table_80442 WHERE "D 42 \u221a" = 'r 2' | wikisql |
CREATE TABLE table_59435 (
"Season" text,
"Round" text,
"Date" text,
"Home" text,
"Away" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round on 26 August 1995?
| SELECT "Round" FROM table_59435 WHERE "Date" = '26 august 1995' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
insuranc... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63849) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt') AND STRFTIME('%y-%m', labevents.charttime) >= '2103-11' ORDER BY labevents... | mimic_iii |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM zyjzjlb WHERE JZKSMC = '中医推拿科' AND RYDJSJ BETWEEN '2004-10-25' AND '2011-05-02' | css |
CREATE TABLE table_36322 (
"Rank" real,
"Time" real,
"Athlete" text,
"Nation" text,
"Date" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Date of 7 september 1996 includes which highest rank athlete?
| SELECT MAX("Rank") FROM table_36322 WHERE "Date" = '7 september 1996' | wikisql |
CREATE TABLE table_24521 (
"Period" real,
"Civilians" text,
"Security forces" text,
"Insurgents" text,
"Total per period" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many insurgents are there when the total per period is 156?
| SELECT "Insurgents" FROM table_24521 WHERE "Total per period" = '156' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE tr... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'intussusception') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26175) AND DATETIME(diagno... | mimic_iii |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9028795' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '90287... | css |
CREATE TABLE table_name_97 (
enrollment VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total enrollment at Laville?
| SELECT COUNT(enrollment) FROM table_name_97 WHERE school = "laville" | sql_create_context |
CREATE TABLE table_41025 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the RECNet belonging to Class A with a Power of 3,000 watts?
| SELECT "RECNet" FROM table_41025 WHERE "Class" = 'a' AND "Power" = '3,000 watts' | wikisql |
CREATE TABLE table_39608 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament was played in NH in 2011?
| SELECT "Tournament" FROM table_39608 WHERE "2011" = 'nh' | wikisql |
CREATE TABLE table_203_424 (
id number,
"year" number,
"starts" number,
"wins" number,
"top 5" number,
"top 10" number,
"poles" number,
"avg. start" number,
"avg. finish" number,
"winnings" text,
"position" text,
"team(s)" text
)
-- Using valid SQLite, answer the follow... | SELECT MAX("winnings") - MIN("winnings") FROM table_203_424 | squall |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-66442')) AND medication.drugname = '30 ml cup : alum & mag hydroxide-s... | eicu |
CREATE TABLE table_name_46 (
apogee VARCHAR,
mission VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Apogee has a Mission of maxus 3?
| SELECT apogee FROM table_name_46 WHERE mission = "maxus 3" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE table_name_22 (
constructor VARCHAR,
driver VARCHAR,
time_retired VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constructor had a Time/Retired of collision, where the grid number was less than 18 and Nick Heidfeld wa... | SELECT constructor FROM table_name_22 WHERE time_retired = "collision" AND grid < 18 AND driver = "nick heidfeld" | sql_create_context |
CREATE TABLE table_23465864_5 (
tues_25_aug VARCHAR,
fri_28_aug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value on Tuesday August 25 if August Friday 28 is 23' 54.54 94.684mph?
| SELECT tues_25_aug FROM table_23465864_5 WHERE fri_28_aug = "23' 54.54 94.684mph" | sql_create_context |
CREATE TABLE table_22696 (
"Rank" real,
"Peak" text,
"Country" text,
"Island" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 44 is the col in meters what is the country?
| SELECT "Country" FROM table_22696 WHERE "Col (m)" = '44' | wikisql |
CREATE TABLE staff (
last_name VARCHAR,
email_address VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the last name of the staff whose email address contains 'wrau'.
| SELECT last_name FROM staff WHERE email_address LIKE "%wrau%" | sql_create_context |
CREATE TABLE table_2404 (
"Episode No." real,
"Series No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Viewers (millions)" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode that had... | SELECT "Written by" FROM table_2404 WHERE "Viewers (millions)" = '8.84' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 14211 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s... | mimic_iii |
CREATE TABLE table_76031 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the largest cuts made when the events are less than 21?... | SELECT MAX("Cuts made") FROM table_76031 WHERE "Events" < '21' | wikisql |
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
region_id number,
region_name text,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE party (
party_id number,
minister text... | SELECT COUNT(DISTINCT party_name) FROM party | spider |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/HAITIAN" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '32447494988' | css |
CREATE TABLE table_35378 (
"Previous season" text,
"Team" text,
"Town" text,
"Arena (capacity)" text,
"Website" text,
"Head Coach" text,
"Foreign Players (max. 2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Website of Head Co... | SELECT "Website" FROM table_35378 WHERE "Head Coach" = 'yuriy korotkevich' | wikisql |
CREATE TABLE table_name_19 (
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did Japan place?
| SELECT place FROM table_name_19 WHERE country = "japan" | sql_create_context |
CREATE TABLE table_name_88 (
capacity INTEGER,
home_city VARCHAR,
manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the capacity when the home city is zagreb and the manager is zlatko kranj ar?
| SELECT AVG(capacity) FROM table_name_88 WHERE home_city = "zagreb" AND manager = "zlatko kranjčar" | sql_create_context |
CREATE TABLE table_name_21 (
team_classification VARCHAR,
general_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Kim Kirchen's team classification?
| SELECT team_classification FROM table_name_21 WHERE general_classification = "kim kirchen" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84042) AND prescriptions.drug = 'glycerin supps' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND S... | mimic_iii |
CREATE TABLE table_9819 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the laps with a grid less than 28, retirement time, and a ducati 1098 f08 bikes?
| SELECT SUM("Laps") FROM table_9819 WHERE "Grid" < '28' AND "Time" = 'retirement' AND "Bike" = 'ducati 1098 f08' | wikisql |
CREATE TABLE table_204_408 (
id number,
"nation" text,
"1986" text,
"1989" text,
"1991" text,
"1997" text,
"1999" text,
"2000" text,
"2003" text,
"2005" text,
"2007" text,
"2009" text,
"2011" text,
"years" number
)
-- Using valid SQLite, answer the following que... | SELECT "nation" FROM table_204_408 WHERE "2007" = 1 | squall |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varc... | 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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW... | atis |
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_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE category (
category_id TINYINT UNSIGNED,
name VARCHAR(25),
last_update TIMESTAMP
)
CREATE TABLE rental (
rental_id INT,
rental_date DATETIME,
inventory_id MEDIUMINT UNSIGNED,
customer_id SMALLINT UNSIGNED,
return_date DATETIME,
staff_id TINYINT UNSIGNED,
last_update... | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' GROUP BY payment_date ORDER BY payment_date | nvbench |
CREATE TABLE table_29163303_1 (
championship VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the championship venues where the score was 6 7 (4 7) , 3 6?
| SELECT championship FROM table_29163303_1 WHERE score = "6–7 (4–7) , 3–6" | 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 Name, SUM(Price) FROM Products GROUP BY Name | nvbench |
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 prescriptions.drug FROM prescriptions WHERE prescriptions.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_18065 (
"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.
-- When did the episode directed by David Duchovny origin... | SELECT "Original air date" FROM table_18065 WHERE "Directed by" = 'David Duchovny' | wikisql |
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_35 (
white VARCHAR,
black VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Category in White has a Black of 38,05%?
| SELECT white FROM table_name_35 WHERE black = "38,05%" | sql_create_context |
CREATE TABLE table_name_50 (
current_club VARCHAR,
height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What current club has a Height of 1.96?
| SELECT current_club FROM table_name_50 WHERE height = 1.96 | sql_create_context |
CREATE TABLE table_64895 (
"Elector" text,
"Place of birth" text,
"Cardinalatial title" text,
"Elevated" text,
"Elevator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's listed for Elevatated that has Cardinalatial title of Priest of SS. XII A... | SELECT "Elevated" FROM table_64895 WHERE "Cardinalatial title" = 'priest of ss. xii apostoli' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.age < "79" | mimicsql_data |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
X... | SELECT mzjzjlb.JZKSRQ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '22882643746' | css |
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 CloseAsOffTopicReasonTypes (
Id number,
... | SELECT DISTINCT t.TagName, (CASE WHEN t.WikiPostId IS NULL AND t.ExcerptPostId IS NULL THEN 'No Wiki/NoExcerpt' WHEN t.WikiPostId IS NULL THEN 'No Wiki' WHEN t.ExcerptPostId IS NULL THEN 'No Excerpt' ELSE '???' END) AS "what_is_missing" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = COALESCE(p.ParentId, p.Id)... | sede |
CREATE TABLE table_29575 (
"Name/Name of Act" text,
"Age(s)" text,
"Genre" text,
"Act" text,
"Hometown" text,
"Qtr. Final (Week)" real,
"Semi Final (Week)" text,
"Position Reached" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "Hometown" FROM table_29575 WHERE "Name/Name of Act" = 'PLUtonic' | wikisql |
CREATE TABLE table_10236830_1 (
nomination VARCHAR,
actors_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of nominations for natalia raskokoha?
| SELECT COUNT(nomination) FROM table_10236830_1 WHERE actors_name = "Natalia Raskokoha" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%seminar%' OR course.name LIKE '%seminar%') AND (course.description LIKE '%Gender and Ancient Egypt%' OR course.name LIKE '%Gender and Ancient Egypt%') AND course.course_id = course_offering.course_id AND semester.semester_id = c... | advising |
CREATE TABLE table_63974 (
"Year" real,
"Category" text,
"Recipients and nominees" text,
"Role/Episode" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Category were Libby Goldstein and Junie Lowry-Johnson recipients and nominees... | SELECT "Category" FROM table_63974 WHERE "Recipients and nominees" = 'libby goldstein and junie lowry-johnson' | wikisql |
CREATE TABLE table_22579 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "Winnings" FROM table_22579 WHERE "Position" = '33rd' | wikisql |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'DENVER' | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.