instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_54458 (
"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 home team plays at VFL Park?
| SELECT "Home team" FROM table_54458 WHERE "Venue" = 'vfl park' | wikisql |
CREATE TABLE table_37059 (
"Player" text,
"Team" text,
"Score" text,
"Versus" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what team played against zimbabwe in 1999?
| SELECT "Team" FROM table_37059 WHERE "Year" = '1999' AND "Versus" = 'zimbabwe' | wikisql |
CREATE TABLE table_name_75 (
total_votes INTEGER,
_number_of_seats_won INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the average Total votes that has the # of seats won smaller than 0?
| SELECT AVG(total_votes) FROM table_name_75 WHERE _number_of_seats_won < 0 | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '85283417' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-10-01' AND '2019-12-09' | css |
CREATE TABLE table_name_74 (
name VARCHAR,
ofsted_number VARCHAR,
type VARCHAR,
dcsf_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the primary with a DCSF number larger than 2337 and an Ofsted number smaller than 135339?
| SELECT name FROM table_name_74 WHERE type = "primary" AND dcsf_number > 2337 AND ofsted_number < 135339 | sql_create_context |
CREATE TABLE table_48148 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game in February 10, 2009 has the most po... | SELECT MAX("Points") FROM table_48148 WHERE "Date" = 'february 10, 2009' AND "Game" > '54' | wikisql |
CREATE TABLE table_65306 (
"World record" text,
"Snatch" text,
"Chen Yanqing ( CHN )" text,
"111kg" text,
"Doha , Qatar" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for Chen Yanqing (CHN) when Doha, Qatar is ?
| SELECT "Chen Yanqing ( CHN )" FROM table_65306 WHERE "Doha , Qatar" = '—' | wikisql |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE teaches (
ID var... | SELECT building, AVG(capacity) FROM classroom GROUP BY building ORDER BY building | nvbench |
CREATE TABLE table_25830834_2 (
written_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode with the production code 2j5153?
| SELECT written_by FROM table_25830834_2 WHERE production_code = "2J5153" | sql_create_context |
CREATE TABLE table_57017 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the course on 13 may?
| SELECT "Course" FROM table_57017 WHERE "Date" = '13 may' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "8852" | mimicsql_data |
CREATE TABLE table_6974 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent of the 3:00 time?
| SELECT "Opponent" FROM table_6974 WHERE "Time" = '3:00' | wikisql |
CREATE TABLE table_17813 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT COUNT("Played") FROM table_17813 WHERE "Tries for" = '60' | wikisql |
CREATE TABLE table_204_125 (
id number,
"state" text,
"type" text,
"name" text,
"title" text,
"royal house" text,
"from" text,
"to" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was king right before kang ?
| SELECT "name" FROM table_204_125 WHERE id = (SELECT id FROM table_204_125 WHERE "name" = 'kang') - 1 | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hemodialysis - for chronic renal failure' AND STRFTI... | eicu |
CREATE TABLE table_34784 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent that anke huber played against in the leipzig tournament?
| SELECT "Opponent" FROM table_34784 WHERE "Tournament" = 'leipzig' | 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 wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_2076490_1 (
founded VARCHAR,
enrollment__2005_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is the founding year, for the school that had an enrollment in 2005 of 963?
| SELECT founded FROM table_2076490_1 WHERE enrollment__2005_ = "963" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "ANGIOEDEMA" AND demographic.age >= "51" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrilla... | eicu |
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.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "22377" | mimicsql_data |
CREATE TABLE table_name_63 (
year INTEGER,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest year when Call of Duty 4: Modern Warfare was the game?
| SELECT MAX(year) FROM table_name_63 WHERE game = "call of duty 4: modern warfare" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1700 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa... | atis |
CREATE TABLE table_33013 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"100m" real,
"150m" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What lane is David Carry in heat 1?
| SELECT COUNT("Lane") FROM table_33013 WHERE "Heat" = '1' AND "Name" = 'david carry' | wikisql |
CREATE TABLE Rating (
mID VARCHAR,
stars INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the average rating star for each movie that received at least 2 ratings.
| SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_27986200_3 (
aggregate_score VARCHAR,
proceed_to_quarter_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the aggregate score for Montauban?
| SELECT aggregate_score FROM table_27986200_3 WHERE proceed_to_quarter_final = "Montauban" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cellulitis - extremity' AND DATETIME(diagnosis.diagnosistime, 'start of y... | eicu |
CREATE TABLE table_14156 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Genre has a Developer(s) of naughty dog?
| SELECT "Genre" FROM table_14156 WHERE "Developer(s)" = 'naughty dog' | wikisql |
CREATE TABLE table_46493 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of week 11?
| SELECT "Result" FROM table_46493 WHERE "Week" = '11' | wikisql |
CREATE TABLE table_19598014_2 (
gt2_winning_team VARCHAR,
lmp2_winning_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gt2 winning team where lmp2 winning team and butch leitzinger marino franchitti ben devlin
| SELECT gt2_winning_team FROM table_19598014_2 WHERE lmp2_winning_team = "Butch Leitzinger Marino Franchitti Ben Devlin" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2187" | mimicsql_data |
CREATE TABLE table_name_8 (
opponent VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has an Event of king of the cage: shock and awe?
| SELECT opponent FROM table_name_8 WHERE event = "king of the cage: shock and awe" | sql_create_context |
CREATE TABLE table_73199 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"Television order" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who directed s01e13
| SELECT "Directed by" FROM table_73199 WHERE "Television order" = 'S01E13' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, MIN(Price) FROM Products GROUP BY Name ORDER BY MIN(Price) | nvbench |
CREATE TABLE product_characteristics (
product_id number,
characteristic_id number,
product_characteristic_value text
)
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_d... | 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_203_538 (
id number,
"flight" text,
"date" text,
"payload nickname" text,
"payload" text,
"orbit" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the earliest date of a flight ?
| SELECT "date" FROM table_203_538 ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_20630 (
"#" real,
"Date" text,
"at/vs." text,
"Opponent" text,
"Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number for new england blazers
| SELECT MAX("#") FROM table_20630 WHERE "Opponent" = 'New England Blazers' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback... | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 8 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'... | atis |
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 jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '09797743' AND jybgb.BGRQ BETWEEN '2013-05-06... | css |
CREATE TABLE table_12609 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of electorates (2009) for Hin... | SELECT AVG("Number of electorates (2009)") FROM table_12609 WHERE "Name" = 'hingna' | wikisql |
CREATE TABLE table_name_6 (
week_12_nov_16 VARCHAR,
week_3_sept_14 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the week 12 opponent for the year that had a week 3 opponent of South Florida (3-0)?
| SELECT week_12_nov_16 FROM table_name_6 WHERE week_3_sept_14 = "south florida (3-0)" | sql_create_context |
CREATE TABLE table_22834834_3 (
surface VARCHAR,
score_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which surfaces have the final score of 6 1, 6 7 (2 7) , 7 6 (7 5) , 7 6 (10 8)?
| SELECT surface FROM table_22834834_3 WHERE score_in_the_final = "6–1, 6–7 (2–7) , 7–6 (7–5) , 7–6 (10–8)" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '窦霞月' AND t_kc22.STA_DATE BETWEEN '2006-06-24' AND '2013-02-13' AND t_kc21.MED_SER_ORG_NO = '1539337' AND t_kc22.MED_INV_ITEM... | css |
CREATE TABLE table_name_32 (
boxscore VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which box score has an Attendance of 54,773?
| SELECT boxscore FROM table_name_32 WHERE attendance = "54,773" | sql_create_context |
CREATE TABLE table_12407546_2 (
running VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the numberof running wiht pamela zapata?
| SELECT COUNT(running) FROM table_12407546_2 WHERE athlete = "Pamela Zapata" | sql_create_context |
CREATE TABLE table_name_22 (
holmenkollen VARCHAR,
country VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Holmenkollen has a Country of norway, and a Winner of tom sandberg?
| SELECT holmenkollen FROM table_name_22 WHERE country = "norway" AND winner = "tom sandberg" | sql_create_context |
CREATE TABLE table_7115 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | SELECT AVG("Administrative Panel") FROM table_7115 WHERE "Agricultural Panel" < '11' AND "Industrial and Commercial Panel" = '3' AND "Labour Panel" < '4' | wikisql |
CREATE TABLE table_68960 (
"Episode" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the singer with the top 8?
| SELECT "Result" FROM table_68960 WHERE "Episode" = 'top 8' | wikisql |
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, SUM(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 SUM(Price) DESC | nvbench |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE fligh... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1800 AND flight.departure_time >= 1400) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight... | atis |
CREATE TABLE table_name_3 (
name VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player had a total of 116 (22)?
| SELECT name FROM table_name_3 WHERE total = "116 (22)" | sql_create_context |
CREATE TABLE table_79265 (
"Constructor" text,
"Chassis" text,
"Starts" real,
"Finishes" real,
"Wins" real,
"Podiums" real,
"Stage wins" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of points whe... | SELECT COUNT("Points") FROM table_79265 WHERE "Constructor" = 'citroën total world rally team' AND "Wins" < '7' | wikisql |
CREATE TABLE table_name_15 (
wins INTEGER,
byes INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest wins with less than 2 Byes?
| SELECT MIN(wins) FROM table_name_15 WHERE byes < 2 | sql_create_context |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
d... | SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY id DESC | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '88840185' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6397.29) | css |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryT... | SELECT QuestionUpVotes = COUNT(*) * 5 FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND v.VoteTypeId = 2 AND p.OwnerUserId = '##UserId##' | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "8847" | mimicsql_data |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Id AS "post_link", Title, Tags AS NotTags FROM Posts WHERE (Tags LIKE '%<dhtml>%') AND NOT (Tags LIKE '%<html>%') AND NOT (Tags LIKE '%<javascript>%') AND NOT (Tags LIKE '%<css>%') | sede |
CREATE TABLE table_52574 (
"Player" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which pens has 1 tries and matt alexander as a player with conv of 4?
| SELECT "Pens" FROM table_52574 WHERE "Tries" = '1' AND "Player" = 'matt alexander' AND "Conv" = '4' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
... | SELECT COUNT(*) AS Volume, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<surface%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO_STR(P.CreationDate, '%YEAR'), TIME_TO_STR(P.CreationDate, '%-mONT%-H... | sede |
CREATE TABLE table_22970 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "No. in season" FROM table_22970 WHERE "Original air date" = 'October 14, 2008' | wikisql |
CREATE TABLE table_name_96 (
no9 VARCHAR,
no7 VARCHAR,
final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was number 9 that had a number 7 of Joana and a Final of Pedro?
| SELECT no9 FROM table_name_96 WHERE no7 = "joana" AND final = "pedro" | sql_create_context |
CREATE TABLE table_name_57 (
score VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the Burnley Home game?
| SELECT score FROM table_name_57 WHERE home_team = "burnley" | sql_create_context |
CREATE TABLE table_1139087_2 (
grand_prix VARCHAR,
constructor VARCHAR,
fastest_lap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many events did nigel mansell drive the fastest and a mclaren - honda win?
| SELECT COUNT(grand_prix) FROM table_1139087_2 WHERE constructor = "McLaren - Honda" AND fastest_lap = "Nigel Mansell" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '华雨华' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_93 (
director VARCHAR,
release_date VARCHAR,
characters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What director has 2004-03-31 as the release date, with daffy (as duck dodgers) as the character?
| SELECT director FROM table_name_93 WHERE release_date = "2004-03-31" AND characters = "daffy (as duck dodgers)" | sql_create_context |
CREATE TABLE table_16387653_1 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum crowd size against St Kilda?
| SELECT MAX(crowd) FROM table_16387653_1 WHERE away_team = "St Kilda" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LATIN' AND course.number = 802 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.... | advising |
CREATE TABLE table_name_78 (
league_cup_goals INTEGER,
position VARCHAR,
total_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average league cup goals when the position is df and total goals is more than 4?
| SELECT AVG(league_cup_goals) FROM table_name_78 WHERE position = "df" AND total_goals > 4 | sql_create_context |
CREATE TABLE Performers (
Performer_ID INTEGER,
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
... | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description | nvbench |
CREATE TABLE table_name_18 (
player VARCHAR,
jersey_number_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player wears the number 2 on his jersey?
| SELECT player FROM table_name_18 WHERE jersey_number_s_ = "2" | sql_create_context |
CREATE TABLE table_20792 (
"product" text,
"dimensions (mm)" text,
"dpi" real,
"pages per minute (color)" real,
"max page size" text,
"interface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the dpi for the scanner with a max page size... | SELECT "dpi" FROM table_20792 WHERE "max page size" = '216mm x 355mm' | wikisql |
CREATE TABLE table_49863 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date were Perth Wildcats the away team?
| SELECT "Date" FROM table_49863 WHERE "Away team" = 'perth wildcats' | wikisql |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
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,
... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY Country_name DESC | nvbench |
CREATE TABLE table_27441210_12 (
weeks_at__number1 INTEGER,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks was K.Maro at #1?
| SELECT MAX(weeks_at__number1) FROM table_27441210_12 WHERE artist = "K.Maro" | sql_create_context |
CREATE TABLE table_35328 (
"Year" real,
"Film" text,
"Role" text,
"Producer/Director" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Producer/Director of Fear Beneath?
| SELECT "Producer/Director" FROM table_35328 WHERE "Film" = 'fear beneath' | wikisql |
CREATE TABLE table_name_26 (
overall VARCHAR,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of overall values with a safety position in a round greater than 1?
| SELECT COUNT(overall) FROM table_name_26 WHERE position = "safety" AND round > 1 | sql_create_context |
CREATE TABLE table_25477 (
"Date" text,
"Location" text,
"Opponent" text,
"Irish Points" real,
"Opp. Points" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the irish points for 23-1 record
| SELECT "Irish Points" FROM table_25477 WHERE "Record" = '23-1' | wikisql |
CREATE TABLE table_43381 (
"Name" text,
"Processor" text,
"Hard Drive" text,
"Ethernet Ports" text,
"Dimensions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ethernet ports of the u150 appliance?
| SELECT "Ethernet Ports" FROM table_43381 WHERE "Name" = 'u150' | wikisql |
CREATE TABLE table_48770 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country, when Place is 'T4', and when Player is 'Scott Simpson'?
| SELECT "Country" FROM table_48770 WHERE "Place" = 't4' AND "Player" = 'scott simpson' | wikisql |
CREATE TABLE table_75536 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Round with Overall of 247 and pick less than 41?
| SELECT MIN("Round") FROM table_75536 WHERE "Overall" = '247' AND "Pick #" < '41' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" | mimicsql_data |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13837 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit... | mimic_iii |
CREATE TABLE table_38501 (
"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.
-- What time was the game during week 5?
| SELECT "Time ( ET )" FROM table_38501 WHERE "Week" = '5' | wikisql |
CREATE TABLE table_204_266 (
id number,
"#" number,
"event year" number,
"season" text,
"flag bearer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell me the number of summer olympics on the list .
| SELECT COUNT(*) FROM table_204_266 WHERE "season" = 'summer' | squall |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
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 swimme... | SELECT name, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE... | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'SAN DIEGO... | atis |
CREATE TABLE table_name_13 (
number INTEGER,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Number, when Position is Forward?
| SELECT AVG(number) FROM table_name_13 WHERE position = "forward" | sql_create_context |
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 mzjzjlb.JZLSH 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 = '邹慧巧' AND hz_info.YLJGDM = '0616625' AND NOT mzjzjlb.JZKSMC LIKE '%病理科%' | css |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_66624 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Class has the Identifier fo CBFX-FM-2?
| SELECT "Class" FROM table_66624 WHERE "Identifier" = 'cbfx-fm-2' | wikisql |
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.marital_status FROM demographic WHERE demographic.name = "Joseph Dillman" | mimicsql_data |
CREATE TABLE table_33847 (
"Number (map)" real,
"Borough" text,
"Population Canada 2011 Census" real,
"Area in km\u00b2" real,
"Density per km\u00b2" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much #s have an Area in km larger than 13.5, and... | SELECT COUNT("Number (map)") FROM table_33847 WHERE "Area in km\u00b2" > '13.5' AND "Population Canada 2011 Census" = '134,038' | wikisql |
CREATE TABLE table_204_105 (
id number,
"#" number,
"name" text,
"height" text,
"weight (lbs.)" number,
"position" text,
"class" text,
"hometown" text,
"previous team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the num... | SELECT COUNT("name") FROM table_204_105 WHERE "weight (lbs.)" > 200 | squall |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '013-33898' AND patient.unitdischargetime IS NULL | eicu |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen, urine') | mimic_iii |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_NM = '袁永安' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-03-27' AND '2015-03-22' | css |
CREATE TABLE table_name_44 (
silver VARCHAR,
nation VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the nation listed as united states with the total more than 1?
| SELECT COUNT(silver) FROM table_name_44 WHERE nation = "united states" AND total > 1 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.