instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT MIN(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 = '007-1517') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_53354 (
"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:38 long?
| SELECT "Title" FROM table_53354 WHERE "Length" = '3:38' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
... | SELECT * FROM Users ORDER BY Reputation DESC LIMIT 10000 | sede |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id n... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(labevents.chartti... | mimic_iii |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM 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,
X... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '8515930' AND zyjzjlb.RYDJSJ BETWEEN '2005-08-01' AND '2021-01-03' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 30 | css |
CREATE TABLE table_19958 (
"Episode No." text,
"Episode Title" text,
"UK Broadcast Date" text,
"Presenter" text,
"Details of Journey" text,
"Countries Visited" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode title for the epis... | SELECT "Episode Title" FROM table_19958 WHERE "Episode No." = '#1.4' | wikisql |
CREATE TABLE table_33639 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school did the guard who began playing in 1991 come from?
| SELECT "School/Country" FROM table_33639 WHERE "Position" = 'guard' AND "From" = '1991' | wikisql |
CREATE TABLE table_name_24 (
gold_coast VARCHAR,
melbourne VARCHAR,
auckland VARCHAR,
adelaide VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Gold Coast has Auckland no, Adelaide yes, and Melbourne no?
| SELECT gold_coast FROM table_name_24 WHERE auckland = "no" AND adelaide = "yes" AND melbourne = "no" | sql_create_context |
CREATE TABLE ref_characteristic_types (
characteristic_type_code text,
characteristic_type_description text
)
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
... | SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000 | spider |
CREATE TABLE table_16148 (
"Rd" real,
"Name" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Johnny Rutherford's fastest lap while A... | SELECT "Fastest Lap" FROM table_16148 WHERE "Winning driver" = 'Johnny Rutherford' AND "Pole Position" = 'Al Unser' | wikisql |
CREATE TABLE table_204_860 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the first venue in calender year 2012 ?
| SELECT "venue" FROM table_204_860 WHERE "date" = 2012 ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_35597 (
"Length of game" text,
"Date" text,
"Away team" text,
"Score" text,
"Home team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game that lasted 75:43?
| SELECT "Date" FROM table_35597 WHERE "Length of game" = '75:43' | wikisql |
CREATE TABLE table_32297 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the time was 1:47?
| SELECT "Opponent" FROM table_32297 WHERE "Time" = '1:47' | wikisql |
CREATE TABLE table_name_28 (
visitor VARCHAR,
leading_scorer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Visitor with a Leading scorer with rudy gay (24)?
| SELECT visitor FROM table_name_28 WHERE leading_scorer = "rudy gay (24)" | sql_create_context |
CREATE TABLE table_74159 (
"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.
-- Who ha... | SELECT "High rebounds" FROM table_74159 WHERE "Date" = 'April 1' | wikisql |
CREATE TABLE table_58656 (
"Matches" real,
"Wins" real,
"Draw" real,
"Losses" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total losses were with less than 51 draws but more than 6 wins?
| SELECT COUNT("Losses") FROM table_58656 WHERE "Draw" < '51' AND "Wins" > '6' | 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 demographic.expire_flag FROM demographic WHERE demographic.subject_id = "83678" | mimicsql_data |
CREATE TABLE table_203_718 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which rider is listed in the position after loris capirossi ?
| SELECT "rider" FROM table_203_718 WHERE "pos" = (SELECT "pos" FROM table_203_718 WHERE "rider" = 'loris capirossi') + 1 | squall |
CREATE TABLE table_6886 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total number of Top-25 values, for which Cuts made w... | SELECT COUNT("Top-25") FROM table_6886 WHERE "Cuts made" = '62' AND "Wins" < '1' | wikisql |
CREATE TABLE table_67992 (
"Year" text,
"Date Final" text,
"Venue" text,
"Prize Money" text,
"Champion" text,
"Runner-up" text,
"Score in final" text,
"Commercial name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date final has 1... | SELECT "Date Final" FROM table_67992 WHERE "Year" = '1982' | wikisql |
CREATE TABLE table_name_79 (
station VARCHAR,
country_of_origin VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which station is from China and has a frequency of 684khz?
| SELECT station FROM table_name_79 WHERE country_of_origin = "china" AND frequency = "684khz" | sql_create_context |
CREATE TABLE table_22248 (
"Name" text,
"Notability" text,
"Reason for Seeking Refuge" text,
"Country" text,
"City" text,
"Missions Country" text,
"Start Date" text,
"End Date" text,
"Resolution" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT COUNT("Missions Country") FROM table_22248 WHERE "Notability" = 'President of Burundi' | wikisql |
CREATE TABLE table_73207 (
"Season" text,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team did ... | SELECT "Team" FROM table_73207 WHERE "Series" = 'GP3 Series' | wikisql |
CREATE TABLE table_25395 (
"Team" text,
"SEC Wins" real,
"SEC Losses" real,
"Percentage" text,
"Home Record" text,
"Road Record" text,
"Overall Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the percentage for ole miss
| SELECT "Percentage" FROM table_25395 WHERE "Team" = 'Ole Miss' | wikisql |
CREATE TABLE table_71549 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did finish 1st in LMP1 class?
| SELECT AVG("Year") FROM table_71549 WHERE "Class" = 'lmp1' AND "Class Pos." = '1st' | wikisql |
CREATE TABLE debate (
Venue VARCHAR,
Num_of_Audience VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the venues of debates in ascending order of the number of audience.
| SELECT Venue FROM debate ORDER BY Num_of_Audience | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Chronic total occlusion of coronary artery" AND prescriptions.drug = "Ondansetron" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-8398' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS NULL G... | eicu |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
... | 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 = 'NEWARK' AND CITY_2.cit... | atis |
CREATE TABLE table_name_54 (
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the cowboys play when 65,537 attended?
| SELECT opponent FROM table_name_54 WHERE attendance = "65,537" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | SELECT a.Id AS link, q.Title AS title, q.Tags AS tags, a.Score AS score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.CommunityOwnedDate IS NULL AND a.OwnerDisplayName = '##UserName##' AND a.OwnerUserId IS NULL ORDER BY a.Score DESC | sede |
CREATE TABLE table_67611 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club... | SELECT "Club" FROM table_67611 WHERE "Try bonus" = '2' | wikisql |
CREATE TABLE table_name_19 (
match VARCHAR,
competition VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Match played in a Location of San Francisco has a Competition of Semifinal?
| SELECT match FROM table_name_19 WHERE competition = "semifinal" AND location = "san francisco" | sql_create_context |
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
... | SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality ORDER BY COUNT(*) | nvbench |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistoryTypes (
Id number,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%chennai%india%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND treatment.treatmen... | eicu |
CREATE TABLE table_2562572_25 (
largest_ethnic_group__2002_ VARCHAR,
cyrillic_name_other_names VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the cyrillic name other names what is the largest ethnic group of 2002?
| SELECT largest_ethnic_group__2002_ FROM table_2562572_25 WHERE cyrillic_name_other_names = "Дероње" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '药剂科' AND t_kc22.STA_DATE BETWEEN '2012-04-08' AND '2012-05-24' AND t_kc22.SOC_SRT_DIRE_CD = '3174-i' | css |
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT... | atis |
CREATE TABLE table_name_97 (
points VARCHAR,
engine VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1962, what was the total number of points, when the Engine was Ferrari v6?
| SELECT COUNT(points) FROM table_name_97 WHERE engine = "ferrari v6" AND year = 1962 | sql_create_context |
CREATE TABLE table_name_43 (
owner VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the owner of the Raglan Road winner?
| SELECT owner FROM table_name_43 WHERE winner = "raglan road" | sql_create_context |
CREATE TABLE table_45127 (
"Player" text,
"Wkts" real,
"Runs" real,
"Econ" real,
"Ovrs" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the runs when the wkts were bigger than 0 and ovrs were smaller than 2?
| SELECT SUM("Runs") FROM table_45127 WHERE "Ovrs" < '2' AND "Wkts" > '0' | 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.PER_ACC_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 '2018-09-12' AND '2019-07-01' | css |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '965' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-12-24' AND '2011-06-04' AND gwyjzb.IN_DIAG_DIS_CD = 'U57.745' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '965' AND fgwyjzb.IN_HOSP_DATE ... | css |
CREATE TABLE table_204_481 (
id number,
"poll source" text,
"date(s)\nadministered" text,
"sample\nsize" number,
"margin of\nerror" text,
"andrew\ncuomo (d)" text,
"rob\nastorino (r)" text,
"other" text,
"undecided" text
)
-- Using valid SQLite, answer the following questions for t... | SELECT (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'siena') > (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'quinnipiac') | squall |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT mzjzjlb.JZZTDM, mzjzjlb.JZZTMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '80538748012' | css |
CREATE TABLE table_203_618 (
id number,
"pick" number,
"player" text,
"team" text,
"position" text,
"school" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is listed after pat burrell ?
| SELECT "player" FROM table_203_618 WHERE id = (SELECT id FROM table_203_618 WHERE "player" = 'pat burrell') + 1 | squall |
CREATE TABLE table_name_55 (
driver VARCHAR,
laps VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drove during the race with less than 19 laps and a time listed as ignition?
| SELECT driver FROM table_name_55 WHERE laps < 19 AND time_retired = "ignition" | sql_create_context |
CREATE TABLE table_name_23 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team 1 where Team 2 is gombe united f.c.?
| SELECT team_1 FROM table_name_23 WHERE team_2 = "gombe united f.c." | sql_create_context |
CREATE TABLE table_79968 (
"Season" text,
"Tier" real,
"League" text,
"Turkish Cup" text,
"European Competitions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tier of 2, and a Season of 2000 01 is what European competitions?
| SELECT "European Competitions" FROM table_79968 WHERE "Tier" = '2' AND "Season" = '2000–01' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | (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 = '17320230' AND jybgb.BGRQ BETWEEN '2013-09-23' AND '2019-11-29') UNI... | css |
CREATE TABLE table_56851 (
"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 was the date of the match where the home te... | SELECT "Date" FROM table_56851 WHERE "Home team score" = '14.13 (97)' | wikisql |
CREATE TABLE table_name_20 (
b_score INTEGER,
gymnast VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average b score when the gymnast is k hei uchimura ( jpn )?
| SELECT AVG(b_score) FROM table_name_20 WHERE gymnast = "kōhei uchimura ( jpn )" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_name_82 (
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the competition for november 19, 2008
| SELECT competition FROM table_name_82 WHERE date = "november 19, 2008" | sql_create_context |
CREATE TABLE table_75855 (
"Player" text,
"Tackles" real,
"Solo" real,
"Assts" real,
"Sacks" real,
"Int yards" real,
"Int avg." real,
"Int TD" real,
"Fum. rec" real,
"Fum. rec TD" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT SUM("Int yards") FROM table_75855 WHERE "Assts" > '3' AND "Player" = 'jay alford' | wikisql |
CREATE TABLE table_name_34 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game on February 3, 2008?
| SELECT SUM(attendance) FROM table_name_34 WHERE date = "february 3, 2008" | 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 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.gender = "M" AND demographic.age < "24" | mimicsql_data |
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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2178" | mimicsql_data |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
)
-- Using valid SQLite, answer the following questio... | SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM entrepreneur) | spider |
CREATE TABLE table_42121 (
"City" text,
"State" text,
"AAM Accredited" text,
"AAM Member" text,
"ASTC Member" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is City, when State is Florida, when AAM Member is No, and when AAM Accredited is No?
| SELECT "City" FROM table_42121 WHERE "State" = 'florida' AND "AAM Member" = 'no' AND "AAM Accredited" = 'no' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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,
... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '45512719' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_22334183_3 (
date VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the circuit Donington Park?
| SELECT date FROM table_22334183_3 WHERE circuit = "Donington Park" | sql_create_context |
CREATE TABLE table_21636599_2 (
civilians VARCHAR,
security_forces VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the civilian total when the security force total is 36?
| SELECT civilians FROM table_21636599_2 WHERE security_forces = "36" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.drug = "Psyllium" | mimicsql_data |
CREATE TABLE table_15502 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original name" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the original name for last days of the victim
| SELECT "Original name" FROM table_15502 WHERE "Film title used in nomination" = 'last days of the victim' | wikisql |
CREATE TABLE table_name_94 (
week INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest week number where they played against the Detroit Lions?
| SELECT MIN(week) FROM table_name_94 WHERE opponent = "detroit lions" | sql_create_context |
CREATE TABLE table_4398 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of time for heat rank of 1
| SELECT COUNT("Time") FROM table_4398 WHERE "Heat Rank" = '1' | wikisql |
CREATE TABLE table_41469 (
"Country" text,
"Population" real,
"GDP 2011 (In Millions USD)" real,
"GDP 2012 (In Millions USD)" real,
"per capita" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population on average with a per capita of 1,... | SELECT AVG("Population") FROM table_41469 WHERE "per capita" = '1,158' AND "GDP 2011 (In Millions USD)" < '6,199' | wikisql |
CREATE TABLE table_58392 (
"AVE- No." real,
"Name" text,
"Country" text,
"Highest mountain" text,
"Height (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Height (m) has a Name of plessur alps, and a AVE-No larger than 63?
| SELECT MIN("Height (m)") FROM table_58392 WHERE "Name" = 'plessur alps' AND "AVE- No." > '63' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 271... | mimic_iii |
CREATE TABLE table_16432543_3 (
enrollment INTEGER,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the enrollment for the Cavaliers?
| SELECT MAX(enrollment) FROM table_16432543_3 WHERE nickname = "Cavaliers" | sql_create_context |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.Y... | css |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return a bar chart on how o... | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job | nvbench |
CREATE TABLE table_33871 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the weeks during which the Redskins played against the Houston Oilers and had more th... | SELECT SUM("Week") FROM table_33871 WHERE "Opponent" = 'houston oilers' AND "Attendance" > '54,582' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '015-23047' AND patient.wardid = 608 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_44643 (
"Election" real,
"Number of PNC votes" text,
"Share of votes" text,
"Seats" text,
"Outcome of election" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seats does the election with the outcome of election of minori... | SELECT "Seats" FROM table_44643 WHERE "Outcome of election" = 'minority in parliament' AND "Number of PNC votes" = '186,226' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'pantoprazole 40 mg iv recon soln' AND patient.uniquepid = '033-42758' AND STRFTIME('%y-%m', medication.drugstarttime) = '... | eicu |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id numbe... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admission... | mimic_iii |
CREATE TABLE table_name_23 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team's score when south melbourne is away?
| SELECT home_team AS score FROM table_name_23 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE table_37207 (
"Season" real,
"Winner" text,
"Finalist" text,
"Score" text,
"Host City" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the finalist in the 2010 season in the host city tartu?
| SELECT "Finalist" FROM table_37207 WHERE "Host City" = 'tartu' AND "Season" = '2010' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.short_title = "Closed liver biopsy" | mimicsql_data |
CREATE TABLE table_name_24 (
host_city VARCHAR,
venue VARCHAR,
theme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the host city of the Singapore Indoor Stadium venue and a Valentine's Day theme?
| SELECT host_city FROM table_name_24 WHERE venue = "singapore indoor stadium" AND theme = "valentine's day" | sql_create_context |
CREATE TABLE table_35095 (
"Date" text,
"Result" text,
"Score" text,
"Venue" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Competition of friendly, and a Date of 03-jun-62 had what score?
| SELECT "Score" FROM table_35095 WHERE "Competition" = 'friendly' AND "Date" = '03-jun-62' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id 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_required varchar
)
CREA... | 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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AN... | atis |
CREATE TABLE table_204_291 (
id number,
"rank" number,
"name" text,
"nation" text,
"cp" number,
"fp" number,
"points" number,
"placings" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which woman finished last in the 1971 world figured... | SELECT "name" FROM table_204_291 ORDER BY "rank" DESC LIMIT 1 | squall |
CREATE TABLE table_name_9 (
crowd VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance at Corio Oval?
| SELECT crowd FROM table_name_9 WHERE venue = "corio oval" | sql_create_context |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
... | 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 CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) | nvbench |
CREATE TABLE table_30768 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Station Type" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many locations have the callsign DXGH?
| SELECT COUNT("Location") FROM table_30768 WHERE "Callsign" = 'DXGH' | wikisql |
CREATE TABLE table_name_8 (
record VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record was reached with a score of 7 - 2?
| SELECT record FROM table_name_8 WHERE score = "7 - 2" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '95310593145' | css |
CREATE TABLE table_55491 (
"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 was the smallest crowd at a home game for e... | SELECT MIN("Crowd") FROM table_55491 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE table_74861 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many top 10s when he had under 1 top 5s?
| SELECT SUM("Top-10") FROM table_74861 WHERE "Top-5" < '1' | wikisql |
CREATE TABLE table_name_18 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a Date of january 31?
| SELECT record FROM table_name_18 WHERE date = "january 31" | sql_create_context |
CREATE TABLE table_203_653 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won the largest amount of bronze medals ?
| SELECT "nation" FROM table_203_653 ORDER BY "bronze" DESC LIMIT 1 | squall |
CREATE TABLE table_65288 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Gold has a Nation of mongolia, and a Total larger than 18?
| SELECT SUM("Gold") FROM table_65288 WHERE "Nation" = 'mongolia' AND "Total" > '18' | wikisql |
CREATE TABLE table_63813 (
"Title" text,
"Author" text,
"First Issue" text,
"Last Issue" text,
"Completed?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Author of the Title with an Ongoing Last Issue?
| SELECT "Author" FROM table_63813 WHERE "Last Issue" = 'ongoing' | wikisql |
CREATE TABLE table_name_73 (
year_left INTEGER,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the first year when Fowler joined?
| SELECT MIN(year_left) FROM table_name_73 WHERE location = "fowler" | sql_create_context |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.