instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_68062 (
"Goal #" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for goal # more than 4
| SELECT "Result" FROM table_68062 WHERE "Goal #" > '4' | wikisql |
CREATE TABLE table_64800 (
"School (IHSAA ID#)" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text,
"Year Joined" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of enrollments for s... | SELECT SUM("Enrollment") FROM table_64800 WHERE "Location" = 'culver' | wikisql |
CREATE TABLE table_21394 (
"Name" text,
"Model" text,
"Max FS" text,
"Tested FS" text,
"Short description" text,
"Publication" text,
"Method" text,
"Output" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the ma... | SELECT "Max FS" FROM table_21394 WHERE "Status" = 'Status' AND "Method" = 'Method' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '10... | css |
CREATE TABLE table_78710 (
"Ending" text,
"American" text,
"British" text,
"Australian" text,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Examples has Australian of m?
| SELECT "Examples" FROM table_78710 WHERE "Australian" = 'əm' | wikisql |
CREATE TABLE table_204_190 (
id number,
"rank" number,
"city" text,
"county" text,
"state" text,
"percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which california city has a higher percentage of korean americans ?
| SELECT "city" FROM table_204_190 WHERE "state" = 'california' ORDER BY "percentage" DESC LIMIT 1 | squall |
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 WHERE demographic.language = "RUSS" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE table_24798489_2 (
original_airdate VARCHAR,
episode_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many original air dates were there for episode 22?
| SELECT COUNT(original_airdate) FROM table_24798489_2 WHERE episode_number = 22 | sql_create_context |
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE documents_to_be_destroyed (
document_id number,
destruction_authorised_by_employee_id number,
destroyed_by_employee_id number,
planned_destruction_date time,
... | SELECT location_code, date_in_location_from, date_in_locaton_to FROM document_locations | spider |
CREATE TABLE table_name_70 (
time VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was lane 4's time?
| SELECT time FROM table_name_70 WHERE lane = 4 | sql_create_context |
CREATE TABLE table_2859 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the title for number 1... | SELECT "Title" FROM table_2859 WHERE "No. in season" = '16' | wikisql |
CREATE TABLE table_name_7 (
player VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player with a t6 place and a 72-68-72=212 score?
| SELECT player FROM table_name_7 WHERE place = "t6" AND score = 72 - 68 - 72 = 212 | sql_create_context |
CREATE TABLE table_name_22 (
date VARCHAR,
uci_rating VARCHAR,
race_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the omloop van de vlaamse scheldeboorden race with a UCI rating of 1.1?
| SELECT date FROM table_name_22 WHERE uci_rating = "1.1" AND race_name = "omloop van de vlaamse scheldeboorden" | sql_create_context |
CREATE TABLE table_name_12 (
pick INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total pick with Bill Duffy?
| SELECT SUM(pick) FROM table_name_12 WHERE player = "bill duffy" | sql_create_context |
CREATE TABLE table_17467578_1 (
original_airdate VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air date of episode 8? Answer: Dec. 21, 2006
| SELECT COUNT(original_airdate) FROM table_17467578_1 WHERE episode__number = 8 | sql_create_context |
CREATE TABLE table_name_24 (
ihsaa_class__football_ VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What IHSAA football class do the Generals play in?
| SELECT ihsaa_class__football_ FROM table_name_24 WHERE mascot = "generals" | sql_create_context |
CREATE TABLE table_2676980_4 (
seats_in_congress VARCHAR,
electoral_district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of seats in congress when the electoral district is Ucayali?
| SELECT COUNT(seats_in_congress) FROM table_2676980_4 WHERE electoral_district = "Ucayali" | sql_create_context |
CREATE TABLE table_75238 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the save for braves for may 15
| SELECT "Save" FROM table_75238 WHERE "Opponent" = 'braves' AND "Date" = 'may 15' | wikisql |
CREATE TABLE table_53108 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who made the car that Alberto Ascari went more than 35 laps on a grid less than 7?
| SELECT "Constructor" FROM table_53108 WHERE "Grid" < '7' AND "Laps" > '35' AND "Driver" = 'alberto ascari' | wikisql |
CREATE TABLE table_34699 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tournament on Apr 6?
| SELECT "Tournament" FROM table_34699 WHERE "Date" = 'apr 6' | wikisql |
CREATE TABLE table_56537 (
"Club" text,
"Wins" text,
"Last win" text,
"Runners-up" text,
"Last final lost" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the last win for the club that had a final loss in 2011?
| SELECT "Last win" FROM table_56537 WHERE "Last final lost" = '2011' | wikisql |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no numbe... | SELECT T1.county FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T2.score > 90 GROUP BY T1.county ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_1342379_23 (
candidates VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the candidates with district being mississippi 4
| SELECT candidates FROM table_1342379_23 WHERE district = "Mississippi 4" | sql_create_context |
CREATE TABLE table_1085 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest pick number?
| SELECT MIN("Pick #") FROM table_1085 | wikisql |
CREATE TABLE table_49347 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" real,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the report about townsville crocodiles... | SELECT "Report" FROM table_49347 WHERE "Away team" = 'townsville crocodiles' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | 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 = 13329) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputev... | mimic_iii |
CREATE TABLE table_43590 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Pick, when Round is greater than 1, and when School/Club Team is ... | SELECT "Pick" FROM table_43590 WHERE "Round" > '1' AND "School/Club Team" = 'south carolina' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE... | SELECT DISTINCT Q.Id AS "post_link", Q.Score AS "number_of_votes", PH.Comment AS "close_reason" FROM Posts AS Q INNER JOIN PostHistory AS PH ON (Q.Id = PH.PostId) WHERE Q.PostTypeId = 1 AND Q.Score >= 100 AND PH.PostHistoryTypeId = 10 AND PH.Comment IN (2, 3, 102, 104, 105) ORDER BY Q.Score DESC | sede |
CREATE TABLE table_14903081_1 (
tournament VARCHAR,
current_venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tournaments have their current venue as the Lindner Family Tennis Center?
| SELECT COUNT(tournament) FROM table_14903081_1 WHERE current_venue = "Lindner Family Tennis Center" | sql_create_context |
CREATE TABLE products (
product_id number,
product_name text,
product_price number,
product_description text
)
CREATE TABLE order_deliveries (
location_code text,
actual_order_id number,
delivery_status_code text,
driver_employee_id number,
truck_id number,
delivery_date time
)
... | SELECT COUNT(DISTINCT payment_method) FROM customers | spider |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "6959" | mimicsql_data |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_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 '2003-04-08' AND '2013-01-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_78248 (
"D 48" text,
"D 47" text,
"D 46" text,
"D 45" text,
"D 44" text,
"D 43" text,
"D 42" text,
"D 41" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the D 44 when it has a D 46 of d 31
| SELECT "D 44" FROM table_78248 WHERE "D 46" = 'd 31' | wikisql |
CREATE TABLE table_name_73 (
island VARCHAR,
age___ma__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the island with age ma of 1.0
| SELECT island FROM table_name_73 WHERE age___ma__ = "1.0" | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT q.Id AS "post_link" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.OwnerUserId = '##askerid##' AND a.OwnerUserId = '##answererid##' | sede |
CREATE TABLE table_name_95 (
losses VARCHAR,
appearances INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses did the division who appeared less than 16 times have?
| SELECT losses FROM table_name_95 WHERE appearances < 16 | sql_create_context |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) | 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 T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | 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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '77127973' AND qtb.MED_SER_ORG_NO = '6027111' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%瘙痒症%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '77127973' AND gyb.MED_SER_ORG_NO = '6027111' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%瘙痒症%' UNION SELECT zyb.MED_CLINIC_ID... | css |
CREATE TABLE Features (
Feature_ID INTEGER,
Feature_Details VARCHAR(255)
)
CREATE TABLE Street_Markets (
Market_ID INTEGER,
Market_Details VARCHAR(255)
)
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Visitors (
Tourist_ID INTEGER,
Tourist_Details VARCH... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name | nvbench |
CREATE TABLE songs (
songid VARCHAR
)
CREATE TABLE vocals (
songid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the vocal types used in song 'Badlands'?
| SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands" | sql_create_context |
CREATE TABLE table_30453 (
"Player" text,
"Cap(s)" real,
"Goal(s)" real,
"International Debut" text,
"Club(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When winston reid category:articles with hcards is the player what is the club?
| SELECT "Club(s)" FROM table_30453 WHERE "Player" = 'Winston Reid Category:Articles with hCards' | wikisql |
CREATE TABLE table_59748 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Against, when Status is 'Six Nations', and when Date is '30/03/2003'?
| SELECT SUM("Against") FROM table_59748 WHERE "Status" = 'six nations' AND "Date" = '30/03/2003' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Esophageal reflux" | mimicsql_data |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 28447) AND icustays.outtime IS NULL)... | mimic_iii |
CREATE TABLE table_37618 (
"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 is the amount of money that a +5 to par with a score of 76-69-70-70=285?
| SELECT COUNT("Money ( $ )") FROM table_37618 WHERE "To par" = '+5' AND "Score" = '76-69-70-70=285' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,... | SELECT COUNT(*) > 0 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 = 26156) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELE... | mimic_iii |
CREATE TABLE table_name_2 (
director VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed hamateur night?
| SELECT director FROM table_name_2 WHERE title = "hamateur night" | sql_create_context |
CREATE TABLE table_name_58 (
erp_w VARCHAR,
class VARCHAR,
frequency_mhz VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total erp w of class c3, which has a frequency mhz less than 89.9?
| SELECT COUNT(erp_w) FROM table_name_58 WHERE class = "c3" AND frequency_mhz < 89.9 | sql_create_context |
CREATE TABLE research_staff (
staff_id number,
employer_organisation_id number,
staff_details text
)
CREATE TABLE research_outcomes (
outcome_code text,
outcome_description text
)
CREATE TABLE staff_roles (
role_code text,
role_description text
)
CREATE TABLE project_outcomes (
projec... | SELECT T1.outcome_description FROM research_outcomes AS T1 JOIN project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code | spider |
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '4645126' AND IN_HOSP_DATE BETWEEN '2003-02-07' AND '2010-03-27' | css |
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 WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2110" | mimicsql_data |
CREATE TABLE table_2853 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name th... | SELECT "High points" FROM table_2853 WHERE "Record" = '30-23' | wikisql |
CREATE TABLE school_bus (
school_id number,
driver_id number,
years_working number,
if_full_time others
)
CREATE TABLE driver (
driver_id number,
name text,
party text,
home_city text,
age number
)
CREATE TABLE school (
school_id number,
grade text,
school text,
loc... | SELECT DISTINCT home_city FROM driver | spider |
CREATE TABLE table_name_63 (
Last INTEGER,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of Last Runners-up that has the club name of dempo sc?
| SELECT SUM(Last) AS runners_up FROM table_name_63 WHERE club = "dempo sc" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDe... | SELECT p.Id AS "post_link", DisplayName, p.CreationDate FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.Title LIKE 'exist %' OR p.Title LIKE 'exists %' OR p.Title LIKE 'Exist %' OR p.Title LIKE 'Exists %' | sede |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
... | SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport, date_day, days, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (((FLIGHT_1.airline_code = 'AA') OR (FLIGHT_1.airline_code = 'DL')) AND date_day.day_number = 15 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name ... | atis |
CREATE TABLE table_1579922_1 (
broadcast_date VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was an episode with a run time of 24:30 broadcasted?
| SELECT broadcast_date FROM table_1579922_1 WHERE run_time = "24:30" | sql_create_context |
CREATE TABLE table_203_346 (
id number,
"date" text,
"location" text,
"venue" text,
"opening act" text,
"supporting" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in which venue was the next performance after the one at verdun auditorium ?
| SELECT "venue" FROM table_203_346 WHERE "date" > (SELECT "date" FROM table_203_346 WHERE "venue" = 'verdun auditorium') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_59 (
place VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Place, when To Par is less than 15, and when Score is 76-72-75-71=294?
| SELECT place FROM table_name_59 WHERE to_par < 15 AND score = 76 - 72 - 75 - 71 = 294 | 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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7349327' AND t_kc22.STA_DATE BETWEEN '2012-03-19' AND '2013-05-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE college (
Leader_Name VARCHAR,
College_ID VARCHAR
)
CREATE TABLE member (
College_ID VARCHAR,
Country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the distinct leader names of colleges associated with members from country 'Canada... | SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada" | sql_create_context |
CREATE TABLE table_26914854_3 (
team VARCHAR,
incoming_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team when the incoming manager is martin allen?
| SELECT team FROM table_26914854_3 WHERE incoming_manager = "Martin Allen" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | SELECT Id AS "user_link", DisplayName FROM Users WHERE UpVotes > '##votes?100##' ORDER BY Id | sede |
CREATE TABLE table_name_90 (
losses VARCHAR,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses when there are less than 0 wins?
| SELECT COUNT(losses) FROM table_name_90 WHERE wins < 0 | sql_create_context |
CREATE TABLE table_45446 (
"Round" real,
"Race Name" text,
"Pole position" text,
"Winning driver" text,
"Winning Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What race after round 6 did Graham Rahal win with a pole position of graham rahal?
| SELECT "Race Name" FROM table_45446 WHERE "Winning driver" = 'graham rahal' AND "Round" > '6' AND "Pole position" = 'graham rahal' | wikisql |
CREATE TABLE entrepreneur (
People_ID VARCHAR
)
CREATE TABLE people (
Name VARCHAR,
People_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of entrepreneurs?
| SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID | sql_create_context |
CREATE TABLE table_356 (
"L&CR No." real,
"Type" text,
"Manufacturer" text,
"Delivered" text,
"Name" text,
"Jt. Cttee No." real,
"1845 disposal" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum l&cr number for archimedes?
| SELECT MAX("L&CR No.") FROM table_356 WHERE "Name" = 'Archimedes' | wikisql |
CREATE TABLE table_204_627 (
id number,
"date" text,
"opponent" text,
"score" text,
"top scorer (total points)" text,
"venue (location)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who scored more points , hrabak or singson ?
| SELECT "top scorer (total points)" FROM table_204_627 WHERE "top scorer (total points)" IN ('mike hrabak', 'dale singson') ORDER BY "top scorer (total points)" DESC LIMIT 1 | squall |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 3125 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_65799 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score on December 12, 1998?
| SELECT "Score" FROM table_65799 WHERE "Date" = 'december 12, 1998' | wikisql |
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_c... | SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN class AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code | spider |
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 All_Road, Team_ID FROM basketball_match ORDER BY Team_ID DESC | nvbench |
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
C... | SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics' | spider |
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 gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '83449469' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_203802_2 (
english_party_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percent of the parliamentary election did the pensioners party receive
| SELECT 2013 AS _parliamentary_election FROM table_203802_2 WHERE english_party_name = "Pensioners Party" | sql_create_context |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '37030215' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 2381.99) | css |
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_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 15) | css |
CREATE TABLE table_29301 (
"Frequency" text,
"Call sign" text,
"Name" text,
"Format" text,
"Owner" text,
"Target city/ market" text,
"City of license" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the market for KLRJ?
| SELECT "Target city/ market" FROM table_29301 WHERE "Call sign" = 'KLRJ' | wikisql |
CREATE TABLE table_203_494 (
id number,
"party" text,
"votes" number,
"%" number,
"swing" number,
"seats" number,
"change" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which party held the most seats but had a lesser turnout ?
| SELECT "party" FROM table_203_494 ORDER BY "seats" DESC LIMIT 1 | squall |
CREATE TABLE table_name_24 (
label VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What label is after 2004?
| SELECT label FROM table_name_24 WHERE year > 2004 | sql_create_context |
CREATE TABLE table_name_84 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the date of 15/6/03
| SELECT score FROM table_name_84 WHERE date = "15/6/03" | sql_create_context |
CREATE TABLE table_204_841 (
id number,
"no." number,
"temple" text,
"honzon (main image)" text,
"city/town/village" text,
"prefecture" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the first city/town/village listed in the table ?
| SELECT "city/town/village" FROM table_204_841 WHERE id = 1 | squall |
CREATE TABLE table_13759592_2 (
institution VARCHAR,
founded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which institution was founded in 1923?
| SELECT institution FROM table_13759592_2 WHERE founded = 1923 | sql_create_context |
CREATE TABLE table_name_49 (
name VARCHAR,
term_end VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name of the leader whose term ended in 2013?
| SELECT name FROM table_name_49 WHERE term_end = "2013" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT Title, Id, Score, ViewCount FROM Posts WHERE PostTypeId = 1 | sede |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND CITY_2... | atis |
CREATE TABLE table_15463188_16 (
school_club_team VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the school/club team for 9
| SELECT school_club_team FROM table_15463188_16 WHERE number = "9" | sql_create_context |
CREATE TABLE table_204_357 (
id number,
"year" number,
"div." text,
"pos." text,
"cup" text,
"top scorer (league)" text,
"score" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the number of times alisher kholigov was the top scorer in the ... | SELECT COUNT(*) FROM table_204_357 WHERE "top scorer (league)" = 'alisher kholiqov' | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-16880')) AND medication.drugname IN ('neurontin', 'midazolam (versed) ... | eicu |
CREATE TABLE table_name_80 (
year INTEGER,
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have less than 28,505 attendance?
| SELECT AVG(year) FROM table_name_80 WHERE attendance < 28 OFFSET 505 | sql_create_context |
CREATE TABLE table_name_40 (
premierships VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many premierships for the queensland raceway?
| SELECT premierships FROM table_name_40 WHERE venue = "queensland raceway" | sql_create_context |
CREATE TABLE table_19897294_11 (
no_in_season VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode in the season was episode us18 in the series?
| SELECT COUNT(no_in_season) FROM table_19897294_11 WHERE no_in_series = "US18" | sql_create_context |
CREATE TABLE table_228973_5 (
written_by VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people wrote episode 68 in the series?
| SELECT COUNT(written_by) FROM table_228973_5 WHERE no_in_series = 68 | sql_create_context |
CREATE TABLE table_27131 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the largest attendance a... | SELECT MAX("Attendance") FROM table_27131 WHERE "Game site" = 'Rheinstadion' | wikisql |
CREATE TABLE table_72512 (
"Round" real,
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick number for round 2?
| SELECT "Pick #" FROM table_72512 WHERE "Round" = '2' | wikisql |
CREATE TABLE table_36177 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Time ( ET )" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Time ( ET ) of 1:00pm, and a Result of w 34 14 has what record?... | SELECT "Record" FROM table_36177 WHERE "Time ( ET )" = '1:00pm' AND "Result" = 'w 34–14' | 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.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
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.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2006-06-30' AND '2008-01-26' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 19 | css |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2120" AND lab.fluid = "Urine" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.