instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE player (
player_id text,
birth_year number,
birth_month number,
birth_day number,
birth_country text,
birth_state text,
birth_city text,
death_year number,
death_month number,
death_day number,
death_country text,
death_state text,
death_city text,
na... | SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JO... | spider |
CREATE TABLE table_24652 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original U.S. air date" text,
"Prod. code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote episode 31 in th... | SELECT "Written by" FROM table_24652 WHERE "No. in series" = '31' | wikisql |
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 AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '小儿传染病科' AND IN_HOSP_DATE BETWEEN '2000-12-13' AND '2020-08-16' AND IN_DIAG_DIS_CD = 'V99.890' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_name_66 (
country VARCHAR,
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country is ranked more than 4?
| SELECT country FROM table_name_66 WHERE rank > 4 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE customers (
id INTEGER,
first_name VARCHAR(40),
last_name VARCHAR(20),
company VARCHAR(80),
address VARCHAR(70),
city VARCHAR(40),
state VARCHAR(40),
country VARCHAR(40),
postal_code VARCHAR(10),
phone VARCHAR(24),
fax VARCHAR(24),
email VARCHAR(60),
supp... | SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE table_31293 (
"Eliminated" real,
"Wrestler" text,
"Entered" real,
"Eliminated by" text,
"Method of elimination" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entries are shown for entered at 21:09?
| SELECT COUNT("Entered") FROM table_31293 WHERE "Time" = '21:09' | wikisql |
CREATE TABLE Customers_cards (
card_type_code VARCHAR,
card_id VARCHAR
)
CREATE TABLE Financial_transactions (
card_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the card type codes and the number of transactions.
| SELECT T2.card_type_code, COUNT(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code | sql_create_context |
CREATE TABLE table_41137 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of S No(s), when the Margin is 16 runs?
| SELECT COUNT("S No") FROM table_41137 WHERE "Margin" = '16 runs' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT demographic.dob, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_23619005_3 (
player VARCHAR,
cfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different players got drafted for the Ottawa Renegades?
| SELECT COUNT(player) FROM table_23619005_3 WHERE cfl_team = "Ottawa Renegades" | sql_create_context |
CREATE TABLE table_204_624 (
id number,
"school" text,
"team name" text,
"town" text,
"county" text,
"enrollment (2010-11 & 2011-12)" number,
"primary mshsaa class*" number,
"football class" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT COUNT("team name") FROM table_204_624 WHERE "enrollment (2010-11 & 2011-12)" >= 500 | squall |
CREATE TABLE table_name_47 (
gold INTEGER,
nation VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Gold has a Nation of malaysia, and a Silver smaller than 0?
| SELECT MIN(gold) FROM table_name_47 WHERE nation = "malaysia" AND silver < 0 | sql_create_context |
CREATE TABLE table_16459 (
"No. in season" real,
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the names... | SELECT "Title" FROM table_16459 WHERE "U.S. viewers (million)" = '3.02' | 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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE table_train_208 (
"id" int,
"anemia" bool,
"serum_bicarbonate" int,
"hemoglobin_a1c_hba1c" float,
"temperature" float,
"dementia" bool,
"electrolyte_imbalances" bool,
"impaired_sensorium" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the followin... | SELECT * FROM table_train_208 WHERE electrolyte_imbalances = 1 OR serum_bicarbonate < 20 | criteria2sql |
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 text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT SHRGH, SHRXM FROM jyjgzbb WHERE JYZBLSH = '19519716783' | css |
CREATE TABLE table_69518 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the qualifying time of Jim Rathmann in 1959?
| SELECT "Qual" FROM table_69518 WHERE "Year" = '1959' | wikisql |
CREATE TABLE student_course_enrolment (
registration_id number,
student_id number,
course_id number,
date_of_enrolment time,
date_of_completion time
)
CREATE TABLE courses (
course_id number,
author_id number,
subject_id number,
course_name text,
course_description text
)
CREAT... | SELECT T1.course_description, T1.course_name FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2 | spider |
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_name_26 (
venue VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team played in the Darida venue?
| SELECT venue FROM table_name_26 WHERE team = "darida" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '9925374' AND JZKSRQ BETWEEN '2016-01-06' AND '2020-10-15' AND ZZBZ > 0 | css |
CREATE TABLE table_name_26 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result on 8 October 1961?
| SELECT result FROM table_name_26 WHERE date = "8 october 1961" | sql_create_context |
CREATE TABLE table_203_303 (
id number,
"tribunal" text,
"number of autos da fe" number,
"executions in persona" number,
"executions in effigie" number,
"penanced" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which tribun... | SELECT "tribunal" FROM table_203_303 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE Project_Staff (
date_from VARCHAR,
date_to VARCHAR,
project_id VARCHAR,
role_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List from which date and to which date these staff work: project staff of the project which hires the most s... | SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader' | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'head ct scan - wi... | eicu |
CREATE TABLE table_76293 (
"Name" text,
"City" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What building in Louisville had more than 35 floors?
| SELECT "Name" FROM table_76293 WHERE "City" = 'louisville' AND "Floors" > '35' | wikisql |
CREATE TABLE table_name_89 (
result VARCHAR,
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the april 6, 2002 game against the greensboro prowlers?
| SELECT result FROM table_name_89 WHERE opponent = "greensboro prowlers" AND date = "april 6, 2002" | sql_create_context |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_74433 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pick number is Kevan George?
| SELECT "Pick #" FROM table_74433 WHERE "Player" = 'Kevan George' | wikisql |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts | nvbench |
CREATE TABLE table_name_36 (
county VARCHAR,
median_household_income VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What County has a Median household income of $46,872?
| SELECT county FROM table_name_36 WHERE median_household_income = "$46,872" | sql_create_context |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY COUNT(local_authority) | nvbench |
CREATE TABLE table_45265 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the game ... | SELECT "Score" FROM table_45265 WHERE "Team" = 'san antonio' | 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_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '喻萍雅' AND t_kc22.STA_DATE BETWEEN '2000-10-01' AND '2010-09-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_26250189_1 (
song_choice VARCHAR,
original_artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the choice of song where the original artist was Stevie Wonder?
| SELECT song_choice FROM table_26250189_1 WHERE original_artist = "Stevie Wonder" | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN... | atis |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞... | css |
CREATE TABLE table_204_147 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games hav... | SELECT COUNT(*) FROM table_204_147 WHERE "attendance" < 25000 | squall |
CREATE TABLE table_17484 (
"Rd." real,
"Grand Prix" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the grand prix with winning... | SELECT "Grand Prix" FROM table_17484 WHERE "Winning driver" = 'Jenson Button' | wikisql |
CREATE TABLE table_13995 (
"Medal" text,
"Name" text,
"Sport" text,
"Event" text,
"Date" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the sport of athletics on a date earlier than 16?
| SELECT "Name" FROM table_13995 WHERE "Sport" = 'athletics' AND "Date" < '16' | wikisql |
CREATE TABLE table_57488 (
"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 South Melbourne's score as the home tea... | SELECT "Home team score" FROM table_57488 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE table_34439 (
"Date" text,
"Label" text,
"Region" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release Date of the 7' single in Catalog 87184?
| SELECT "Date" FROM table_34439 WHERE "Format" = '7" single' AND "Catalog" = '87184' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | SELECT COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id WHERE (v.VoteTypeId = 6) AND p.OwnerUserId = 235 | sede |
CREATE TABLE table_19517621_4 (
original_airdate VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of the episode written by Michelle Offen?
| SELECT original_airdate FROM table_19517621_4 WHERE written_by = "Michelle Offen" | sql_create_context |
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Descri... | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion - right' AND STRFTIME('%y', diagnosis.diagnosistime) = '... | eicu |
CREATE TABLE table_2562572_5 (
population__2002_ INTEGER,
urban_settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the population for 2002 being ada
| SELECT MIN(population__2002_) FROM table_2562572_5 WHERE urban_settlement = "Ada" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
require... | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH... | advising |
CREATE TABLE table_203_615 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" number,
"result" text,
"candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many of these congressmen were re elected ?
| SELECT COUNT("incumbent") FROM table_203_615 WHERE "result" = 're-elected' | 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.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '60507668' AND t_kc21.MED_SER_ORG_NO = '9524641' AND t_kc21.OUT_DIAG_DOC_NM LIKE '陶%' | css |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
)
-- Using valid SQLite, answer the ... | SELECT Party, COUNT(*) FROM representative GROUP BY Party | nvbench |
CREATE TABLE table_23180 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the school from Logan Township, Pennsylvania jo... | SELECT "Joined" FROM table_23180 WHERE "Location" = 'Logan Township, Pennsylvania' | wikisql |
CREATE TABLE table_184 (
"Information" text,
"Dysart" text,
"Shadow Ridge" text,
"Valley Vista" text,
"Willow Canyon" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many informations does Michael Hawkins have?
| SELECT COUNT("Information") FROM table_184 WHERE "Shadow Ridge" = 'Michael Hawkins' | wikisql |
CREATE TABLE table_name_57 (
dist_from_origin VARCHAR,
location__all_in_nagano__ VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the distance from origin in Azumino including Toyoshina IC?
| SELECT dist_from_origin FROM table_name_57 WHERE location__all_in_nagano__ = "azumino" AND name = "toyoshina ic" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_88 (
against INTEGER,
played VARCHAR,
drawn VARCHAR,
difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Against when the drawn is more than 2 and the Difference of- 17, and a Played smaller than 20?
| SELECT AVG(against) FROM table_name_88 WHERE drawn > 2 AND difference = "- 17" AND played < 20 | sql_create_context |
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
)
CREATE TABLE useracct (
u_id number,
name text
)
-- Usi... | SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5 | spider |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TA... | SELECT t.TagName FROM Tags AS t WHERE NOT t.TagName LIKE '%s' | sede |
CREATE TABLE table_65070 (
"Project" text,
"License" text,
"Date" text,
"Protocol" text,
"Technology" text,
"Server" text,
"Client" text,
"Web Client" text,
"Multiple Sessions" text,
"Encryption" text,
"Authentication" text,
"Data Compression" text,
"Image Quality" te... | SELECT "Proxy" FROM table_65070 WHERE "Image Quality" = '✓' AND "Encryption" = 'ssl' AND "License" = 'proprietary' | wikisql |
CREATE TABLE table_name_30 (
date VARCHAR,
attendance VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the game with fewer than 6650 in attendance, that finished 0:1?
| SELECT date FROM table_name_30 WHERE attendance < 6650 AND score = "0:1" | sql_create_context |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class DESC | nvbench |
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 text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | (SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_75888 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Country, when Lane is 5, and when React is greater than 0.166?
| SELECT "Country" FROM table_75888 WHERE "Lane" = '5' AND "React" > '0.166' | wikisql |
CREATE TABLE table_17687 (
"Track Name" text,
"Location" text,
"Length" text,
"Seating" real,
"Year Opened" real,
"Year Acquired [A ]" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the track that opened in 1950?
| SELECT "Location" FROM table_17687 WHERE "Year Opened" = '1950' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, Price FROM Products WHERE Price >= 180 ORDER BY Price DESC, Name | nvbench |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_stop (
flight_id in... | 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 ((((flight.departure_time <= 2359 AND flight.departure_time >= 2000) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year... | atis |
CREATE TABLE table_5225 (
"Team" text,
"Copa Libertadores 1992" text,
"Supercopa Sudamericana 1992" text,
"Copa CONMEBOL 1992" text,
"Recopa Sudamericana 1992" text,
"Intercontinental Cup 1992" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whic... | SELECT "Supercopa Sudamericana 1992" FROM table_5225 WHERE "Team" = 'santos' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-54876')) ORDER BY medication.drugstarttime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_33 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At the match in windy hill, how much did the home team score?
| SELECT home_team AS score FROM table_name_33 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE table_51975 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game on February 25, 2008?
| SELECT "Record" FROM table_51975 WHERE "Date" = 'february 25, 2008' | wikisql |
CREATE TABLE table_name_88 (
silver INTEGER,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For all countries with 7 bronze medals and a total number of medals less than 13, what's the sum of silver medals?
| SELECT SUM(silver) FROM table_name_88 WHERE bronze = 7 AND total < 13 | sql_create_context |
CREATE TABLE table_27811 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was ... | SELECT "Skipper" FROM table_27811 WHERE "Elapsed time d:hh:mm:ss" = '3:07:39:33' | wikisql |
CREATE TABLE table_20908 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons have a pro... | SELECT COUNT("No. in season") FROM table_20908 WHERE "Production code" = '204' | wikisql |
CREATE TABLE table_47411 (
"Circuit" text,
"Location" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Winner, when Circuit is June 8?
| SELECT "Winner" FROM table_47411 WHERE "Circuit" = 'june 8' | wikisql |
CREATE TABLE phone (
model_name VARCHAR,
chip_model VARCHAR,
Accreditation_type VARCHAR
)
CREATE TABLE chip_model (
model_name VARCHAR,
chip_model VARCHAR,
Accreditation_type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of t... | SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full' | sql_create_context |
CREATE TABLE table_16021 (
"Episode #" real,
"Production code" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the episode # for production code 227
| SELECT "Episode #" FROM table_16021 WHERE "Production code" = '227' | wikisql |
CREATE TABLE table_name_79 (
season VARCHAR,
final_placing VARCHAR,
podiums VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has a Final Place of 8th and 8 Podiums?
| SELECT season FROM table_name_79 WHERE final_placing = "8th" AND podiums = "8" | sql_create_context |
CREATE TABLE table_name_17 (
south_dakota VARCHAR,
oklahoma VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What South Dakota has Bush of Oklahoma?
| SELECT south_dakota FROM table_name_17 WHERE oklahoma = "bush" | sql_create_context |
CREATE TABLE table_name_69 (
laps INTEGER,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the lowest laps of Tarso Marques?
| SELECT MIN(laps) FROM table_name_69 WHERE driver = "tarso marques" | sql_create_context |
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 SOC_SRT_DIRE_NM, AMOUNT, MED_CLINIC_ID FROM t_kc22 WHERE (MED_CLINIC_ID = '32363645968' OR MED_CLINIC_ID = '49194590311') AND SOC_SRT_DIRE_NM IN ((SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '32363645968') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '49194590311')) | css |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'SPANISH' | advising |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2687252' AND t_kc21.MED_ORG_DEPT_NM = '小儿神经内科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-05-05' AND '2008-07-19' | css |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Ignor... | SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY title | nvbench |
CREATE TABLE table_21995 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Country" text,
"Project" text,
"Status at production" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what country did the 'ams... | SELECT "Country" FROM table_21995 WHERE "Title" = 'Amsterdam''s Futuristic Floating City' | wikisql |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2186.0" AND prescriptions.drug = "NEO*IV*Fat Emulsion" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'splenic trauma - grade ii laceration' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_name_46 (
name VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Name has a Time of 01:56:52?
| SELECT name FROM table_name_46 WHERE time = "01:56:52" | sql_create_context |
CREATE TABLE table_73984 (
"Name" text,
"Park" text,
"Length (ft)" real,
"Height (ft)" real,
"Speed (mph)" text,
"Opened" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many parks are called mt. olympus
| SELECT COUNT("Name") FROM table_73984 WHERE "Park" = 'Mt. Olympus' | wikisql |
CREATE TABLE table_name_25 (
res VARCHAR,
record VARCHAR,
time VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which res has a Time of 5:00, and a Method of decision (unanimous), and a Record of 1 0?
| SELECT res FROM table_name_25 WHERE time = "5:00" AND method = "decision (unanimous)" AND record = "1–0" | sql_create_context |
CREATE TABLE table_12591 (
"Year" real,
"Date" text,
"Home Team" text,
"Result" text,
"Visiting Team" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the game at the Los Angeles Memorial Coliseum... | SELECT "Year" FROM table_12591 WHERE "Venue" = 'los angeles memorial coliseum' AND "Attendance" > '85,302' AND "Date" = 'november 9' | wikisql |
CREATE TABLE table_75869 (
"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 lowest total when the rank is 14 and the gold medals is larger than 0?
| SELECT MIN("Total") FROM table_75869 WHERE "Rank" = '14' AND "Gold" > '0' | wikisql |
CREATE TABLE table_10248 (
"Sun Belt" text,
"Lost" real,
"Tied" real,
"Pct." real,
"Years" real,
"Total Games" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the low loss total for teams with under 3 years and a less than 0.625% winning ... | SELECT MIN("Lost") FROM table_10248 WHERE "Pct." < '0.625' AND "Years" < '3' | wikisql |
CREATE TABLE genre (
genreid number,
name text
)
CREATE TABLE mediatype (
mediatypeid number,
name text
)
CREATE TABLE track (
trackid number,
name text,
albumid number,
mediatypeid number,
genreid number,
composer text,
milliseconds number,
bytes number,
unitprice ... | SELECT AVG(T2.unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Rock" | spider |
CREATE TABLE table_name_69 (
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in week 12?
| SELECT opponent FROM table_name_69 WHERE week = 12 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Transplant cadaver donor" | mimicsql_data |
CREATE TABLE table_203_564 (
id number,
"hand" text,
"1 credit" number,
"2 credits" number,
"3 credits" number,
"4 credits" number,
"5 credits" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference of payout on 3 credits , ... | SELECT ABS((SELECT "3 credits" FROM table_203_564 WHERE "hand" = 'straight flush') - (SELECT "3 credits" FROM table_203_564 WHERE "hand" = 'royal flush')) | squall |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Coun... | SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 | nvbench |
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
... | SELECT Service_Type_Description, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code ORDER BY Service_Type_Description DESC | nvbench |
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "64208" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.