instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_35236 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest game against the New York Rangers with more than 55 points?
| SELECT MAX("Game") FROM table_35236 WHERE "Opponent" = 'new york rangers' AND "Points" > '55' | wikisql |
CREATE TABLE table_name_46 (
last_performance VARCHAR,
status VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the Last Performance of Billy Elliot with a Cast Status of past replacement?
| SELECT last_performance FROM table_name_46 WHERE status = "past replacement" | sql_create_context |
CREATE TABLE Department (
DNO INTEGER,
Division VARCHAR(2),
DName VARCHAR(25),
Room VARCHAR(5),
Building VARCHAR(13),
DPhone INTEGER
)
CREATE TABLE Enrolled_in (
StuID INTEGER,
CID VARCHAR(7),
Grade VARCHAR(2)
)
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
C... | SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age DESC | nvbench |
CREATE TABLE table_1805191_34 (
results VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was Mike McIntyre elected?
| SELECT COUNT(results) FROM table_1805191_34 WHERE incumbent = "Mike McIntyre" | sql_create_context |
CREATE TABLE table_41300 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the tournament played 13 November 2000?
| SELECT "Tournament" FROM table_41300 WHERE "Date" = '13 november 2000' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 T... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_52169 (
"Region" text,
"Year" real,
"Name" text,
"Format(s)" text,
"Label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the region before 2008 when name of best 1200
| SELECT "Region" FROM table_52169 WHERE "Year" < '2008' AND "Name" = 'best 1200' | wikisql |
CREATE TABLE table_203_589 (
id number,
"protein" text,
"natural host" text,
"normal function" text,
"prion state" text,
"prion phenotype" text,
"year identified" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long after the third prio... | SELECT (SELECT "year identified" FROM table_203_589 WHERE id = 3 + 1) - (SELECT "year identified" FROM table_203_589 WHERE id = 3) | squall |
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND date_day.day_number = 27 AND date_day.month_number = 8 AN... | atis |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Aortocor bypas-3 cor art" | mimicsql_data |
CREATE TABLE table_name_3 (
country VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the country for rank 6?
| SELECT country FROM table_name_3 WHERE rank = 6 | sql_create_context |
CREATE TABLE table_name_13 (
goals_conceded VARCHAR,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the number of goals conceded that has a played greater than 18?
| SELECT COUNT(goals_conceded) FROM table_name_13 WHERE played > 18 | sql_create_context |
CREATE TABLE table_204_416 (
id number,
"chip" text,
"flash size" text,
"eeprom" number,
"sram" number,
"frequency\n[mhz]" number,
"package" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which two chips have the most flash size ?
| SELECT "chip" FROM table_204_416 WHERE "flash size" = (SELECT MAX("flash size") FROM table_204_416) | squall |
CREATE TABLE table_71847 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Point of Chassis of Lancia d50 in 1954
| SELECT "Points" FROM table_71847 WHERE "Chassis" = 'lancia d50' AND "Year" = '1954' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28343) AND prescriptions.route = 'po' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Sm-to-sm bowel anastom" | mimicsql_data |
CREATE TABLE VOTING_RECORD (
Election_Cycle VARCHAR
)
CREATE TABLE STUDENT (
Age INTEGER,
StuID VARCHAR,
city_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the average age of students who live in the city with code 'NYC' and have secretar... | SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = "NYC" AND T2.Election_Cycle = "Spring" | sql_create_context |
CREATE TABLE table_79778 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest score that Bob Tway get when he placed t5?
| SELECT MIN("Score") FROM table_79778 WHERE "Place" = 't5' AND "Player" = 'bob tway' | wikisql |
CREATE TABLE teachers (
LastName TEXT,
FirstName TEXT,
Classroom INTEGER
)
CREATE TABLE list (
LastName TEXT,
FirstName TEXT,
Grade INTEGER,
Classroom INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return a scatter on how many students d... | SELECT COUNT(*), Classroom FROM list GROUP BY Classroom | nvbench |
CREATE TABLE table_name_45 (
time VARCHAR,
lane VARCHAR,
heat VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Hungary's time with a heat higher than 2 and two lanes?
| SELECT time FROM table_name_45 WHERE heat > 2 AND nationality = "hungary" AND lane = 2 | sql_create_context |
CREATE TABLE document_locations (
document_id number,
location_code text,
date_in_location_from time,
date_in_locaton_to time
)
CREATE TABLE roles (
role_code text,
role_name text,
role_description text
)
CREATE TABLE all_documents (
document_id number,
date_stored time,
docume... | SELECT role_name, role_description FROM roles WHERE role_code = "MG" | spider |
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY AVG(age) DESC | nvbench |
CREATE TABLE table_45396 (
"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.
-- Total for 1994, 1997 years won?
| SELECT SUM("Total") FROM table_45396 WHERE "Year(s) won" = '1994, 1997' | wikisql |
CREATE TABLE table_8288 (
"Player" text,
"PL Apps" real,
"PL G" real,
"CL Apps" real,
"CL G" real,
"FAC / LC Apps" real,
"FAC / LC G" real,
"Total Apps" real,
"Total G" real,
"FA YC" real,
"UEFA YC" real
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT COUNT("PL G") FROM table_8288 WHERE "CL G" < '7' AND "CL Apps" < '7' AND "FA YC" = '0' AND "Player" = 'pennant' | wikisql |
CREATE TABLE table_56183 (
"Player" text,
"Car." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Car with more than 155 yards?
| SELECT MAX("Car.") FROM table_56183 WHERE "Yards" > '155' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
dire... | 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 = 'B... | atis |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
E... | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_14 (
iata VARCHAR,
icao VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which IATA has a ICAO of slk?
| SELECT iata FROM table_name_14 WHERE icao = "slk" | sql_create_context |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '2084494' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-06-03' AND '2019-07-02' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '2084494' AND bdmzjzjlb.JZKSRQ BETWEEN '2001-06-03' AND '2019-07-02' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_42138 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Conservative ticket" text,
"Liberal ticket" text,
"Socialist Labor ticket" text,
"Socialist Workers ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Liberal ticket" FROM table_42138 WHERE "Socialist Workers ticket" = 'judith white' | wikisql |
CREATE TABLE table_name_57 (
works_number INTEGER,
builder VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average work number of Snowdon Ranger with the builder Vulcan Foundry?
| SELECT AVG(works_number) FROM table_name_57 WHERE builder = "vulcan foundry" AND name = "snowdon ranger" | sql_create_context |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE View_Unit_Status (
apt_id INTEG... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date ORDER BY booking_end_date | nvbench |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2175" | mimicsql_data |
CREATE TABLE table_name_62 (
loss VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the loss for September 16?
| SELECT loss FROM table_name_62 WHERE date = "september 16" | sql_create_context |
CREATE TABLE table_11753080_2 (
weekly_rank VARCHAR,
_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weekly rank where the number is 4?
| SELECT weekly_rank FROM table_11753080_2 WHERE _number = 4 | sql_create_context |
CREATE TABLE table_72617 (
"Age band" text,
"Median income" text,
"Mean income" text,
"Median income (men)" text,
"Mean income (men)" text,
"Median income (women)" text,
"Mean income (women)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Na... | SELECT "Median income" FROM table_72617 WHERE "Age band" = 'Under 20' | wikisql |
CREATE TABLE written_by (
id int,
msid int,
wid int
)
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE cast (
id int,
msid int,
aid int,
role text
)
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_yea... | SELECT movie.title FROM actor AS ACTOR_0, actor AS ACTOR_1, cast AS CAST_0, cast AS CAST_1, movie WHERE ACTOR_0.name = 'Benedict Cumberbatch' AND ACTOR_1.name = 'Keira Knightley' AND CAST_0.aid = ACTOR_0.aid AND CAST_1.aid = ACTOR_1.aid AND movie.mid = CAST_0.msid AND movie.mid = CAST_1.msid | imdb |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" | mimicsql_data |
CREATE TABLE table_name_44 (
part_2 VARCHAR,
part_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is Part 2, when Part 4 is on December 9, 2007?
| SELECT part_2 FROM table_name_44 WHERE part_4 = "december 9, 2007" | sql_create_context |
CREATE TABLE table_name_23 (
partner VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Partner during the Asian Games Year?
| SELECT partner FROM table_name_23 WHERE year = "asian games" | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY COUNT(County) DESC | nvbench |
CREATE TABLE table_name_5 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was South Melbourne's score when they played as the away team?
| SELECT away_team AS score FROM table_name_5 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE table_name_11 (
pick__number INTEGER,
league_from VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average pick # from the Quebec Major Junior Hockey League player Samuel Carrier?
| SELECT AVG(pick__number) FROM table_name_11 WHERE league_from = "quebec major junior hockey league" AND player = "samuel carrier" | sql_create_context |
CREATE TABLE table_30450 (
"Player" text,
"Cap(s)" real,
"Goal(s)" real,
"International Debut" text,
"Club(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals did the player from Ipswich town score?
| SELECT MIN("Goal(s)") FROM table_30450 WHERE "Club(s)" = 'Ipswich Town' | wikisql |
CREATE TABLE table_203_366 (
id number,
"pos" number,
"class" text,
"no" number,
"team" text,
"drivers" text,
"chassis" text,
"engine" text,
"laps" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of laps fo... | SELECT SUM("laps") FROM table_203_366 WHERE "team" IN ('ecurie savin-calberson', 'dana chevrolet inc') | squall |
CREATE TABLE table_10715317_2 (
title VARCHAR,
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the episode directed by Peter Markle and written by Jerry Stahl?
| SELECT title FROM table_10715317_2 WHERE directed_by = "Peter Markle" AND written_by = "Jerry Stahl" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT demographic.gender, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_77454 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Road Team has a Home Team of rochester, and a Game of game 2?
| SELECT "Road Team" FROM table_77454 WHERE "Home Team" = 'rochester' AND "Game" = 'game 2' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | SELECT Tags, Title, AcceptedAnswerId, CreationDate, 'http://dba.stackexchange.com/questions/' + CAST(Id AS TEXT) AS URL FROM Posts WHERE Tags LIKE '%' + '##mainTag:string##' + '-%' AND NOT Tags LIKE '%<' + '##mainTag:string##' + '>%' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_95 (
league INTEGER,
fa_cup INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest League Cup with an FA Cup thats larger than 2?
| SELECT MAX(league) AS Cup FROM table_name_95 WHERE fa_cup > 2 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Thoracentesis" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCFF FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH... | css |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE train (
Train_ID ... | SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY COUNT(Location) DESC | nvbench |
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGER
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,... | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments ORDER BY Date_Payment_Made | nvbench |
CREATE TABLE table_63323 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the tie number when the away team was Mansfield Town?
| SELECT "Tie no" FROM table_63323 WHERE "Away team" = 'mansfield town' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Date_of_Birth, Height FROM people ORDER BY Height DESC | nvbench |
CREATE TABLE table_5820 (
"Placing" real,
"Team" text,
"Players" text,
"Seeding" text,
"Playoffs W-L" text,
"Matches W-L" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Players of amanda coetzer and marcos ondruska is what team?
| SELECT "Team" FROM table_5820 WHERE "Players" = 'amanda coetzer and marcos ondruska' | wikisql |
CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
)
-- Using val... | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name ORDER BY AVG(T2.Speed) | nvbench |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_43 (
venue VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the venue for staines town
| SELECT venue FROM table_name_43 WHERE opponent = "staines town" | sql_create_context |
CREATE TABLE table_65137 (
"Rank" real,
"Player" text,
"Team" text,
"Runs" text,
"Balls" real,
"Year" real,
"Against" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player had 50 balls?
| SELECT "Player" FROM table_65137 WHERE "Balls" = '50' | wikisql |
CREATE TABLE table_name_68 (
points INTEGER,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Points for a year before 1955?
| SELECT AVG(points) FROM table_name_68 WHERE year < 1955 | sql_create_context |
CREATE TABLE table_203_565 (
id number,
"wrestlers" text,
"times" number,
"date" text,
"location" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many locations were used at least twice ?
| SELECT COUNT(*) FROM (SELECT "location" FROM table_203_565 GROUP BY "location" HAVING COUNT(*) >= 2) | squall |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body te... | SELECT AGE FROM Users GROUP BY AGE | sede |
CREATE TABLE table_72845 (
"Poll Year" text,
"Winner" text,
"Second" text,
"Third" text,
"Fourth" text,
"Fifth" text,
"Sixth" text,
"Seventh" text,
"Eighth" text,
"Ninth" text,
"Tenth" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("Seventh") FROM table_72845 WHERE "Sixth" = 'Interpol' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "ABDOMINAL ABSCESS" | mimicsql_data |
CREATE TABLE table_46917 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the trainer when Mckaymackenna won?
| SELECT "Trainer" FROM table_46917 WHERE "Winner" = 'mckaymackenna' | wikisql |
CREATE TABLE table_204_428 (
id number,
"season" text,
"east superleague" text,
"east premier league" text,
"east region south division" text,
"east region central division" text,
"east region north division" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "season" FROM table_204_428 WHERE "east superleague" = "bo'ness united" ORDER BY "season" DESC LIMIT 1 | squall |
CREATE TABLE table_name_39 (
result VARCHAR,
record VARCHAR
)
-- 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_name_39 WHERE record = "1-3" | sql_create_context |
CREATE TABLE table_204_861 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the goal difference in the game on february 18th ?
| SELECT ABS("score" - "score") FROM table_204_861 WHERE "date" = '18 february 1976' | squall |
CREATE TABLE table_name_24 (
draws INTEGER,
ballarat_fl VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of Draws scored by Sebastapol when the value for Against was less than 1802?
| SELECT MAX(draws) FROM table_name_24 WHERE ballarat_fl = "sebastapol" AND against < 1802 | sql_create_context |
CREATE TABLE table_name_31 (
speed INTEGER,
year VARCHAR,
passengers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average speed for ships before 1974 with over 1.73 passengers?
| SELECT AVG(speed) FROM table_name_31 WHERE year < 1974 AND passengers > 1.73 | sql_create_context |
CREATE TABLE document_types (
document_type_code text,
document_description text
)
CREATE TABLE research_staff (
staff_id number,
employer_organisation_id number,
staff_details text
)
CREATE TABLE project_staff (
staff_id number,
project_id number,
role_code text,
date_from time,
... | SELECT SUM(grant_amount), organisation_id FROM grants GROUP BY organisation_id | spider |
CREATE TABLE table_16361 (
"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 "Title" FROM table_16361 WHERE "U.S. viewers (millions)" = '16.38' | wikisql |
CREATE TABLE table_name_21 (
record VARCHAR,
game VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the celtics record after game 33 when they score of the game was 111-108?
| SELECT record FROM table_name_21 WHERE game > 33 AND score = "111-108" | sql_create_context |
CREATE TABLE table_204_870 (
id number,
"product" text,
"main functionality" text,
"input format" text,
"output format" text,
"platform" text,
"license and cost" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the on... | SELECT "product" FROM table_204_870 WHERE "input format" = 'rdf' AND "output format" = 'rdf' | squall |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
Creati... | SELECT maxQScores.OwnerUserId AS "user_link", maxQScores.maxQScore, p1.Id AS "post_link" FROM (SELECT p.OwnerUserId, MAX(p.Score) AS maxQScore FROM Posts AS p WHERE p.PostTypeId = 1 GROUP BY p.OwnerUserId) AS maxQScores INNER JOIN Posts AS p1 ON p1.Score = maxQScores.maxQScore AND p1.PostTypeId = 1 AND p1.OwnerUserId =... | sede |
CREATE TABLE table_38584 (
"Designation HD" text,
"Constellation" text,
"Date sent" text,
"Arrival date" text,
"Message" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date sent has cancer as the constellation?
| SELECT "Date sent" FROM table_38584 WHERE "Constellation" = 'cancer' | wikisql |
CREATE TABLE table_225093_4 (
vacator VARCHAR,
date_successor_seated VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many vacators have October 22, 1808 as date successor seated?
| SELECT COUNT(vacator) FROM table_225093_4 WHERE date_successor_seated = "October 22, 1808" | 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.dod_year <= "2126.0" AND prescriptions.formulary_drug_cd = "GGAC5L" | 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 transfers (
row_id number,
subject_id number,
hadm_... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25312) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETI... | mimic_iii |
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE ref_product_categories (
product_category_code text,
product_category_description text,
unit_... | SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil" | spider |
CREATE TABLE table_70677 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the finishing place for 1953?
| SELECT "Finish" FROM table_70677 WHERE "Year" = '1953' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZL... | css |
CREATE TABLE table_30408 (
"Season" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text,
"Mixed Doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winners of the mens doubles in the season o... | SELECT "Mens Doubles" FROM table_30408 WHERE "Season" = '1963/64' | 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 * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
ins... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'MCDB' AND semester.semester = 'WN' AND s... | advising |
CREATE TABLE table_name_38 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the game when Footscray was the away team?
| SELECT date FROM table_name_38 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_name_82 (
winning_constructor VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Winning constructor has a Circuit of lasarte?
| SELECT winning_constructor FROM table_name_82 WHERE circuit = "lasarte" | sql_create_context |
CREATE TABLE table_25855 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name t... | SELECT "Location Attendance" FROM table_25855 WHERE "Game" = '4' | wikisql |
CREATE TABLE table_name_83 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Grid that has a Time/Retired of +2 laps, and under 51 laps?
| SELECT AVG(grid) FROM table_name_83 WHERE time_retired = "+2 laps" AND laps < 51 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.ZZYSGH = '65472198' AND txmzjzjlb.JZKSRQ BETWEEN '2008-10-02' AND '2019-11-28' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN ftxmzjzjlb ON hz_inf... | css |
CREATE TABLE table_203_131 (
id number,
"pos." number,
"car #" number,
"driver" text,
"make" text,
"team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many toyotas were there in the top 10 finishes ?
| SELECT COUNT(*) FROM table_203_131 WHERE "make" = 'toyota' | squall |
CREATE TABLE table_50695 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE TOURNAMENT WITH A 2010 OF A, 2009 OF A, AND 001 PERFORMANCE OF Q... | SELECT "Tournament" FROM table_50695 WHERE "2010" = 'a' AND "2009" = 'a' AND "2011" = 'q1' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
C... | 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 = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALT... | atis |
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 COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '卫谷雪' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-08-07' AND '2004-08-08' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '卫谷雪' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2004-08-07' AND '2004-08-08' AND fgwyjzb.CLINIC_TYPE = '住院' | css |
CREATE TABLE table_19097 (
"Call sign" text,
"Analog channel" text,
"Digital channel" text,
"Virtual channel" text,
"Network" text,
"Station Ownership" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is JCTV's digital channel?
| SELECT "Digital channel" FROM table_19097 WHERE "Network" = 'JCTV' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Users (
Id number,
Reputation number,... | WITH Raw AS (SELECT Q.OwnerUserId AS QId, A.OwnerUserId AS AId, COUNT(*) AS Count FROM Posts AS Q, Posts AS A WHERE A.ParentId = Q.Id AND A.OwnerUserId > 0 AND Q.OwnerUserId > 0 AND A.OwnerUserId != Q.OwnerUserId AND Q.CommunityOwnedDate IS NULL AND A.CommunityOwnedDate IS NULL GROUP BY Q.OwnerUserId, A.OwnerUserId) SE... | sede |
CREATE TABLE table_63848 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the developers for the Action RPG made after 2010?
| SELECT "Developer(s)" FROM table_63848 WHERE "Year" > '2010' AND "Genre" = 'action rpg' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaladmitsource = 'other hospital' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.