instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_43484 (
"Venue" text,
"Location" text,
"Environment" text,
"Closed" text,
"Reason" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venues were closed because they were replaced?
| SELECT "Location" FROM table_43484 WHERE "Reason" = 'replaced' | wikisql |
CREATE TABLE record (
id number,
result text,
swimmer_id number,
event_id number
)
CREATE TABLE event (
id number,
name text,
stadium_id number,
year text
)
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year numbe... | SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006 | spider |
CREATE TABLE table_203_417 (
id number,
"rnd." number,
"pick #" number,
"nfl team" text,
"player" text,
"pos." text,
"college" text,
"conf." text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which nfl team picked the first... | SELECT "nfl team" FROM table_203_417 WHERE "pick #" = 1 | squall |
CREATE TABLE table_name_97 (
top_5 INTEGER,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest top-5 when wins is more than 1?
| SELECT MAX(top_5) FROM table_name_97 WHERE wins > 1 | sql_create_context |
CREATE TABLE Product (
product_id INTEGER,
product_name VARCHAR(80),
product_details VARCHAR(255)
)
CREATE TABLE Problem_Category_Codes (
problem_category_code VARCHAR(20),
problem_category_description VARCHAR(80)
)
CREATE TABLE Problem_Log (
problem_log_id INTEGER,
assigned_to_staff_id IN... | SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY log_entry_description | nvbench |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy... | css |
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '29762576' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-02-05' AND '2020-09-20' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_203_372 (
id number,
"from" number,
"to" number,
"name" text,
"party" text,
"position" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who served the most years as mayor ?
| SELECT "name" FROM table_203_372 ORDER BY "to" - "from" DESC LIMIT 1 | squall |
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 = 'acute renal failure' AND DATETIME(diagnosis.diagno... | eicu |
CREATE TABLE table_36194 (
"Round" real,
"Pick" text,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest round for Paul Hubbard?
| SELECT MIN("Round") FROM table_36194 WHERE "Name" = 'paul hubbard' | wikisql |
CREATE TABLE table_4704 (
"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 date of the game when Hawthorn was t... | SELECT "Date" FROM table_4704 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_7728 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in Final" text,
"Score in Final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponents in the final that was ... | SELECT "Opponents in Final" FROM table_7728 WHERE "Outcome" = 'runner-up' AND "Date" = 'april 16, 2006' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
h... | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND DATETIME(labevents.charttime, 'start of month') = D... | mimic_iii |
CREATE TABLE table_237199_1 (
company_name VARCHAR,
world_headquarters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which company name has headquarters in nagaokakyo, kyoto?
| SELECT company_name FROM table_237199_1 WHERE world_headquarters = "Nagaokakyo, Kyoto" | sql_create_context |
CREATE TABLE table_32455 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team at Lake Oval?
| SELECT "Away team" FROM table_32455 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy... | css |
CREATE TABLE table_17151 (
"Player" text,
"No.(s)" text,
"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.
-- what is the total number of player where years fo... | SELECT COUNT("Player") FROM table_17151 WHERE "Years for Rockets" = '1975-79' | wikisql |
CREATE TABLE table_57081 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position was active in Jazz in 2002-03?
| SELECT "Position" FROM table_57081 WHERE "Years for Jazz" = '2002-03' | wikisql |
CREATE TABLE table_15150 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Laps were there in 2010?
| SELECT SUM("Laps") FROM table_15150 WHERE "Year" = '2010' | wikisql |
CREATE TABLE table_204_506 (
id number,
"seasons" number,
"team" text,
"ch.wins" number,
"promotions" number,
"relegations" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams had the most seasons ?
| SELECT COUNT("team") FROM table_204_506 WHERE "seasons" = (SELECT MAX("seasons") FROM table_204_506) | squall |
CREATE TABLE table_name_71 (
event VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The event that has a record of 1-0 is none of the above.
| SELECT event FROM table_name_71 WHERE record = "1-0" | sql_create_context |
CREATE TABLE table_37760 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average field goal someone has when they have 0 extra points but more than 5 to... | SELECT AVG("Field goals") FROM table_37760 WHERE "Extra points" > '0' AND "Touchdowns" > '5' | wikisql |
CREATE TABLE table_name_89 (
laps INTEGER,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most number of laps run by Ilario Dionisi?
| SELECT MAX(laps) FROM table_name_89 WHERE rider = "ilario dionisi" | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '6403042' AND RYDJSJ BETWEEN '2012-03-10' AND '2019-08-21' AND DATEDIFF(CYSJ, RYSJ) > 20 | css |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400 | advising |
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1 | spider |
CREATE TABLE table_54856 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school did the player have a height of 6-4?
| SELECT "School" FROM table_54856 WHERE "Height" = '6-4' | wikisql |
CREATE TABLE table_79475 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest pick of the defensive tackle player dave haverdick?
| SELECT MIN("Pick") FROM table_79475 WHERE "Position" = 'defensive tackle' AND "Player" = 'dave haverdick' | wikisql |
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
ID int,
Musi... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result | nvbench |
CREATE TABLE table_name_74 (
skip VARCHAR,
alternate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the skip of the nation with Laurens van der Windt as the alternate?
| SELECT skip FROM table_name_74 WHERE alternate = "laurens van der windt" | sql_create_context |
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
)
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TAB... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Ventricl shunt tube punc" | mimicsql_data |
CREATE TABLE table_63190 (
"Year" real,
"Title" text,
"Billboard Hot 100" text,
"UK Singles Chart" text,
"Album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the billboard hot 100 with an album bust a nut, and the title of 'need your lovi... | SELECT "Billboard Hot 100" FROM table_63190 WHERE "Album" = 'bust a nut' AND "Title" = 'need your lovin'' (re-release)' | wikisql |
CREATE TABLE table_19089486_1 (
clubs_remaining INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least clubs remaining
| SELECT MIN(clubs_remaining) FROM table_19089486_1 | sql_create_context |
CREATE TABLE institution (
institution_id text,
institution text,
location text,
founded number,
type text,
enrollment number,
team text,
primary_conference text,
building_id text
)
CREATE TABLE building (
building_id text,
name text,
street_address text,
years_as_ta... | SELECT COUNT(*) FROM building | spider |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
u... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'hypercalcemia' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | eicu |
CREATE TABLE table_24213 (
"Competition" text,
"Round" text,
"Opponent" text,
"Result" text,
"Score" text,
"Home/Away" text,
"Venue" text,
"Attendance" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- state the round that ... | SELECT "Round" FROM table_24213 WHERE "Score" = '50-10' | wikisql |
CREATE TABLE table_47806 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE HIGHEST PICK WITH A TE POSITION, AND ROUND SMALLER THAN 2?
| SELECT MAX("Pick") FROM table_47806 WHERE "Position" = 'te' AND "Round" < '2' | wikisql |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
... | SELECT Name, Total_Passengers FROM station WHERE Location <> 'London' ORDER BY Name DESC | nvbench |
CREATE TABLE table_name_32 (
position VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does the player from texas a&m play?
| SELECT position FROM table_name_32 WHERE school = "texas a&m" | sql_create_context |
CREATE TABLE table_203_685 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the last episode of season one
| SELECT "title" FROM table_203_685 ORDER BY "no. in\nseason" DESC LIMIT 1 | squall |
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 jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.JZLSH = '71275819532' GROUP BY jybgb.BGRGH HAVING COUNT(*) > 20 | css |
CREATE TABLE table_46077 (
"Name" text,
"Born-Died" text,
"Term start" text,
"Term end" text,
"Political Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Born-Died, when Term Start is 4 December 1941?
| SELECT "Born-Died" FROM table_46077 WHERE "Term start" = '4 december 1941' | wikisql |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by | nvbench |
CREATE TABLE table_50892 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team raced at Amaroo Park?
| SELECT "Team" FROM table_50892 WHERE "Circuit" = 'amaroo park' | 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE Ref_Company_Types (
company_type_code VARCHAR
)
CREATE TABLE Maintenance_Contracts (
maintenance_contract_company_id VARCHAR,
contract_end_date VARCHAR
)
CREATE TABLE Third_Party_Companies (
company_name VARCHAR,
company_id VARCHAR,
company_type_code VARCHAR
)
-- Using valid SQL... | SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code = T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_46855 (
"School" text,
"Locality" text,
"Description" text,
"Ofsted" real,
"Website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many values for Ofsted occurr at Chowbent Primary School?
| SELECT COUNT("Ofsted") FROM table_46855 WHERE "School" = 'chowbent primary school' | wikisql |
CREATE TABLE table_33021 (
"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.
-- Which Away team has a score of 6.17 (53)?
| SELECT "Away team" FROM table_33021 WHERE "Away team score" = '6.17 (53)' | wikisql |
CREATE TABLE table_train_236 (
"id" int,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"hba1c" float,
"fbg" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- fbg > 180 mg /... | SELECT * FROM table_train_236 WHERE fbg > 180 | criteria2sql |
CREATE TABLE table_name_61 (
chinese VARCHAR,
rōmaji VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the Chinese characters for the word that has a R maji of ch sh ?
| SELECT chinese FROM table_name_61 WHERE rōmaji = "chāshū" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
... | SELECT (SELECT SUM(inputevents_cv.amount) 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 = 4401)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT... | mimic_iii |
CREATE TABLE table_name_51 (
date VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team with a tie number of 6.
| SELECT date FROM table_name_51 WHERE tie_no = "6" | sql_create_context |
CREATE TABLE table_15358 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of goals conceded when lost i... | SELECT SUM("Goals Conceded") FROM table_15358 WHERE "Lost" > '7' AND "Points" < '26' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = course... | advising |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT procedures.icd9_code, prescriptions.formulary_drug_cd FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "24425" | mimicsql_data |
CREATE TABLE table_name_61 (
conmebol_1995 VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which CONMEBOL 1995 has river plate team?
| SELECT conmebol_1995 FROM table_name_61 WHERE team = "river plate" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '02068561850' | css |
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE songs (
songid... | SELECT * FROM albums WHERE year = 2012 | spider |
CREATE TABLE table_59923 (
"Week 8 Oct 26" text,
"Week 10 Nov 9" text,
"Week 11 Nov 16" text,
"Week 12 Nov 23" text,
"Week 13 Nov 30" text,
"Week 14 (Final) Dec 7" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the week 8 Oct 26 standing... | SELECT "Week 8 Oct 26" FROM table_59923 WHERE "Week 12 Nov 23" = 'georgia tech (8-2)' | wikisql |
CREATE TABLE table_name_26 (
loss VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss when the score was 7-1?
| SELECT loss FROM table_name_26 WHERE score = "7-1" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Yogesh More%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer... | advising |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
h... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31306) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE table_name_2 (
binibining_pilipinas_international VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Binibining Pilipinas-International has a Year of 1975?
| SELECT binibining_pilipinas_international FROM table_name_2 WHERE year = 1975 | sql_create_context |
CREATE TABLE table_name_18 (
venue VARCHAR,
silver VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was 2010 tournament where the United States received the silver?
| SELECT venue FROM table_name_18 WHERE silver = "united states" AND year = 2010 | sql_create_context |
CREATE TABLE table_name_58 (
built VARCHAR,
number_in_class VARCHAR,
owner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was built in a class with less than 10, and the Downer Rail owner?
| SELECT built FROM table_name_58 WHERE number_in_class < 10 AND owner = "downer rail" | sql_create_context |
CREATE TABLE WINE (
Appelation VARCHAR,
Price INTEGER,
Score INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the average price and score of wines grouped by appelation?
| SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation | sql_create_context |
CREATE TABLE table_34571 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the team played at the bobcats?
| SELECT "Score" FROM table_34571 WHERE "Home" = 'bobcats' | wikisql |
CREATE TABLE table_203_426 (
id number,
"year" number,
"title" text,
"peak chart positions\naus" number,
"peak chart positions\nnz" number,
"peak chart positions\nuk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tr... | SELECT COUNT("title") FROM table_203_426 WHERE "album" = 'single-only release' | squall |
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 shop_name FROM shop WHERE NOT shop_id IN (SELECT shop_id FROM stock) | spider |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistoryTypes (
Id number,
Name te... | SELECT DisplayName, CreationDate, UpVotes + DownVotes AS totalVotes, DATEDIFF(DAY, CreationDate, LastAccessDate) AS "Days active", (UpVotes + DownVotes) / (CASE WHEN DATEDIFF(DAY, CreationDate, LastAccessDate) = 0 THEN 1 ELSE DATEDIFF(DAY, CreationDate, LastAccessDate) END) AS "Votes per day" FROM Users WHERE Reputatio... | sede |
CREATE TABLE table_203_593 (
id number,
"tenure" text,
"coach" text,
"years" number,
"record" text,
"pct." number,
"ncaa tournament" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of years hal baird coached ?
| SELECT "years" FROM table_203_593 WHERE "coach" = 'hal baird' | squall |
CREATE TABLE table_name_57 (
network VARCHAR,
studio_host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network had the host of john wells?
| SELECT network FROM table_name_57 WHERE studio_host = "john wells" | sql_create_context |
CREATE TABLE table_32790 (
"Year" real,
"Player" text,
"Country" text,
"Team" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country did mario lemieux play for in 1994?
| SELECT "Country" FROM table_32790 WHERE "Player" = 'mario lemieux' AND "Year" = '1994' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age < "79" | mimicsql_data |
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR... | atis |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE job... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%human... | advising |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
... | SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'Noah A. Smith' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_21501565_1 (
week__number VARCHAR,
original_artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With original artist of Tina Turner, what is the week number?
| SELECT week__number FROM table_21501565_1 WHERE original_artist = "Tina Turner" | sql_create_context |
CREATE TABLE table_name_27 (
l_100km_urban__cold_ INTEGER,
mpg_uk_urban__cold_ VARCHAR,
mpg_uk_combined VARCHAR,
engine_capacity VARCHAR,
mpg_us_urban VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average L/100km urban (cold) for eng... | SELECT AVG(l_100km_urban__cold_) FROM table_name_27 WHERE engine_capacity > 1910 AND mpg_us_urban < 25.3 AND mpg_uk_combined > 27.2 AND mpg_uk_urban__cold_ = 22.4 | sql_create_context |
CREATE TABLE table_name_29 (
title VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title for the state of qin?
| SELECT title FROM table_name_29 WHERE state = "qin" | sql_create_context |
CREATE TABLE table_75828 (
"Season" text,
"Competition" text,
"Round" text,
"Opponent" text,
"Home" text,
"Away" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home has a Round of r1, and an Opponent of dundee united?
| SELECT "Home" FROM table_75828 WHERE "Round" = 'r1' AND "Opponent" = 'dundee united' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.long_title = "Insertion of endotracheal tube" | mimicsql_data |
CREATE TABLE table_57271 (
"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 was victoria park used as a venue?
| SELECT "Date" FROM table_57271 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_name_39 (
winning_score VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score when Damien McGrane was runner-up?
| SELECT winning_score FROM table_name_39 WHERE runner_s__up = "damien mcgrane" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_51723 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points for the cosworth v8 engine after 1985?
| SELECT "Points" FROM table_51723 WHERE "Year" > '1985' AND "Engine" = 'cosworth v8' | wikisql |
CREATE TABLE table_name_35 (
year VARCHAR,
total VARCHAR,
la_matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had a total of 2 and LA matches of 0?
| SELECT year FROM table_name_35 WHERE total = "2" AND la_matches = "0" | sql_create_context |
CREATE TABLE table_name_56 (
opponent VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Game of 31?
| SELECT opponent FROM table_name_56 WHERE game = 31 | sql_create_context |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE team (
Team_id int,
... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY Country_name | nvbench |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26772) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.it... | mimic_iii |
CREATE TABLE table_10405 (
"Year" text,
"Name" text,
"Film" text,
"Role" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year is the status of won?
| SELECT "Year" FROM table_10405 WHERE "Status" = 'won' | wikisql |
CREATE TABLE table_203_407 (
id number,
"name" text,
"party" text,
"province" text,
"term expires" number,
"years in office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of members whose term expires in 1989 ?
| SELECT COUNT("name") FROM table_203_407 WHERE "years in office" = 1989 | squall |
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 ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) | nvbench |
CREATE TABLE table_33947 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament has a hard surface and final opponents rohan bopann... | SELECT "Tournament" FROM table_33947 WHERE "Surface" = 'hard' AND "Opponents in the final" = 'rohan bopanna & mustafa ghouse' | wikisql |
CREATE TABLE table_name_37 (
tournament VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had a winning score of 5 (69-69-73=211)?
| SELECT tournament FROM table_name_37 WHERE winning_score = −5(69 - 69 - 73 = 211) | sql_create_context |
CREATE TABLE table_65907 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gold medals did Brazil win with a total of more than 55 medals?
| SELECT AVG("Gold") FROM table_65907 WHERE "Nation" = 'brazil' AND "Total" > '55' | wikisql |
CREATE TABLE table_70444 (
"Year" real,
"Champion" text,
"City" text,
"LLWS" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest Year when the City is Peabody?
| SELECT MIN("Year") FROM table_70444 WHERE "City" = 'peabody' | wikisql |
CREATE TABLE table_75902 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team of the game at the time 15:00?
| SELECT "Away" FROM table_75902 WHERE "Time" = '15:00' | wikisql |
CREATE TABLE table_name_67 (
draws INTEGER,
season INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Draws for a season later than 1964?
| SELECT SUM(draws) FROM table_name_67 WHERE season > 1964 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.