instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_17120964_8 (
attendance VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attendance figures are given for the game where the final score was lost 5-3?
| SELECT COUNT(attendance) FROM table_17120964_8 WHERE result = "Lost 5-3" | 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 zyjybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '78981064' AND zyjybgb.BGRQ BETWEEN '2018-02-11' AND '2018-... | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Polycythemia vera" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_21092 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Grechukha Tholi has what longitude?
| SELECT "Longitude" FROM table_21092 WHERE "Name" = 'Grechukha Tholi' | wikisql |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show ... | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY stars DESC | nvbench |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
... | SELECT COUNT(*) FROM Tags | sede |
CREATE TABLE table_2781227_7 (
college_junior_club_team VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college team did the pick for Pittsburgh Penguins come from?
| SELECT college_junior_club_team FROM table_2781227_7 WHERE nhl_team = "Pittsburgh Penguins" | 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_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Subarachnoid hemorrhage following injury without mention of open intracranial wound, with loss of consciousness of uns... | mimicsql_data |
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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Alcoh dep NEC/NOS-unspec" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_35 (
method VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The record of 11-1 used what method?
| SELECT method FROM table_name_35 WHERE record = "11-1" | sql_create_context |
CREATE TABLE table_62617 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Status, when Opposing Teams is 'Scotland'?
| SELECT "Status" FROM table_62617 WHERE "Opposing Teams" = 'scotland' | wikisql |
CREATE TABLE table_name_30 (
category VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the category of the film made in Switzerland?
| SELECT category FROM table_name_30 WHERE country = "switzerland" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-39202' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) | eicu |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other specified diseases of pericardium" | mimicsql_data |
CREATE TABLE table_name_87 (
green_communist VARCHAR,
left_bloc VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for the Green-Communist party when the Left Bloc has 3.0%?
| SELECT green_communist FROM table_name_87 WHERE left_bloc = "3.0%" | sql_create_context |
CREATE TABLE table_28140588_1 (
title VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title when the director is Maynard C. Virgil i ?
| SELECT title FROM table_28140588_1 WHERE directed_by = "Maynard C. Virgil I" | sql_create_context |
CREATE TABLE table_name_78 (
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Tom Kite's Place?
| SELECT place FROM table_name_78 WHERE player = "tom kite" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anxiety' AND DATETIME(diagnosis.diagnosistime, 'st... | eicu |
CREATE TABLE table_12443 (
"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 To par of the player with a Finish of T20?
| SELECT "To par" FROM table_12443 WHERE "Finish" = 't20' | wikisql |
CREATE TABLE table_46605 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was his record at the AFC: Brazil 1 event that went 3 rounds?
| SELECT "Record" FROM table_46605 WHERE "Round" = '3' AND "Event" = 'afc: brazil 1' | wikisql |
CREATE TABLE table_20933 (
"Year (January)" real,
"Population (000)" real,
"Rural, %" real,
"Urban, %" real,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rural population percentage in 1979?
| SELECT MIN("Rural, %") FROM table_20933 WHERE "Year (January)" = '1979' | wikisql |
CREATE TABLE table_22468 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Land ( sqmi )" FROM table_22468 WHERE "Township" = 'Lansing' | wikisql |
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 COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '68417064' AND mzjzjlb.JZKSRQ BETWEEN '2009-12-28' AND '2021-09-30' AND mzjzjlb.YLJGDM = '1278762' | css |
CREATE TABLE table_32145 (
"Engine" text,
"Horsepower" text,
"Torque" text,
"Carburetor" text,
"Compression Ratio" text,
"Bore & Stroke" text,
"VIN Code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the compression ratio when the vi... | SELECT "Compression Ratio" FROM table_32145 WHERE "VIN Code" = 'c' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.short_title = "Candidal vulvovaginitis" | mimicsql_data |
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory... | SELECT COUNT(p.Id) FROM Posts AS p WHERE p.DeletionDate IS NULL AND p.ClosedDate IS NULL AND NOT p.AcceptedAnswerId IS NULL ORDER BY RAND() | sede |
CREATE TABLE table_17804 (
"Club" text,
"Played" text,
"Won" 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 follo... | SELECT "Tries for" FROM table_17804 WHERE "Club" = 'Club' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE T... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'open wound of neck nec')) | mimic_iii |
CREATE TABLE table_name_23 (
theme_song_s_ VARCHAR,
romaji_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Theme Song of Iryu -Team Medical Dragon-2?
| SELECT theme_song_s_ FROM table_name_23 WHERE romaji_title = "iryu -team medical dragon-2" | sql_create_context |
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON 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 mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM... | css |
CREATE TABLE table_74180 (
"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 "High points" FROM table_74180 WHERE "Date" = 'March 30' | wikisql |
CREATE TABLE table_27091 (
"Rank" text,
"Player" text,
"Nationality" text,
"Team" text,
"Opponent" text,
"Score" text,
"Competition" text,
"Vote percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ranking of the UEFA E... | SELECT "Rank" FROM table_27091 WHERE "Competition" = 'UEFA Euro 2012 qualifying Group A' | wikisql |
CREATE TABLE table_name_30 (
visitor VARCHAR,
home VARCHAR,
game__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the visitor team of game 19 with Los Angeles as the home team?
| SELECT visitor FROM table_name_30 WHERE home = "los angeles" AND game__number = 19 | sql_create_context |
CREATE TABLE table_name_87 (
entries INTEGER,
front_row_starts VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the lowest entries for a front row smaller than 15 where Michael Schumacher was driving?
| SELECT MIN(entries) FROM table_name_87 WHERE front_row_starts < 15 AND driver = "michael schumacher" | sql_create_context |
CREATE TABLE table_55472 (
"Player" text,
"No.(s)" real,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the years 1992-93, what position did he play ... | SELECT "Position" FROM table_55472 WHERE "Years for Rockets" = '1992-93' | wikisql |
CREATE TABLE table_name_93 (
updated_in_past_30_days VARCHAR,
registration VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Updated In Past 30 Days, when Registration is 'Open to people 13 and over'?
| SELECT updated_in_past_30_days FROM table_name_93 WHERE registration = "open to people 13 and over" | sql_create_context |
CREATE TABLE table_57170 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number in attendance for may 1
| SELECT COUNT("Attendance") FROM table_57170 WHERE "Date" = 'may 1' | wikisql |
CREATE TABLE table_57 (
"Year" real,
"Game or event" text,
"Date contested" text,
"League or governing body" text,
"Sport" text,
"Winning team" text,
"Losing team" text,
"Final score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wa... | SELECT "Winning team" FROM table_57 WHERE "Date contested" = 'February 1, 2009' | wikisql |
CREATE TABLE table_43514 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a Game smaller than 43, and a Record of 23-14-3?
| SELECT "Opponent" FROM table_43514 WHERE "Game" < '43' AND "Record" = '23-14-3' | wikisql |
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 COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '8879930' GROUP BY MED_ORG_DEPT_CD HAVING MIN(IN_HOSP_DAYS) > 10) AS T | css |
CREATE TABLE table_28114 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the writer who wrote the episode that was aired on September 11, 1972?... | SELECT "Writer(s)" FROM table_28114 WHERE "Airdate" = 'September 11, 1972' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id num... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '021-80293' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_85 (
date VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the date for 2010 fifa world cup qualification
| SELECT date FROM table_name_85 WHERE competition = "2010 fifa world cup qualification" | sql_create_context |
CREATE TABLE table_17448 (
"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 position does the player from Peterborough Petes (OHA) ... | SELECT "Position" FROM table_17448 WHERE "College/junior/club team" = 'Peterborough Petes (OHA)' | wikisql |
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 Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | nvbench |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW... | atis |
CREATE TABLE table_49580 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface that Laura Golarsa and her opponent played on in the final?
| SELECT "Surface" FROM table_49580 WHERE "Opponent in the final" = 'laura golarsa' | wikisql |
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 School_ID, ACC_Percent FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE table_52692 (
"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 sum of Crowd when Essendon was the h... | SELECT SUM("Crowd") FROM table_52692 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 varch... | SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY CITY DESC | nvbench |
CREATE TABLE manager_half (
player_id text,
year number,
team_id text,
league_id text,
inseason number,
half number,
g number,
w number,
l number,
rank number
)
CREATE TABLE manager (
player_id text,
year number,
team_id text,
league_id text,
inseason number,... | SELECT salary FROM salary WHERE year = 2010 UNION SELECT salary FROM salary WHERE year = 2001 | spider |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
... | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' | nvbench |
CREATE TABLE table_4184 (
"#" text,
"Project" text,
"Shipyard" text,
"Laid down" text,
"Launched" text,
"Commissioned" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which vessel area was called for on november 30, 1970
| SELECT "Shipyard" FROM table_4184 WHERE "Commissioned" = 'November 30, 1970' | wikisql |
CREATE TABLE table_name_33 (
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1st leg has a Team #1 of ummc ekaterinburg?
| SELECT 1 AS st_leg FROM table_name_33 WHERE team__number1 = "ummc ekaterinburg" | sql_create_context |
CREATE TABLE table_name_49 (
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Opponent has an Attendance of 74,246?
| SELECT opponent FROM table_name_49 WHERE attendance = "74,246" | sql_create_context |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT Year, AVG(MAX(Score)) FROM wine ORDER BY AVG(MAX(Score)) DESC | nvbench |
CREATE TABLE table_62834 (
"World record" text,
"Snatch" text,
"Marcin Do\u0142\u0119ga ( POL )" text,
"199kg" text,
"W\u0142adys\u0142awowo , Poland" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for W adys awowo, Poland when the world ... | SELECT "W\u0142adys\u0142awowo , Poland" FROM table_62834 WHERE "World record" = 'olympic record' AND "Marcin Do\u0142\u0119ga ( POL )" = 'olympic standard' AND "Snatch" = 'clean & jerk' | wikisql |
CREATE TABLE table_2562572_30 (
dominant_religion__2002_ VARCHAR,
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many dominant religions are in ala?
| SELECT COUNT(dominant_religion__2002_) FROM table_2562572_30 WHERE settlement = "Đala" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "1532" AND lab.fluid = "Blood" | mimicsql_data |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT demographic.insurance FROM demographic WHERE demographic.subject_id = "3284" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_50252 (
"Institution" text,
"Location" text,
"Nickname" text,
"Enrollment" real,
"Established" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nickname of the college established in 1773?
| SELECT "Nickname" FROM table_50252 WHERE "Established" = '1773' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId n... | SELECT p.Id AS "post_link", c.Text FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE (c.Text LIKE '%duplicate%' AND p.AnswerCount = 0 AND p.ClosedDate IS NULL) ORDER BY p.CreationDate | sede |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'aortic aneurysm - thoracic' AND DATETIME... | eicu |
CREATE TABLE table_23248869_6 (
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different people did different scores of high assists during the December 11 game?
| SELECT COUNT(high_assists) FROM table_23248869_6 WHERE date = "December 11" | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 te... | 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 Aircraft (
name VARCHAR,
distance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the name of aircrafts with top three lowest distances.
| SELECT name FROM Aircraft ORDER BY distance LIMIT 3 | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 398 | advising |
CREATE TABLE table_name_75 (
loss INTEGER,
name VARCHAR,
gain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total yards lost by antwon bailey when he gained 227?
| SELECT MIN(loss) FROM table_name_75 WHERE name = "antwon bailey" AND gain > 227 | sql_create_context |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE STUDENT... | SELECT MAX(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_name_75 (
builder VARCHAR,
launched VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what builder launched 20 jun 1953?
| SELECT builder FROM table_name_75 WHERE launched = "20 jun 1953" | sql_create_context |
CREATE TABLE table_44068 (
"Nat." text,
"Name" text,
"Since" real,
"Goals" real,
"Ends" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Name has Ends of 30 june 2010, and a Nation of eng, and Since larger than 2007?
| SELECT "Name" FROM table_44068 WHERE "Ends" = '30 june 2010' AND "Nat." = 'eng' AND "Since" > '2007' | wikisql |
CREATE TABLE table_3895 (
"Model - Computer name" text,
"CPU type" text,
"No. of processors" text,
"Period of operation" text,
"Maximum peak performance ( Teraflops )" text,
"Use" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of... | SELECT "No. of processors" FROM table_3895 WHERE "Period of operation" = 'October 2006 - January 2010' | wikisql |
CREATE TABLE table_204_6 (
id number,
"category" text,
"urban settlements" text,
"population" number,
"male" text,
"female" text,
"inhabited localities in jurisdiction" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many cities are below... | SELECT COUNT("urban settlements") FROM table_204_6 WHERE "population" < 1000 | squall |
CREATE TABLE table_name_5 (
score VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the tournament in Wellington?
| SELECT score FROM table_name_5 WHERE tournament = "wellington" | sql_create_context |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, COUNT(*) FROM ship GROUP BY Type ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_34 (
mascot VARCHAR,
school VARCHAR,
enrollment VARCHAR,
ihsaa_class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the mascot of Eastern Pekin having less than 627 enrolled and an AA for their IHSAA Class?
| SELECT mascot FROM table_name_34 WHERE enrollment < 627 AND ihsaa_class = "aa" AND school = "eastern pekin" | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'NW' AND flight.flight_id = flight_stop.flight_id | atis |
CREATE TABLE table_202_257 (
id number,
"year" number,
"single" text,
"chart" text,
"position" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many of the singles are under the chart of pop singles ?
| SELECT COUNT("single") FROM table_202_257 WHERE "chart" = 'pop singles' | squall |
CREATE TABLE Playlist (
PlaylistId integer,
Name varchar(120)
)
CREATE TABLE Invoice (
InvoiceId integer,
CustomerId integer,
InvoiceDate datetime,
BillingAddress varchar(70),
BillingCity varchar(40),
BillingState varchar(40),
BillingCountry varchar(40),
BillingPostalCode varcha... | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone DESC | nvbench |
CREATE TABLE table_6448 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what day was the sandown
| SELECT "Date" FROM table_6448 WHERE "Race Title" = 'sandown' | wikisql |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
... | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state | nvbench |
CREATE TABLE table_train_77 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"language" string,
"hiv_aids" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- hiv positive
| SELECT * FROM table_train_77 WHERE hiv_aids = 1 | criteria2sql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(*) AS num, AVG(PT.Score), TagName FROM (SELECT * FROM (SELECT Score, Id FROM Posts WHERE PostTypeId = 1) AS P JOIN PostTags ON P.Id = PostTags.PostId) AS PT JOIN Tags ON PT.TagId = Tags.Id GROUP BY TagName HAVING COUNT(*) >= 5 ORDER BY AVG(PT.Score) DESC | sede |
CREATE TABLE table_2668347_22 (
district VARCHAR,
candidates VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district did William A. Burwell (Dr) belong to?
| SELECT district FROM table_2668347_22 WHERE candidates = "William A. Burwell (DR)" | sql_create_context |
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 q.Id AS "post_link" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL AND q.AcceptedAnswerId > 0 AND q.AnswerCount > 2 AND EXISTS(SELECT a.Id FROM Posts AS a WHERE a.Score = 0 AND a.ParentId = q.Id) ORDER BY q.CreationDate DESC | sede |
CREATE TABLE table_name_19 (
country VARCHAR,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From what Country is T6 Place Player Robert Karlsson?
| SELECT country FROM table_name_19 WHERE place = "t6" AND player = "robert karlsson" | 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 jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '13818309' AND jybgb.BGRQ BETWEEN '2001-10-19' AND '2016-08-22' UNION... | css |
CREATE TABLE table_29861 (
"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 "Location Attendance" FROM table_29861 WHERE "Score" = 'L 105–123 (OT)' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '24113912' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2013-05-12') UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOI... | css |
CREATE TABLE table_name_8 (
theatre VARCHAR,
_studio VARCHAR,
_or_network VARCHAR,
role VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the theatre where Peter P. Peters is the role?
| SELECT theatre, _studio, _or_network FROM table_name_8 WHERE role = "peter p. peters" | sql_create_context |
CREATE TABLE table_21391 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Language(s)" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director of the film with an... | SELECT "Director" FROM table_21391 WHERE "Original title" = '16 Days in Afghanistan' | wikisql |
CREATE TABLE table_name_67 (
mountain_peak VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the mountain peak of 49 rank
| SELECT mountain_peak FROM table_name_67 WHERE rank = 49 | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_76 (
construction_completed VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What construction completed is named nelson tunnel/commodore waste rock?
| SELECT construction_completed FROM table_name_76 WHERE name = "nelson tunnel/commodore waste rock" | sql_create_context |
CREATE TABLE table_name_43 (
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many strokes under par was the player who scored 71?
| SELECT to_par FROM table_name_43 WHERE score = 71 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.