instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_63495 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of wins when there are less than 2 losses?
| SELECT MAX("Wins") FROM table_63495 WHERE "Losses" < '2' | 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 wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '姜浩歌' AND hz_info.YLJGDM = '1560846' AND wdmzjzjlb.JZKSMC LIKE '%牙病%' UNION SELECT bdmzjzjlb.J... | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8025333' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING AVG(t_kc21.IN_HOSP_DAYS) > 9) AS T | css |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | SELECT p1.Title AS "Question", 'http://www.stackoverflow.com/questions/' + CAST(p1.Id AS TEXT) AS "URL", p1.FavoriteCount AS "Favorite Votes" FROM Posts AS p1, PostTypes AS ptypes1, PostTags AS ptags1, Tags AS t1 WHERE p1.PostTypeId = ptypes1.Id AND ptypes1.Id = 1 AND p1.Id = ptags1.PostId AND ptags1.TagId = t1.Id AND ... | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.dod_year <= "2126.0" | mimicsql_data |
CREATE TABLE table_203_271 (
id number,
"date" text,
"series" text,
"circuit" text,
"city / state" text,
"winner" text,
"team" text,
"car" text,
"report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of rac... | SELECT COUNT(*) FROM table_203_271 | squall |
CREATE TABLE table_name_5 (
tie_no VARCHAR,
attendance VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the attendance of 2 january 1999 with a home team of plymouth argyle what is the tie no. ?
| SELECT tie_no FROM table_name_5 WHERE attendance = "2 january 1999" AND home_team = "plymouth argyle" | sql_create_context |
CREATE TABLE table_name_94 (
yacht VARCHAR,
loa__metres_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of yacht has a LOA of 15.15 metres?
| SELECT yacht AS Type FROM table_name_94 WHERE loa__metres_ = 15.15 | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id nu... | 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 = 19428) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHE... | mimic_iii |
CREATE TABLE table_72650 (
"Category" text,
"Type" text,
"Attribute" text,
"Description" text,
"Bubbles" text,
"Cancelable" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the attribute with cancelable being yes
| SELECT "Attribute" FROM table_72650 WHERE "Cancelable" = 'Yes' | wikisql |
CREATE TABLE table_203_763 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the higher number of meters listed in the notes section of the table ?
| SELECT "notes" FROM table_203_763 ORDER BY "notes" DESC LIMIT 1 | squall |
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
CREATE TABLE table_22835602_1 (
directed_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many directors were there for the production code 1ark08?
| SELECT COUNT(directed_by) FROM table_22835602_1 WHERE production_code = "1ARK08" | sql_create_context |
CREATE TABLE table_name_48 (
date VARCHAR,
winning_driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was Rodger Ward the winning driver?
| SELECT date FROM table_name_48 WHERE winning_driver = "rodger ward" | sql_create_context |
CREATE TABLE table_name_72 (
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game played when the score was 1-4?
| SELECT venue FROM table_name_72 WHERE score = "1-4" | sql_create_context |
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9550631' AND IN_HOSP_DATE BETWEEN '2007-02-26' AND '2020-08-03' AND INSURED_STS = '未就业' AND MED_AMOUT >= 5252.43 | css |
CREATE TABLE table_4299 (
"Year" real,
"GDP at constant prices (THB trillions)" text,
"GDP at constant prices growth rate (percent change)" text,
"GDP at current prices (USD billions)" text,
"Export volume of goods and services (percent change)" text,
"Current account balance (percent of GDP)" t... | SELECT COUNT("Current account balance (percent of GDP)") FROM table_4299 WHERE "GDP at constant prices growth rate (percent change)" = '4.6' | wikisql |
CREATE TABLE table_17369472_2 (
points VARCHAR,
tries_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points were there when tries for were 84?
| SELECT points FROM table_17369472_2 WHERE tries_for = "84" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE table_name_18 (
torque VARCHAR,
power VARCHAR,
trim VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Torque that has a Power of hp (kw), and a Trim of xr (2009)? Question 6
| SELECT torque FROM table_name_18 WHERE power = "hp (kw)" AND trim = "xr (2009)" | sql_create_context |
CREATE TABLE table_name_51 (
overall INTEGER,
college VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest Overall average that has a College of Arkansas, and a Round larger than 3?
| SELECT MIN(overall) FROM table_name_51 WHERE college = "arkansas" AND round > 3 | sql_create_context |
CREATE TABLE table_22081847_1 (
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum number of wins?
| SELECT MAX(wins) FROM table_22081847_1 | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D... | atis |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '结膜炎' AND jyjgzbb.JCZBMC = '超敏甲状腺球蛋白' | css |
CREATE TABLE table_name_82 (
opponent VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Opponent of the game with a Score of 74-66?
| SELECT opponent FROM table_name_82 WHERE score = "74-66" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of physical abuse') AND DATETIME(diagnoses_icd.charttim... | mimic_iii |
CREATE TABLE table_12728 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Home team of Tie no 40?
| SELECT "Home team" FROM table_12728 WHERE "Tie no" = '40' | wikisql |
CREATE TABLE table_203_150 (
id number,
"season" number,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"f/laps" number,
"podiums" number,
"points" number,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT SUM("wins") FROM table_203_150 | squall |
CREATE TABLE table_10098 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college or club team did Dale Mitchell play for?
| SELECT "College/Junior/Club Team (League)" FROM table_10098 WHERE "Player" = 'dale mitchell' | wikisql |
CREATE TABLE table_47853 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT ARE THE LAPS WITH POINTS LARGER THAN 5, WITH FORSYTHE RACING, AND GRID 5?
| SELECT MIN("Laps") FROM table_47853 WHERE "Points" > '5' AND "Team" = 'forsythe racing' AND "Grid" = '5' | wikisql |
CREATE TABLE table_27055 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power kW" text,
"Station Type" text,
"Location (Transmitter site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power in KW of the transmitter situated in ... | SELECT "Power kW" FROM table_27055 WHERE "Location (Transmitter site)" = 'Borongan' | wikisql |
CREATE TABLE table_name_39 (
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's in third place that's going 1-0?
| SELECT 3 AS rd_place FROM table_name_39 WHERE score = "1-0" | sql_create_context |
CREATE TABLE table_12552 (
"Club" text,
"City" text,
"Arena" text,
"Capacity" real,
"Last Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest capacity for Bursa?
| SELECT MIN("Capacity") FROM table_12552 WHERE "City" = 'bursa' | wikisql |
CREATE TABLE table_name_22 (
week_6 VARCHAR,
week_2 VARCHAR,
week_3 VARCHAR,
week_7 VARCHAR,
week_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is week 6 when week 7, week 4, and week 3 are evicted and week 2 29.35?
| SELECT week_6 FROM table_name_22 WHERE week_7 = "evicted" AND week_4 = "evicted" AND week_3 = "evicted" AND week_2 = "29.35" | sql_create_context |
CREATE TABLE table_6846 (
"Position" text,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"1997\u20131998 Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Position with a height of l... | SELECT "Position" FROM table_6846 WHERE "Height (cm)" < '183' AND "Weight (kg)" < '91' AND "Birthplace" = 'bloomington, minnesota' | wikisql |
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 demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.name = "Michael Tyndall" | mimicsql_data |
CREATE TABLE table_1342013_20 (
incumbent VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the incumbent first elected in 1944?
| SELECT incumbent FROM table_1342013_20 WHERE first_elected = 1944 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId numb... | SELECT * FROM Tags ORDER BY Count DESC | sede |
CREATE TABLE table_64445 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is from County Dublin?
| SELECT "Player" FROM table_64445 WHERE "County" = 'dublin' | wikisql |
CREATE TABLE table_203_633 (
id number,
"title" text,
"year" number,
"platform" text,
"developer" text,
"publisher" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the title swat 4 shared the same developer as what other title ?
| SELECT "title" FROM table_203_633 WHERE "title" <> 'swat 4' AND "developer" = (SELECT "developer" FROM table_203_633 WHERE "title" = 'swat 4') | squall |
CREATE TABLE table_25279 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the constituency for 175130
| SELECT "Constituency" FROM table_25279 WHERE "Margin" = '175130' | wikisql |
CREATE TABLE table_3194 (
"Episode #" real,
"Production Count" real,
"Original Airdate" text,
"Prod. Code" text,
"Title" text,
"Viewing Figures millions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the 1st air date for the episode titled... | SELECT "Original Airdate" FROM table_3194 WHERE "Title" = 'Baby Talk' | wikisql |
CREATE TABLE table_69341 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Club" FROM table_69341 WHERE "Goals for" < '61' AND "Goals against" = '55' | wikisql |
CREATE TABLE table_name_17 (
enrollment INTEGER,
left VARCHAR,
current_conference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest enrollment amount for a year left of 2012 and a current conference of Mid-South?
| SELECT MIN(enrollment) FROM table_name_17 WHERE left = 2012 AND current_conference = "mid-south" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
Acce... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##Location##%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_36060 (
"Year" real,
"Name" text,
"Country" text,
"Language(s)" text,
"Literary tradition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nation was the film from that was in english and had a Literary tradition of canadian l... | SELECT "Country" FROM table_36060 WHERE "Language(s)" = 'english' AND "Literary tradition" = 'canadian literature' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 26) | css |
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 * 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 = '82173410' AND jyjgzbb.jybgb_BBCJBW = '踝部' UNION SELECT * FR... | css |
CREATE TABLE table_23284271_9 (
location_attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the stadium and number of people in attendance when the team record was 45-22.
| SELECT COUNT(location_attendance) FROM table_23284271_9 WHERE record = "45-22" | sql_create_context |
CREATE TABLE table_45917 (
"Game" real,
"Date" text,
"Opponent" 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.
-- WH... | SELECT "High points" FROM table_45917 WHERE "Opponent" = 'los angeles' | wikisql |
CREATE TABLE table_42685 (
"Frequency" text,
"Call sign" text,
"Format" text,
"Owner" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Notes of the Frequency with a Format of soft adult contemporary?
| SELECT "Notes" FROM table_42685 WHERE "Format" = 'soft adult contemporary' | 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 SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '鲁和颂' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-03-16' AND '2004-10-26' | css |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description ... | WITH user_tag AS (SELECT t.TagName, a.OwnerUserId AS "user_link", SUM(a.Score) / 10.0 AS Score, COUNT(a.Score) AS "count", ((SUM(a.Score) / 10.0) + COUNT(a.Score)) / 2.0 AS Total FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id JOIN PostTags AS qt ON q.Id = qt.PostId JOIN Tags AS t ON t.Id = qt.TagId WHERE a.PostTy... | sede |
CREATE TABLE table_name_15 (
hereditary_peers VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Hereditary peers have a Total of 1?
| SELECT hereditary_peers FROM table_name_15 WHERE total = 1 | sql_create_context |
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 mzjzj... | css |
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
)
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
)
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
)
-- Using valid SQLit... | SELECT T1.result FROM acceptance AS T1 JOIN submission AS T2 ON T1.submission_id = T2.submission_id ORDER BY T2.scores DESC LIMIT 1 | spider |
CREATE TABLE table_name_42 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what 2001 has 1991 of 4r?
| SELECT 2001 FROM table_name_42 WHERE 1991 = "4r" | sql_create_context |
CREATE TABLE table_18373863_2 (
mlb_team VARCHAR,
years_played VARCHAR,
fcsl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when deland is the fcsl team and 2008 is the year played who is the mlb team?
| SELECT mlb_team FROM table_18373863_2 WHERE years_played = "2008" AND fcsl_team = "DeLand" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.icd9_code = "9229" | mimicsql_data |
CREATE TABLE table_61350 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2nd leg score when atl tico tucum n played at home?
| SELECT "2nd leg" FROM table_61350 WHERE "Home (2nd leg)" = 'atlético tucumán' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE semester (
semester_id int,
... | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... | advising |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous... | SELECT * FROM Posts WHERE MONTH(CreationDate) = 1 AND YEAR(CreationDate) = 2017 | sede |
CREATE TABLE table_8057 (
"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 we... | SELECT "High rebounds" FROM table_8057 WHERE "Score" = 'l 101–109 (ot)' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 29741 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM mzjzjlb WHERE JZKSMC = '手外科' AND JZKSRQ BETWEEN '2003-04-03' AND '2008-05-21' | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006... | eicu |
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
apps number,
tries number,
goals text,
points number
)
CREATE TABLE club_rank (
... | SELECT SUM(points) FROM player | spider |
CREATE TABLE table_name_4 (
goal_difference VARCHAR,
goals_against VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the totla number of goal difference for goals against of 30 and played less than 18
| SELECT COUNT(goal_difference) FROM table_name_4 WHERE goals_against = 30 AND played < 18 | sql_create_context |
CREATE TABLE table_204_59 (
id number,
"rank" number,
"athlete" text,
"nationality" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- anna zagorska recieved 2nd place , what was her time ?
| SELECT "time" FROM table_204_59 WHERE "athlete" = 'anna zagorska' | squall |
CREATE TABLE table_14984050_1 (
result VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for milwaukee county stadium
| SELECT result FROM table_14984050_1 WHERE game_site = "Milwaukee County Stadium" | sql_create_context |
CREATE TABLE table_13375 (
"Position" text,
"Name" text,
"Party" text,
"First Election" text,
"District" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Position does First Elected in 2003 William D. Euille hold ?
| SELECT "Position" FROM table_13375 WHERE "First Election" = '2003' AND "Name" = 'william d. euille' | wikisql |
CREATE TABLE table_name_59 (
attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended the game with a record of 43-34?
| SELECT COUNT(attendance) FROM table_name_59 WHERE record = "43-34" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75762 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea ... | mimic_iii |
CREATE TABLE table_29486 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest... | SELECT MAX("No. in Season") FROM table_29486 WHERE "No. in Series" = '47' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-47098' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-47098' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_name_80 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final game result that was played on December 2?
| SELECT result FROM table_name_80 WHERE date = "december 2" | sql_create_context |
CREATE TABLE table_name_55 (
weight_division VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the weight division for the fight that ended in a TKO (strikes)?
| SELECT weight_division FROM table_name_55 WHERE method = "tko (strikes)" | sql_create_context |
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID ... | SELECT Name, Total_Passengers FROM station WHERE Location <> 'London' ORDER BY Name DESC | nvbench |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
a... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 7 AND program_course.category LIKE 'ULCS' | advising |
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 MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "LIVER TRANSPLANT" | mimicsql_data |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name var... | 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 = 'CHARLOTTE' AND date_day.day_number = 27 AND date_day.month_number = 8 AND... | atis |
CREATE TABLE table_49034 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team when Qual 1 is 1:20.139?
| SELECT "Team" FROM table_49034 WHERE "Qual 1" = '1:20.139' | wikisql |
CREATE TABLE table_2248784_3 (
rank_world VARCHAR,
rank_subcontinent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rank world for 7 rank subcontinent
| SELECT rank_world FROM table_2248784_3 WHERE rank_subcontinent = 7 | sql_create_context |
CREATE TABLE table_55810 (
"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.
-- When was the game played at the Western Oval ven... | SELECT "Date" FROM table_55810 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_name_51 (
priority_entry_rights_to_derby VARCHAR,
race_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Priority-entry-rights to Derby in rank 4?
| SELECT priority_entry_rights_to_derby FROM table_name_51 WHERE NOT race_name = 4 | sql_create_context |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "55" AND lab.itemid = "51026" | mimicsql_data |
CREATE TABLE table_name_30 (
storage_stability INTEGER,
field_stability VARCHAR,
toxicity_as_blood_agent VARCHAR,
agent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the storage stability of Arsine with a toxicity of 8, and field stability l... | SELECT MIN(storage_stability) FROM table_name_30 WHERE toxicity_as_blood_agent > 8 AND agent = "arsine" AND field_stability < 5 | 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.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_i... | css |
CREATE TABLE table_name_66 (
rank VARCHAR,
chassis VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank did the chassis reynard 94i have in 1996?
| SELECT rank FROM table_name_66 WHERE chassis = "reynard 94i" AND year = "1996" | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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,
... | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
u... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898')) AND treatment.treatmentname = 'oxygen therapy (40% to 60%) - no... | eicu |
CREATE TABLE table_47456 (
"Election" text,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the outcome of the election with 43.3% share of votes?
| SELECT "Outcome of election" FROM table_47456 WHERE "Share of votes" = '43.3%' | wikisql |
CREATE TABLE table_name_86 (
name VARCHAR,
age_as_of_1_february_2014 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is 111years, 358days Age as of 1 February 2014?
| SELECT name FROM table_name_86 WHERE age_as_of_1_february_2014 = "111years, 358days" | sql_create_context |
CREATE TABLE table_1404984_1 (
call_sign VARCHAR,
virtual_channel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is channel 33.7's official call sign?
| SELECT call_sign FROM table_1404984_1 WHERE virtual_channel = "33.7" | sql_create_context |
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15),
document_type_description VARCHAR(255)
)
CREATE TABLE Employees (
employee_id INTEGER,
role_code CHAR(15),
employee_name VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_detail... | SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY COUNT(*) | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "26" | mimicsql_data |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous... | SELECT * FROM PostHistoryTypes | sede |
CREATE TABLE copyright (
id int,
msid int,
cid int
)
CREATE TABLE producer (
pid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE movie (
mid int,
title text,
release_year int,
title_aka text,
budget text
)
CREATE TA... | SELECT movie.title FROM actor, cast, movie WHERE actor.name = 'Robin Wright' AND cast.aid = actor.aid AND movie.mid = cast.msid | imdb |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
lan... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360) AND STRFTIME('%y', icustays.intime) = '2105' | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.