instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '抽动障碍' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '抽动障碍' | 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 WHERE demographic.language = "RUSS" AND demographic.ethnicity = "WHITE - RUSSIAN" | mimicsql_data |
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj... | css |
CREATE TABLE table_60278 (
"Player" text,
"Country" text,
"Year(s) won" real,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of years won by Justin Leonard with a to par under 9?
| SELECT COUNT("Year(s) won") FROM table_60278 WHERE "Player" = 'justin leonard' AND "To par" < '9' | wikisql |
CREATE TABLE table_60582 (
"Year (Ceremony)" text,
"Original title" text,
"Film title used in nomination" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the result for director elia schneider's punto y raya?
| SELECT "Result" FROM table_60582 WHERE "Director" = 'elia schneider' AND "Film title used in nomination" = 'punto y raya' | wikisql |
CREATE TABLE table_45096 (
"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.
-- What i... | SELECT "Record" FROM table_45096 WHERE "Location Attendance" = 'pepsi center 19,749' | wikisql |
CREATE TABLE table_name_50 (
team VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team played the Jazz at game 68?
| SELECT team FROM table_name_50 WHERE game = 68 | sql_create_context |
CREATE TABLE table_name_80 (
overall INTEGER,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average Overall, when Pick is 19?
| SELECT AVG(overall) FROM table_name_80 WHERE pick = 19 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.short_title = "PTCA" | mimicsql_data |
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 * FROM jybgb WHERE jybgb.JZLSH = '86575549461' | css |
CREATE TABLE table_4039 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pick was Greg Strome?
| SELECT MAX("Pick #") FROM table_4039 WHERE "Player" = 'Greg Strome' | wikisql |
CREATE TABLE table_65654 (
"Millewa" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the average Wins that has the Against of 1132, and the Losses smaller than... | SELECT AVG("Wins") FROM table_65654 WHERE "Against" = '1132' AND "Losses" < '7' | wikisql |
CREATE TABLE film_category (
film_id number,
category_id number,
last_update time
)
CREATE TABLE customer (
customer_id number,
store_id number,
first_name text,
last_name text,
email text,
address_id number,
active boolean,
create_date time,
last_update time
)
CREATE T... | SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1 | spider |
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.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "ABDOMINAL PAIN" | mimicsql_data |
CREATE TABLE table_24303 (
"Census division" text,
"Area (km\u00b2)" text,
"Pop. (2011)" real,
"Pop. (2006)" real,
"Pop. (2001)" real,
"Pop. (1996)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest population count in any of th... | SELECT MAX("Pop. (2006)") FROM table_24303 | wikisql |
CREATE TABLE table_name_12 (
home_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team has 44 ties?
| SELECT home_team FROM table_name_12 WHERE tie_no = "44" | sql_create_context |
CREATE TABLE table_204_725 (
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 country scored the most gold medals - iran or indonesia ?
| SELECT "nation" FROM table_204_725 WHERE "nation" IN ('iran', 'indonesia') ORDER BY "gold" DESC LIMIT 1 | squall |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500 | nvbench |
CREATE TABLE table_66558 (
"Season" text,
"Games" text,
"Lost" text,
"Tied" text,
"Points" text,
"Goals for" text,
"Goals against" text,
"Standing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the points if the goals against w... | SELECT "Points" FROM table_66558 WHERE "Goals against" = '260' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.icd9_code = "5761" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.gender, demographic.insurance FROM demographic WHERE demographic.subject_id = "9575" | mimicsql_data |
CREATE TABLE table_61261 (
"Military deaths" text,
"Civilian deaths" text,
"Total deaths (not including foreigners)" text,
"Military and/or Civilian wounded" text,
"Total casualties" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many civilians ... | SELECT "Civilian deaths" FROM table_61261 WHERE "Military deaths" = '231' | wikisql |
CREATE TABLE table_71163 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who participated in the Mixed Doubles when Simon Santoso participated in the... | SELECT "Mixed doubles" FROM table_71163 WHERE "Men's singles" = 'simon santoso' AND "Year" > '2008' | wikisql |
CREATE TABLE table_29237 (
"City" text,
"Population" real,
"Registered voters" text,
"Democratic" text,
"Republican" text,
"D\u2013R spread" text,
"Other" text,
"No party preference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is... | SELECT "Democratic" FROM table_29237 WHERE "Registered voters" = '67.8%' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | 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 = 'PHILADELPHIA' AND date_day.day_number = 15 AND date_day.month_number = 9 ... | atis |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51257" | mimicsql_data |
CREATE TABLE table_39676 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the Euro '64 qualifying game?
| SELECT "Date" FROM table_39676 WHERE "Type of game" = 'euro ''64 qualifying' | wikisql |
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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') AND Reputation > '##Reputation##' AND LastAccessDate BETWEEN '20-Oct-17' AND '20-Nov-17' ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_92 (
result_score VARCHAR,
year VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Result/Score, when Year is greater than 2005, and when Opponent is #8 Arkansas #1 Memphis?
| SELECT result_score FROM table_name_92 WHERE year > 2005 AND opponent = "#8 arkansas #1 memphis" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rigid proctosigmoidoscpy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814) AND STRFTIME('%... | mimic_iii |
CREATE TABLE table_25848 (
"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 MAX("Game") FROM table_25848 WHERE "Score" = 'W 113–96 (OT)' | wikisql |
CREATE TABLE table_14523485_9 (
channel VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the show aired in New Zealand?
| SELECT channel FROM table_14523485_9 WHERE country = "New Zealand" | 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 t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '柏和玉' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 1924.14) | css |
CREATE TABLE table_name_72 (
method VARCHAR,
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of sergei bondarovich, and a Record of 2 0 had what method?
| SELECT method FROM table_name_72 WHERE opponent = "sergei bondarovich" AND record = "2–0" | sql_create_context |
CREATE TABLE table_65316 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2003)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which District is Constituency number 22?
| SELECT "District" FROM table_65316 WHERE "Constituency number" = '22' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '8054634' AND BGRQ BETWEEN '2009-07-03' AND '2014-12-19' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) | css |
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 780... | mimic_iii |
CREATE TABLE table_20855452_4 (
points VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did agnieszka radwa ska score?
| SELECT points FROM table_20855452_4 WHERE player = "Agnieszka Radwańska" | sql_create_context |
CREATE TABLE table_72991 (
"Year" real,
"Date (Opening)" text,
"Date (Closing)" text,
"Opening Film" text,
"Number of Screening" text,
"Award-Winning Film" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many number of screenings have an open... | SELECT COUNT("Number of Screening") FROM table_72991 WHERE "Opening Film" = 'The Journey of Vaan Nguyen' | wikisql |
CREATE TABLE table_14056 (
"Gene" text,
"Route of administration" text,
"Phase" text,
"Subject number" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which gene is ongoing and has an intramuscular route of administration?
| SELECT "Gene" FROM table_14056 WHERE "Route of administration" = 'intramuscular' AND "Status" = 'ongoing' | wikisql |
CREATE TABLE table_67964 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of wins when there are 7 points?
| SELECT "Wins" FROM table_67964 WHERE "Points" = '7' | wikisql |
CREATE TABLE table_1594772_2 (
winner VARCHAR,
match_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winner for date of nov 5, 1987
| SELECT winner FROM table_1594772_2 WHERE match_date = "Nov 5, 1987" | sql_create_context |
CREATE TABLE table_204_739 (
id number,
"districts" text,
"ubigeo" number,
"area\n(km2)" number,
"population" number,
"population density\n(/km2)" number,
"created" text,
"postal\ncode" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- wh... | SELECT "districts" FROM table_204_739 ORDER BY "population" DESC LIMIT 1 | squall |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '陶颖慧' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-07-04' AND '2009-12-15' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_1341586_43 (
first_elected VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name number first elected for tennessee 2?
| SELECT COUNT(first_elected) FROM table_1341586_43 WHERE district = "Tennessee 2" | sql_create_context |
CREATE TABLE table_60088 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Event that has an Opponent of kendall grove?
| SELECT "Event" FROM table_60088 WHERE "Opponent" = 'kendall grove' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
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,
fligh... | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id ... | atis |
CREATE TABLE table_name_37 (
versus VARCHAR,
player VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Versus with a Player with ko otieno, with Venue with bloemfontein?
| SELECT versus FROM table_name_37 WHERE player = "ko otieno" AND venue = "bloemfontein" | sql_create_context |
CREATE TABLE table_66014 (
"Title" text,
"Time" text,
"Writer(s)" text,
"Performer(s)" text,
"Producer(s)" text,
"Recorded at" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the album recorded at funhouse studios with a time of 3:27?
| SELECT "Writer(s)" FROM table_66014 WHERE "Recorded at" = 'funhouse studios' AND "Time" = '3:27' | wikisql |
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.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = ... | css |
CREATE TABLE table_train_169 (
"id" int,
"leukocytes" int,
"hemoglobin_a1c_hba1c" float,
"urine_albumin_excretion" int,
"estimated_glomerular_filtration_rate_egfr" int,
"glucola_beverage_gct" int,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for th... | SELECT * FROM table_train_169 WHERE glucola_beverage_gct >= 190 | criteria2sql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | 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 = '015-33415')) AND medication.drugname IN ('midazolam', 'magnesium sulf 2 g/... | eicu |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND STRFTIME('%y-%m', lab.labresulttime) = '2105-12' ORDER BY lab.labr... | eicu |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime ti... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114 AND admissions.dischtime IS NULL) AND prescriptions.drug = '1/2 ns' | mimic_iii |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "SEPSIS" AND procedures.short_title = "Abdomen artery incision" | mimicsql_data |
CREATE TABLE table_203_752 (
id number,
"rank" number,
"circuit" text,
"headquarters" text,
"screens" number,
"sites" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which circuit has the most screens ?
| SELECT "circuit" FROM table_203_752 ORDER BY "screens" DESC LIMIT 1 | squall |
CREATE TABLE table_name_31 (
segment_a VARCHAR,
segment_c VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What segment A is associated with a Segment C of paint chip cards?
| SELECT segment_a FROM table_name_31 WHERE segment_c = "paint chip cards" | sql_create_context |
CREATE TABLE table_55460 (
"Year" real,
"Player" text,
"Position" text,
"College/Country" text,
"WNBA Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year that includes a Seattle Storm guard?
| SELECT MIN("Year") FROM table_55460 WHERE "Position" = 'guard' AND "WNBA Team" = 'seattle storm' | wikisql |
CREATE TABLE table_name_23 (
date VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the attendance 3686?
| SELECT date FROM table_name_23 WHERE attendance = 3686 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr" | mimicsql_data |
CREATE TABLE Rating (
rID VARCHAR,
stars VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- find the ids of reviewers who did not give 4 star.
| SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4 | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT COUNT(*) FROM t_kc24 WHERE PERSON_ID = '54371682' AND CLINIC_SLT_DATE BETWEEN '2008-07-10' AND '2015-07-26' AND MED_AMOUT <= 10 | css |
CREATE TABLE table_name_68 (
score VARCHAR,
outcome VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the of the Tournament against Tim Gullikson with Outcome of runner-up?
| SELECT score FROM table_name_68 WHERE outcome = "runner-up" AND opponent = "tim gullikson" | sql_create_context |
CREATE TABLE table_1301373_7 (
Vice VARCHAR,
captain VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the vice captain for melbourne victory
| SELECT Vice - captain FROM table_1301373_7 WHERE club = "Melbourne Victory" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE v... | 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 = '021-239662')) AND NOT vitalperiodic.heartrate IS NU... | eicu |
CREATE TABLE table_68444 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The 147.481 Qual, happened in what year?
| SELECT "Year" FROM table_68444 WHERE "Qual" = '147.481' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title 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 admissions (
row_id numb... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22449 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND chart... | mimic_iii |
CREATE TABLE party_forms (
party_id number,
form_id number,
date_completion_started time,
form_status_code text,
date_fully_completed time
)
CREATE TABLE party_addresses (
party_id number,
address_id number,
date_address_from time,
address_type_code text,
date_address_to time
)
... | SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%" | spider |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '018-115975' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) = '2105' | eicu |
CREATE TABLE table_204_587 (
id number,
"drop(s)" text,
"multiplayer map(s)" text,
"spec ops mission(s)" text,
"face off map(s)" text,
"xbox 360 release date" text,
"playstation 3 release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT (SELECT "xbox 360 release date" FROM table_204_587 WHERE "drop(s)" = '4-6') > (SELECT "playstation 3 release date" FROM table_204_587 WHERE "drop(s)" = '4-6') | squall |
CREATE TABLE producer (
pid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE copyright (
id int,
msid int,
cid int
)
CREATE TABLE writer (
wid int,
gender text,
name text,
nationality text,
birth_city text,
birth_... | SELECT tv_series.title FROM made_by, producer, tv_series WHERE producer.name = 'Shonda Rhimes' AND producer.pid = made_by.pid AND tv_series.sid = made_by.msid | imdb |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.icustay_id = "242681.0" | mimicsql_data |
CREATE TABLE table_9940 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the silver when the nation is japan and the total is less than 1?
| SELECT SUM("Silver") FROM table_9940 WHERE "Nation" = 'japan' AND "Total" < '1' | wikisql |
CREATE TABLE table_35340 (
"Race Title" text,
"Circuit" text,
"Location / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won at the Circuit of lakeside international raceway?
| SELECT "Winner" FROM table_35340 WHERE "Circuit" = 'lakeside international raceway' | wikisql |
CREATE TABLE table_name_96 (
final_score VARCHAR,
date VARCHAR,
host_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the final score for january 9 for cincinnati bengals
| SELECT final_score FROM table_name_96 WHERE date = "january 9" AND host_team = "cincinnati bengals" | sql_create_context |
CREATE TABLE Products (
product_id INTEGER,
product_category VARCHAR(15),
product_name VARCHAR(80)
)
CREATE TABLE Mailshot_Campaigns (
mailshot_id INTEGER,
product_category VARCHAR(15),
mailshot_name VARCHAR(80),
mailshot_start_date DATETIME,
mailshot_end_date DATETIME
)
CREATE TABLE M... | SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY COUNT(*) DESC | nvbench |
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 AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3907255' AND t_kc22.STA_DATE BETWEEN '2000-08-14' AND '2012-06-06' | css |
CREATE TABLE table_56032 (
"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.
-- How many points did the home team score when the... | SELECT "Home team score" FROM table_56032 WHERE "Away team score" = '18.19 (127)' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE... | SELECT PostId AS "post_link", Comment, UserId AS "user_link", CreationDate, url = 'site://posts/' + CAST(PostId AS TEXT) + '/revisions' FROM PostHistory WHERE UserId = '##id##' ORDER BY CreationDate | sede |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | SELECT (SELECT t_kc22.QTY * t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '09769938539') = (SELECT t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '09769938539') | css |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '78649221818' AND NOT jybgb.KSMC LIKE '%变态反应%' | css |
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 * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9146044' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-10-14' AND '2021-03-06' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9146044' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-10-14' AND '2021-03-06' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '914604... | css |
CREATE TABLE table_62710 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Tries against" FROM table_62710 WHERE "Club" = 'burry port rfc' | wikisql |
CREATE TABLE table_name_29 (
date VARCHAR,
competition VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the UEFA Cup against Panathinaikos?
| SELECT date FROM table_name_29 WHERE competition = "uefa cup" AND opponent = "panathinaikos" | sql_create_context |
CREATE TABLE table_name_29 (
network VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network has model nForce Professional 3400 MCP?
| SELECT network FROM table_name_29 WHERE model = "nforce professional 3400 mcp" | sql_create_context |
CREATE TABLE table_59670 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for the player whose finish was t66?
| SELECT "Total" FROM table_59670 WHERE "Finish" = 't66' | wikisql |
CREATE TABLE table_30415 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (millions)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the origi... | SELECT "Original air date" FROM table_30415 WHERE "Written by" = 'Aron Eli Coleite' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWit... | SELECT pf.PostId AS "post_link", SUM(CASE WHEN pf.VoteTypeId = 2 THEN 1 ELSE NULL END) AS UpFeedback, SUM(CASE WHEN pf.VoteTypeId = 3 THEN 1 ELSE NULL END) AS DownFeedback, SUM(CASE pf.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 END) AS Score, p.Score FROM PostFeedback AS pf JOIN Posts AS p ON p.Id = pf.PostId WHERE (p.Own... | sede |
CREATE TABLE table_31783 (
"Nomination" text,
"Actor's Name" text,
"Film Name" text,
"Director" text,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the nomination for goran paskaljevic
| SELECT "Nomination" FROM table_31783 WHERE "Director" = 'goran paskaljevic' | wikisql |
CREATE TABLE table_18524_6 (
tourism_receipts__2011___us VARCHAR,
tourism_receipts__2003___as__percentage_of_gdp_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of tourism receipts 2011 where tourism receipts 2003 13.5
| SELECT COUNT(tourism_receipts__2011___us) AS $_per_capita_ FROM table_18524_6 WHERE tourism_receipts__2003___as__percentage_of_gdp_ = "13.5" | sql_create_context |
CREATE TABLE table_name_26 (
against VARCHAR,
points VARCHAR,
drawn VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Against has a Drawn smaller than 5, and a Lost smaller than 6, and a Points larger than 36?
| SELECT COUNT(against) FROM table_name_26 WHERE drawn < 5 AND lost < 6 AND points > 36 | sql_create_context |
CREATE TABLE table_name_52 (
engine VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine did the porsche 718 chassis use?
| SELECT engine FROM table_name_52 WHERE chassis = "porsche 718" | sql_create_context |
CREATE TABLE table_197638_6 (
australian_open VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did Roy Emerson win the Australian Open?
| SELECT COUNT(australian_open) FROM table_197638_6 WHERE player = "Roy Emerson" | sql_create_context |
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id in... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC | nvbench |
CREATE TABLE table_train_155 (
"id" int,
"cholesterol" float,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"diabetic" string,
"hyperlipidemia" bool,
"creatinine_clearance_cl" float,
"platelet_count" float,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer... | SELECT * FROM table_train_155 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 150 | criteria2sql |
CREATE TABLE table_79292 (
"Time" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team when kwong wah was the away team?
| SELECT "Home team" FROM table_79292 WHERE "Away team" = 'kwong wah' | wikisql |
CREATE TABLE table_name_77 (
stake VARCHAR,
organized VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the stake president when the organized date is April 18, 1965?
| SELECT stake AS President FROM table_name_77 WHERE organized = "april 18, 1965" | sql_create_context |
CREATE TABLE table_73261 (
"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 "Directed by" FROM table_73261 WHERE "Title" = 'Someone to Witch Over Me' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.