instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_item_details text
)
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_... | SELECT DISTINCT product_name FROM products ORDER BY product_name | spider |
CREATE TABLE city (
city_id SMALLINT UNSIGNED,
city VARCHAR(50),
country_id SMALLINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE rental (
rental_id INT,
rental_date DATETIME,
inventory_id MEDIUMINT UNSIGNED,
customer_id SMALLINT UNSIGNED,
return_date DATETIME,
staff_id TINYIN... | SELECT name, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id ORDER BY name | nvbench |
CREATE TABLE table_name_83 (
city___state VARCHAR,
circuit VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is City / State, when Circuit is Eastern Creek Raceway, and when Winner is Michael Donaher?
| SELECT city___state FROM table_name_83 WHERE circuit = "eastern creek raceway" AND winner = "michael donaher" | sql_create_context |
CREATE TABLE regular_order_products (
regular_order_id number,
product_id number
)
CREATE TABLE employees (
employee_id number,
employee_address_id number,
employee_name text,
employee_phone text
)
CREATE TABLE delivery_route_locations (
location_code text,
route_id number,
locatio... | SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success' | spider |
CREATE TABLE table_45145 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event had a time of 2:34?
| SELECT "Event" FROM table_45145 WHERE "Time" = '2:34' | wikisql |
CREATE TABLE table_36648 (
"Club" text,
"Played" 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 following questions f... | SELECT "Drawn" FROM table_36648 WHERE "Points against" = '542' | wikisql |
CREATE TABLE table_26681728_1 (
rank_final INTEGER,
apparatus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum rank-final score on the floor exercise?
| SELECT MAX(rank_final) FROM table_26681728_1 WHERE apparatus = "Floor Exercise" | sql_create_context |
CREATE TABLE table_203_42 (
id number,
"model" text,
"class" text,
"length" text,
"fuel" text,
"starting price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which model is at the top of the list with the highest starting price ?
| SELECT "model" FROM table_203_42 ORDER BY "starting price" DESC LIMIT 1 | squall |
CREATE TABLE table_6291 (
"Player" text,
"Result" text,
"Appeared" real,
"RR W\u2013L" text,
"RR W Rate" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For Angelique Kerber who had an RR Rate of less than 0.33, what's the appeared?
| SELECT SUM("Appeared") FROM table_6291 WHERE "RR W Rate" < '0.33' AND "Player" = 'angelique kerber' | wikisql |
CREATE TABLE table_name_33 (
acquisition_via VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Acquisition via for Dennis Miranda?
| SELECT acquisition_via FROM table_name_33 WHERE name = "dennis miranda" | sql_create_context |
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 t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2013-06-02' AND '2020-05-10' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 21 | css |
CREATE TABLE table_name_2 (
total VARCHAR,
gold VARCHAR,
silver VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total of rank 8 when Silver medals are 0 and gold is more than 1?
| SELECT COUNT(total) FROM table_name_2 WHERE silver = 0 AND rank = 8 AND gold > 1 | 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 SUM(MED_AMOUT) FROM t_kc24 WHERE PERSON_ID = '61183552' AND CLINIC_SLT_DATE BETWEEN '2003-06-24' AND '2008-06-14' | css |
CREATE TABLE table_name_10 (
goals_conceded INTEGER,
points VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Goals conceded has Points of 6 and Draws larger than 0?
| SELECT MAX(goals_conceded) FROM table_name_10 WHERE points = 6 AND draws > 0 | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_35154 (
"Season" text,
"Record" text,
"Pct." real,
"Games" real,
"Attendance" real,
"Average" real,
"Sellouts" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the full amount of averages when the sellouts are less t... | SELECT COUNT("Average") FROM table_35154 WHERE "Sellouts" < '14' AND "Season" = '2011-12' AND "Attendance" < '162,474' | wikisql |
CREATE TABLE table_36670 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Home of pittsburgh, and a Record of 3 6 5?
| SELECT "Date" FROM table_36670 WHERE "Home" = 'pittsburgh' AND "Record" = '3–6–5' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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,
... | SELECT COUNT(DISTINCT t1.subject_id) 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_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | mimic_iii |
CREATE TABLE management (
department_id number,
head_id number,
temporary_acting text
)
CREATE TABLE head (
head_id number,
name text,
born_state text,
age number
)
CREATE TABLE department (
department_id number,
name text,
creation text,
ranking number,
budget_in_billi... | SELECT creation FROM department GROUP BY creation ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_19420 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the class a for pearland
| SELECT "Class A" FROM table_19420 WHERE "Class AAAAA" = 'Pearland' | wikisql |
CREATE TABLE table_26866205_1 (
original_airdate VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every original air date for series# of 26?
| SELECT original_airdate FROM table_26866205_1 WHERE series__number = 26 | sql_create_context |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "4659" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_18712423_3 (
series_episode INTEGER,
viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the show episode number of the episode that reached 1.215 millions views?
| SELECT MIN(series_episode) FROM table_18712423_3 WHERE viewers__millions_ = "1.215" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D... | atis |
CREATE TABLE table_204_469 (
id number,
"coach" text,
"years" text,
"seasons" number,
"wins" number,
"losses" number,
"ties" number,
"pct" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which coach has the least number of total games o... | SELECT "coach" FROM table_204_469 ORDER BY "wins" + "losses" + "ties" LIMIT 1 | squall |
CREATE TABLE table_37085 (
"Round" real,
"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 country does Round 4 come from?
| SELECT "Nationality" FROM table_37085 WHERE "Round" = '4' | wikisql |
CREATE TABLE table_name_58 (
lost INTEGER,
points VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number lost with more than 29 points and an against less than 19?
| SELECT MAX(lost) FROM table_name_58 WHERE points > 29 AND against < 19 | sql_create_context |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-1 cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12274) AND STRFTIME('%... | mimic_iii |
CREATE TABLE table_12668 (
"Rank" real,
"Result" text,
"Wind" text,
"Athlete" text,
"Date" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Wind has a Result of 21.69?
| SELECT "Wind" FROM table_12668 WHERE "Result" = '21.69' | 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_69615 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average total of Gay Brewer from the United States with a to par of 9?
| SELECT AVG("Total") FROM table_69615 WHERE "Country" = 'united states' AND "To par" = '9' AND "Player" = 'gay brewer' | wikisql |
CREATE TABLE table_50328 (
"Season" text,
"North" text,
"South" text,
"East" text,
"West" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was west when ev f rstenfeldbruck was south?
| SELECT "West" FROM table_50328 WHERE "South" = 'ev fürstenfeldbruck' | wikisql |
CREATE TABLE table_name_25 (
score VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the 1998 FIFA World Cup qualification competition?
| SELECT score FROM table_name_25 WHERE competition = "1998 fifa world cup qualification" | sql_create_context |
CREATE TABLE table_31144 (
"Season" real,
"Winner" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons did Otsuka Pharmaceuticals come in third?
| SELECT COUNT("Season") FROM table_31144 WHERE "Third place" = 'Otsuka Pharmaceuticals' | wikisql |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '李雅蕊' AND t_kc22.STA_DATE BETWEEN '2009-09-20' AND '2016-10-30' AND t_kc22.SOC_SRT_DIRE_CD = '255778471-s' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '... | css |
CREATE TABLE table_33041 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance of the game on December 11, 2005?
| SELECT "Attendance" FROM table_33041 WHERE "Date" = 'december 11, 2005' | wikisql |
CREATE TABLE table_name_42 (
author VARCHAR,
language VARCHAR,
book_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which author wrote Sironia, Texas in English?
| SELECT author FROM table_name_42 WHERE language = "english" AND book_title = "sironia, texas" | sql_create_context |
CREATE TABLE table_69025 (
"Appearances" real,
"Team" text,
"Wins" real,
"Losses" real,
"Winning percentage" real,
"Season(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With Appearances larger than 1, what is the Wins for the Reno Aces Team... | SELECT MIN("Wins") FROM table_69025 WHERE "Team" = 'reno aces' AND "Appearances" > '1' | wikisql |
CREATE TABLE organization_contact_individuals (
individual_id number,
organization_id number,
date_contact_from time,
date_contact_to time
)
CREATE TABLE services (
service_id number,
service_type_code text,
service_name text,
service_descriptio text
)
CREATE TABLE forms (
form_id ... | SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1 | spider |
CREATE TABLE table_36176 (
"Character" text,
"Actor" text,
"Duration" text,
"Role" text,
"Appearances" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the duration for nickolas grace as the actor?
| SELECT "Duration" FROM table_36176 WHERE "Actor" = 'nickolas grace' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '小儿麻醉科' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-05-11' AND '2016-12-20' AND t_kc21.IN_DIAG_DIS_CD = 'T40.906' AND t_kc21.CLINIC_TYPE = '住院' | css |
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '戚智纯' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '戚智纯' | css |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
... | SELECT u.Id AS "user_link", SUM(Score) AS totalscore FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id OR pt.PostId = p.ParentId INNER JOIN Tags AS t ON t.Id = pt.TagId INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE TagName = '##tag1:string##' COLLATE SQL_Latin1_General_CP1_CI_AI AND Location LIKE '%' ... | sede |
CREATE TABLE table_45673 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the city in India with an airport named Sardar Vallabhbhai Patel International Airport?
| SELECT "City" FROM table_45673 WHERE "Country" = 'india' AND "Airport" = 'sardar vallabhbhai patel international airport' | wikisql |
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
... | SELECT COUNT(*) FROM club_rank WHERE total < 10 | spider |
CREATE TABLE table_name_22 (
to_par VARCHAR,
country VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par of the player from the United States with a t6 place and a score of 70-73-68-73=284?
| SELECT to_par FROM table_name_22 WHERE country = "united states" AND place = "t6" AND score = 70 - 73 - 68 - 73 = 284 | sql_create_context |
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location text,
length_meters real,
length_feet real
)
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
... | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.name | nvbench |
CREATE TABLE table_name_65 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did carlton score while away?
| SELECT away_team AS score FROM table_name_65 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_48355 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the Results for 25,000 Attendance?
| SELECT "Result" FROM table_48355 WHERE "Attendance" = '25,000' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'abscess') | eicu |
CREATE TABLE table_22660 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the ... | SELECT "Record" FROM table_22660 WHERE "High rebounds" = 'Dydek (10)' | wikisql |
CREATE TABLE table_14316 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the parter against Marin ili lovro Zovko?
| SELECT "Partnering" FROM table_14316 WHERE "Opponents" = 'marin čilić lovro zovko' | wikisql |
CREATE TABLE table_203_308 (
id number,
"athlete" text,
"nation" text,
"olympics" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who has earned the most medals ?
| SELECT "athlete" FROM table_203_308 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE table_29590 (
"Players" text,
"Games Won" real,
"Games Lost" real,
"Total points" real,
"Grand Average" text,
"Best Winning Average" text,
"Best Run" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- if the best run was 138, what i... | SELECT "Games Lost" FROM table_29590 WHERE "Best Run" = '138' | wikisql |
CREATE TABLE table_name_30 (
round VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round's position is according to official website?
| SELECT round FROM table_name_30 WHERE position = "according to official website" | sql_create_context |
CREATE TABLE table_28441 (
"Name" text,
"Original Club" text,
"Stadium" text,
"City" text,
"Country" text,
"Sport" text,
"Founded" real,
"Reason for foundation with source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many clubs we... | SELECT COUNT("Founded") FROM table_28441 WHERE "Stadium" = 'Westfalenstadion' | wikisql |
CREATE TABLE table_name_51 (
laps VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps have a time/retired of +23.080?
| SELECT laps FROM table_name_51 WHERE time_retired = "+23.080" | sql_create_context |
CREATE TABLE table_39250 (
"Rank" real,
"Town" text,
"Population" real,
"Year" real,
"Borough" text,
"Definition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year is the highest one that has a Population larger than 13,012, and a Boroug... | SELECT MAX("Year") FROM table_39250 WHERE "Population" > '13,012' AND "Borough" = 'richmondshire' | wikisql |
CREATE TABLE table_47315 (
"Title" text,
"Parent magazine" text,
"Magazine type" text,
"Frequency" text,
"First published" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frequency that the magazine issues that was first published on apri... | SELECT "Frequency" FROM table_47315 WHERE "First published" = 'april 27, 2010' | wikisql |
CREATE TABLE table_47471 (
"Subclass" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the part 4 with *heguldun *febungun in part 3?
| SELECT "Part 4" FROM table_47471 WHERE "Part 3" = '*heguldun *febungun' | wikisql |
CREATE TABLE school_performance (
School_Id int,
School_Year text,
Class_A text,
Class_AA text
)
CREATE TABLE school (
School_ID int,
School text,
Location text,
Enrollment real,
Founded real,
Denomination text,
Boys_or_Girls text,
Day_or_Boarding text,
Year_Entered_... | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination | nvbench |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT qtb.PERSON_NM, qtb.PERSON_SEX, qtb.PERSON_AGE, qtb.IDENTITY_CARD FROM qtb WHERE qtb.MED_CLINIC_ID = '75285494355' UNION SELECT gyb.PERSON_NM, gyb.PERSON_SEX, gyb.PERSON_AGE, gyb.IDENTITY_CARD FROM gyb WHERE gyb.MED_CLINIC_ID = '75285494355' UNION SELECT zyb.PERSON_NM, zyb.PERSON_SEX, zyb.PERSON_AGE, zyb.IDENTITY... | css |
CREATE TABLE table_name_53 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Home Team is 'Luton Town'?
| SELECT date FROM table_name_53 WHERE home_team = "luton town" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Promyelocytes" | mimicsql_data |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '1303547' AND qtb.IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '1303547' AND gyb.IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '1303547' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_name_86 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team score for South Melbourne?
| SELECT away_team AS score FROM table_name_86 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Ciprofloxacin" | mimicsql_data |
CREATE TABLE table_19611 (
"Hand" text,
"1 credit" real,
"2 credits" real,
"3 credits" real,
"4 credits" real,
"5 credits" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least 2 credits for straight hand
| SELECT MIN("2 credits") FROM table_19611 WHERE "Hand" = 'Straight' | wikisql |
CREATE TABLE table_name_14 (
location VARCHAR,
year VARCHAR,
second VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In years after 1999, what was the location where Anja Huber finished 2nd?
| SELECT location FROM table_name_14 WHERE year > 1999 AND second = "anja huber" | sql_create_context |
CREATE TABLE table_18288 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the candidates in the Louisiana 4 district?
| SELECT "Candidates" FROM table_18288 WHERE "District" = 'Louisiana 4' | wikisql |
CREATE TABLE table_39245 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the leading scorer when the record was 9... | SELECT "Leading scorer" FROM table_39245 WHERE "Record" = '9–6' | wikisql |
CREATE TABLE table_60687 (
"Golden Rivers" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of wins for Quambatook when Against is less than 1129?
| SELECT MAX("Wins") FROM table_60687 WHERE "Golden Rivers" = 'quambatook' AND "Against" < '1129' | wikisql |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
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 Faculty_Participates_in (
FacID INTEGER... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY Rank | nvbench |
CREATE TABLE table_11536 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player who went to Stanford?
| SELECT "Player" FROM table_11536 WHERE "School/Club Team" = 'stanford' | 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 Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue) | nvbench |
CREATE TABLE table_9130 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of surface was played at the tournament in berlin?
| SELECT "Surface" FROM table_9130 WHERE "Tournament" = 'berlin' | wikisql |
CREATE TABLE table_72361 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many candidates were elected first in 1980?
| SELECT COUNT("Candidates") FROM table_72361 WHERE "First elected" = '1980' | wikisql |
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT DISTINCT T1.director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.film_id = T2.film_id WHERE T2.year = 1995 | spider |
CREATE TABLE table_name_25 (
chassis VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the chassis when the rank is 3rd?
| SELECT chassis FROM table_name_25 WHERE rank = "3rd" | sql_create_context |
CREATE TABLE table_name_65 (
tournament VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tournament has a Partner of tom gorman?
| SELECT tournament FROM table_name_65 WHERE partner = "tom gorman" | sql_create_context |
CREATE TABLE table_72711 (
"Season" real,
"Date" text,
"Location" text,
"Driver" text,
"Chassis" text,
"Engine" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine does Galles Racing use?
| SELECT "Engine" FROM table_72711 WHERE "Team" = 'Galles Racing' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | advising |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | 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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 809... | mimic_iii |
CREATE TABLE table_13780 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg when team 2 is Asil Lysi?
| SELECT "1st leg" FROM table_13780 WHERE "Team 2" = 'asil lysi' | wikisql |
CREATE TABLE table_name_71 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for game number 30?
| SELECT score FROM table_name_71 WHERE game = 30 | sql_create_context |
CREATE TABLE table_55011 (
"Date" text,
"Ship" text,
"Type" text,
"Nationality" text,
"Tonnage GRT" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Ship of hallbjorg?
| SELECT "Date" FROM table_55011 WHERE "Ship" = 'hallbjorg' | wikisql |
CREATE TABLE table_67034 (
"Name" text,
"Species/Authority" text,
"Order" text,
"Family" text,
"Red List" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which family has a Name of humpback whale?
| SELECT "Family" FROM table_67034 WHERE "Name" = 'humpback whale' | 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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_42954 (
"Member state" text,
"Population millions" real,
"MEPs" real,
"Inhabitants per MEP" real,
"Influence" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest population in millions that has inhabitants per MEP le... | SELECT MIN("Population millions") FROM table_42954 WHERE "Inhabitants per MEP" < '414,538' AND "Influence" = '2.06' AND "MEPs" < '13' | 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, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE student... | SELECT building, MAX(capacity) FROM classroom GROUP BY building | nvbench |
CREATE TABLE table_59618 (
"Combined" text,
"50 yard Freestyle" text,
"100 yard Freestyle" text,
"200 yard Freestyle" text,
"500 yard Freestyle" text,
"100 yard Backstroke" text,
"100 yard Butterfly" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "500 yard Freestyle" FROM table_59618 WHERE "Combined" = 'palo verde' AND "100 yard Butterfly" = 'edward kollar (douglas)' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT FIRST_NAME, MANAGER_ID FROM employees | nvbench |
CREATE TABLE table_51500 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does gerald carter play?
| SELECT "Position" FROM table_51500 WHERE "Player" = 'gerald carter' | wikisql |
CREATE TABLE table_name_92 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district has an incumbent of Sanford Bishop?
| SELECT district FROM table_name_92 WHERE incumbent = "sanford bishop" | 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... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE table_203_835 (
id number,
"season" text,
"club" text,
"country" text,
"competition" text,
"apps." number,
"goals" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country has the least amount of total goals ?
| SELECT "country" FROM table_203_835 GROUP BY "country" ORDER BY SUM("goals") LIMIT 1 | squall |
CREATE TABLE table_1341663_33 (
district VARCHAR,
incumbent VARCHAR,
party VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district did the Democratic party incumbent Stephen J. Solarz get first elected to in 1974?
| SELECT district FROM table_1341663_33 WHERE party = "Democratic" AND first_elected = 1974 AND incumbent = "Stephen J. Solarz" | sql_create_context |
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
pa... | SELECT T2.governor FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T1.district = 1 | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.