instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_32 (
river_mile VARCHAR,
lock_side VARCHAR,
pool_length__miles_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the River Mile with a RDB lock side and a pool length of 55.4?
| SELECT river_mile FROM table_name_32 WHERE lock_side = "rdb" AND pool_length__miles_ = "55.4" | sql_create_context |
CREATE TABLE table_39945 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lo... | SELECT MIN("Wins") FROM table_39945 WHERE "Position" = '4' AND "Loses" < '4' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPo... | SELECT 'site://review/suggested-edits/' + CAST(t.Id AS TEXT) FROM SuggestedEdits AS e INNER JOIN ReviewTasks AS t ON t.SuggestedEditId = e.Id WHERE e.Text LIKE '%nigger%' AND e.ApprovalDate IS NULL LIMIT 10 | sede |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... | mimic_iii |
CREATE TABLE table_203_797 (
id number,
"genre" text,
"year" number,
"title" text,
"role" text,
"episodes" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was coleman domingo 's first tv series ?
| SELECT "title" FROM table_203_797 WHERE "genre" = 'tv series' ORDER BY "year" LIMIT 1 | squall |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "SHORT TERM HOSPITAL" | mimicsql_data |
CREATE TABLE table_name_83 (
nationality VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name Nationality is on 6 july 1942?
| SELECT nationality FROM table_name_83 WHERE date = "6 july 1942" | sql_create_context |
CREATE TABLE table_name_45 (
field_goals INTEGER,
extra_points VARCHAR,
touchdowns VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Field goals have Touchdowns smaller than 3, and a Player of willis ward, and an Extra points sm... | SELECT SUM(field_goals) FROM table_name_45 WHERE touchdowns < 3 AND player = "willis ward" AND extra_points < 0 | sql_create_context |
CREATE TABLE table_name_69 (
district VARCHAR,
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district is the democratic Francis C. Le Blond from?
| SELECT district FROM table_name_69 WHERE party = "democratic" AND incumbent = "francis c. le blond" | sql_create_context |
CREATE TABLE table_203_296 (
id number,
"country" text,
"total gdp (nominal)\n(billion us$)" text,
"gdp per capita\n(us$, ppp)" text,
"gdp growth,\n2007-2011\n(in %)" number,
"hdi" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- there are how man... | SELECT COUNT("country") FROM table_203_296 WHERE "total gdp (nominal)\n(billion us$)" > 100 | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid ... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_name_97 (
silver INTEGER,
bronze VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silver when bronze is 25 and overall is less than 67?
| SELECT SUM(silver) FROM table_name_97 WHERE bronze = 25 AND overall < 67 | sql_create_context |
CREATE TABLE table_name_23 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the loss for record of 71-81
| SELECT loss FROM table_name_23 WHERE record = "71-81" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT Id AS "post_link", * FROM Posts WHERE PostTypeId = 1 ORDER BY CommentCount DESC LIMIT 1 | sede |
CREATE TABLE table_name_98 (
tie_no VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tie has a Score of 5 1?
| SELECT tie_no FROM table_name_98 WHERE score = "5–1" | sql_create_context |
CREATE TABLE table_36384 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which series episode has a segment c that is Elect... | SELECT "Series Ep." FROM table_36384 WHERE "Segment C" = 'electric pole s transformer' | wikisql |
CREATE TABLE table_name_99 (
decile INTEGER,
authority VARCHAR,
roll VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Decile with a State Authority and a roll of 120?
| SELECT SUM(decile) FROM table_name_99 WHERE authority = "state" AND roll = 120 | sql_create_context |
CREATE TABLE table_46785 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Location/Attendance on Dec 2?
| SELECT "Location/Attendance" FROM table_46785 WHERE "Date" = 'dec 2' | wikisql |
CREATE TABLE table_19509 (
"Rank" real,
"State" text,
"Revenue (millions)" text,
"Population" real,
"Revenue per capita" text,
"Spending (millions)" text,
"Spending per capita" text,
"Net contribution per capita" text,
"Presidential majority 2000/2004" text,
"Presidential majorit... | SELECT "Presidential majority 2000/2004" FROM table_19509 WHERE "Presidential majority 2012" = 'Non-voting' | wikisql |
CREATE TABLE table_68496 (
"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.
-- Name the 2nd leg for defence force
| SELECT "2nd leg" FROM table_68496 WHERE "Team 2" = 'defence force' | wikisql |
CREATE TABLE table_20833768_4 (
season VARCHAR,
l__ot_so_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When l (ot/so) is 22 (3/4), what is the season?
| SELECT season FROM table_20833768_4 WHERE l__ot_so_ = "22 (3/4)" | sql_create_context |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
prod... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' | nvbench |
CREATE TABLE table_75691 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position with the total number les... | SELECT COUNT("Position") FROM table_75691 WHERE "Lost" < '1' | wikisql |
CREATE TABLE table_67322 (
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games played for the army team with over 51 points and under 5 games drawn?
| SELECT COUNT("Played") FROM table_67322 WHERE "Drawn" < '5' AND "Team" = 'army' AND "Points" > '51' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,... | SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'CHARLOTTE')) AND to_airport IN (SELECT AIRPOR... | atis |
CREATE TABLE table_name_18 (
league VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 2010-11, what was the League name?
| SELECT league FROM table_name_18 WHERE year = "2010-11" | sql_create_context |
CREATE TABLE table_49235 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Pick #, when Round is '10'?
| SELECT "Pick #" FROM table_49235 WHERE "Round" = '10' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.icd9_code = "4105" | mimicsql_data |
CREATE TABLE table_1342393_16 (
candidates VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the candidates for first elected 1914
| SELECT candidates FROM table_1342393_16 WHERE first_elected = 1914 | sql_create_context |
CREATE TABLE hosting_city (
host_city VARCHAR,
YEAR VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is id of the city that hosted events in the most recent year?
| SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_84 (
teams VARCHAR,
league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had a league of regionalliga s d?
| SELECT teams FROM table_name_84 WHERE league = "regionalliga süd" | sql_create_context |
CREATE TABLE table_118 (
"Title" text,
"System" text,
"Publisher" text,
"Product No." text,
"Compatible with 20/60GB NTSC PS3 (CECHA/CECHB)" text,
"Compatible with 60GB PAL/80GB NTSC PS3 (CECHC/CECHE)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT COUNT("Title") FROM table_118 WHERE "Product No." = 'SCUS-97330' | wikisql |
CREATE TABLE table_name_33 (
area VARCHAR,
decile VARCHAR,
roll VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the area of the school with a decile of 2 and a roll number 222?
| SELECT area FROM table_name_33 WHERE decile = "2" AND roll = "222" | sql_create_context |
CREATE TABLE table_51335 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver had a grid of 18?
| SELECT "Driver" FROM table_51335 WHERE "Grid" = '18' | wikisql |
CREATE TABLE table_60705 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"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("Wins") FROM table_60705 WHERE "Draws" < '5' AND "Goals against" > '49' AND "Played" > '30' | wikisql |
CREATE TABLE table_47633 (
"Opponent" text,
"Res." text,
"Class" text,
"Score" text,
"Date" text,
"Competition" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT COMPETITION HAS MARIAN SANDU?
| SELECT "Competition" FROM table_47633 WHERE "Res." = 'marian sandu' | wikisql |
CREATE TABLE table_14343 (
"Round" real,
"Race Title" text,
"Grand Prix" text,
"Circuit" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest round with a Race Title of korean grand prix?
| SELECT MAX("Round") FROM table_14343 WHERE "Race Title" = 'korean grand prix' | wikisql |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE CO... | SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE DESC | nvbench |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 employees (
EMPLOYEE_ID decimal(6,0),... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_name_43 (
total INTEGER,
gold VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Total has Gold smaller than 12, and a Nation of hong kong (hkg)?
| SELECT MAX(total) FROM table_name_43 WHERE gold < 12 AND nation = "hong kong (hkg)" | sql_create_context |
CREATE TABLE problems (
problem_id number,
product_id number,
closure_authorised_by_staff_id number,
reported_by_staff_id number,
date_problem_reported time,
date_problem_closed time,
problem_description text,
other_problem_details text
)
CREATE TABLE problem_category_codes (
proble... | SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" | spider |
CREATE TABLE table_62284 (
"Round" real,
"Race" text,
"Circuit" text,
"Date" text,
"Event" text,
"Winning driver" text,
"Winning team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date that Fabrizio Giovanardi Christian Abt won... | SELECT "Date" FROM table_62284 WHERE "Winning driver" = 'fabrizio giovanardi christian abt' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Transfusion of other serum" | mimicsql_data |
CREATE TABLE loan (
branch_id VARCHAR,
amount INTEGER
)
CREATE TABLE bank (
bname VARCHAR,
branch_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of bank branch that provided the greatest total amount of loans.
| SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY SUM(T2.amount) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_25030512_41 (
district VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the district for 1994
| SELECT district FROM table_25030512_41 WHERE first_elected = 1994 | sql_create_context |
CREATE TABLE table_12504 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the finish is t27 what is the year (s) won?
| SELECT "Year(s) won" FROM table_12504 WHERE "Finish" = 't27' | wikisql |
CREATE TABLE table_50498 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has a 72-70-75-72=289 score?
| SELECT "Country" FROM table_50498 WHERE "Score" = '72-70-75-72=289' | wikisql |
CREATE TABLE table_2590 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many season numbers are... | SELECT COUNT("No. in season") FROM table_2590 WHERE "Written by" = 'Art Everett' | wikisql |
CREATE TABLE table_54633 (
"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 is the location when the home team score is... | SELECT "Venue" FROM table_54633 WHERE "Home team score" = '11.16 (82)' AND "Away team score" = '18.13 (121)' | wikisql |
CREATE TABLE table_10355 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time for the second qualification where the best time was 1:20.772?
| SELECT "Qual 2" FROM table_10355 WHERE "Best" = '1:20.772' | wikisql |
CREATE TABLE table_name_99 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the opponents score when Geelong played as home team?
| SELECT away_team AS score FROM table_name_99 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
catalog_entry_name VARCHAR(80),
product_stock_number VARCHAR(50),
price_in_dollars DOUBLE,
price_in_euros DOUBLE,
pri... | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_number | nvbench |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", DisplayName, Id, Reputation FROM Users WHERE LOWER(Location) LIKE '%gujarat%' ORDER BY Reputation DESC LIMIT 1000 | sede |
CREATE TABLE table_63455 (
"Result" text,
"Record" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result of the event with a Record of 1-3?
| SELECT "Result" FROM table_63455 WHERE "Record" = '1-3' | wikisql |
CREATE TABLE table_name_36 (
date VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the attendance 17,136?
| SELECT date FROM table_name_36 WHERE attendance = "17,136" | 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 COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_ID = '35830097' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-05-05' AND '2011-01-04' | css |
CREATE TABLE table_name_30 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What grid is the lowest when the time/retired is + 5 laps and the laps is less than 161?
| SELECT MIN(grid) FROM table_name_30 WHERE time_retired = "+ 5 laps" AND laps < 161 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE Location LIKE '%Greece%' OR Location LIKE '%Hellas%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_39129 (
"Position" real,
"Channel" text,
"Owner" text,
"Share (%)" real,
"Rating (%)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average rating % for shandong satellite tv and share % less than 1.74
| SELECT AVG("Rating (%)") FROM table_39129 WHERE "Channel" = 'shandong satellite tv' AND "Share (%)" < '1.74' | wikisql |
CREATE TABLE table_23835213_2 (
df VARCHAR,
adam_hinshelwood VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the df when Adam Hinshelwood is Junior Mendes?
| SELECT df FROM table_23835213_2 WHERE adam_hinshelwood = "Junior Mendes" | sql_create_context |
CREATE TABLE table_43330 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Rank for Jason Kreis, with less than 305 matches?
| SELECT MAX("Rank") FROM table_43330 WHERE "Name" = 'jason kreis' AND "Matches" < '305' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) = '2100' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_name_94 (
week INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the week of the game played on November 28, 1974?
| SELECT MIN(week) FROM table_name_94 WHERE date = "november 28, 1974" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-12011')) AND intakeoutput.cellpath LIKE '%intake%' AND S... | eicu |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT p.Id, p.CreationDate, p.ClosedDate FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 AND u.Reputation <= '##ReputationAtMost##' AND p.CreationDate > '##SinceDate##' ORDER BY p.CreationDate DESC | sede |
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay = "13" | mimicsql_data |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Coun... | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID) DESC | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT MZZYZDZZBM FROM zyjzjlb WHERE JZLSH = '33429029356' | css |
CREATE TABLE table_name_33 (
deaths_from_warfare VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many warfare deaths befell the choctaw nation?
| SELECT deaths_from_warfare FROM table_name_33 WHERE nation = "choctaw" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
u... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-754')) AND intakeoutput.cellpath LIKE '%intake%' ... | eicu |
CREATE TABLE table_name_13 (
year VARCHAR,
serial_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the year for the three musketeers
| SELECT year FROM table_name_13 WHERE serial_title = "the three musketeers" | sql_create_context |
CREATE TABLE table_10311 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During the hungarian grand prix ... | SELECT COUNT("Round") FROM table_10311 WHERE "Fastest Lap" = 'damon hill' AND "Pole Position" = 'michael schumacher' AND "Grand Prix" = 'hungarian grand prix' | wikisql |
CREATE TABLE table_train_51 (
"id" int,
"active_infection" bool,
"procalcitonin" int,
"oliguria" bool,
"receiving_vasopressor" bool,
"metabolic_acidosis" bool,
"colonized_with_a_multi_drug_resistant_organism" bool,
"hypoperfusion" bool,
"central_venous_oxygen_saturation_scvo2" int,
... | SELECT * FROM table_train_51 WHERE active_infection = 1 | criteria2sql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name | nvbench |
CREATE TABLE procedures (
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2167" AND diagnoses.short_title = "Pressure ulcer, hip" | mimicsql_data |
CREATE TABLE table_62912 (
"Round" real,
"Date" text,
"Home" text,
"Result" text,
"Visitor" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest attendance on Monday, November 10 when link pings ... | SELECT MIN("Attendance") FROM table_62912 WHERE "Home" = 'linköpings hc' AND "Date" = 'monday, november 10' AND "Round" > '18' | wikisql |
CREATE TABLE procedures (
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.formulary_drug_cd = "NTGBASE" | mimicsql_data |
CREATE TABLE table_name_99 (
geo_id INTEGER,
land___sqmi__ VARCHAR,
water__sqmi_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest GEO ID for land masses over 38.117 sq mi and over 2.065 sq mi of water?
| SELECT MAX(geo_id) FROM table_name_99 WHERE land___sqmi__ > 38.117 AND water__sqmi_ > 2.065 | sql_create_context |
CREATE TABLE table_name_57 (
host_team VARCHAR,
stadium VARCHAR,
visiting_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the host team for giants stadium and visiting of cincinnati bengals
| SELECT host_team FROM table_name_57 WHERE stadium = "giants stadium" AND visiting_team = "cincinnati bengals" | sql_create_context |
CREATE TABLE table_64023 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has an Against larger than 0?
| SELECT "Date" FROM table_64023 WHERE "Against" > '0' | wikisql |
CREATE TABLE table_15680 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which entrant before 1965 scored more than 0 point with the lotus 25 chassis?
| SELECT "Entrant" FROM table_15680 WHERE "Year" < '1965' AND "Points" > '0' AND "Chassis" = 'lotus 25' | wikisql |
CREATE TABLE table_68210 (
"Number" real,
"Name of the song" text,
"Singer" text,
"Drama" text,
"Kind of the song" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which song has a ending theme, and is sung by miriam yeung?
| SELECT "Name of the song" FROM table_68210 WHERE "Kind of the song" = 'ending theme' AND "Singer" = 'miriam yeung' | wikisql |
CREATE TABLE table_16670746_2 (
fastest_lap VARCHAR,
winning_team VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the fastest lap in the race won by Team Impul at the Twin Ring Motegi circuit?
| SELECT fastest_lap FROM table_16670746_2 WHERE winning_team = "Team Impul" AND circuit = "Twin Ring Motegi" | 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 COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5265726' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MIN(gwyjzb.IN_HOSP_DAYS) > 12 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '5265726' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MIN(fgwyjzb.IN_H... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'F51.X21' AND jyjgzbb.JCZBMC =... | css |
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category text,
Result text
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category | nvbench |
CREATE TABLE table_name_17 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has hal sutton as the player?
| SELECT score FROM table_name_17 WHERE player = "hal sutton" | sql_create_context |
CREATE TABLE table_41156 (
"Track" real,
"Recorded" text,
"Catalogue" text,
"Release date" text,
"Song title" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What track has a catalogue of 47-9465?
| SELECT SUM("Track") FROM table_41156 WHERE "Catalogue" = '47-9465' | wikisql |
CREATE TABLE table_63506 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank # of the swimmer in Lane 5?
| SELECT COUNT("Rank") FROM table_63506 WHERE "Lane" = '5' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.long_title = "Other and unspecified hyperlipidemia" AND procedures.long_title = "Central venous catheter placem... | mimicsql_data |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '谢昊昊' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-01-27' AND '2014-08-11' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '谢昊昊' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-01-2... | css |
CREATE TABLE table_name_8 (
median_household_income VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the median household income in Valley County?
| SELECT median_household_income FROM table_name_8 WHERE county = "valley" | sql_create_context |
CREATE TABLE table_24784769_1 (
team VARCHAR,
total_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had 342 total points?
| SELECT team FROM table_24784769_1 WHERE total_points = 342 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '89718939232' | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2138" | mimicsql_data |
CREATE TABLE table_26110 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name ... | SELECT "Title" FROM table_26110 WHERE "Directed by" = 'Jessica Yu' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.