instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_45 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the avarage Attendance for the Date of october 26, 1947?
| SELECT AVG(attendance) FROM table_name_45 WHERE date = "october 26, 1947" | sql_create_context |
CREATE TABLE table_69220 (
"Name" text,
"Father" text,
"Birth" text,
"Marriage" text,
"Became Countess" text,
"Ceased to be Countess" text,
"Death" text,
"Spouse" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the father of the p... | SELECT "Father" FROM table_69220 WHERE "Birth" = '1363' | wikisql |
CREATE TABLE table_44142 (
"Season" real,
"Wins" real,
"Poles" real,
"Podiums" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Poles, when Season is before 2005, when Position is '2nd', and when Wins is less than 6... | SELECT SUM("Poles") FROM table_44142 WHERE "Season" < '2005' AND "Position" = '2nd' AND "Wins" < '6' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuest... | SELECT * FROM Posts WHERE Id = '##id##' | sede |
CREATE TABLE table_name_2 (
player VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player with a FB position?
| SELECT player FROM table_name_2 WHERE position = "fb" | sql_create_context |
CREATE TABLE table_10183 (
"Year" real,
"Title" text,
"Genre" text,
"Role" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the eula goodnight movie after 1949?
| SELECT "Director" FROM table_10183 WHERE "Year" > '1949' AND "Role" = 'eula goodnight' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_77361 (
"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 most money ($) when the score is 71-74-69-72=286?
| SELECT MAX("Money ( $ )") FROM table_77361 WHERE "Score" = '71-74-69-72=286' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_train_271 (
"id" int,
"renal_disease" bool,
"hepatic_disease" bool,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"myocardial_infarction" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the followin... | SELECT * FROM table_train_271 WHERE smoking = 0 | criteria2sql |
CREATE TABLE table_27268238_4 (
player VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the average is 50.16, who is the player?
| SELECT player FROM table_27268238_4 WHERE average = "50.16" | sql_create_context |
CREATE TABLE table_73613 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people voted for Kerry in the county where 8 voted for othe... | SELECT MIN("Kerry#") FROM table_73613 WHERE "Others#" = '8' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.name = "Herlinda Thomson" | mimicsql_data |
CREATE TABLE table_22225 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Written by" FROM table_22225 WHERE "Production code" = '3T7573' | wikisql |
CREATE TABLE table_50439 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Platense was the away team on 16 August 2008 how many people attended the game?
| SELECT "Attendance" FROM table_50439 WHERE "Date" = '16 august 2008' AND "Away" = 'platense' | wikisql |
CREATE TABLE table_21256068_3 (
round VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many rounds had the score 44-22
| SELECT COUNT(round) FROM table_21256068_3 WHERE score = "44-22" | sql_create_context |
CREATE TABLE table_name_67 (
set_1 VARCHAR,
set_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the set 1 with a 28-30 set 4?
| SELECT set_1 FROM table_name_67 WHERE set_4 = "28-30" | sql_create_context |
CREATE TABLE table_13733 (
"Date" text,
"Ship" text,
"Nationality" text,
"Tonnage" real,
"Fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the nationality of the ship named Toward?
| SELECT "Nationality" FROM table_13733 WHERE "Ship" = 'toward' | wikisql |
CREATE TABLE table_name_50 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was Richmond hosted as the away team?
| SELECT date FROM table_name_50 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE table_78218 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the state with an evening gown more than 8.86 and interview less than 8.7 and swimsuit les... | SELECT "State" FROM table_78218 WHERE "Evening Gown" > '8.86' AND "Swimsuit" < '8.96' AND "Interview" < '8.7' | wikisql |
CREATE TABLE table_13382 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the draw for the artist Ketil Stokkan which has le... | SELECT MIN("Draw") FROM table_13382 WHERE "Artist" = 'ketil stokkan' AND "Points" < '44' | wikisql |
CREATE TABLE table_name_56 (
number_of_electorates__2009_ INTEGER,
constituency_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the number of electorates for constituency number 56?
| SELECT SUM(number_of_electorates__2009_) FROM table_name_56 WHERE constituency_number = "56" | sql_create_context |
CREATE TABLE table_44532 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average points when position is more than 5 and played is less than 10?
| SELECT AVG("Points") FROM table_44532 WHERE "Position" > '5' AND "Played" < '10' | wikisql |
CREATE TABLE table_60964 (
"Class" text,
"Team" text,
"Drivers" text,
"Laps" real,
"Qual Pos" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are Perkins Engineering's fewest laps?
| SELECT MIN("Laps") FROM table_60964 WHERE "Team" = 'perkins engineering' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_name_22 (
points_for VARCHAR,
drawn VARCHAR,
try_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What points have 1 for drawn, and 16 as a try bonus?
| SELECT points_for FROM table_name_22 WHERE drawn = "1" AND try_bonus = "16" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE v... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-165214' AND patient.wardid = 952 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_80050 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which entrant was present prior to 1953?
| SELECT "Entrant" FROM table_80050 WHERE "Year" < '1953' | wikisql |
CREATE TABLE table_501 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"1st leg" text,
"2nd leg" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg when 2nd leg is 1 0 and competition is uefa... | SELECT "1st leg" FROM table_501 WHERE "2nd leg" = '1–0' AND "Competition" = 'UEFA Champions League' | wikisql |
CREATE TABLE table_16384648_2 (
location VARCHAR,
team_website VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has the cincinnati hockey website?
| SELECT location FROM table_16384648_2 WHERE team_website = "Cincinnati Hockey" | sql_create_context |
CREATE TABLE table_63729 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of bronze medals when the rank is greater than 2, and less than 2 total meda... | SELECT COUNT("Bronze") FROM table_63729 WHERE "Rank" > '2' AND "Total" < '2' AND "Silver" > '0' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '41810948156' | css |
CREATE TABLE table_1211545_2 (
heavy_vehicle__3_4_axles_ VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the toll for heavy vehicles with 3/4 axles at Verkeerdevlei toll plaza?
| SELECT heavy_vehicle__3_4_axles_ FROM table_1211545_2 WHERE name = "Verkeerdevlei Toll Plaza" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE person_info_hz_info (
RYBH text,
... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJ... | css |
CREATE TABLE table_37621 (
"Game #" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home has a Game # of 59?
| SELECT "Home" FROM table_37621 WHERE "Game #" = '59' | wikisql |
CREATE TABLE table_10089 (
"Number" real,
"Name" text,
"Year Built" text,
"Boat Builder" text,
"Current Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the boat builder for a boat built in 1910/11 and a number of 39?
| SELECT "Boat Builder" FROM table_10089 WHERE "Year Built" = '1910/11' AND "Number" = '39' | wikisql |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "GLYC1R" | mimicsql_data |
CREATE TABLE table_22854 (
"Year" real,
"Worldwide" real,
"Africa" real,
"America" real,
"Asia" real,
"Australia" real,
"Europe" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum number of members Africa had in 2001?
| SELECT MIN("Africa") FROM table_22854 WHERE "Year" = '2001' | wikisql |
CREATE TABLE table_59624 (
"Player" text,
"Team" text,
"Matches" real,
"Overs" real,
"Runs" real,
"Wickets" real,
"Best" text,
"Econ" real,
"S/Rate" real,
"4/inns" real,
"5+/inns" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the table... | SELECT MIN("Matches") FROM table_59624 WHERE "Wickets" > '16' AND "Best" = '3/15' AND "Econ" < '8' | wikisql |
CREATE TABLE table_name_85 (
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1964 has a Country of united states, and a 1969 smaller than 7.3?
| SELECT MIN(1964) FROM table_name_85 WHERE country = "united states" AND 1969 < 7.3 | sql_create_context |
CREATE TABLE table_name_30 (
interview_subject VARCHAR,
pictorials VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Interview subject has a Pictorials of vida guerra?
| SELECT interview_subject FROM table_name_30 WHERE pictorials = "vida guerra" | sql_create_context |
CREATE TABLE table_name_78 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the match on 30 July 2004?
| SELECT result FROM table_name_78 WHERE date = "30 july 2004" | sql_create_context |
CREATE TABLE table_name_4 (
event VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Event, when Date is April 20, 2013?
| SELECT event FROM table_name_4 WHERE date = "april 20, 2013" | sql_create_context |
CREATE TABLE table_28690 (
"Role" text,
"Original Broadway Cast" text,
"2005 film" text,
"2008 Final Performance Film" text,
"Hollywood Bowl Cast" text,
"2011 Off-Broadway Revival" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the 2008 ... | SELECT "2008 Final Performance Film" FROM table_28690 WHERE "2011 Off-Broadway Revival" = 'Annaleigh Ashford' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid... | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY city_code DESC | nvbench |
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGE... | SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY purchase_details | nvbench |
CREATE TABLE table_name_19 (
points VARCHAR,
wins VARCHAR,
team VARCHAR,
class VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points numbers had a class of 250cc, a year prior to 1978, Yamaha as a team, and where wins was m... | SELECT COUNT(points) FROM table_name_19 WHERE class = "250cc" AND year < 1978 AND team = "yamaha" AND wins > 0 | sql_create_context |
CREATE TABLE city (
city_id number,
county_id number,
name text,
white number,
black number,
amerindian number,
asian number,
multiracial number,
hispanic number
)
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers num... | SELECT name FROM county_public_safety ORDER BY population DESC | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "5680" | mimicsql_data |
CREATE TABLE table_name_42 (
city VARCHAR,
type_of_game VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what city has a game of friendly and an opponent of tunisia?
| SELECT city FROM table_name_42 WHERE type_of_game = "friendly" AND opponent = "tunisia" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id num... | SELECT * FROM (SELECT COUNT(*) AS favcnt, Votes.UserId AS "user_link" FROM Votes INNER JOIN Users ON Votes.UserId = Users.Id WHERE Votes.VoteTypeId = 5 GROUP BY UserId) AS subq ORDER BY favcnt DESC LIMIT 100 | sede |
CREATE TABLE table_3538 (
"Series #" real,
"Season #" real,
"Episode Title" text,
"Original airdate" text,
"Prod. No." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode number was 'Stumped Again / The Kick Stays in the Picture'?
| SELECT MIN("Season #") FROM table_3538 WHERE "Episode Title" = 'Stumped Again / The Kick Stays in the Picture' | wikisql |
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 wdmzjzjlb (
CYBQDM text,
CYBQ... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
... | 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, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 26 AND da... | atis |
CREATE TABLE table_14414 (
"Sunday Surya (the Sun)" text,
"Monday Soma (the Moon)" text,
"Tuesday Mangala (Mars)" text,
"Friday Shukra (Venus)" text,
"Saturday Shani (Saturn)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of Satu... | SELECT "Saturday Shani (Saturn)" FROM table_14414 WHERE "Sunday Surya (the Sun)" = 'ថ្ងៃអាទិត្យ [tŋaj ʔaatɨt ]' | wikisql |
CREATE TABLE table_name_95 (
sets VARCHAR,
nadal VARCHAR,
federer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the sets when Federer had 6 and a nadal of 13?
| SELECT sets FROM table_name_95 WHERE nadal = 13 AND federer = 6 | sql_create_context |
CREATE TABLE table_35408 (
"Year" real,
"Jewish" real,
"Muslim" real,
"Christian" real,
"Druze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest jewish that has a druze less than 2,517, and a year prior to 2007?
| SELECT MIN("Jewish") FROM table_35408 WHERE "Druze" < '2,517' AND "Year" < '2007' | wikisql |
CREATE TABLE table_54775 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps have a grid under 14 and a time/retired of out of fuel?
| SELECT SUM("Laps") FROM table_54775 WHERE "Grid" < '14' AND "Time/Retired" = 'out of fuel' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
... | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 15 AND date_day.month_number = 1... | atis |
CREATE TABLE table_9711 (
"Province" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ends lost when shot % is 88 and ends won ar... | SELECT COUNT("Ends Lost") FROM table_9711 WHERE "Shot Pct." = '88' AND "Ends Won" = '31' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-146580')) AND intakeoutput.celllabel = 'ente... | eicu |
CREATE TABLE table_name_50 (
regular_season VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which regular season was 2013 in?
| SELECT regular_season FROM table_name_50 WHERE year = 2013 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | SELECT u.Id, u.DisplayName, u.Reputation, COUNT(*) - COUNT(q.AcceptedAnswerId) FROM Users AS u INNER JOIN Posts AS q ON u.Id = q.OwnerUserId WHERE q.PostTypeId = 1 AND q.AnswerCount > 0 GROUP BY u.Id, u.DisplayName, u.Reputation HAVING COUNT(*) = (COUNT(*) - COUNT(q.AcceptedAnswerId)) AND COUNT(*) > 10 ORDER BY COUNT(*... | sede |
CREATE TABLE table_44843 (
"Date" real,
"Region" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE LOWEST DATE FOR KOREA, IN CD FORMAT?
| SELECT MIN("Date") FROM table_44843 WHERE "Region" = 'korea' AND "Format" = 'cd' | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.Y... | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_... | mimic_iii |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service ... | SELECT DISTINCT airline.airline_code FROM airline, airport, flight WHERE airport.airport_code = 'DAL' AND flight.airline_code = airline.airline_code AND flight.to_airport = airport.airport_code | atis |
CREATE TABLE table_51769 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance at the Footscray away ga... | SELECT "Crowd" FROM table_51769 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | nvbench |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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... | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_name_71 (
county VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What county has a school mascot of the Pioneers?
| SELECT county FROM table_name_71 WHERE mascot = "pioneers" | sql_create_context |
CREATE TABLE table_51980 (
"Game" real,
"Score" text,
"Date" text,
"Location" text,
"Attendance" real,
"Time of Game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first game number that had attendance of 56,505?
| SELECT MIN("Game") FROM table_51980 WHERE "Attendance" = '56,505' | wikisql |
CREATE TABLE table_55925 (
"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 COUNT("Draws") FROM table_55925 WHERE "Goals for" = '58' AND "Losses" = '12' AND "Goal Difference" < '21' | wikisql |
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 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 = '012-66291' AND patient.hospitaldischargetime IS NULL)) AND medication.drug... | eicu |
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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5091059' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '50... | css |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varch... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... | advising |
CREATE TABLE table_13442 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode ... | SELECT "Title" FROM table_13442 WHERE "Written by" = 'robert haywood' | wikisql |
CREATE TABLE table_1341640_14 (
result VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the election when someone was first elected in 1960?
| SELECT result FROM table_1341640_14 WHERE first_elected = 1960 | sql_create_context |
CREATE TABLE table_203_784 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"performer" text,
"appearance" text,
"air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many different performers appeared during this season ?
| SELECT COUNT(DISTINCT "performer") FROM table_203_784 | squall |
CREATE TABLE table_name_65 (
coverage_area VARCHAR,
genre VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the coverage area of muzik fm station, which has a music genre?
| SELECT coverage_area FROM table_name_65 WHERE genre = "music" AND station = "muzik fm" | sql_create_context |
CREATE TABLE table_74511 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nation has the lowest gold average that has a rank over 9?
| SELECT MIN("Gold") FROM table_74511 WHERE "Rank" > '9' | wikisql |
CREATE TABLE table_71179 (
"Player" text,
"Country" text,
"Caps" real,
"Goals" text,
"Years Active" text,
"Years at Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were scored by players with more than 16 caps?
| SELECT "Goals" FROM table_71179 WHERE "Caps" > '16' | wikisql |
CREATE TABLE table_65815 (
"Position" text,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total scored for the 8th position and a score more than 6.6
| SELECT MAX("Total") FROM table_65815 WHERE "Position" = '8th' AND "A Score" > '6.6' | wikisql |
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
)
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE useracct (
u_id number,
name text
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
-- Usi... | SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1 | spider |
CREATE TABLE table_24567 (
"Country" text,
"% of imports from Russia" text,
"% cut" text,
"Diversification" text,
"Gas storage" text,
"Alternative fuel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country had 20% imports from russia?
| SELECT "Country" FROM table_24567 WHERE "% of imports from Russia" = '20%' | wikisql |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- second highest forward/center -lrb- f/c -rrb-... | SELECT "player" FROM table_204_93 WHERE "position" = 'f/c' AND id > (SELECT MIN(id) FROM table_204_93 WHERE "position" = 'f/c') ORDER BY id LIMIT 1 | squall |
CREATE TABLE HOST (
Nationality VARCHAR,
Age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the nations that have both hosts older than 45 and hosts younger than 35.
| SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35 | sql_create_context |
CREATE TABLE table_1174162_1 (
median_age__in_2006_ VARCHAR,
area__km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the median age where the area is 1.7?
| SELECT median_age__in_2006_ FROM table_1174162_1 WHERE area__km²_ = "1.7" | sql_create_context |
CREATE TABLE table_24385 (
"Title" text,
"Total copies sold" text,
"Sales breakdown" text,
"Genre" text,
"Release date" text,
"Developer" text,
"Publisher" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many copies were sold of the game ... | SELECT "Total copies sold" FROM table_24385 WHERE "Release date" = 'October 23, 2008' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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),
... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_name_41 (
oberliga_baden_württemberg VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Oberliga Baden-W rttemberg has a Season of 1991-92?
| SELECT oberliga_baden_württemberg FROM table_name_41 WHERE season = "1991-92" | sql_create_context |
CREATE TABLE table_10566 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest rank with a total less than 1?
| SELECT MAX("Rank") FROM table_10566 WHERE "Total" < '1' | wikisql |
CREATE TABLE table_name_52 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date southampton was the away team?
| SELECT date FROM table_name_52 WHERE away_team = "southampton" | sql_create_context |
CREATE TABLE table_train_56 (
"id" int,
"organ_transplantation" bool,
"severe_sepsis" bool,
"immune_suppression" bool,
"autoimmune_disease" bool,
"hematopoietic" bool,
"chronic_infectious" bool,
"steroid_therapy" bool,
"sepsis" bool,
"systemic_inflammatory_response" bool,
"or... | SELECT * FROM table_train_56 WHERE hematopoietic = 1 OR organ_transplantation = 1 | criteria2sql |
CREATE TABLE table_name_39 (
all_time INTEGER,
amateur_era INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of All-Time, when Amateur Era is less than 0?
| SELECT SUM(all_time) FROM table_name_39 WHERE amateur_era < 0 | sql_create_context |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT name FROM reviewer UNION SELECT title FROM movie | 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.dob, demographic.diagnosis FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_203_368 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the result of the first game on this chart ?
| SELECT "result" FROM table_203_368 WHERE id = 1 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.