instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '60506395740' AND jyjgzbb.JCRXM LIKE '陶%' | css |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '70984037' AND jybgb.BGRQ BETWEEN '2009-08-30' AND '2012-10-24' UNION... | css |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%dehradun%' OR UPPER(Location) LIKE '%DEHRADUN' ORDER BY Reputation DESC LIMIT 50 | sede |
CREATE TABLE table_8466 (
"Name" text,
"Type" text,
"Nationality" text,
"Date" text,
"Displacement" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name when the displacement is 8,305 t?
| SELECT "Name" FROM table_8466 WHERE "Displacement" = '8,305 t' | wikisql |
CREATE TABLE table_name_38 (
alternate VARCHAR,
second VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the alternate for Magnus Swartling as Second?
| SELECT alternate FROM table_name_38 WHERE second = "magnus swartling" | sql_create_context |
CREATE TABLE table_32802 (
"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 largest crowd for a Melbourne away t... | SELECT MAX("Crowd") FROM table_32802 WHERE "Away team" = 'melbourne' | wikisql |
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst text,
packst t... | SELECT pestcode FROM resultsdata15 GROUP BY pestcode ORDER BY COUNT(*) DESC LIMIT 1 | pesticide |
CREATE TABLE table_name_47 (
nationality VARCHAR,
position VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality for the guard position from Bowling Green?
| SELECT nationality FROM table_name_47 WHERE position = "guard" AND school_club_team = "bowling green" | sql_create_context |
CREATE TABLE table_43700 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Mark Begich" text,
"Republican: Ted Stevens" text,
"Lead Maragin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average lead maragin for the dates adm... | SELECT AVG("Lead Maragin") FROM table_43700 WHERE "Dates administered" = 'october 6, 2008' | wikisql |
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 zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '韦宏放' AND hz_info.YLJGDM = '9529640' AND NOT zzmzjzjlb.JZKSMC LIKE '%补牙%' UNION SELECT fzzmzjz... | css |
CREATE TABLE table_name_59 (
co_drivers VARCHAR,
team VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the co-driver for Toyota Racing after the year 2012?
| SELECT co_drivers FROM table_name_59 WHERE team = "toyota racing" AND year > 2012 | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | SELECT SE.PostId AS "post_link", V.Name AS "vote_type", SE.ApprovalDate, SE.RejectionDate FROM SuggestedEditVotes AS SEV INNER JOIN SuggestedEdits AS SE ON SEV.SuggestedEditId = SE.Id INNER JOIN VoteTypes AS V ON V.Id = SEV.VoteTypeId WHERE SEV.UserId = @UserId AND ((SEV.VoteTypeId = 2 AND NOT RejectionDate IS NULL) OR... | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.gender FROM demographic WHERE demographic.name = "Estrella Carroll" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-158338' AND patient.wardid = 413 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_26335424_86 (
semifinals VARCHAR,
round_of_16 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the round of 16 was yulius fernando ( ina ) l pts 5-6, what was the semifinals?
| SELECT semifinals FROM table_26335424_86 WHERE round_of_16 = "Yulius Fernando ( INA ) L PTS 5-6" | sql_create_context |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight_fare ... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... | atis |
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 Id AS "post_link" FROM Posts WHERE Score = -3 AND Body LIKE '%handle%xml%' AND PostTypeId = 2 ORDER BY Id DESC | sede |
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 (
HXPLC number,
HZXM ... | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '67621156' AND jyjgzbb.JYRQ BETWEEN '2008-05-15' ... | css |
CREATE TABLE table_2394927_1 (
power___dbm__ VARCHAR,
profile VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all dbm's when profiles are 8a.
| SELECT power___dbm__ FROM table_2394927_1 WHERE profile = "8a" | sql_create_context |
CREATE TABLE table_203_430 (
id number,
"draw" number,
"artist" text,
"song" text,
"jury" number,
"televote" number,
"total" number,
"place" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who had the most televotes on the eurovision so... | SELECT "artist" FROM table_203_430 ORDER BY "televote" DESC LIMIT 1 | squall |
CREATE TABLE table_47963 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Notre Dame position has a pick lower than 5 and round 7?
| SELECT "Position" FROM table_47963 WHERE "Pick" < '5' AND "College" = 'notre dame' AND "Round" = '7' | wikisql |
CREATE TABLE store_product (
Store_ID int,
Product_ID int
)
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE store (
Store_ID ... | SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_3989 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode number in the ... | SELECT "No. in series" FROM table_3989 WHERE "Title" = 'The Drum Major' | wikisql |
CREATE TABLE table_15024 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the women's doubles for mixed doubles of no c... | SELECT "Women's doubles" FROM table_15024 WHERE "Mixed doubles" = 'no competition' | wikisql |
CREATE TABLE table_name_94 (
engine VARCHAR,
driver VARCHAR,
team VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of engine does the BF Racing Marron Excavations have that also has Monaco as chassis and Lee Filliponi as the ... | SELECT engine FROM table_name_94 WHERE team = "bf racing marron excavations" AND chassis = "monaco" AND driver = "lee filliponi" | sql_create_context |
CREATE TABLE table_46976 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Year was the Result of the game 16-14?
| SELECT MAX("Year") FROM table_46976 WHERE "Result" = '16-14' | wikisql |
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 WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dob_year < "2200" | mimicsql_data |
CREATE TABLE table_47174 (
"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.
-- What To par was won in 1982?
| SELECT "To par" FROM table_47174 WHERE "Year(s) won" = '1982' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' | atis |
CREATE TABLE table_10484 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid total for alain prost with over 14 laps?
| SELECT SUM("Grid") FROM table_10484 WHERE "Laps" > '14' AND "Driver" = 'alain prost' | wikisql |
CREATE TABLE table_24906653_5 (
steals VARCHAR,
blocks VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the number of takeaways with 1 rejection.
| SELECT COUNT(steals) FROM table_24906653_5 WHERE blocks = 1 | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT COUNT(*) FROM jybgb WHERE JZLSH = '91340380252' | css |
CREATE TABLE table_20916 (
"Central Forest Reserve" text,
"Size in km\u00b2" real,
"Total plant species" real,
"Tree species" real,
"Endemic" real,
"Threatened (CR,VU,EN)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tree species are ... | SELECT "Tree species" FROM table_20916 WHERE "Central Forest Reserve" = 'Kitechura' | wikisql |
CREATE TABLE table_6035 (
"Year" real,
"Group" text,
"Award" text,
"Film/Series" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year that Kim was nominated for Over the Rainbow?
| SELECT MAX("Year") FROM table_6035 WHERE "Film/Series" = 'over the rainbow' | 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute cd4 count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND STRFTIME('%y', labevents.charttime) >= '2105' | mimic_iii |
CREATE TABLE head (
age VARCHAR,
head_id VARCHAR
)
CREATE TABLE management (
head_id VARCHAR,
temporary_acting VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the distinct ages of the heads who are acting?
| SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes' | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(Id) FROM Users WHERE Reputation > 15 AND Reputation < 3000 | sede |
CREATE TABLE table_25594271_2 (
loa__metres_ VARCHAR,
yacht VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the LOA metres for the yacht ichi ban?
| SELECT loa__metres_ FROM table_25594271_2 WHERE yacht = "Ichi Ban" | sql_create_context |
CREATE TABLE table_19897896_7 (
class VARCHAR,
university VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in which class was the ohio state university
| SELECT class FROM table_19897896_7 WHERE university = "Ohio state" | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "6" AND diagnoses.icd9_code = "59654" | mimicsql_data |
CREATE TABLE table_18677 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the election in the Arkansas 2 district?
| SELECT "Result" FROM table_18677 WHERE "District" = 'Arkansas 2' | wikisql |
CREATE TABLE table_60673 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the T4 Place Player with a Score of 71-74-66=211?
| SELECT "Player" FROM table_60673 WHERE "Place" = 't4' AND "Score" = '71-74-66=211' | wikisql |
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 WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "BLACK/HAITIAN" | mimicsql_data |
CREATE TABLE table_name_86 (
method VARCHAR,
time VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the method when the time was 5:00, and the round higher than 4?
| SELECT method FROM table_name_86 WHERE time = "5:00" AND round > 4 | sql_create_context |
CREATE TABLE participants_in_Events (
participant_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the distinct participant ids who attended any events?
| SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events | sql_create_context |
CREATE TABLE table_22034 (
"Romanised name" text,
"Chinese name" text,
"age at appointment" real,
"Foreign nationality" text,
"Portfolio attachment" text,
"Prior occupation" text,
"Govt salary" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Foreign nationality" FROM table_22034 WHERE "Romanised name" = 'Cheung, Raymond Man-to' | wikisql |
CREATE TABLE table_56185 (
"Book title" text,
"Author" text,
"Edition/Publisher" text,
"Page count" text,
"Page size" text,
"Language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which author wrote Sironia, Texas in English?
| SELECT "Author" FROM table_56185 WHERE "Language" = 'english' AND "Book title" = 'sironia, texas' | wikisql |
CREATE TABLE table_18555 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party does the incumbent from the Ohio 7 district belong to?
| SELECT "Party" FROM table_18555 WHERE "District" = 'Ohio 7' | wikisql |
CREATE TABLE cinema (
name VARCHAR,
openning_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all the cinema names and opening years in descending order of opening year.
| SELECT name, openning_year FROM cinema ORDER BY openning_year DESC | sql_create_context |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC | 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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8098) | mimic_iii |
CREATE TABLE table_204_429 (
id number,
"battle" text,
"location" text,
"date(s)" text,
"engagement remarks" text,
"victor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total amount of m -lrb- mexican -rrb- victories ?
| SELECT COUNT(*) FROM table_204_429 WHERE "victor" = 'm' | squall |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | 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 = 594)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp... | mimic_iii |
CREATE TABLE table_8308 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the match was in the country of Scotland?
| SELECT "Score" FROM table_8308 WHERE "Country" = 'scotland' | wikisql |
CREATE TABLE table_20799905_1 (
mccain_percentage VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many figures are given for McCain's % in Davidson county?
| SELECT COUNT(mccain_percentage) FROM table_20799905_1 WHERE county = "DAVIDSON" | sql_create_context |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,... | SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY COUNT(services) | nvbench |
CREATE TABLE table_name_45 (
grid VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What grid is associated with 67 laps?
| SELECT grid FROM table_name_45 WHERE laps = 67 | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABL... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94937) AND STRFTIME('%y', procedures_icd.charttime) >= '2105' ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_171250_2 (
census_ranking VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the census ranking(s) for a population of 284?
| SELECT census_ranking FROM table_171250_2 WHERE population = 284 | sql_create_context |
CREATE TABLE table_name_35 (
date VARCHAR,
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date has a label of alfa records?
| SELECT date FROM table_name_35 WHERE label = "alfa records" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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,
round_trip_re... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '76340683' AND MED_SER_ORG_NO = '3169811' AND OUT_DIAG_DIS_NM LIKE '%妊娠%' | css |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | SELECT a.ParentId, q.Id AS "post_link" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.Score > 0 AND a.OwnerUserId = @userId AND a.PostTypeId = 2 AND NOT q.Tags LIKE '%<' + @tags + '>%' | sede |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inpute... | SELECT AVG(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 = 655)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arteri... | mimic_iii |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_name_15 (
result VARCHAR,
event VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has the Event Strikeforce and the Method, Ko (spinning back fist)?
| SELECT result FROM table_name_15 WHERE event = "strikeforce" AND method = "ko (spinning back fist)" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" AND demographic.age < "27" | mimicsql_data |
CREATE TABLE table_54256 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game with result 7-2 played?
| SELECT "Venue" FROM table_54256 WHERE "Result" = '7-2' | wikisql |
CREATE TABLE table_20329 (
"Year" real,
"Matches" real,
"Wins" real,
"Losses" real,
"No Result" real,
"Tied" real,
"Success Rate" text,
"Position" text,
"Summary" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least wins of ... | SELECT MIN("Wins") FROM table_20329 WHERE "Success Rate" = '56.25%' | wikisql |
CREATE TABLE table_40608 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Rank, when Name is Travis Watson, and when Games is less than 14?
| SELECT MAX("Rank") FROM table_40608 WHERE "Name" = 'travis watson' AND "Games" < '14' | wikisql |
CREATE TABLE table_53355 (
"Track" real,
"Title" text,
"Author(s)" text,
"Recorded" text,
"Length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title is 3:43 long?
| SELECT "Title" FROM table_53355 WHERE "Length" = '3:43' | wikisql |
CREATE TABLE table_name_98 (
model_number VARCHAR,
multiplier VARCHAR,
front_side_bus VARCHAR,
l2_cache VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Model number has a Front Side Bus of 100mhz, a L2-Cache of 64kib and a Multiplier of 8.5 ?
| SELECT model_number FROM table_name_98 WHERE front_side_bus = "100mhz" AND l2_cache = "64kib" AND multiplier = "8.5×" | sql_create_context |
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 ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME var... | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE, CRS_DESCRIPTION | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_name_26 (
colours VARCHAR,
head_coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the colours of the team with benedikt gu mundsson as head coach?
| SELECT colours FROM table_name_26 WHERE head_coach = "benedikt guðmundsson" | sql_create_context |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | SELECT Creation, SUM(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation | nvbench |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_des... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.cit... | atis |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate ti... | SELECT u.Id AS "user_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.UpVotes, u.DownVotes, u.Age FROM Users AS u JOIN (SELECT DISTINCT UserId FROM Badges WHERE LOWER(Name) IN ('python', 'django') AND Class IN (1, 2, 3) AND TagBased = 1) AS tag_badges ON tag_badges.UserId = u.Id WHERE LOWER(Locatio... | sede |
CREATE TABLE table_43429 (
"Year" text,
"Award" text,
"Production" text,
"Role" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which award was given in 2012?
| SELECT "Award" FROM table_43429 WHERE "Year" = '2012' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
ins... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri... | advising |
CREATE TABLE table_27512025_1 (
ab_ripper_x VARCHAR,
exercise VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ab ripper x when exercise is x stretch?
| SELECT ab_ripper_x FROM table_27512025_1 WHERE exercise = "X Stretch" | sql_create_context |
CREATE TABLE table_204_751 (
id number,
"date" text,
"train" text,
"location" text,
"present location" text,
"comments" text,
"top speed (km/h)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many trains listed have the same speed as the... | SELECT COUNT("train") FROM table_204_751 WHERE "train" <> 'hmb2' AND "top speed (km/h)" = (SELECT "top speed (km/h)" FROM table_204_751 WHERE "train" = 'hmb2') | squall |
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 JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_19 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2011, when 2006 is 'A', when 2008 is 'A', and when Tournament is 'Rome'?
| SELECT 2011 FROM table_name_19 WHERE 2006 = "a" AND 2008 = "a" AND tournament = "rome" | sql_create_context |
CREATE TABLE table_55062 (
"Block A" text,
"Ryuji Hijikata" text,
"Shuji Kondo" text,
"El NOSAWA Mendoza" text,
"PEPE Michinoku" text,
"Katsuhiko Nakajima" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Block A value for an El NOSAWA... | SELECT "Block A" FROM table_55062 WHERE "El NOSAWA Mendoza" = 'kondo (7:08)' | wikisql |
CREATE TABLE player_college (
player_id TEXT,
college_id TEXT,
year INTEGER
)
CREATE TABLE player_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes TEXT
)
CREATE TABLE appearances (
year INTEGER,
team_id TEXT,
league_id TEXT,
playe... | SELECT year, COUNT(year) FROM home_game ORDER BY COUNT(year) DESC | nvbench |
CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height real,
Hometown text
)
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real... | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown | nvbench |
CREATE TABLE table_2933761_1 (
occupation VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Joan Leaven's occupation?
| SELECT occupation FROM table_2933761_1 WHERE name = "Joan Leaven" | sql_create_context |
CREATE TABLE table_203_424 (
id number,
"year" number,
"starts" number,
"wins" number,
"top 5" number,
"top 10" number,
"poles" number,
"avg. start" number,
"avg. finish" number,
"winnings" text,
"position" text,
"team(s)" text
)
-- Using valid SQLite, answer the follow... | SELECT COUNT(*) FROM table_203_424 WHERE "avg. finish" < 18 | squall |
CREATE TABLE table_53454 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the stadium when the date of the game is December 14?
| SELECT "Stadium" FROM table_53454 WHERE "Date" = 'december 14' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patient... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-11687')) AND medication.routeadmin = 'po' AND STRFTIME('%y... | eicu |
CREATE TABLE table_68466 (
"Event" text,
"Individual" text,
"Sprint" text,
"Pursuit" text,
"Mass Start" text,
"Relay" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the individual in the event of 1998 Pokljuka?
| SELECT "Individual" FROM table_68466 WHERE "Event" = '1998 pokljuka' | wikisql |
CREATE TABLE table_41271 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which bike had a grid less than 35 and time at 37:58.607?
| SELECT "Bike" FROM table_41271 WHERE "Grid" < '35' AND "Time" = '37:58.607' | wikisql |
CREATE TABLE table_71259 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which engine has a Lotus 49c chassis?
| SELECT "Engine" FROM table_71259 WHERE "Chassis" = 'lotus 49c' | wikisql |
CREATE TABLE table_18899 (
"Rnd" real,
"Circuit" text,
"GTO Winning Team" text,
"GTU Winning Team" text,
"TO Winning Team" text,
"TU Winning Team" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the gtu winning team w... | SELECT "GTU Winning Team" FROM table_18899 WHERE "GTO Winning Team" = '#48 Greenwood Racing' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND intakeoutput.celllabel = 'enter... | eicu |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age) | nvbench |
CREATE TABLE table_69089 (
"Year" real,
"Date" text,
"Title" text,
"Format(s)" text,
"Award Description(s)" text,
"Result(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the average year with the date of February 24?
| SELECT AVG("Year") FROM table_69089 WHERE "Date" = 'february 24' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.