instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_12 (
msdn_integration VARCHAR,
intellitrace VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which MSDN integration has a IntelliTrace of yes?
| SELECT msdn_integration FROM table_name_12 WHERE intellitrace = "yes" | sql_create_context |
CREATE TABLE table_26319 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What the product... | SELECT MAX("Production code") FROM table_26319 WHERE "U.S. viewers (millions)" = '16.10' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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... | SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54494)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hem... | mimic_iii |
CREATE TABLE table_26614365_5 (
galician___reintegrationist__ VARCHAR,
galician___official__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Galician (reintegrationist) word of the Galician (Official) is adeus*?
| SELECT galician___reintegrationist__ FROM table_26614365_5 WHERE galician___official__ = "Adeus*" | sql_create_context |
CREATE TABLE table_name_59 (
type VARCHAR,
date VARCHAR,
president VARCHAR,
location VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Type with a Location with justus lipsius building, brussels, and a Year of 2012, and a P... | SELECT type FROM table_name_59 WHERE location = "justus lipsius building, brussels" AND year = 2012 AND president = "herman van rompuy (1st term)" AND date = "23 may" | sql_create_context |
CREATE TABLE table_66169 (
"Property" text,
"K-band" real,
"Ka-band" real,
"Q-band" real,
"V-band" real,
"W-band" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average v-band for Ka-band values under 33 and Q-bands of 1?
| SELECT AVG("V-band") FROM table_66169 WHERE "Ka-band" < '33' AND "Q-band" = '1' | wikisql |
CREATE TABLE table_name_38 (
first_elected INTEGER,
results VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest First Elected, when Results is 'Re-elected', and when Incumbent is 'Lincoln Davis'?
| SELECT MIN(first_elected) FROM table_name_38 WHERE results = "re-elected" AND incumbent = "lincoln davis" | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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.JZLSH_MZJZJLB ... | css |
CREATE TABLE table_60675 (
"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 To par of the Player with a Score of 73-67-68=208?
| SELECT "To par" FROM table_60675 WHERE "Score" = '73-67-68=208' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc21 WHERE MED_CLINIC_ID = '55063958449' | css |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTy... | SELECT SUM(p.Score) AS total, COUNT(p.Score) AS num_questions, (SUM(p.Score) * 1.0) / COUNT(p.Score) AS ave FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id LEFT JOIN (SELECT u.Id AS u_id, MIN(p.Id) AS min_pid FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY u.Id) AS mp ON mp.u_id = u.I... | sede |
CREATE TABLE tracks (
id number,
name text,
album_id number,
media_type_id number,
genre_id number,
composer text,
milliseconds number,
bytes number,
unit_price number
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to n... | SELECT T2.first_name, T2.last_name, COUNT(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY COUNT(T1.reports_to) DESC LIMIT 1 | spider |
CREATE TABLE table_37903 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the First elected that has a republican party and california 4?
| SELECT "First elected" FROM table_37903 WHERE "Party" = 'republican' AND "District" = 'california 4' | wikisql |
CREATE TABLE table_12084 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's... | SELECT "Score" FROM table_12084 WHERE "Game" = '2' | wikisql |
CREATE TABLE journalist (
Name VARCHAR,
journalist_ID VARCHAR
)
CREATE TABLE event (
Name VARCHAR,
Event_ID VARCHAR,
Event_Attendance VARCHAR
)
CREATE TABLE news_report (
Event_ID VARCHAR,
journalist_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGui... | SELECT c.Text, c.Id AS "comment_link", CreationDate FROM Comments AS c WHERE c.Text LIKE '%##keyword##%' AND LENGTH(c.Text) <= 25 ORDER BY CreationDate DESC LIMIT 100 | sede |
CREATE TABLE table_74955 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record has detroit as the home and mtl. maroons as the visitor?
| SELECT "Record" FROM table_74955 WHERE "Home" = 'detroit' AND "Visitor" = 'mtl. maroons' | wikisql |
CREATE TABLE table_50780 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text... | SELECT "1996" FROM table_50780 WHERE "1994" = 'a' AND "2003" = 'a' AND "2001" = '1r' | wikisql |
CREATE TABLE table_204_985 (
id number,
"season" text,
"competition" text,
"round" text,
"club" text,
"home" text,
"away" text,
"aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the most aggregate score in germany ?
| SELECT MAX("aggregate") FROM table_204_985 | squall |
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
... | SELECT T1.driverId, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverId = T2.driverId JOIN races AS T3 ON T2.raceId = T3.raceId GROUP BY T1.driverId | nvbench |
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating num... | SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english" | spider |
CREATE TABLE table_name_70 (
score INTEGER,
place VARCHAR,
player VARCHAR
)
-- 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_name_70 WHERE place = "t5" AND player = "bob tway" | sql_create_context |
CREATE TABLE player (
player_id number,
sponsor_name text,
player_name text,
gender text,
residence text,
occupation text,
votes number,
rank text
)
CREATE TABLE coach (
coach_id number,
coach_name text,
gender text,
club_id number,
rank number
)
CREATE TABLE player... | SELECT COUNT(*) FROM player | spider |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_test... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec... | advising |
CREATE TABLE table_30967 (
"Episode" real,
"Broadcast date" text,
"Guest(s)" text,
"Singer(s)" text,
"Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many guest stars did the episode that was broadcasted 11september2012 have
| SELECT COUNT("Guest(s)") FROM table_30967 WHERE "Broadcast date" = '11September2012' | wikisql |
CREATE TABLE table_name_71 (
range__varies_with_payload_weight_ VARCHAR,
name_designation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the range (varies by payload weight) for Shahab-4?
| SELECT range__varies_with_payload_weight_ FROM table_name_71 WHERE name_designation = "shahab-4" | sql_create_context |
CREATE TABLE table_name_11 (
silver VARCHAR,
gold VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silver medals were there with 2 gold medals and more than 2 bronze medals?
| SELECT silver FROM table_name_11 WHERE gold = 2 AND bronze > 2 | sql_create_context |
CREATE TABLE addresses (
state_province_county VARCHAR,
line_1_number_building VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which state can address '6862 Kaitlyn Knolls' possibly be in?
| SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE "%6862 Kaitlyn Knolls%" | sql_create_context |
CREATE TABLE table_21647 (
"Team" text,
"Head coach" text,
"Team captain" text,
"Venue" text,
"Capacity" real,
"Kitmaker" text,
"Shirt sponsor" text,
"Club Chairman" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the club chairman... | SELECT "Club Chairman" FROM table_21647 WHERE "Team captain" = 'Murat Erdoğan' | wikisql |
CREATE TABLE table_name_96 (
record VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for the game that shows the Rose Garden 20,126 as attendance?
| SELECT record FROM table_name_96 WHERE attendance = "rose garden 20,126" | sql_create_context |
CREATE TABLE table_name_81 (
release INTEGER,
director VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest release for Pathogen directed by Sharon Gosling?
| SELECT MIN(release) FROM table_name_81 WHERE director = "sharon gosling" AND title = "pathogen" | sql_create_context |
CREATE TABLE table_35603 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the smallest grid for Time/Retired of +22.687?
| SELECT MIN("Grid") FROM table_35603 WHERE "Time/Retired" = '+22.687' | wikisql |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rati... | SELECT COUNT(*) FROM geographic, restaurant WHERE geographic.county = 'yolo county' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'italian' | restaurants |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM, AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '2592878' GROUP BY MED_ORG_DEPT_CD ORDER BY AVG(IN_HOSP_DAYS) | css |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Hyposmolality and/or hyponatremia" | mimicsql_data |
CREATE TABLE table_1745843_7 (
verb_meaning VARCHAR,
part_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the meaning of the verb whose part 1 is slapen?
| SELECT verb_meaning FROM table_1745843_7 WHERE part_1 = "slapen" | sql_create_context |
CREATE TABLE table_54643 (
"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 time/retired for a grid over 17 with 74 laps?
| SELECT "Time/Retired" FROM table_54643 WHERE "Grid" > '17' AND "Laps" = '74' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_... | 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 = 3369)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit... | mimic_iii |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, PostTypes.Name AS Type, COUNT(*) AS Count, SUM(Posts.Score) AS Score, SUM(Posts.FavoriteCount) AS CommentCount, SUM(Posts.ViewCount) AS ViewCount, SUM(LEN(Posts.Title)) AS TitleChars, SUM(LEN(Posts.Body)) AS BodyChar... | sede |
CREATE TABLE table_204_433 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished before nate boyle for the united states ?
| SELECT "name" FROM table_204_433 WHERE id = (SELECT id FROM table_204_433 WHERE "name" = 'nate boyle') - 1 | squall |
CREATE TABLE table_name_13 (
last_final_won VARCHAR,
runners_up VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the last final won when runners-up is 1 and club is rijeka?
| SELECT last_final_won FROM table_name_13 WHERE runners_up = 1 AND club = "rijeka" | sql_create_context |
CREATE TABLE table_29391888_1 (
original_air_date VARCHAR,
season__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air date for the season# 2?
| SELECT original_air_date FROM table_29391888_1 WHERE season__number = 2 | sql_create_context |
CREATE TABLE table_34238 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least total with rank less than 7, gold more than 16 and bronze less than 29
| SELECT MIN("Total") FROM table_34238 WHERE "Rank" < '7' AND "Gold" > '16' AND "Bronze" < '29' | wikisql |
CREATE TABLE table_35488 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won by 2 or more goals difference" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT MAX("Played") FROM table_35488 WHERE "Lost" > '2' AND "Team" = 'palmeiras' AND "Drawn" < '1' | wikisql |
CREATE TABLE table_56061 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result week 11?
| SELECT "Result" FROM table_56061 WHERE "Week" = '11' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span 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 = 'PITTSBURGH' AND date_day.day_number = 8 AND date_day.month_number = 7 AND... | atis |
CREATE TABLE table_19408 (
"1890 No game" text,
"1891 No game" text,
"1892 No game" text,
"1893 No game" text,
"1894 WSU 10\u20130 Moscow" text,
"1895 WSU* 10\u20134 Pullman" text,
"1896 No game" text,
"1897 No game" text,
"1898 No game" text,
"1899 WSU* 11\u20130 Pullman" text
)... | SELECT COUNT("1899 WSU* 11\u20130 Pullman") FROM table_19408 WHERE "1894 WSU 10\u20130 Moscow" = '1934 WSU* 19–0 Pullman' | wikisql |
CREATE TABLE table_15128839_22 (
gp VARCHAR,
ff VARCHAR,
qbh VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gp for ff being 0 and qbh being 1
| SELECT gp FROM table_15128839_22 WHERE ff = 0 AND qbh = 1 | sql_create_context |
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 t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '06002285' AND t_kc22.STA_DATE BETWEEN '2015-05-16' AND '2018-08-07' AND t_kc22.SOC_SRT_DIRE_NM = '妥布霉素滴眼液' | css |
CREATE TABLE table_204_95 (
id number,
"name" text,
"title" text,
"first year\nin this position" number,
"years at nebraska" text,
"alma mater" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which coach held his position for the most years ?
| SELECT "name" FROM table_204_95 ORDER BY "years at nebraska" - "years at nebraska" DESC LIMIT 1 | squall |
CREATE TABLE table_15262 (
"Rank" real,
"Team" text,
"Country" text,
"Value ($M)" real,
"Revenue ($M)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least revenue for chelsea of england with rank less than 7
| SELECT MIN("Revenue ($M)") FROM table_15262 WHERE "Country" = 'england' AND "Team" = 'chelsea' AND "Rank" < '7' | wikisql |
CREATE TABLE table_204_859 (
id number,
"year" number,
"seniors (trood award & rodda medal)" text,
"reserves (rex hartley medal)" text,
"under 18's (bruce wilkinson medal)" text,
"under 16's (shaw/carter medal)" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "seniors (trood award & rodda medal)" FROM table_204_859 WHERE "year" = 1965 | squall |
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 hz_info.person_info_XM 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 jybgb.BGDH = '80578545144' | css |
CREATE TABLE table_204_243 (
id number,
"year" number,
"album" text,
"song" text,
"duration" text,
"artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in which years did he release more than 2 albums ?
| SELECT "year" FROM table_204_243 GROUP BY "year" HAVING COUNT("album") > 2 | squall |
CREATE TABLE table_73578 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the episo... | SELECT "Original air date" FROM table_73578 WHERE "Title" = 'Do You Believe in Magic' | wikisql |
CREATE TABLE table_name_19 (
wins INTEGER,
goal_difference VARCHAR,
position VARCHAR,
goals_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least wins for goal difference being less than -20 with position less than 20 and goals for of 35
| SELECT MIN(wins) FROM table_name_19 WHERE position < 20 AND goals_for = 35 AND goal_difference < -20 | sql_create_context |
CREATE TABLE table_name_94 (
games INTEGER,
years_at_club VARCHAR,
debut_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Games have Years at club of 1971 1974, and a Debut year larger than 1971?
| SELECT SUM(games) FROM table_name_94 WHERE years_at_club = "1971–1974" AND debut_year > 1971 | sql_create_context |
CREATE TABLE table_7835 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Houston Rockets play Home?
| SELECT "Date" FROM table_7835 WHERE "Home" = 'houston rockets' | wikisql |
CREATE TABLE table_204_123 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT SUM("attendance") FROM table_204_123 WHERE "week" IN (1, 2) | squall |
CREATE TABLE table_66194 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Theme Song(s)" text,
"Episodes" real,
"Average Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Japanese Title has a TV Station of ntv?
| SELECT "Japanese Title" FROM table_66194 WHERE "TV Station" = 'ntv' | wikisql |
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
-... | SELECT fname FROM authors WHERE lname = "Ueno" | spider |
CREATE TABLE table_6767 (
"SANSKRT" text,
"CHINESE" text,
"VIETNAMESE" text,
"JAPANESE" text,
"KOREAN" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which SANSKRT has a CHINESE of / m n lu ?
| SELECT "SANSKRT" FROM table_6767 WHERE "CHINESE" = '摩拏羅 / mónáluó' | wikisql |
CREATE TABLE table_25296 (
"Station" text,
"Extension" text,
"City/Neighborhood" text,
"Projected opening" real,
"Transit Connections" text,
"Park and ride?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the park and ride for roosevelt u
| SELECT "Park and ride?" FROM table_25296 WHERE "Station" = 'Roosevelt U' | wikisql |
CREATE TABLE table_1447085_1 (
county VARCHAR,
number_of_households VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What county has 2053 households?
| SELECT county FROM table_1447085_1 WHERE number_of_households = 2053 | sql_create_context |
CREATE TABLE table_31996 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the result for warsaw 1929
| SELECT "Result" FROM table_31996 WHERE "Location" = 'warsaw' AND "Year" = '1929' | wikisql |
CREATE TABLE table_43862 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of times that the heat is 3 and the name is cxhristy ekpukhon ihunaegbo?
| SELECT COUNT("Lane") FROM table_43862 WHERE "Heat" = '3' AND "Name" = 'cxhristy ekpukhon ihunaegbo' | wikisql |
CREATE TABLE table_24675 (
"State Rank by Revenue" real,
"Company Name" text,
"National Rank" real,
"Revenue ($billions) 2012 estimate" text,
"Headquarters City" text,
"Known for" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the state ... | SELECT "State Rank by Revenue" FROM table_24675 WHERE "Revenue ($billions) 2012 estimate" = '6.8' | wikisql |
CREATE TABLE table_1341522_41 (
opponent VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was in the election that was for incumbent bud shuster's seat?
| SELECT opponent FROM table_1341522_41 WHERE incumbent = "Bud Shuster" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811) AND microbiologyevents.spec_type_desc = 'stool' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-01' ORD... | mimic_iii |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHA... | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE employees (
phone VARCHAR,
first_name VARCHAR,
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is employee Nancy Edwards's phone number?
| SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" | sql_create_context |
CREATE TABLE table_name_76 (
date_s__released VARCHAR,
democratic_alternative VARCHAR,
labour VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date released had a Democratic Alternative value of 1% and Labour of 34%?
| SELECT date_s__released FROM table_name_76 WHERE democratic_alternative = "1%" AND labour = "34%" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT zyjybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '65243829' AND zyjybgb.BGRQ BETWEEN '2018-07-03' AND '2020-02... | css |
CREATE TABLE table_37811 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Field goals have Points larger than 5, and Touchdowns larger than 2, and an Extra ... | SELECT COUNT("Field goals") FROM table_37811 WHERE "Points" > '5' AND "Touchdowns" > '2' AND "Extra points" < '0' | 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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE >= 20) | css |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
... | SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM gyb WHERE gyb.MED_TYPE = '2893713' AND gyb.IN_HOSP_DAYS BETWEEN '2003-11-14' AND '2007-08-09' | css |
CREATE TABLE table_name_52 (
manner_of_departure VARCHAR,
date_of_appointment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the manner of depature when the date of appointment was 27 December 2007?
| SELECT manner_of_departure FROM table_name_52 WHERE date_of_appointment = "27 december 2007" | sql_create_context |
CREATE TABLE table_26463 (
"Overall Episode #" real,
"Original airdate" text,
"Iron Chef" text,
"Challenger" text,
"Challenger Specialty" text,
"Theme Ingredient" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many iron ch... | SELECT COUNT("Iron Chef") FROM table_26463 WHERE "Challenger Specialty" = 'Japanese' | wikisql |
CREATE TABLE table_66686 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest week on September 26, 1965?
| SELECT MIN("Week") FROM table_66686 WHERE "Date" = 'september 26, 1965' | wikisql |
CREATE TABLE table_name_38 (
country VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has a time of 6:49.28?
| SELECT country FROM table_name_38 WHERE time = "6:49.28" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE table_name_19 (
outcome VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Outcome that has a Tournament of milan , italy?
| SELECT outcome FROM table_name_19 WHERE tournament = "milan , italy" | sql_create_context |
CREATE TABLE table_name_34 (
attendance INTEGER,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest attendance for week 3?
| SELECT MAX(attendance) FROM table_name_34 WHERE week = 3 | sql_create_context |
CREATE TABLE table_name_90 (
location VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the match held that lasted 3:24?
| SELECT location FROM table_name_90 WHERE time = "3:24" | sql_create_context |
CREATE TABLE table_50495 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place has a 67-68-78-77=290 score?
| SELECT "Place" FROM table_50495 WHERE "Score" = '67-68-78-77=290' | wikisql |
CREATE TABLE table_33538 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of gold medal totals for nations with 1 silver, less than 2 bronze, and rank... | SELECT SUM("Gold") FROM table_33538 WHERE "Silver" = '1' AND "Bronze" < '2' AND "Total" = '1' AND "Rank" < '10' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_77318 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Bunky Henry of the United States scored higher than 67 and his To par was e, what was his place?
| SELECT "Place" FROM table_77318 WHERE "Score" > '67' AND "Country" = 'united states' AND "To par" = 'e' AND "Player" = 'bunky henry' | wikisql |
CREATE TABLE table_9006 (
"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 is the Money of the Player with a Score of 71-66-74-67=278?
| SELECT AVG("Money ( $ )") FROM table_9006 WHERE "Score" = '71-66-74-67=278' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | 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 = 14458 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev... | mimic_iii |
CREATE TABLE table_14475 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the cosworth ca2006 2.4 v8 4 series used?
| SELECT AVG("Year") FROM table_14475 WHERE "Engine" = 'cosworth ca2006 2.4 v8 4 series' | wikisql |
CREATE TABLE table_14835674_1 (
introductory_phrase VARCHAR,
guest VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the inroductory phase for the episode with neil shubin as a guest?
| SELECT introductory_phrase FROM table_14835674_1 WHERE guest = "Neil Shubin" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Delet... | SELECT Id FROM Posts AS p WHERE p.PostTypeId = 1 AND p.CreationDate < '2013-01-11' AND p.CreationDate >= '2013-01-01' | sede |
CREATE TABLE table_name_97 (
player VARCHAR,
pba_team VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player went to college at Up-Diliman and plays on PBA team of the Alaska Milkmen?
| SELECT player FROM table_name_97 WHERE pba_team = "alaska milkmen" AND college = "up-diliman" | sql_create_context |
CREATE TABLE table_13975 (
"Country" text,
"Airport" text,
"City" text,
"2008" real,
"Change (08/07)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has a Change (08/07) of unknown, and a 2008 larger than 1,102,497, and a City of luand... | SELECT "Country" FROM table_13975 WHERE "Change (08/07)" = 'unknown' AND "2008" > '1,102,497' AND "City" = 'luanda' | wikisql |
CREATE TABLE table_3077 (
"Record label" text,
"Composer" text,
"Work title" text,
"Part" text,
"Conductor" text,
"Recording year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the conductor for Rusalka?
| SELECT "Conductor" FROM table_3077 WHERE "Work title" = 'Rusalka' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'seizures - suspected')) AND DATETIME(cost.ch... | eicu |
CREATE TABLE status (
station_id number,
bikes_available number,
docks_available number,
time text
)
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE weather (
date text,
max_te... | SELECT AVG(long) FROM station WHERE NOT id IN (SELECT station_id FROM status GROUP BY station_id HAVING MAX(bikes_available) > 10) | spider |
CREATE TABLE table_24018 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"LWAT" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT MAX("180s") FROM table_24018 WHERE "Legs Won" = '45' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.