instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_7 (
roll VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number on roll for Shelly Park school?
| SELECT COUNT(roll) FROM table_name_7 WHERE name = "shelly park school" | sql_create_context |
CREATE TABLE table_name_36 (
shuttle_run__sec_ VARCHAR,
grade VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the shuttle run with grade c
| SELECT shuttle_run__sec_ FROM table_name_36 WHERE grade = "c" | sql_create_context |
CREATE TABLE wdmzjzjlb (
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 wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '33997628' AND hz_info.YLJGDM = '2339646' AND NOT wdmzjzjlb.JZKSMC LIKE '%化疗%' UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN bdmzjzjlb ON hz_info.YL... | css |
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nation... | SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY COUNT(year) DESC | nvbench |
CREATE TABLE table_67802 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of points for entrants with a Jordan 192 chassis?
| SELECT SUM("Pts.") FROM table_67802 WHERE "Chassis" = 'jordan 192' | wikisql |
CREATE TABLE publication (
publication_id number,
book_id number,
publisher text,
publication_date text,
price number
)
CREATE TABLE book (
book_id number,
title text,
issues number,
writer text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT publisher, COUNT(*) FROM publication GROUP BY publisher | spider |
CREATE TABLE farm_competition (
Competition_ID int,
Year int,
Theme text,
Host_city_ID int,
Hosts text
)
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
... | SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) DESC | nvbench |
CREATE TABLE table_203_16 (
id number,
"name" text,
"took office" text,
"left office" text,
"party" text,
"district residence" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many terms did a republican serve before watkins ... | SELECT COUNT(*) FROM table_203_16 WHERE "party" = 'republican' AND id < (SELECT id FROM table_203_16 WHERE "name" = 'wes watkins') | squall |
CREATE TABLE table_name_51 (
result VARCHAR,
awards VARCHAR,
category VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in the year greaters than 2008 with an award of Jahat and had a category of Stacy?
| SELECT result FROM table_name_51 WHERE category = "stacy" AND year > 2008 AND awards = "jahat" | sql_create_context |
CREATE TABLE table_58408 (
"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 venue has an Away team score of 17.14 (116... | SELECT "Venue" FROM table_58408 WHERE "Away team score" = '17.14 (116)' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_24665 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the trucks for scott neal
| SELECT "Truck(s)" FROM table_24665 WHERE "Crew Chief" = 'Scott Neal' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '35733517644' | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-3247')) AND intakeoutput.cellpath LIKE '%output%'... | eicu |
CREATE TABLE table_name_16 (
lost INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest loss with points less than 7?
| SELECT MAX(lost) FROM table_name_16 WHERE points < 7 | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654')) AND lab.labname = 'chloride' AND DATETIME(lab.labresulttime, 'start o... | eicu |
CREATE TABLE table_203_354 (
id number,
"party" text,
"candidate(s)" text,
"votes" number,
"percentage" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which candidates had the most votes listed ?
| SELECT "candidate(s)" FROM table_203_354 ORDER BY "votes" DESC LIMIT 1 | squall |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
... | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY COUNT(Main_Industry) | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular insufficiency - mitral valve' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATE... | eicu |
CREATE TABLE table_name_92 (
points VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points for the simtek s951 chassis?
| SELECT COUNT(points) FROM table_name_92 WHERE chassis = "simtek s951" | sql_create_context |
CREATE TABLE table_25703_2 (
birth_2012 INTEGER,
january_december_2012 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the total number of 2012 births for the January December 2012 Tver Oblast region?
| SELECT MIN(birth_2012) FROM table_25703_2 WHERE january_december_2012 = "Tver Oblast" | sql_create_context |
CREATE TABLE table_49267 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the home team when the away team is frickley colliery?
| SELECT "Home team" FROM table_49267 WHERE "Away team" = 'frickley colliery' | wikisql |
CREATE TABLE table_8899 (
"Consonant final stem" text,
"Example: did-" text,
"Vowel final stem" text,
"Example: ch'aghara-" text,
"Noun example: datv-" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What example for did- is shown for a Consonant fin... | SELECT "Example: did-" FROM table_8899 WHERE "Consonant final stem" = '-ø' | 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(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '5908391' AND IN_HOSP_DATE BETWEEN '2003-09-17' AND '2006-10-06' | css |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATET... | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken | nvbench |
CREATE TABLE table_30925 (
"Stage" real,
"Winner" text,
"General classification" text,
"Mountains Classification" text,
"Points classification" text,
"Sprints Classification" text,
"Team Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Team Classification" FROM table_30925 WHERE "Winner" = 'Thomas De Gendt' | wikisql |
CREATE TABLE table_203_646 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- following the world championships in seville , what was the next venue for the world... | SELECT "venue" FROM table_203_646 WHERE "competition" = 'world championships' AND "year" > (SELECT "year" FROM table_203_646 WHERE "competition" = 'world championships' AND "venue" = 'seville') ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_37730 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game that led to a 79-77 record?
| SELECT "Score" FROM table_37730 WHERE "Record" = '79-77' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | 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 = 30460)) | mimic_iii |
CREATE TABLE table_7209 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Aberdeen team's date of vacancy?... | SELECT "Date of vacancy" FROM table_7209 WHERE "Team" = 'aberdeen' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8814772' GROUP BY t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_name_43 (
points VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points for the skater from club btsc?
| SELECT COUNT(points) FROM table_name_43 WHERE club = "btsc" | sql_create_context |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
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)
)
... | SELECT pName, HS FROM Player WHERE HS < 1500 | nvbench |
CREATE TABLE table_name_12 (
name VARCHAR,
displacement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name when the displacement is 8,305 t?
| SELECT name FROM table_name_12 WHERE displacement = "8,305 t" | sql_create_context |
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 jybgb (
BBCJBW text,
BBDM tex... | SELECT mzjzjlb.SG, mzjzjlb.TZ 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 = '23887920' | css |
CREATE TABLE table_203_374 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many gold medals does poland have ?
| SELECT "gold" FROM table_203_374 WHERE "nation" = 'poland' | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
Cr... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Location LIKE '%Hyderabad%' ORDER BY Reputation DESC LIMIT 1000 | sede |
CREATE TABLE table_204_155 (
id number,
"rank" number,
"heat" number,
"athlete" text,
"nationality" text,
"time" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the only cyclist from brazil ?
| SELECT "athlete" FROM table_204_155 WHERE "nationality" = 'brazil' | squall |
CREATE TABLE table_68791 (
"Institution" text,
"Team" text,
"City" text,
"Province" text,
"First season" real,
"Head coach" text,
"Enrollment" real,
"Football stadium" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT "City" FROM table_68791 WHERE "First season" = '1996' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ... | css |
CREATE TABLE table_10472 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average prize for first place with a $500,000... | SELECT AVG("1st Prize( $ )") FROM table_10472 WHERE "Purse( $ )" = '500,000' AND "Tournament" = 'franklin quest championship' | wikisql |
CREATE TABLE table_name_84 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team 1, when Team 2 is Saint Louis?
| SELECT team_1 FROM table_name_84 WHERE team_2 = "saint louis" | sql_create_context |
CREATE TABLE table_51933 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the grid when the laps is more than 0, the time/retired is engine and the driver is pedro d... | SELECT "Grid" FROM table_51933 WHERE "Laps" > '0' AND "Time/Retired" = 'engine' AND "Driver" = 'pedro de la rosa' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '90180222' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2021-06-07') | css |
CREATE TABLE table_204_416 (
id number,
"chip" text,
"flash size" text,
"eeprom" number,
"sram" number,
"frequency\n[mhz]" number,
"package" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what microcontroller has the same flash size as at90s... | SELECT "chip" FROM table_204_416 WHERE "chip" <> 'at90s4414' AND "flash size" = (SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s4414') | squall |
CREATE TABLE table_name_1 (
party VARCHAR,
municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Municipality of tampere involves which party?
| SELECT party FROM table_name_1 WHERE municipality = "tampere" | sql_create_context |
CREATE TABLE table_204_179 (
id number,
"season" number,
"division" number,
"tms." number,
"pos." number,
"fa cup" text,
"afc cl" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which year was the most pos .
| SELECT "season" FROM table_204_179 WHERE "pos." = (SELECT MAX("pos.") FROM table_204_179) | squall |
CREATE TABLE table_16119 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of playoffs where regular season is 6th, southwest... | SELECT COUNT("Playoffs") FROM table_16119 WHERE "Regular Season" = '6th, Southwest' | wikisql |
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_m... | SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY Type_of_Thing_Code | nvbench |
CREATE TABLE table_name_61 (
gold VARCHAR,
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of gold medals of slovakia, which has less than 1 silver medal?
| SELECT COUNT(gold) FROM table_name_61 WHERE silver < 1 AND nation = "slovakia" | sql_create_context |
CREATE TABLE table_2832 (
"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.
-- Who is ... | SELECT "High rebounds" FROM table_2832 WHERE "Game" = '64' | wikisql |
CREATE TABLE table_name_96 (
date VARCHAR,
film VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the film 'Monsters' come out?
| SELECT date FROM table_name_96 WHERE film = "monsters" | sql_create_context |
CREATE TABLE table_13693 (
"Lane" real,
"Name" text,
"Country" text,
"Reaction Time" real,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Times have a Reaction Time larger than 0.17500000000000002, and a Lane of 3?
| SELECT COUNT("Time") FROM table_13693 WHERE "Reaction Time" > '0.17500000000000002' AND "Lane" = '3' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC | nvbench |
CREATE TABLE table_62382 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week had an attendance more than 63,268 and Kansas City Chiefs as the opponent?
| SELECT COUNT("Week") FROM table_62382 WHERE "Attendance" > '63,268' AND "Opponent" = 'kansas city chiefs' | wikisql |
CREATE TABLE table_46523 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Location of gold coast , austr... | SELECT "Opponent" FROM table_46523 WHERE "Location" = 'gold coast , australia' AND "Method" = 'submission (punches)' | wikisql |
CREATE TABLE table_name_22 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2002 result where 2011 and 2000 are 1R?
| SELECT 2002 FROM table_name_22 WHERE 2011 = "1r" AND 2000 = "1r" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
Dele... | SELECT * FROM Posts WHERE AnswerCount > 5 AND CommentCount > 5 AND ViewCount > 50 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND AcceptedAnswerId IS NULL AND Tags LIKE '%##Tag1##%' AND CreationDate > '2015-12-21' | sede |
CREATE TABLE table_80231 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a Rank of 19, and a Start of 14, what was the finish?
| SELECT "Finish" FROM table_80231 WHERE "Rank" = '19' AND "Start" = '14' | wikisql |
CREATE TABLE table_6326 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Engine with 3 as the start in the year of 2007?
| SELECT "Engine" FROM table_6326 WHERE "Start" = '3' AND "Year" = '2007' | wikisql |
CREATE TABLE table_name_76 (
weblink VARCHAR,
college_or_campus_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Weblink has a College or Campus Name of anna university college of engineering tindivanam?
| SELECT weblink FROM table_name_76 WHERE college_or_campus_name = "anna university college of engineering tindivanam" | sql_create_context |
CREATE TABLE table_13886 (
"Name" text,
"Position" text,
"Date of Appointment" text,
"Date of Birth" text,
"Date of Retirement" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Hon. Vicente Q. Roxas appointment date?
| SELECT "Date of Appointment" FROM table_13886 WHERE "Name" = 'hon. vicente q. roxas' | wikisql |
CREATE TABLE table_name_96 (
delegate VARCHAR,
placement_in_miss_universe VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Delegate has a Placement in Miss Universe of fourth runner-up, and a Hometown of makati , rizal?
| SELECT delegate FROM table_name_96 WHERE placement_in_miss_universe = "fourth runner-up" AND hometown = "makati , rizal" | sql_create_context |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '52950661' AND gwyjzb.MED_SER_ORG_NO = '7572010' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-10-25' AND '2018-02-18' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb... | css |
CREATE TABLE table_name_40 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where Date is october 14 what is the attendance?
| SELECT attendance FROM table_name_40 WHERE date = "october 14" | sql_create_context |
CREATE TABLE table_27987767_2 (
points_margin VARCHAR,
winners VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total number of points margin when brive is the winners
| SELECT COUNT(points_margin) FROM table_27987767_2 WHERE winners = "Brive" | sql_create_context |
CREATE TABLE table_31289 (
"Season" text,
"Level" text,
"Division" text,
"Section" text,
"Position" text,
"Movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the level for the 7th position
| SELECT "Level" FROM table_31289 WHERE "Position" = '7th' | wikisql |
CREATE TABLE table_name_25 (
score VARCHAR,
opponent VARCHAR,
game VARCHAR,
february VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Game is less than 61, when February is less than 11, and when Opponent is '@ Buffalo Sabres'?
| SELECT score FROM table_name_25 WHERE game < 61 AND february < 11 AND opponent = "@ buffalo sabres" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | 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 '%Emily Zinnemann%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... | advising |
CREATE TABLE table_3148 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest average for t... | SELECT MAX("Average") FROM table_3148 WHERE "HK viewers" = '1.97 million' | wikisql |
CREATE TABLE table_29504351_2 (
best_finish VARCHAR,
earnings__$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the best finish for the player whose earnings was $421050?
| SELECT best_finish FROM table_29504351_2 WHERE earnings__$_ = 421050 | sql_create_context |
CREATE TABLE table_203_452 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which driver scored the least... | SELECT "driver" FROM table_203_452 ORDER BY "points" LIMIT 1 | squall |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE View_Unit_Status (
apt_id INTEG... | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth) | nvbench |
CREATE TABLE table_name_12 (
team VARCHAR,
sponsor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the sponsor of motorola
| SELECT team FROM table_name_12 WHERE sponsor = "motorola" | sql_create_context |
CREATE TABLE table_name_67 (
opponent VARCHAR,
date VARCHAR,
type VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Type of tko, and a Round of 2 (6) on 2006-09-20?
| SELECT opponent FROM table_name_67 WHERE type = "tko" AND round = "2 (6)" AND date = "2006-09-20" | sql_create_context |
CREATE TABLE table_name_94 (
opponent VARCHAR,
january VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponent, when January is greater than 19, and when Score is '7 - 2'?
| SELECT opponent FROM table_name_94 WHERE january > 19 AND score = "7 - 2" | sql_create_context |
CREATE TABLE table_name_28 (
standings VARCHAR,
champions VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Standings of Eintracht Braunschweig?
| SELECT standings FROM table_name_28 WHERE champions = "eintracht braunschweig" | sql_create_context |
CREATE TABLE table_name_35 (
top_10 VARCHAR,
wins VARCHAR,
poles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Top 10s have Wins larger than 0, and Poles larger than 0?
| SELECT COUNT(top_10) FROM table_name_35 WHERE wins > 0 AND poles > 0 | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 463 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date DESC | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
lan... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 30267 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_21322 (
"Rank" real,
"1-year peak" text,
"5-year peak" text,
"10-year peak" text,
"15-year peak" text,
"20-year peak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank when Garry Kasparov, 2879 is the 1-y... | SELECT MAX("Rank") FROM table_21322 WHERE "1-year peak" = 'Garry Kasparov, 2879' | wikisql |
CREATE TABLE table_51446 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which top ten, having less than 12 cuts less than 2 top five, an... | SELECT MAX("Top-10") FROM table_51446 WHERE "Cuts made" < '12' AND "Top-5" < '2' AND "Events" < '14' | wikisql |
CREATE TABLE ref_characteristic_types (
characteristic_type_code text,
characteristic_type_description text
)
CREATE TABLE ref_product_categories (
product_category_code text,
product_category_description text,
unit_of_measure text
)
CREATE TABLE characteristics (
characteristic_id number,
... | SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax" | spider |
CREATE TABLE table_14273 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the highest Bronze which has a Gold larger than 2 and a Rank of total?
| SELECT MAX("Bronze") FROM table_14273 WHERE "Gold" > '2' AND "Rank" = 'total' | wikisql |
CREATE TABLE table_name_58 (
crowd VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended the game with north melbourne as the away side?
| SELECT crowd FROM table_name_58 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE table_76017 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What grid has 78 laps, and Ronnie Bremer as driver?
| SELECT "Grid" FROM table_76017 WHERE "Laps" = '78' AND "Driver" = 'ronnie bremer' | 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 ACC_Home | nvbench |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | SELECT a.Id AS "post_link", q.Tags FROM Posts AS q, Posts AS a WHERE a.Score = 0 AND q.AcceptedAnswerId = a.Id AND q.Tags LIKE LOWER('%##Tag##%') ORDER BY q.Id LIMIT 100 | sede |
CREATE TABLE table_name_26 (
winner VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the winner when the runner-up shows both teams awarded championship after a draw.?
| SELECT winner FROM table_name_26 WHERE runner_up = "both teams awarded championship after a draw." | sql_create_context |
CREATE TABLE table_name_37 (
lane VARCHAR,
swimmer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which lane is Goksu Bicer in?
| SELECT lane FROM table_name_37 WHERE swimmer = "goksu bicer" | sql_create_context |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Ra... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY COUNT(Rank) | nvbench |
CREATE TABLE table_12962773_13 (
current_club VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the current club for player sacha giffa
| SELECT current_club FROM table_12962773_13 WHERE player = "Sacha Giffa" | sql_create_context |
CREATE TABLE table_12786 (
"Flight Day" text,
"Song" text,
"Artist" text,
"Played for" text,
"Links" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What links were used on flight day 16?
| SELECT "Links" FROM table_12786 WHERE "Flight Day" = 'day 16' | 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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG... | css |
CREATE TABLE CLASS (
crs_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many courses are offered?
| SELECT COUNT(DISTINCT crs_code) FROM CLASS | sql_create_context |
CREATE TABLE table_name_17 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what day was the game that ended in a score of 97-38?
| SELECT date FROM table_name_17 WHERE score = "97-38" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.