instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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.dob_year < "2065" AND diagnoses.short_title = "Malig neo ascend colon" | mimicsql_data |
CREATE TABLE table_name_86 (
drawn INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many drawn having more than 9 points?
| SELECT SUM(drawn) FROM table_name_86 WHERE points > 9 | sql_create_context |
CREATE TABLE table_name_93 (
fourth VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Fourth in the 2008 Telstra Men's Pro Event?
| SELECT fourth FROM table_name_93 WHERE event = "2008 telstra men's pro" | sql_create_context |
CREATE TABLE table_17263 (
"No." text,
"Player" text,
"Date of Birth" text,
"Batting Style" text,
"Bowling Style" text,
"First Class Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the bowling style of chris harris?
| SELECT "Bowling Style" FROM table_17263 WHERE "Player" = 'Chris Harris' | wikisql |
CREATE TABLE table_16571 (
"Character" text,
"Portrayed by" text,
"First appearance" text,
"Last appearance" text,
"Duration" text,
"Episodes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes did actress Vanessa Ferlito appear in... | SELECT "Episodes" FROM table_16571 WHERE "Portrayed by" = 'Vanessa Ferlito' | wikisql |
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE station_company (
station_id number,
company_id number,
ran... | SELECT company, headquarters FROM company ORDER BY market_value DESC | spider |
CREATE TABLE table_204_912 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many competitors were from the soviet union ?
| SELECT COUNT("athlete") FROM table_204_912 WHERE "country" = 'soviet union' | squall |
CREATE TABLE table_name_25 (
event VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what event is the opponent Joe Nameth?
| SELECT event FROM table_name_25 WHERE opponent = "joe nameth" | sql_create_context |
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
GDP real
)
CREATE TABLE hosting_city (
Year int,
Match_ID int,
Host_City text
)
CREATE TABLE temperature (
City_ID int,
Jan real,
Feb real,
Mar real,
Apr real,
... | SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY Competition DESC | nvbench |
CREATE TABLE table_48047 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score did Australia get?
| SELECT "Score" FROM table_48047 WHERE "Country" = 'australia' | wikisql |
CREATE TABLE table_name_99 (
week INTEGER,
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average week with St. Louis Cardinals with less than 80,010 attendance?
| SELECT AVG(week) FROM table_name_99 WHERE opponent = "st. louis cardinals" AND attendance < 80 OFFSET 010 | sql_create_context |
CREATE TABLE table_79560 (
"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.
-- Which tie number had an away team of Arsenal?
| SELECT "Tie no" FROM table_79560 WHERE "Away team" = 'arsenal' | wikisql |
CREATE TABLE table_78047 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the trofeo fast team in stage 10?
| SELECT "Trofeo Fast Team" FROM table_78047 WHERE "Stage" = '10' | wikisql |
CREATE TABLE table_47836 (
"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 score when Fulham is the away team?
| SELECT "Score" FROM table_47836 WHERE "Away team" = 'fulham' | wikisql |
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,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND prescriptions.drug = 'ns' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY presc... | mimic_iii |
CREATE TABLE table_name_44 (
attendance VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game when the game was won 4-2?
| SELECT COUNT(attendance) FROM table_name_44 WHERE result = "won 4-2" | sql_create_context |
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 Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE table_name_93 (
byes INTEGER,
losses VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of byes where the losses were 9 and the draws were less than 0?
| SELECT MAX(byes) FROM table_name_93 WHERE losses = 9 AND draws < 0 | sql_create_context |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
... | SELECT DISTINCT author.authorname, COUNT(cite.citingpaperid) FROM author, cite, writes WHERE writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid GROUP BY author.authorname ORDER BY COUNT(cite.citingpaperid) DESC | scholar |
CREATE TABLE table_13118 (
"Mark" text,
"Wind*" text,
"Athlete" text,
"Nationality" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Wind* has a Nationality of united states, and an Athlete of jackie joyner-kersee?... | SELECT "Wind*" FROM table_13118 WHERE "Nationality" = 'united states' AND "Athlete" = 'jackie joyner-kersee' | wikisql |
CREATE TABLE table_name_20 (
episode INTEGER,
segment_d VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode has a manual motorcycle transmissions section D?
| SELECT SUM(episode) FROM table_name_20 WHERE segment_d = "manual motorcycle transmissions" | sql_create_context |
CREATE TABLE table_29827 (
"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.
-- What w... | SELECT "Score" FROM table_29827 WHERE "High points" = 'Andray Blatche , Al Thornton (20)' | wikisql |
CREATE TABLE table_65198 (
"Rank" text,
"Country" text,
"Jerseys" real,
"Giro wins" real,
"Points" real,
"Young rider" real,
"Most recent cyclist" text,
"Most recent date" text,
"Different holders" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT MIN("Different holders") FROM table_65198 WHERE "Country" = 'ireland' AND "Giro wins" < '1' | wikisql |
CREATE TABLE table_name_81 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result on 27 august 2003?
| SELECT result FROM table_name_81 WHERE date = "27 august 2003" | sql_create_context |
CREATE TABLE table_name_66 (
december INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest December, when Score is '4 - 4'?
| SELECT MIN(december) FROM table_name_66 WHERE score = "4 - 4" | sql_create_context |
CREATE TABLE individuals (
individual_id number,
individual_first_name text,
individual_middle_name text,
inidividual_phone text,
individual_email text,
individual_address text,
individual_last_name text
)
CREATE TABLE party_services (
booking_id number,
customer_id number,
serv... | SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%" | spider |
CREATE TABLE table_14135 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week was the December 21, 2003 game?
| SELECT "Week" FROM table_14135 WHERE "Date" = 'december 21, 2003' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'aspirin' AND admissions.subject_id = 20332) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JO... | mimic_iii |
CREATE TABLE VOTING_RECORD (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of voting records in total.
| SELECT COUNT(*) FROM VOTING_RECORD | sql_create_context |
CREATE TABLE table_28891101_3 (
census_2006_population VARCHAR,
area__km_2__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2006 census population when the area is 159?
| SELECT COUNT(census_2006_population) FROM table_28891101_3 WHERE area__km_2__ = 159 | sql_create_context |
CREATE TABLE table_52412 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MAX("Draws") FROM table_52412 WHERE "Points" = '20-18' AND "Wins" < '4' | wikisql |
CREATE TABLE table_41784 (
"Year" real,
"Country" text,
"Team" text,
"Individual" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team when the match was in buenos aires , argentina?
| SELECT "Team" FROM table_41784 WHERE "Location" = 'buenos aires , argentina' | 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 t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '姜玉石' AND t_kc22.STA_DATE BETWEEN '2004-07-19' AND '2019-01-14' AND t_kc22.SOC_SRT_DIRE_NM = '布洛芬片(糖衣)' | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND lab.labname = 'protein - csf' AND DATETIME(lab.labresulttime, 'start of mon... | eicu |
CREATE TABLE table_22178 (
"Season" real,
"Average Attendance Home" text,
"Highest Attendance Home" text,
"Average Attendance Away" text,
"Highest Attendance Away" text,
"Division / Section" text,
"Level" text,
"Average Attendance League" text
)
-- Using valid SQLite, answer the follow... | SELECT "Average Attendance Home" FROM table_22178 WHERE "Division / Section" = 'Superettan' AND "Average Attendance Away" = '1.889' | wikisql |
CREATE TABLE table_name_85 (
round INTEGER,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the round when the position is (c)?
| SELECT MAX(round) FROM table_name_85 WHERE position = "(c)" | sql_create_context |
CREATE TABLE table_62451 (
"Class" text,
"Number(s)" text,
"Quantity" text,
"Year(s) of Manufacture" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the quantity of class B V?
| SELECT "Quantity" FROM table_62451 WHERE "Class" = 'b v' | wikisql |
CREATE TABLE table_name_39 (
date_of_attack VARCHAR,
fate VARCHAR,
cargo VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of attack of the ship with iron ore sunk by u-101 *?
| SELECT date_of_attack FROM table_name_39 WHERE fate = "sunk by u-101 *" AND cargo = "iron ore" | sql_create_context |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE products (
product_id VARCHAR,
product_type_code VARCHAR,
product_price VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the product id and product type of the cheapest product?
| SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1 | sql_create_context |
CREATE TABLE table_name_75 (
game_site VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game site has an Opponent of buffalo bills?
| SELECT game_site FROM table_name_75 WHERE opponent = "buffalo bills" | sql_create_context |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "10" AND procedures.long_title = "Coronary arteriography using two catheters" | mimicsql_data |
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_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | SELECT long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id | nvbench |
CREATE TABLE table_68760 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament has a Date of april 20, 1987?
| SELECT "Tournament" FROM table_68760 WHERE "Date" = 'april 20, 1987' | wikisql |
CREATE TABLE team (
Team_id int,
Name 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 match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | SELECT Position, COUNT(*) FROM match_season GROUP BY Position | nvbench |
CREATE TABLE table_204_603 (
id number,
"pos" text,
"no" number,
"rider" text,
"bike" text,
"laps" number,
"time" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what rider finished next after jonas fol... | SELECT "rider" FROM table_204_603 WHERE "pos" = (SELECT "pos" FROM table_204_603 WHERE "rider" = 'jonas folger') + 1 | squall |
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 txmzjzjlb (
HXPLC number,
HZX... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'V27.340' AND jyjgzbb.JCZBDM = '043045' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE table_18069 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of ... | SELECT COUNT("U.S. viewers (million)") FROM table_18069 WHERE "No. in season" = '2' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT SALARY, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 20) | css |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | SELECT RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '57073431477' | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-1459')) AND vitalperiodic.systemicdiastolic BETWEEN diastolic_bp... | eicu |
CREATE TABLE table_name_11 (
width__inches_ VARCHAR,
length__feet_ VARCHAR,
engine VARCHAR,
retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For a vehicle below 25 feet, that was retired in 2005 and had a navistar t444e engine, what was the tot... | SELECT COUNT(width__inches_) FROM table_name_11 WHERE engine = "navistar t444e" AND retired = "2005" AND length__feet_ < 25 | sql_create_context |
CREATE TABLE table_name_5 (
fa_cup_goals INTEGER,
league_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of FA Cup goals when there are 19 league goals?
| SELECT SUM(fa_cup_goals) FROM table_name_5 WHERE league_goals = "19" | sql_create_context |
CREATE TABLE table_2009095_2 (
year INTEGER,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least year for evonne goolagong helen gourlay
| SELECT MIN(year) FROM table_2009095_2 WHERE opponents = "Evonne Goolagong Helen Gourlay" | sql_create_context |
CREATE TABLE table_32745 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What laps have a Time of +28.778?
| SELECT "Laps" FROM table_32745 WHERE "Time" = '+28.778' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) DESC | nvbench |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE T... | SELECT 'site://questions/' + CAST(Id AS TEXT) AS "question_with_highest_score" FROM Posts ORDER BY Score DESC LIMIT 1 | sede |
CREATE TABLE table_79764 (
"Tournament" text,
"Wins" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cuts did he make at the PGA championship in 3 events?
| SELECT MAX("Cuts made") FROM table_79764 WHERE "Tournament" = 'pga championship' AND "Events" > '3' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE T... | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
CREATE TABLE table_28485 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the order # for the original artist sarah mclachlan?
| SELECT "Order #" FROM table_28485 WHERE "Original artist" = 'Sarah McLachlan' | 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 AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1195150' AND t_kc22.STA_DATE BETWEEN '2003-02-04' AND '2004-12-30' | css |
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video... | SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) >= 2 | spider |
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 demographic.days_stay FROM demographic WHERE demographic.subject_id = "64208" | mimicsql_data |
CREATE TABLE table_204_384 (
id number,
"#" number,
"air date" text,
"timeslot (est)" text,
"season" text,
"rating" number,
"share" number,
"18-49 (rating/share)" text,
"viewers (m)" number,
"weekly rank (#)" number
)
-- Using valid SQLite, answer the following questions for th... | SELECT "air date" FROM table_204_384 ORDER BY "rating" DESC LIMIT 1 | squall |
CREATE TABLE table_68093 (
"Name" text,
"Position" text,
"Club career" text,
"League apps" real,
"League goals" real,
"Total apps" real,
"Total goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest total goals scored for p... | SELECT MIN("Total goals") FROM table_68093 WHERE "League apps" < '171' AND "Total apps" = '151' AND "Position" = 'df' | wikisql |
CREATE TABLE table_name_76 (
potassium VARCHAR,
lithium VARCHAR,
sodium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the properties of potassium when lithium is h a l o g e n s and sodium is bromine?
| SELECT potassium FROM table_name_76 WHERE lithium = "h a l o g e n s" AND sodium = "bromine" | sql_create_context |
CREATE TABLE table_name_7 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which loss had a record of 79-49?
| SELECT loss FROM table_name_7 WHERE record = "79-49" | sql_create_context |
CREATE TABLE table_9281 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a Date of june 26?
| SELECT "Record" FROM table_9281 WHERE "Date" = 'june 26' | wikisql |
CREATE TABLE table_36262 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of chicago bears involved what date?
| SELECT "Date" FROM table_36262 WHERE "Opponent" = 'chicago bears' | wikisql |
CREATE TABLE table_name_77 (
blagojevich__d_ VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Blagojevich (D) happened on october 16, 2006?
| SELECT blagojevich__d_ FROM table_name_77 WHERE date = "october 16, 2006" | 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 mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '葛心怡' UNION SELECT wdmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = ... | css |
CREATE TABLE table_66513 (
"Year" real,
"Category" text,
"Nominee(s)" text,
"Episode" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the years after 2001?
| SELECT "Result" FROM table_66513 WHERE "Year" > '2001' | wikisql |
CREATE TABLE table_27061 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 120 is the number in ... | SELECT "Written by" FROM table_27061 WHERE "No. in series" = '120' | wikisql |
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_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
... | SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500 | nvbench |
CREATE TABLE table_34133 (
"Year" text,
"Title" text,
"Director" text,
"Distributor(s)" text,
"Box office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the movie that Paul Schneider directed?
| SELECT "Title" FROM table_34133 WHERE "Director" = 'paul schneider' | wikisql |
CREATE TABLE table_18894 (
"Title and Source" text,
"Developer(s)/Publisher(s)" text,
"JP -210-" text,
"NA -350-" text,
"PAL -295-" text,
"Wii Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the wii points with title and source bei... | SELECT "Wii Points" FROM table_18894 WHERE "Title and Source" = 'Tsūshin Taikyoku: Igo Dōjō 2700-Mon' | wikisql |
CREATE TABLE table_name_30 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Score has a Date on november 11?
| SELECT score FROM table_name_30 WHERE date = "november 11" | 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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc24.PER_EXP FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '33531671277' | css |
CREATE TABLE table_train_108 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"deficiency_to_iga" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer t... | SELECT * FROM table_train_108 WHERE body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 32 | criteria2sql |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name | nvbench |
CREATE TABLE table_name_87 (
city___state VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the city/state of the circuit where Russell Ingall Larry Perkins was the winner?
| SELECT city___state FROM table_name_87 WHERE winner = "russell ingall larry perkins" | sql_create_context |
CREATE TABLE table_20624 (
"No." real,
"Name" text,
"Mi from Kingston" text,
"Km from Kingston" text,
"Parish" text,
"Length feet" real,
"Length meters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many feet in length are there when th... | SELECT COUNT("Length feet") FROM table_20624 WHERE "Length meters" = '106.1' | wikisql |
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player did not have positive yardage ?
| SELECT "player" FROM table_203_8 WHERE "yards" <= 0 | squall |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),... | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name | nvbench |
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 SUM(Manufacturer) | nvbench |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '65472198' AND mzjzjlb.JZKSRQ BETWEEN '2008-10-02' AND '2019-11-28' | css |
CREATE TABLE table_3186 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When dennis ross (r) unopposed is the candidate what is the party?
| SELECT "Party" FROM table_3186 WHERE "Candidates" = 'Dennis Ross (R) unopposed' | wikisql |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Subject... | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) | nvbench |
CREATE TABLE table_name_17 (
scorer VARCHAR,
club VARCHAR,
league_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which scorer plays for Aldershot and has scored a total of 19 League goals?
| SELECT scorer FROM table_name_17 WHERE club = "aldershot" AND league_goals = "19" | sql_create_context |
CREATE TABLE table_name_41 (
score VARCHAR,
opponent_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the tournament with olivier dela tre as the opponent in the final?
| SELECT score FROM table_name_41 WHERE opponent_in_the_final = "olivier delaître" | sql_create_context |
CREATE TABLE table_43669 (
"Match" text,
"Date" text,
"Location" text,
"Lineup" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Match has a Competition of Group Stage on 2000-09-17?
| SELECT "Match" FROM table_43669 WHERE "Competition" = 'group stage' AND "Date" = '2000-09-17' | wikisql |
CREATE TABLE table_name_8 (
deleted VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was Anniston Army Depot (SE Industrial Area) deleted?
| SELECT deleted FROM table_name_8 WHERE name = "anniston army depot (se industrial area)" | sql_create_context |
CREATE TABLE table_name_79 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the score when the opponent is ann grossman?
| SELECT score FROM table_name_79 WHERE opponent = "ann grossman" | sql_create_context |
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 offering_instructor (
offering_instructor_id int,
offering_id int,
ins... | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' | advising |
CREATE TABLE table_14577 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real,
"First round" real,
"Final round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pos for the New York Knicks?
| SELECT "Pos." FROM table_14577 WHERE "Team" = 'new york knicks' | wikisql |
CREATE TABLE table_30923 (
"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 "Points classification" FROM table_30923 WHERE "General classification" = 'Levi Leipheimer' | wikisql |
CREATE TABLE table_32389 (
"Player" text,
"Home Town" text,
"College/Prior" text,
"Drafting Team" text,
"Graduated" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From what town was Steve Zakuani?
| SELECT "Home Town" FROM table_32389 WHERE "Player" = 'steve zakuani' | wikisql |
CREATE TABLE table_69565 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which loss has a Date of april 26?
| SELECT "Loss" FROM table_69565 WHERE "Date" = 'april 26' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.