instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_18438494_3 (
entered VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entered the match with a time of 14:42?
| SELECT entered FROM table_18438494_3 WHERE time = "14:42" | sql_create_context |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT zyjybgb.BGJGDM, zyjybgb.BGJGMC FROM zyjybgb WHERE zyjybgb.BGDH = '33869497970' UNION SELECT mzjybgb.BGJGDM, mzjybgb.BGJGMC FROM mzjybgb WHERE mzjybgb.BGDH = '33869497970' | css |
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 MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dod_year < "2180.0" | mimicsql_data |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | 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 = '008-19005')) AND lab.labname = 'ptt' AND STRFTIME('%y-%m', lab.labresulttime) = '21... | eicu |
CREATE TABLE table_name_78 (
date VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date that Elvir Krehmic made a high jump record?
| SELECT date FROM table_name_78 WHERE athlete = "elvir krehmic" | sql_create_context |
CREATE TABLE table_1137704_2 (
pole_position VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the pole position where date is 26 july
| SELECT pole_position FROM table_1137704_2 WHERE date = "26 July" | sql_create_context |
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_Regular_Season, Team_ID FROM basketball_match | nvbench |
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, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID | nvbench |
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
-... | SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Functional%" | spider |
CREATE TABLE table_13307 (
"Entities" text,
"Country" text,
"Supply point" text,
"Voltage (kV)" real,
"Power (MW)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has Entities of emsa?
| SELECT "Country" FROM table_13307 WHERE "Entities" = 'emsa' | wikisql |
CREATE TABLE table_5822 (
"Placing" real,
"Team" text,
"Players" text,
"Seeding" text,
"Playoffs W-L" text,
"Matches W-L" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Placing of 3 had what match w-l?
| SELECT "Matches W-L" FROM table_5822 WHERE "Placing" = '3' | wikisql |
CREATE TABLE table_name_23 (
years_in_orlando VARCHAR,
nationality VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Years in Orlando has a Nationality of united states, and a School/Club Team of illinois?
| SELECT years_in_orlando FROM table_name_23 WHERE nationality = "united states" AND school_club_team = "illinois" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '57199324847') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '57199324847') AND JCZBJGDL = (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '57199324847') | css |
CREATE TABLE table_45059 (
"Year" real,
"Location" text,
"Gold" text,
"Silver" text,
"Bronze" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Silver the Year Katie Curtis Unknown won the Bronze?
| SELECT "Silver" FROM table_45059 WHERE "Bronze" = 'katie curtis unknown' | wikisql |
CREATE TABLE table_name_32 (
original_artist VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which original artist has a Episode of workshop #1?
| SELECT original_artist FROM table_name_32 WHERE episode = "workshop #1" | sql_create_context |
CREATE TABLE table_22496374_1 (
home_town VARCHAR,
high_school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown of the players from alvin high school?
| SELECT home_town FROM table_22496374_1 WHERE high_school = "Alvin" | sql_create_context |
CREATE TABLE table_2076463_2 (
control VARCHAR,
founded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the only type of university that was founded in 1873?
| SELECT control FROM table_2076463_2 WHERE founded = 1873 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.religion FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_12992 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the moving from with a transfer and the nationality of Bra?
| SELECT "Moving from" FROM table_12992 WHERE "Type" = 'transfer' AND "Nat." = 'bra' | wikisql |
CREATE TABLE table_52491 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the away team when the gam... | SELECT "Away team score" FROM table_52491 WHERE "Venue" = 'vfl park' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
h... | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2498)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd10w' AND... | mimic_iii |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY Date_of_Birth DESC | nvbench |
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
product_category_code VARCHAR(20),
date_product_first_available DATETIME,
date_product_discontinued DATETIME,
product_name VARCHAR(80),
product_description VARCHAR(255),
product_price DECIMAL(19,4)
)
CREATE TABLE Com... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code | nvbench |
CREATE TABLE table_75518 (
"Rank" real,
"# of Titles" real,
"School" text,
"City" text,
"Sport" text,
"First" real,
"Last" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank for the boys swimming team in Albuquerque?
| SELECT MAX("Rank") FROM table_75518 WHERE "Sport" = 'boys swimming' AND "City" = 'albuquerque' | wikisql |
CREATE TABLE table_48820 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of game 1?
| SELECT "Result" FROM table_48820 WHERE "Game" = 'game 1' | wikisql |
CREATE TABLE gyb (
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_NM = '郑丹红' AND t_kc22.STA_DATE BETWEEN '2001-08-25' AND '2014-08-03' AND t_kc22.SELF_PAY_PRO < 0.85 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '郑丹红' AND t_k... | css |
CREATE TABLE table_name_51 (
imperial_value VARCHAR,
jyutping VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the imperial that contains a jyutping of cin4?
| SELECT imperial_value FROM table_name_51 WHERE jyutping = "cin4" | sql_create_context |
CREATE TABLE table_11411 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the average Laps for grid of 9
| SELECT AVG("Laps") FROM table_11411 WHERE "Grid" = '9' | wikisql |
CREATE TABLE table_1474099_6 (
goals INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At maximum, what are our goals?
| SELECT MAX(goals) FROM table_1474099_6 | sql_create_context |
CREATE TABLE table_name_47 (
tournament VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tournament had Jack Nicklaus as Runner(s)-up?
| SELECT tournament FROM table_name_47 WHERE runner_s__up = "jack nicklaus" | sql_create_context |
CREATE TABLE table_29519 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the series nu... | SELECT "No. in series" FROM table_29519 WHERE "Title" = 'Shock Waves' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NESLANG' AND course.number = 602 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 | advising |
CREATE TABLE table_3666 (
"#" real,
"Title" text,
"Timeslot" text,
"Air date" text,
"Viewers (000s)" real,
"Weekly Rank Sky1" real,
"Weekly Rank Virgin Media" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is title numer 103's rank for ... | SELECT "Weekly Rank Sky1" FROM table_3666 WHERE "#" = '103' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 26195 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
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 QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '20733069750' | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_name_34 (
preliminary_average VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the preliminary average for utah
| SELECT preliminary_average FROM table_name_34 WHERE state = "utah" | sql_create_context |
CREATE TABLE table_203_687 (
id number,
"#" number,
"title" text,
"time" text,
"performer(s)" text,
"songwriters" text,
"producer(s)" text,
"samples and notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what track comes after say som... | SELECT "title" FROM table_203_687 WHERE "#" = (SELECT "#" FROM table_203_687 WHERE "title" = '"say something"') + 1 | squall |
CREATE TABLE table_name_66 (
lead VARCHAR,
second VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Lead when the Second was marc kennedy, in the 2012 13 season?
| SELECT lead FROM table_name_66 WHERE second = "marc kennedy" AND season = "2012–13" | sql_create_context |
CREATE TABLE table_name_98 (
report VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What does the Circuit of caen report?
| SELECT report FROM table_name_98 WHERE circuit = "caen" | sql_create_context |
CREATE TABLE table_36411 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has postponed (rain) rescheduled for august 7 as the score?
| SELECT "Date" FROM table_36411 WHERE "Score" = 'postponed (rain) rescheduled for august 7' | wikisql |
CREATE TABLE table_19542477_9 (
song_s__—_weeks VARCHAR,
artist_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of every song, and how many weeks was each song at #1 for One Direction?
| SELECT song_s__—_weeks FROM table_19542477_9 WHERE artist_s_ = "One Direction" | sql_create_context |
CREATE TABLE wdmzjzjlb (
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 jyjgzbb.JCFF 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 = jyj... | css |
CREATE TABLE table_28702208_1 (
volume__hm³_ VARCHAR,
reservoir VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the volume when the resrvoir is Tanes?
| SELECT volume__hm³_ FROM table_28702208_1 WHERE reservoir = "Tanes" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '15... | css |
CREATE TABLE table_79051 (
"Team" text,
"1982" text,
"1983" text,
"1984" real,
"Total points" real,
"Seasons" real,
"Points average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team had 3 seasons and fewer than 27 in 1984?
| SELECT "Team" FROM table_79051 WHERE "Seasons" = '3' AND "1984" < '27' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '葛德元' AND t_kc22.STA_DATE BETWEEN '2017-02-20' AND '2020-04-10' AND t_kc22.SOC_SRT_DIRE_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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_name_57 (
date VARCHAR,
home VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is Home of chicago black hawks has a Record of 0 1?
| SELECT date FROM table_name_57 WHERE home = "chicago black hawks" AND record = "0–1" | sql_create_context |
CREATE TABLE table_name_39 (
byes VARCHAR,
benalla_dfl VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Benalla DFL is swanpool with less than 16 losses, what is the sum of Byes?
| SELECT COUNT(byes) FROM table_name_39 WHERE benalla_dfl = "swanpool" AND losses < 16 | sql_create_context |
CREATE TABLE table_16768245_2 (
namesake VARCHAR,
longitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the longitude is 147.1w what is the namesake of the feature?
| SELECT namesake FROM table_16768245_2 WHERE longitude = "147.1W" | sql_create_context |
CREATE TABLE table_train_39 (
"id" int,
"active_infection" bool,
"sepsis" bool,
"organ_failure" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- evidence of acute organ dysfunction and / or shoc... | SELECT * FROM table_train_39 WHERE organ_failure = 1 OR septic_shock = 1 | criteria2sql |
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year number
)
CREATE TABLE record (
id number,
result text,
swimmer_id number,
event_id number
)
CREATE TABLE swimmer (
id number,
name text,
nationality text,
meter_1... | SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_19848 (
"PRINT NAME" text,
"NICKNAME" text,
"NUMBER OF COLORS" text,
"FRAMED SIZE" text,
"DATE COMPLETED" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when the nickname halley is used, what are the date completed
| SELECT "DATE COMPLETED" FROM table_19848 WHERE "NICKNAME" = 'Halley' | wikisql |
CREATE TABLE shop (
shop_id number,
shop_name text,
location text,
open_date text,
open_year number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE stock (
shop_id number... | SELECT carrier FROM device WHERE software_platform <> 'Android' | spider |
CREATE TABLE table_33702 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the biggest crowd when the home side sco... | SELECT MAX("Crowd") FROM table_33702 WHERE "Home team score" = '7.7 (49)' | wikisql |
CREATE TABLE table_45384 (
"Stop no." text,
"Platform" text,
"Line" text,
"Stopping pattern" text,
"Destination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Destination has a Stopping pattern of [2777] mciver station platforms?
| SELECT "Destination" FROM table_45384 WHERE "Stopping pattern" = '[2777] mciver station platforms' | wikisql |
CREATE TABLE table_46547 (
"Name" text,
"Date" text,
"Defending forces" text,
"Brigade" text,
"Population" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the brigade when Al-Hamra ('arab al-hamra) shows for name?
| SELECT "Brigade" FROM table_46547 WHERE "Name" = 'al-hamra (''arab al-hamra)' | wikisql |
CREATE TABLE table_76995 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Bush#, when Others% is '1.7%', when Others# is l... | SELECT MAX("Bush#") FROM table_76995 WHERE "Others%" = '1.7%' AND "Others#" < '75' AND "Kerry#" > '1,524' | wikisql |
CREATE TABLE table_12303563_2 (
winners INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many maximum winners
| SELECT MAX(winners) FROM table_12303563_2 | sql_create_context |
CREATE TABLE table_1341690_5 (
candidates VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was running for office in the California 10 district?
| SELECT candidates FROM table_1341690_5 WHERE district = "California 10" | sql_create_context |
CREATE TABLE table_26429658_1 (
production_code VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many production codes had a US viewership of 4.43 million?
| SELECT COUNT(production_code) FROM table_26429658_1 WHERE us_viewers__millions_ = "4.43" | sql_create_context |
CREATE TABLE table_33943 (
"Latitude" text,
"Longitude" text,
"City" text,
"State" text,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the latitude is 77 28 n, what is the longitude?
| SELECT "Longitude" FROM table_33943 WHERE "Latitude" = '77°28′n' | wikisql |
CREATE TABLE table_13027 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Outcome has a Score in the fi... | SELECT "Outcome" FROM table_13027 WHERE "Score in the final" = '1–6, 6–4, 7–5' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTask... | SELECT DISTINCT se.Id AS "suggested_edit_link", se.PostId AS "post_link", p.OwnerUserId AS "user_link", sev.UserId AS "user_link", se.CreationDate, se.ApprovalDate, se.RejectionDate FROM SuggestedEditVotes AS sev INNER JOIN SuggestedEdits AS se ON sev.SuggestedEditId = se.Id INNER JOIN Posts AS p ON sev.UserId = p.Owne... | sede |
CREATE TABLE table_name_31 (
goals_against INTEGER,
points VARCHAR,
goal_difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest goals against value for a team with 83 points and a difference over 50?
| SELECT MIN(goals_against) FROM table_name_31 WHERE points = 83 AND goal_difference > 50 | sql_create_context |
CREATE TABLE table_7536 (
"Position" text,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"Previous Club/Team" text,
"NHL rights, if any" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is S... | SELECT MAX("Weight (kg)") FROM table_7536 WHERE "Name" = 'scott gomez' | wikisql |
CREATE TABLE table_name_7 (
district VARCHAR,
first_elected VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district had a first elected in 1882 with a result of re-elected?
| SELECT district FROM table_name_7 WHERE first_elected = 1882 AND result = "re-elected" | sql_create_context |
CREATE TABLE table_262527_1 (
institution VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the institution located in north newton, kansas?
| SELECT institution FROM table_262527_1 WHERE location = "North Newton, Kansas" | sql_create_context |
CREATE TABLE table_name_11 (
nation VARCHAR,
rank VARCHAR,
bronze VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Nation, when Bronze is 1, when Gold is greater than 0, and when Rank is 2?
| SELECT nation FROM table_name_11 WHERE bronze = 1 AND gold > 0 AND rank = "2" | sql_create_context |
CREATE TABLE table_238124_1 (
bleeding_time VARCHAR,
partial_thromboplastin_time VARCHAR,
prothrombin_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the bleeding time during the prolonged partial thromboplastin time in which the prothrombin... | SELECT bleeding_time FROM table_238124_1 WHERE partial_thromboplastin_time = "Prolonged" AND prothrombin_time = "Unaffected" | sql_create_context |
CREATE TABLE table_57545 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on May 20?
| SELECT "Record" FROM table_57545 WHERE "Date" = 'may 20' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '中医风湿免疫病科' AND zyjzjlb.RYDJSJ BETWEEN '2002-04-24' AND '2003-09-08' | css |
CREATE TABLE table_45379 (
"Player" text,
"Club" text,
"Games" real,
"Goals" real,
"Assists" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Assists have a Club of adler mannheim, and Points larger than 57?
| SELECT SUM("Assists") FROM table_45379 WHERE "Club" = 'adler mannheim' AND "Points" > '57' | wikisql |
CREATE TABLE table_25831483_1 (
actor_actress VARCHAR,
first_appearance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the actor/actress with a first appearance is 3 june 2007?
| SELECT actor_actress FROM table_25831483_1 WHERE first_appearance = "3 June 2007" | sql_create_context |
CREATE TABLE table_name_50 (
design VARCHAR,
theme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which design uses the theme alpine skiing?
| SELECT design FROM table_name_50 WHERE theme = "alpine skiing" | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Lipase" | mimicsql_data |
CREATE TABLE table_37594 (
"Rank" real,
"Club" text,
"Wins" real,
"Last win" real,
"Runner-up" real,
"Last losing final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Runner-up has a Last win smaller than 1998, and Wins of 1, and a Rank l... | SELECT COUNT("Runner-up") FROM table_37594 WHERE "Last win" < '1998' AND "Wins" = '1' AND "Rank" > '13' | wikisql |
CREATE TABLE table_name_86 (
recording VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the recording for 2012
| SELECT recording FROM table_name_86 WHERE year = "2012" | sql_create_context |
CREATE TABLE table_25735_1 (
latest_year VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cook island league competitions were there?
| SELECT COUNT(latest_year) FROM table_25735_1 WHERE competition = "Cook Island League" | sql_create_context |
CREATE TABLE t_kc21 (
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 COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_NM = '俞玉轩' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_21409 (
"Year" real,
"Indians admitted" real,
"Pakistanis admitted" real,
"Sri Lankans admitted" real,
"Bangladeshis admitted" real,
"Nepalis admitted" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most number of ... | SELECT MIN("Indians admitted") FROM table_21409 WHERE "Sri Lankans admitted" = '3104' | wikisql |
CREATE TABLE table_20514 (
"Line" text,
"Terminals" text,
"Status" text,
"Length" text,
"Total number of stations" real,
"Operator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of the airport line?
| SELECT "Status" FROM table_20514 WHERE "Line" = 'Airport Line' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name DESC | nvbench |
CREATE TABLE constructorResults (
constructorResultsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
status TEXT
)
CREATE TABLE driverStandings (
driverStandingsId INTEGER,
raceId INTEGER,
driverId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
... | SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 ORDER BY COUNT(year) | nvbench |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time... | SELECT jyjgzbb.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 table_name_39 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the Steelers play against the New York Jets?
| SELECT date FROM table_name_39 WHERE opponent = "new york jets" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSMC = '头颈肿瘤科' AND mzjzjlb.JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18' | css |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Year | nvbench |
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY AVG(Age) | nvbench |
CREATE TABLE table_name_13 (
no_of_events VARCHAR,
country VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Events have a Country of trinidad and tobago, and a Date of march 30-april 1?
| SELECT no_of_events FROM table_name_13 WHERE country = "trinidad and tobago" AND date = "march 30-april 1" | 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 qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_ID = '53365571' AND qtb.IN_HOSP_DATE BETWEEN '2002-10-09' AND '2011-08-01' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_ID = '53365571' AND gyb.IN_HOSP... | css |
CREATE TABLE table_11473 (
"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 North Melbourne is the Away team, what is t... | SELECT COUNT("Crowd") FROM table_11473 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_6636 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which District has a First elected larger than 1858?
| SELECT "District" FROM table_6636 WHERE "First elected" > '1858' | wikisql |
CREATE TABLE table_54816 (
"Marginal Ordinary Income Tax Rate" text,
"Single" text,
"Married Filing Jointly or Qualified Widow(er)" text,
"Married Filing Separately" text,
"Head of Household" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the m... | SELECT "Married Filing Jointly or Qualified Widow(er)" FROM table_54816 WHERE "Head of Household" = '$117,451–$190,200' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Laryngoscopy and other tracheoscopy" | mimicsql_data |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer) | nvbench |
CREATE TABLE table_17008 (
"Abbreviation" text,
"Voivodeship" text,
"Capital" text,
"Area km\u00b2 (1998)" text,
"Population (1980)" text,
"No. of cities" real,
"No. of communes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many differ... | SELECT COUNT("Voivodeship") FROM table_17008 WHERE "Population (1980)" = '747 900' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.