instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_57856 (
"Country" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (nominal)" text,
"GDP per capita (nominal)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which population has a GDP (nominal) of $6.4 billion?
| SELECT "Population" FROM table_57856 WHERE "GDP (nominal)" = '$6.4 billion' | wikisql |
CREATE TABLE table_5970 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Indians play a game with a record of 28-41?
| SELECT "Date" FROM table_5970 WHERE "Record" = '28-41' | wikisql |
CREATE TABLE table_36732 (
"Year" text,
"Champion" text,
"Runner-up" text,
"Score" text,
"Surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the surface of the match with Brian Gottfried as the runner-up?
| SELECT "Surface" FROM table_36732 WHERE "Runner-up" = 'brian gottfried' | wikisql |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '任凌霜' AND NOT ... | css |
CREATE TABLE tags (
index number,
id number,
tag text
)
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT SUM(totalsnatched), releasetype FROM torrents GROUP BY releasetype | whatcdhiphop |
CREATE TABLE table_41717 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record with an attendance of more than 54,761, and a Result of loss?
| SELECT "Record" FROM table_41717 WHERE "attendance" > '54,761' AND "Result" = 'loss' | wikisql |
CREATE TABLE table_40577 (
"Team" text,
"City" text,
"Inaugural season" text,
"Final season" text,
"Captain" text,
"Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which City has the Bahawalpur Stags Team?
| SELECT "City" FROM table_40577 WHERE "Team" = 'bahawalpur stags' | wikisql |
CREATE TABLE table_46044 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Nationality has a Pick larger than 109, and a Round smaller than 5?
| SELECT "Nationality" FROM table_46044 WHERE "Pick" > '109' AND "Round" < '5' | wikisql |
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... | SELECT 'site:///a/' + CAST(p.Id AS TEXT) + '/4918|' + CAST(p.Id AS TEXT) AS pLink, COUNT(*) AS cCount FROM Comments AS c LEFT JOIN Posts AS p ON c.PostId = p.Id GROUP BY p.Id HAVING '##limit?30##' <= COUNT(*) ORDER BY 2 DESC | sede |
CREATE TABLE table_name_97 (
method VARCHAR,
round VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the method for round 1 and the opponent is bobby mcmaster?
| SELECT method FROM table_name_97 WHERE round = 1 AND opponent = "bobby mcmaster" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_dista... | 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 = 'BALTIMORE' AND date_day.day_number = 3 AND date_day.month_number = 8 AND... | atis |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Backache NOS" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_203_113 (
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.
-- which of these countries was ranked next after yugoslavia ?
| SELECT "nation" FROM table_203_113 WHERE "rank" = (SELECT "rank" FROM table_203_113 WHERE "nation" = 'yugoslavia') + 1 | squall |
CREATE TABLE table_17103566_1 (
team_2 VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is team 2 where the result is ICL world by 8 wickets?
| SELECT team_2 FROM table_17103566_1 WHERE result = "ICL World by 8 wickets" | sql_create_context |
CREATE TABLE table_28591 (
"Engine Family" text,
"Cylinder Layout" text,
"Displacement(s)" text,
"Injection type" text,
"Years produced" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The engine family MaxxForce 5 in the years produced 2007-current,... | SELECT "Cylinder Layout" FROM table_28591 WHERE "Years produced" = '2007-current' AND "Engine Family" = 'MaxxForce 5' | wikisql |
CREATE TABLE table_26423157_2 (
seed VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What seed was California?
| SELECT seed FROM table_26423157_2 WHERE school = "California" | sql_create_context |
CREATE TABLE table_38394 (
"Name" text,
"Years of Operation" text,
"Location" text,
"Historical Photos" text,
"Year Clubhouse Constructed" text,
"Sign-in/Bicker" text,
"Year co-ed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the l... | SELECT "Location" FROM table_38394 WHERE "Name" = 'the ivy club' | wikisql |
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_... | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY Product_Name | nvbench |
CREATE TABLE table_name_64 (
fcc_info VARCHAR,
frequency_mhz VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I need the FCC info on the radio Frequency MHz 107.5?
| SELECT fcc_info FROM table_name_64 WHERE frequency_mhz = 107.5 | sql_create_context |
CREATE TABLE table_26218783_7 (
status VARCHAR,
sd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status when sd is 15?
| SELECT status FROM table_26218783_7 WHERE sd = 15 | sql_create_context |
CREATE TABLE table_32080 (
"Model" text,
"Release date" text,
"Sensor res., size" text,
"Lens(35mmequiv.) zoom, aperture" text,
"Screen size,pixels" text,
"Dimensions W\u00d7H\u00d7D (mm)" text,
"Weight" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Screen size,pixels" FROM table_32080 WHERE "Dimensions W\u00d7H\u00d7D (mm)" = '98×64.5×41' AND "Model" = 'p5000' | wikisql |
CREATE TABLE table_37952 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week had a lower attendance than 51,423 but was still higher than the other w... | SELECT MAX("Week") FROM table_37952 WHERE "Attendance" < '51,423' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB 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 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 = '09797743' AND jybgb.BGRQ BETWEEN '2013-05-06' AND '2020-... | css |
CREATE TABLE table_35055 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round was Brian Elder taken in?
| SELECT MIN("Round") FROM table_35055 WHERE "Player" = 'brian elder' | wikisql |
CREATE TABLE table_2756 (
"Pos" text,
"##" real,
"Name" text,
"Team" text,
"Lap One" text,
"Lap Two" text,
"Lap Three" text,
"Lap Four" text,
"Total Time" text,
"Avg. Speed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many... | SELECT COUNT("Lap Two") FROM table_2756 WHERE "Name" = 'Marco Andretti' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT CYZTDM FROM zyjzjlb WHERE JZLSH = '81313263168' | css |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_63 (
circuit VARCHAR,
winning_constructor VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the circuit for darracq and name of cuban race
| SELECT circuit FROM table_name_63 WHERE winning_constructor = "darracq" AND name = "cuban race" | sql_create_context |
CREATE TABLE table_name_94 (
money___ INTEGER,
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average money for United States when Lanny Wadkins played?
| SELECT AVG(money___) AS $__ FROM table_name_94 WHERE country = "united states" AND player = "lanny wadkins" | sql_create_context |
CREATE TABLE table_27275 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the cfl team for steven turner
| SELECT "CFL Team" FROM table_27275 WHERE "Player" = 'Steven Turner' | wikisql |
CREATE TABLE table_50856 (
"Internet Plan" text,
"Downstream" text,
"Upstream" text,
"Bandwidth Included" text,
"Price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Downstream, when Upstream is '384 kbit'?
| SELECT "Downstream" FROM table_50856 WHERE "Upstream" = '384 kbit' | wikisql |
CREATE TABLE table_24775 (
"Dates (MDY)" text,
"Gross Sales" text,
"Tickets Sold / Available" text,
"Shows / Sellout" text,
"Sellout (%)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Between November 25 30, 2008 the sellout rate was at 75%, indica... | SELECT "Shows / Sellout" FROM table_24775 WHERE "Sellout (%)" = '75%' | 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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i... | css |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 transfers (
row_id number,
subject_id number,
had... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59728) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-02' ORDER BY labevents.charttime DESC LIMIT 1) | mimic_iii |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count ... | SELECT COUNT(p1.Id) FROM Posts AS p1 INNER JOIN PostTags AS pt ON pt.TagId = @TagId INNER JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.PostTypeId = 2 AND pt.PostId = p2.Id | sede |
CREATE TABLE table_name_3 (
length VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the length of the version from 2003?
| SELECT length FROM table_name_3 WHERE year = 2003 | sql_create_context |
CREATE TABLE table_26824484_1 (
title VARCHAR,
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode was directed by Jeff Woolnough and written by Christopher Ambrose?
| SELECT title FROM table_26824484_1 WHERE directed_by = "Jeff Woolnough" AND written_by = "Christopher Ambrose" | sql_create_context |
CREATE TABLE table_23345 (
"Rank" real,
"City" text,
"1890 census" text,
"1910 census" real,
"1920 census" real,
"1930 census" real,
"1940 census" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For cities with a census of 74000 in 1920, what... | SELECT "1890 census" FROM table_23345 WHERE "1920 census" = '74000' | 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 flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
... | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination | nvbench |
CREATE TABLE table_train_197 (
"id" int,
"dyscrasia" bool,
"gender" string,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT * FROM table_train_197 WHERE bleeding = 1 OR dyscrasia = 1 | criteria2sql |
CREATE TABLE mzb (
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '54888449' AND t_kc22.STA_DATE BETWEEN '2016-04-25' AND '2020-10-09' AND qtb.MED_SER_ORG_NO = '7077401' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_21 (
team VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Are there any Teams after 1997?
| SELECT team FROM table_name_21 WHERE year > 1997 | sql_create_context |
CREATE TABLE table_name_96 (
set_1 VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Set 1 with a Score with 3 2?
| SELECT set_1 FROM table_name_96 WHERE score = "3–2" | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SWC' AND number = 200 | advising |
CREATE TABLE table_72256 (
"Series #" real,
"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.
-- What is the season where the episode 'when worlds collide' was s... | SELECT MAX("Season #") FROM table_72256 WHERE "Title" = 'When Worlds Collide' | wikisql |
CREATE TABLE table_10967 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me th... | SELECT "Pole position" FROM table_10967 WHERE "Fastest lap" = 'graham hill' AND "Winning driver" = 'graham hill' AND "Date" = '30 may' | wikisql |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr syst/diastl hrt fail" | mimicsql_data |
CREATE TABLE table_16409745_1 (
dimensions__mm_ VARCHAR,
product VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the mm dimensions of the Plustek Mobileoffice D28 Corporate?
| SELECT dimensions__mm_ FROM table_16409745_1 WHERE product = "Plustek MobileOffice D28 Corporate" | sql_create_context |
CREATE TABLE table_61514 (
"Region" text,
"Date" text,
"Label" text,
"Format(s)" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the dage of catalog asw 28033?
| SELECT "Date" FROM table_61514 WHERE "Catalog" = 'asw 28033' | wikisql |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many females are in the network?
| SELECT COUNT(*) FROM person WHERE gender = 'female' | spider |
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 WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "8" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid ... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10559')) AND intakeoutput.celllabel = 'enter... | eicu |
CREATE TABLE table_name_52 (
being__qualities_ VARCHAR,
having__things_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the being for having things of language, religions, work, customs, values, norms?
| SELECT being__qualities_ FROM table_name_52 WHERE having__things_ = "language, religions, work, customs, values, norms" | sql_create_context |
CREATE TABLE table_name_28 (
fast_laps VARCHAR,
points VARCHAR,
series VARCHAR,
races VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many fast laps are in 6 races with 30 points in the World Series by Nissan?
| SELECT fast_laps FROM table_name_28 WHERE series = "world series by nissan" AND races = "6" AND points = "30" | sql_create_context |
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
region_id number,
... | SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_51944 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft (m)" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- There is a building at 800 Boylston Street, how many floors does it have?
| SELECT SUM("Floors") FROM table_51944 WHERE "Street address" = '800 boylston street' | wikisql |
CREATE TABLE table_27734769_8 (
date VARCHAR,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was the high rebounds by marcus camby (18)?
| SELECT COUNT(date) FROM table_27734769_8 WHERE high_rebounds = "Marcus Camby (18)" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND intakeoutput.celllabel = 'volum... | eicu |
CREATE TABLE table_55889 (
"Name" text,
"Entered office" text,
"Left office" text,
"Political party" text,
"Monarchs served" text,
"Birth Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- To which political party did the prime minister who s... | SELECT "Political party" FROM table_55889 WHERE "Monarchs served" = 'george v' AND "Birth Place" = 'manchester' | wikisql |
CREATE TABLE table_23987362_2 (
hicham_el_guerrouj___mar__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many of 3:26.00 when hicham el guerrouj ( mar ) is hudson de souza ( bra )?
| SELECT COUNT(3) AS :2600 FROM table_23987362_2 WHERE hicham_el_guerrouj___mar__ = "Hudson de Souza ( BRA )" | sql_create_context |
CREATE TABLE table_name_26 (
first_issued INTEGER,
color VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Color of green last issued?
| SELECT MAX(first_issued) FROM table_name_26 WHERE color = "green" | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "54" AND diagnoses.icd9_code = "7470" | mimicsql_data |
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 DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_10726 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the school of the player with a hometown of little rock, arkansas?
| SELECT "School" FROM table_10726 WHERE "Hometown" = 'little rock, arkansas' | 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 demographic (... | 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.short_title = "Hyp ht dis NOS w ht fail" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_25790 (
"Rank" real,
"City/Town" text,
"County" text,
"Region/Province" text,
"Population" real,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When birkenhead is the city/town and merseyside is the county and englan... | SELECT COUNT("Rank") FROM table_25790 WHERE "Country" = 'England' AND "County" = 'Merseyside' AND "City/Town" = 'Birkenhead' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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,
JO... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
... | SELECT AVG(CAST(Score AS FLOAT)) AS score, DH FROM (SELECT TagName, Tags.Id, (TIME_TO_STR(CreationDate, '%W') - 1) * 24 + TIME_TO_STR(CreationDate, '%h') AS DH, Score FROM Tags INNER JOIN PostTags ON TagId = Tags.Id INNER JOIN Posts ON PostId = Posts.Id WHERE Posts.ParentId IS NULL AND TagName = '##TagName##') AS sq GR... | sede |
CREATE TABLE table_27605 (
"Team" text,
"Played" real,
"Won" real,
"Lost" real,
"No-Result" real,
"Abandoned" real,
"Bonus Points" real,
"Total Points" real,
"Net Run Rate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team had... | SELECT "Team" FROM table_27605 WHERE "Net Run Rate" = '0.134' | wikisql |
CREATE TABLE table_25143284_1 (
location VARCHAR,
score_qualifying VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the competition with a qualifying score of 58.425?
| SELECT location FROM table_25143284_1 WHERE score_qualifying = "58.425" | sql_create_context |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '韩文丽' AND MED_SER_ORG_NO = '7659093' AND NOT IN_DIAG_DIS_NM LIKE '%炭末%' | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.short_title = "Diabetic retinopathy NOS" | mimicsql_data |
CREATE TABLE Parties (
Party_ID INTEGER,
Party_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Cod... | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name) DESC | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2071" | mimicsql_data |
CREATE TABLE table_64791 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time of the Great Britain players with Notes of SA/B?
| SELECT "Time" FROM table_64791 WHERE "Notes" = 'sa/b' AND "Country" = 'great britain' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047') AND patient.unitdischargetime IS NULL) ... | eicu |
CREATE TABLE table_18042 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "U.S. viewers (millions)" FROM table_18042 WHERE "Original air date" = 'November 13, 2007' | wikisql |
CREATE TABLE table_22621 (
"Country" text,
"TV Network(s)" text,
"Series Premiere" text,
"Weekly Schedule" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every TV network with a weekly schedule of Monday to Thursday @ 11:00 pm... | SELECT "TV Network(s)" FROM table_22621 WHERE "Weekly Schedule" = 'Monday to Thursday @ 11:00 pm' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "MAGO140" | mimicsql_data |
CREATE TABLE table_204_94 (
id number,
"outcome" text,
"date" text,
"tournament" text,
"surface" text,
"partnering" text,
"opponent in the final" text,
"score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many surfaces... | SELECT COUNT("surface") FROM table_204_94 WHERE "surface" = 'grass' | squall |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... | mimic_iii |
CREATE TABLE procedures (
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541" | mimicsql_data |
CREATE TABLE table_name_39 (
margin_of_victory VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the margin of victory in a semgroup championship?
| SELECT margin_of_victory FROM table_name_39 WHERE tournament = "semgroup championship" | sql_create_context |
CREATE TABLE table_name_21 (
team VARCHAR,
year_entered_league VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had a year entering the league under 2009, located in Bath?
| SELECT team FROM table_name_21 WHERE year_entered_league < 2009 AND location = "bath" | sql_create_context |
CREATE TABLE table_name_41 (
player VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is from Dartmouth?
| SELECT player FROM table_name_41 WHERE school_club_team = "dartmouth" | sql_create_context |
CREATE TABLE table_14725 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was a game played on 23,24,25,26 july 1992?
| SELECT "Venue" FROM table_14725 WHERE "Date" = '23,24,25,26 july 1992' | wikisql |
CREATE TABLE table_name_38 (
domestic_passengers INTEGER,
_percentage_change_2005_2006 VARCHAR,
freight__metric_tonnes_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of all domestic passengers with 10.9% change and less than 4,022 tonnes... | SELECT SUM(domestic_passengers) FROM table_name_38 WHERE _percentage_change_2005_2006 = "10.9%" AND freight__metric_tonnes_ < 4 OFFSET 022 | sql_create_context |
CREATE TABLE table_66025 (
"Rank" real,
"Archer" text,
"1st Half" real,
"2nd Half" real,
"Score" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest first half when the score is larger than 621 and the rank 35?
| SELECT MIN("1st Half") FROM table_66025 WHERE "Score" > '621' AND "Rank" = '35' | wikisql |
CREATE TABLE table_17476 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the writer of t... | SELECT "Written by" FROM table_17476 WHERE "U.S. viewers (millions)" = '12.13' | wikisql |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid i... | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'stefan savage' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_53649 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Fitzroy play as the away team?
| SELECT "Date" FROM table_53649 WHERE "Away team" = 'fitzroy' | wikisql |
CREATE TABLE table_name_63 (
music VARCHAR,
uncut_run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What music is in the film with an Uncut run time of 95 minutes?
| SELECT music FROM table_name_63 WHERE uncut_run_time = "95 minutes" | sql_create_context |
CREATE TABLE table_53566 (
"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.
-- Who was the opponent when Footscray played as th... | SELECT "Away team score" FROM table_53566 WHERE "Home team" = 'footscray' | wikisql |
CREATE TABLE table_name_96 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss of the Mariners game when they had a record of 22-35?
| SELECT loss FROM table_name_96 WHERE record = "22-35" | sql_create_context |
CREATE TABLE table_name_42 (
team_name VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team name from Hammond Bishop Noll?
| SELECT team_name FROM table_name_42 WHERE school = "hammond bishop noll" | sql_create_context |
CREATE TABLE table_39564 (
"Role" text,
"D'Oyly Carte 1920 Tour" text,
"D'Oyly Carte 1930 Tour" text,
"D'Oyly Carte 1939 Tour" text,
"D'Oyly Carte 1945 Tour" text,
"D'Oyly Carte 1950 Tour" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- D'Oyly Ca... | SELECT "D'Oyly Carte 1945 Tour" FROM table_39564 WHERE "D'Oyly Carte 1920 Tour" = 'james turnbull' | wikisql |
CREATE TABLE table_36605 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Bronze has a Gold larger than 0, and a Total smaller than 1?
| SELECT COUNT("Bronze") FROM table_36605 WHERE "Gold" > '0' AND "Total" < '1' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.