instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_62398 (
"S.no." real,
"Power Plant" text,
"State" text,
"Commissioned Capacity (MW)" real,
"year of commission" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What power plant was commissioned in 2008?
| SELECT "Power Plant" FROM table_62398 WHERE "year of commission" = '2008' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTy... | SELECT name FROM sysdatabases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb', 'Data.StackExchange') | sede |
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 WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.age < "74" | mimicsql_data |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
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 t... | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location DESC | nvbench |
CREATE TABLE table_27782699_3 (
outgoing_manager VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which manager was replaced by Thomas Thomasberg?
| SELECT outgoing_manager FROM table_27782699_3 WHERE replaced_by = "Thomas Thomasberg" | sql_create_context |
CREATE TABLE table_17941032_2 (
tries_against VARCHAR,
points_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tries against were there with points of 150?
| SELECT tries_against FROM table_17941032_2 WHERE points_for = "150" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
ProfileImage... | SELECT DISTINCT u.DisplayName, CONCAT('https://stackoverflow.com/users/', p.OwnerUserId) AS profile_link FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON pt.PostId = p.Id INNER JOIN Users AS u ON p.OwnerUserId = u.Id AND LOWER(u.Location) LIKE '%moscow%' WHERE t.TagName IN ('dynamics... | sede |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE T... | SELECT MIN(Posts.AnswerCount) AS "minimum_#_of_answers", AVG(CAST(Posts.AnswerCount AS FLOAT)) AS "average_#_of_answers", MAX(Posts.AnswerCount) AS "maximum_#_of_answers" FROM Posts WHERE Posts.PostTypeId = 1 | sede |
CREATE TABLE table_27501030_7 (
decision VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the decision when the opponents are atlanta thrashers?
| SELECT decision FROM table_27501030_7 WHERE opponent = "Atlanta Thrashers" | sql_create_context |
CREATE TABLE table_29551 (
"Country" text,
"Name" text,
"Host(s)" text,
"Judges" text,
"Network" text,
"Air dates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the series with the unknown host?
| SELECT "Name" FROM table_29551 WHERE "Host(s)" = 'unknown' | wikisql |
CREATE TABLE table_49804 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of November, when Game is greater than 23?
| SELECT SUM("November") FROM table_49804 WHERE "Game" > '23' | wikisql |
CREATE TABLE table_20979 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Falcons points" real,
"Opponents" real,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the 1978 Atla... | SELECT "Result" FROM table_20979 WHERE "Record" = '1-2' | wikisql |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Pla... | SELECT Calendar_Date, Day_Number FROM Ref_Calendar | nvbench |
CREATE TABLE table_11196 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the engine used before 1996 with 5 points?
| SELECT "Engine" FROM table_11196 WHERE "Year" < '1996' AND "Points" = '5' | wikisql |
CREATE TABLE table_name_46 (
enrollment INTEGER,
capacity INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the enrollment associated with a capacity greater then 35,650?
| SELECT MIN(enrollment) FROM table_name_46 WHERE capacity > 35 OFFSET 650 | sql_create_context |
CREATE TABLE table_58372 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the lowest ranked player from the United States that has less than 3 Wins?
| SELECT MIN("Rank") FROM table_58372 WHERE "Country" = 'united states' AND "Wins" < '3' | 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALA... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_16645_1 (
__percentage VARCHAR,
rural INTEGER,
year__january_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rural population percentage in 1979?
| SELECT MIN(rural), __percentage FROM table_16645_1 WHERE year__january_ = 1979 | sql_create_context |
CREATE TABLE table_name_36 (
team VARCHAR,
game VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team played before game 71 and had a score w 91 86 (ot)?
| SELECT team FROM table_name_36 WHERE game < 71 AND score = "w 91–86 (ot)" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "5783" | mimicsql_data |
CREATE TABLE table_name_62 (
silver INTEGER,
bronze INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of silvers for nations with over 1 bronze medal?
| SELECT AVG(silver) FROM table_name_62 WHERE bronze > 1 | sql_create_context |
CREATE TABLE table_30912 (
"Round" real,
"Date" text,
"Opponent" text,
"Home/Away" text,
"Score (Collingwoods score is in bold)" text,
"Result (includes margin)" text,
"Venue" text,
"Position on Ladder" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT "Home/Away" FROM table_30912 WHERE "Position on Ladder" = '6th' | wikisql |
CREATE TABLE table_40059 (
"Club" text,
"Wins" real,
"Loses" real,
"Points For" real,
"Points Against" real,
"Percentage" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What losses have points for less than 1175, wins greater ... | SELECT "Loses" FROM table_40059 WHERE "Points For" < '1175' AND "Wins" > '2' AND "Points Against" > '894' AND "Points" = '24' | wikisql |
CREATE TABLE table_name_81 (
record VARCHAR,
date VARCHAR,
decision VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record has a decision of parent, Philadelphia as the home, with december 12 as the date?
| SELECT record FROM table_name_81 WHERE decision = "parent" AND home = "philadelphia" AND date = "december 12" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "3343" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden ... | SELECT TOP(10) AS ViewCount, Id AS "post_link" FROM Posts ORDER BY ViewCount DESC | sede |
CREATE TABLE table_2185 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest division number through the years?
| SELECT MAX("Division") FROM table_2185 | wikisql |
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_19671 (
"Year" real,
"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.
-- HOW MANY YEARS DID MENS DOUBLES PLAYER HEIKI SORGE MEE... | SELECT COUNT("Year") FROM table_19671 WHERE "Mens doubles" = 'Heiki Sorge Meelis Maiste' | wikisql |
CREATE TABLE table_1602620_1 (
term_ended VARCHAR,
elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did the term end for those elected in 1990
| SELECT term_ended FROM table_1602620_1 WHERE elected = 1990 | sql_create_context |
CREATE TABLE table_14532 (
"Country" text,
"Total population (1000)" real,
"Total Foreign-born (1000)" real,
"Born in other EU state (1000)" real,
"Born in a non EU state (1000)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Tot... | SELECT MAX("Total Foreign-born (1000)") FROM table_14532 WHERE "Born in a non EU state (1000)" = '685' AND "Total population (1000)" > '10,666' | wikisql |
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 jybgb.SHSJ FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '24318631' AND jybgb.BGRQ BETWEEN '2001-02-17' AND '2007-... | css |
CREATE TABLE table_6685 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average pick # of the player from round 11?
| SELECT AVG("Pick #") FROM table_6685 WHERE "Round" = '11' | wikisql |
CREATE TABLE table_2970978_1 (
ave_attendance INTEGER,
___ave_on_prev_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least value for average attendance when average on previous season is +644?
| SELECT MIN(ave_attendance) FROM table_2970978_1 WHERE ___ave_on_prev_season = "+644" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND diagnoses.icd9_code = "28522" | mimicsql_data |
CREATE TABLE table_26460435_8 (
monarch VARCHAR,
heir VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the monarch with the heir thado minsaw?
| SELECT monarch FROM table_26460435_8 WHERE heir = "Thado Minsaw" | 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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id num... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) <= '2101' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4) | mimic_iii |
CREATE TABLE table_26375386_23 (
result VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the total of 12?
| SELECT result FROM table_26375386_23 WHERE total = 12 | sql_create_context |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Orthostatic hypotension" | mimicsql_data |
CREATE TABLE table_name_49 (
class VARCHAR,
frequency_mhz INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What class is assigned to frequencies lower than 90.5?
| SELECT class FROM table_name_49 WHERE frequency_mhz < 90.5 | sql_create_context |
CREATE TABLE table_7237 (
"Name" text,
"Japanese" text,
"Population ( 2012 )" real,
"Date of designation" text,
"Region" text,
"Prefecture" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Japanese prefecture has Ibaraki, Tsukuba?
| SELECT "Japanese" FROM table_7237 WHERE "Prefecture" = 'ibaraki' AND "Name" = 'tsukuba' | wikisql |
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_id INTEGER,
date_of_notes DATETIME,
text_of_notes VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TAB... | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Hector Blair" | mimicsql_data |
CREATE TABLE table_name_95 (
round INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest round to have a record of 4-0?
| SELECT MIN(round) FROM table_name_95 WHERE record = "4-0" | sql_create_context |
CREATE TABLE table_name_1 (
coach VARCHAR,
captain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which coach works with Robert Harvey?
| SELECT coach FROM table_name_1 WHERE captain = "robert harvey" | sql_create_context |
CREATE TABLE table_203_35 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many riders were faster than massimo ottobre ?
| SELECT COUNT("rider") FROM table_203_35 WHERE "points" > (SELECT "points" FROM table_203_35 WHERE "rider" = 'massimo ottobre') | squall |
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 zyjybgb.JYXMDM, zyjybgb.JYXMMC FROM zyjybgb WHERE zyjybgb.BGDH = '70540908797' UNION SELECT mzjybgb.JYXMDM, mzjybgb.JYXMMC FROM mzjybgb WHERE mzjybgb.BGDH = '70540908797' | css |
CREATE TABLE table_name_16 (
opponent VARCHAR,
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played on clay on 3 march 2012?
| SELECT opponent FROM table_name_16 WHERE surface = "clay" AND date = "3 march 2012" | sql_create_context |
CREATE TABLE table_19753 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Jockey" text,
"Winner/2nd" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different jockey... | SELECT COUNT("Jockey") FROM table_19753 WHERE "Date" = '17 Feb 2007' | wikisql |
CREATE TABLE assignedto (
scientist number,
project text
)
CREATE TABLE scientists (
ssn number,
name text
)
CREATE TABLE projects (
code text,
name text,
hours number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the proje... | SELECT name FROM projects ORDER BY hours DESC LIMIT 1 | spider |
CREATE TABLE table_4898 (
"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.
-- How many people watch an away team score 6.9 (45)... | SELECT AVG("Crowd") FROM table_4898 WHERE "Away team score" = '6.9 (45)' | wikisql |
CREATE TABLE table_2649597_1 (
finish VARCHAR,
start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did he finish when he started at 21.6?
| SELECT COUNT(finish) FROM table_2649597_1 WHERE start = "21.6" | sql_create_context |
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(... | SELECT other_details, COUNT(other_details) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY other_details | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | (SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE LOCATIONS (
Address VARCHAR,
Location_Name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the address of the location 'UK Gallery'?
| SELECT Address FROM LOCATIONS WHERE Location_Name = "UK Gallery" | 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 job_history (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_49779 (
"Year" real,
"Series" text,
"Make" text,
"Driver" text,
"Team" text,
"Schedule" text,
"Role" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the team when the make is dodge and the year is after 2008?
| SELECT "Team" FROM table_49779 WHERE "Make" = 'dodge' AND "Year" > '2008' | wikisql |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
-- Using valid SQLite, answer the ... | SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY COUNT(Result) | nvbench |
CREATE TABLE table_name_41 (
weight VARCHAR,
denomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weight with a denomination that is three paise?
| SELECT weight FROM table_name_41 WHERE denomination = "three paise" | sql_create_context |
CREATE TABLE table_26693 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ... | SELECT COUNT("Position in table") FROM table_26693 WHERE "Date of vacancy" = '14 February 2011' | wikisql |
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_ID = '31931776' AND gwyjzb.CLINIC_TYPE = '住院' AND MOD(gwyjzb.MED_AMOUT, 1) = 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '31931776' AND fgwyjzb.CLINIC_TYPE = '住院' AND MOD(fgwyjzb.MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_6021 (
"Rank" real,
"Rider" text,
"Manufacturer" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Points larger than 108, and a Wins of 0, and a Rank smaller than 8, and a Manufacturer of honda is what ri... | SELECT "Rider" FROM table_6021 WHERE "Points" > '108' AND "Wins" = '0' AND "Rank" < '8' AND "Manufacturer" = 'honda' | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Creatine Kinase (CK)" | mimicsql_data |
CREATE TABLE table_204_639 (
id number,
"poll company" text,
"source" text,
"publication date" text,
"psuv" number,
"opposition" number,
"undecided" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of polls published... | SELECT COUNT(*) FROM table_204_639 WHERE "poll company" = 'gis xxi' | squall |
CREATE TABLE Staff (
staff_id INTEGER,
staff_first_name VARCHAR(80),
staff_last_name VARCHAR(80),
other_staff_details VARCHAR(255)
)
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_rep... | SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) DESC | nvbench |
CREATE TABLE table_49279 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game on December 22?
| SELECT "Score" FROM table_49279 WHERE "Date" = 'december 22' | wikisql |
CREATE TABLE table_dev_14 (
"id" int,
"anemia" bool,
"pulmonary_disease" bool,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"cardiovascular_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"fasting_c_peptide" float,
"organ_failure" b... | SELECT * FROM table_dev_14 WHERE organ_failure = 1 OR pulmonary_disease = 1 OR cardiovascular_disease = 1 OR anemia = 1 OR hemoglobin_a1c_hba1c < 10 OR renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 60 | criteria2sql |
CREATE TABLE table_name_57 (
time VARCHAR,
nation VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time of the peachtree road race in kenya?
| SELECT time FROM table_name_57 WHERE nation = "kenya" AND race = "peachtree road race" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2175" AND procedures.icd9_code = "9915" | mimicsql_data |
CREATE TABLE table_50602 (
"Oklahoma vs." text,
"Overall Record" text,
"at Norman" text,
"at Opponent's Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"Since Beginning of Big 12" text
)
-- Using valid SQLite, answer the ... | SELECT "Oklahoma vs." FROM table_50602 WHERE "Current Streak" = 'l 1' AND "at Neutral Site" = 'osu, 7-6' | wikisql |
CREATE TABLE table_name_42 (
pick INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which pick was MIchael Holper?
| SELECT MIN(pick) FROM table_name_42 WHERE player = "michael holper" | sql_create_context |
CREATE TABLE table_name_46 (
player VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has a total of 290 points?
| SELECT player FROM table_name_46 WHERE total = 290 | sql_create_context |
CREATE TABLE table_46121 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Lowest pick for mike flater?
| SELECT MIN("Pick") FROM table_46121 WHERE "Name" = 'mike flater' | wikisql |
CREATE TABLE table_name_20 (
film_title_used_in_nomination VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title was used in the nomination of Una Giornata Particolare?
| SELECT film_title_used_in_nomination FROM table_name_20 WHERE original_title = "una giornata particolare" | sql_create_context |
CREATE TABLE table_2117 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real,
"Left" real,
"Current Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which con... | SELECT "Current Conference" FROM table_2117 WHERE "Nickname" = 'Chargers' | wikisql |
CREATE TABLE table_name_65 (
margin_of_victory VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the margin of victory at the LPGA Championship?
| SELECT margin_of_victory FROM table_name_65 WHERE tournament = "lpga championship" | sql_create_context |
CREATE TABLE table_43276 (
"element" text,
"group" real,
"period" real,
"reaction" text,
"potential" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which highest period's element is platinum?
| SELECT MAX("period") FROM table_43276 WHERE "element" = 'platinum' | wikisql |
CREATE TABLE table_28941 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the district for john randolph (dr)
| SELECT "District" FROM table_28941 WHERE "Candidates" = 'John Randolph (DR)' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '42321223' AND hz_info.YLJGDM = '7925513' AND zyjzjlb.JZKSMC LIKE '%与%' | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22449 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch... | mimic_iii |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC | nvbench |
CREATE TABLE table_10566855_1 (
runner_up VARCHAR,
premier VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who are all the runner-up for premier in richmond
| SELECT runner_up FROM table_10566855_1 WHERE premier = "Richmond" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2057')) AND medication.routeadmin = 'iv push' AND DATETIME(medi... | eicu |
CREATE TABLE table_18912 (
"Cost" text,
"2400 kWh/kWp\u2022y" text,
"2200 kWh/kWp\u2022y" text,
"2000 kWh/kWp\u2022y" text,
"1800 kWh/kWp\u2022y" text,
"1600 kWh/kWp\u2022y" text,
"1400 kWh/kWp\u2022y" text,
"1200 kWh/kWp\u2022y" text,
"1000 kWh/kWp\u2022y" text,
"800 kWh/kWp\u20... | SELECT "1600 kWh/kWp\u2022y" FROM table_18912 WHERE "1000 kWh/kWp\u2022y" = '26.0' | wikisql |
CREATE TABLE table_46612 (
"Class" 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 3 when the Verb meaning is to gather?
| SELECT "Part 3" FROM table_46612 WHERE "Verb meaning" = 'to gather' | wikisql |
CREATE TABLE table_name_62 (
american VARCHAR,
british VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which American has British of m?
| SELECT american FROM table_name_62 WHERE british = "ɛm" | sql_create_context |
CREATE TABLE table_1137718_2 (
winning_driver VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winning driver on 13 August?
| SELECT winning_driver FROM table_1137718_2 WHERE date = "13 August" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '71249027132' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 13 | css |
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 t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'systemic antibiot... | eicu |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]" | mimicsql_data |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar... | 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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTS... | atis |
CREATE TABLE table_17260 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage (Proof)" text,
"Issue Price (Proof)" text,
"Mintage (BU)[ clarification needed ]" text,
"Issue Price (BU)[ clarification needed ]" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Year" FROM table_17260 WHERE "Issue Price (BU)[ clarification needed ]" = '$26.95' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime DE... | mimic_iii |
CREATE TABLE table_73554 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many directed by have 2.80 as u.s. vi... | SELECT COUNT("Directed by") FROM table_73554 WHERE "U.S. viewers (in millions)" = '2.80' | 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 mzjzjlb_jybgb (
YLJGDM_MZJZJLB te... | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '9038216' AND mzjzjlb.JZKSRQ BETWEEN '2019-12-09' AND '2020-06-11' AND mzjzjlb.TXBZ > 0 | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.subject_id = "31066" | mimicsql_data |
CREATE TABLE table_15537 (
"Call Sign" text,
"City of License" text,
"Frequency" text,
"age Watt" text,
"Coverage Area" text,
"Founded" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the city of license for when founded is october 2010
| SELECT "City of License" FROM table_15537 WHERE "Founded" = 'october 2010' | wikisql |
CREATE TABLE table_name_8 (
iata VARCHAR,
airport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA of Madrid-Barajas Airport?
| SELECT iata FROM table_name_8 WHERE airport = "madrid-barajas airport" | sql_create_context |
CREATE TABLE table_name_51 (
place VARCHAR,
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place has a score greater than 68, and camilo villegas as the player?
| SELECT place FROM table_name_51 WHERE score > 68 AND player = "camilo villegas" | sql_create_context |
CREATE TABLE table_name_8 (
attendance INTEGER,
season VARCHAR,
premiership VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the season is before 2000, the runner up was north melbourne, and it's the pre-season cup, what's the sum... | SELECT SUM(attendance) FROM table_name_8 WHERE premiership = "pre-season cup" AND runner_up = "north melbourne" AND season < 2000 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.