instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_72120 (
"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.
-- How many winning drivers in the kraco twin 125 (... | SELECT COUNT("Winning driver") FROM table_72120 WHERE "Name" = 'Kraco Twin 125 (R2)' | wikisql |
CREATE TABLE table_name_24 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Player of herbert s. graver has what position?
| SELECT position FROM table_name_24 WHERE player = "herbert s. graver" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
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.
-- Draw a bar chart for what i... | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job DESC | nvbench |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title te... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 16 AND STRFTIME('%y', transfers.intime) <= '2104') | mimic_iii |
CREATE TABLE table_19589 (
"INEGI code" real,
"Municipality" text,
"Municipal Seat" text,
"Area (km 2 )" text,
"Population (2005)" real,
"Population density (/km 2 )" text,
"Human Development Index (2000)" text
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT "Municipality" FROM table_19589 WHERE "Human Development Index (2000)" = '0.7827' | wikisql |
CREATE TABLE table_name_76 (
winner VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Fedex tour of Calabarzon?
| SELECT winner FROM table_name_76 WHERE name = "fedex tour of calabarzon" | sql_create_context |
CREATE TABLE table_69678 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On July 26, 1977, what competition played at the venue of Kuala Lumpur, resulted in 4-0?
| SELECT "Competition" FROM table_69678 WHERE "Venue" = 'kuala lumpur' AND "Result" = '4-0' AND "Date" = 'july 26, 1977' | wikisql |
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 jybgb.KSBM, jybgb.KSMC 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 = '32152549' AND jybgb.BGRQ BETWEEN '2015-03-23' AND '2021-... | css |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '吕建茗' AND jy... | css |
CREATE TABLE Royal_Family (
Royal_Family_ID INTEGER,
Royal_Family_Details VARCHAR(255)
)
CREATE TABLE Theme_Parks (
Theme_Park_ID INTEGER,
Theme_Park_Details VARCHAR(255)
)
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Tourist_Attractions (
Tourist_Attract... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_96 (
placement VARCHAR,
candidate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Placement when the Candidate is Jean-Patrick Berthiaume?
| SELECT placement FROM table_name_96 WHERE candidate = "jean-patrick berthiaume" | sql_create_context |
CREATE TABLE table_204_16 (
id number,
"name" text,
"place" text,
"map ref" text,
"date" text,
"notes" text,
"image" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many buildings are there total ?
| SELECT COUNT("name") FROM table_204_16 | squall |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'GERMAN' AND COURSE_0.number = 501 AND COURSE_1.course_id = course_prerequisite.course_id | advising |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '21485538' AND t_kc22.t_kc21_MED_SER_ORG_NO = '1900114') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE table_69568 (
"Arena/Venue" text,
"Home Campus" text,
"Location" text,
"Province/Region" text,
"Maximum Seating Capacity" text,
"Year Opened" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum capacity of the San Agu... | SELECT "Maximum Seating Capacity" FROM table_69568 WHERE "Arena/Venue" = 'san agustin gym' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 480 AND NOT instructor.name LIKE '%George Bacon%' AND offering_instructor.instructor_id = instructor.instructor_id AND offer... | advising |
CREATE TABLE table_4890 (
"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.
-- Who faced Collingwood as an away team?
| SELECT "Away team" FROM table_4890 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time > 1300 AND flight.to_airport = AIRPORT_SERVICE_1.airpo... | atis |
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 SUM(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_MED_SER_ORG_NO = '1849548' AND t_kc24.t_kc21_MED_ORG_DEPT_CD = '1081') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-11-11' AND '2020-07-03' | css |
CREATE TABLE table_51592 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA of Leonardo da Vinci-Fiumicino Airport?
| SELECT "IATA" FROM table_51592 WHERE "Airport" = 'leonardo da vinci-fiumicino airport' | wikisql |
CREATE TABLE table_15131 (
"Hindi" text,
"Romani" text,
"Domari" text,
"Lomavren" text,
"Persian" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Persian word has the same meaning as the Domari word na?
| SELECT "Persian" FROM table_15131 WHERE "Domari" = 'na' | wikisql |
CREATE TABLE table_name_22 (
lane VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Rhiannon Leier's lane?
| SELECT lane FROM table_name_22 WHERE name = "rhiannon leier" | sql_create_context |
CREATE TABLE table_61932 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the run 1 of athlete matthias guggenberger, who has a run 2 greater than 55.24?
| SELECT SUM("Run 1") FROM table_61932 WHERE "Run 2" > '55.24' AND "Athlete" = 'matthias guggenberger' | wikisql |
CREATE TABLE table_31611 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gold for silver of 39
| SELECT "Gold" FROM table_31611 WHERE "Silver" = '39' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREA... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 594 | advising |
CREATE TABLE table_name_97 (
nhl_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team of vitali yeremeyev
| SELECT nhl_team FROM table_name_97 WHERE player = "vitali yeremeyev" | sql_create_context |
CREATE TABLE table_24193494_3 (
manufacturer VARCHAR,
order_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the manufacturer for 2011
| SELECT manufacturer FROM table_24193494_3 WHERE order_year = 2011 | sql_create_context |
CREATE TABLE table_61085 (
"Place" real,
"Name" text,
"All Around" real,
"Rope" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Bianka Panova's highest total with lower than place 1?
| SELECT MAX("Total") FROM table_61085 WHERE "Name" = 'bianka panova' AND "Place" < '1' | wikisql |
CREATE TABLE table_name_66 (
to_par INTEGER,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest To Par, when Year(s) Won is '1962 , 1967'?
| SELECT MAX(to_par) FROM table_name_66 WHERE year_s__won = "1962 , 1967" | sql_create_context |
CREATE TABLE table_204_869 (
id number,
"species" text,
"country of origin" text,
"total released" number,
"first release" text,
"last release" text,
"areas of release" text,
"areas established" text,
"pasture type" text
)
-- Using valid SQLite, answer the following questions for t... | SELECT COUNT(DISTINCT "species") FROM table_204_869 WHERE "first release" = 1971 | squall |
CREATE TABLE table_name_36 (
assists VARCHAR,
total_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many assists were there when the total points was 2?
| SELECT assists FROM table_name_36 WHERE total_points = "2" | sql_create_context |
CREATE TABLE table_11165 (
"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.
-- At what venue was richmond the away team?
| SELECT "Venue" FROM table_11165 WHERE "Away team" = 'richmond' | 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 t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8114710' GROUP BY t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_name_10 (
status VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What status has 10 as the population?
| SELECT status FROM table_name_10 WHERE population = 10 | sql_create_context |
CREATE TABLE table_name_84 (
australia VARCHAR,
japan VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the Australia march 17, 2005
| SELECT australia FROM table_name_84 WHERE japan = "march 17, 2005" | sql_create_context |
CREATE TABLE table_204_693 (
id number,
"place" text,
"total" number,
"men" number,
"women" number,
"children" number,
"elderly" number,
"serbs" number,
"jews" number,
"romani" number,
"rusyns" number,
"hungarians" number,
"russians" number
)
-- Using valid SQLite, ... | SELECT "place" FROM table_204_693 WHERE "elderly" = 1 | squall |
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '潘锐泽' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2007-03-13') | css |
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 SOC_SRT_DIRE_NM, AMOUNT, MED_CLINIC_ID FROM t_kc22 WHERE (MED_CLINIC_ID = '98852331777' OR MED_CLINIC_ID = '39740471362') AND SOC_SRT_DIRE_NM IN ((SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '98852331777') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '39740471362')) | css |
CREATE TABLE table_train_9 (
"id" int,
"pregnancy_or_lactation" bool,
"intention_to_arterial_catheter" bool,
"intention_to_central_venous_catheter" bool,
"surgery" bool,
"hypotension" bool,
"chest_trauma" bool,
"burn_injury" int,
"impossible_transthoracic_echocardiogram_tte" bool,
... | SELECT * FROM table_train_9 WHERE intention_to_arterial_catheter = 0 OR intention_to_central_venous_catheter = 0 | criteria2sql |
CREATE TABLE table_14261 (
"Rank" real,
"Heat" real,
"Cyclist" text,
"Nation" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the result when the rank is 12?
| SELECT "Result" FROM table_14261 WHERE "Rank" = '12' | wikisql |
CREATE TABLE table_name_76 (
gdp__billion_us$_ VARCHAR,
area__km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the GDP (billion US$) of the country that has an Area (km ) of 316?
| SELECT gdp__billion_us$_ FROM table_name_76 WHERE area__km²_ = "316" | 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.icd9_code = "78057" AND prescriptions.route = "IH" | mimicsql_data |
CREATE TABLE table_41703 (
"Album title" text,
"Format" text,
"Year" real,
"Original label" text,
"Chart positions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the album that has Popup has the original label?
| SELECT "Album title" FROM table_41703 WHERE "Original label" = 'popup' | 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 t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '70715838' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '986663290') | css |
CREATE TABLE table_43155 (
"Week" real,
"Date" text,
"Time ( PT )" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record has candlestick park as the game site, and october... | SELECT "Record" FROM table_43155 WHERE "Game site" = 'candlestick park' AND "Date" = 'october 12, 2008' | wikisql |
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
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
cha... | SELECT chartevents.charttime 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 = 6921)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | mimic_iii |
CREATE TABLE table_58892 (
"Team" text,
"2006\u201307 Pts" text,
"2007\u201308 Pts" text,
"2008\u201309 Pts" real,
"Total Pts" real,
"Total Pld" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total pld with 57 points in 2006-0... | SELECT MIN("Total Pld") FROM table_58892 WHERE "2006\u201307 Pts" = '57' AND "2008\u201309 Pts" > '39' | wikisql |
CREATE TABLE table_5392 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"Format" text,
"City of License" text,
"Website" text,
"Webcast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which webcast was in Spanish contemporary on xhnoe.com... | SELECT "Webcast" FROM table_5392 WHERE "Format" = 'spanish contemporary' AND "Website" = 'xhnoe.com' | wikisql |
CREATE TABLE table_name_83 (
bronze VARCHAR,
total VARCHAR,
rank VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of bronze medals of West Germany, which is ranked 2 and has less than 1 total medals?
| SELECT COUNT(bronze) FROM table_name_83 WHERE rank = 2 AND nation = "west germany" AND total < 1 | sql_create_context |
CREATE TABLE table_80256 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On May 29 which team had the loss?
| SELECT "Loss" FROM table_80256 WHERE "Date" = 'may 29' | wikisql |
CREATE TABLE table_75624 (
"Team" text,
"Games" real,
"Tries" real,
"Conversions" real,
"Total Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of tries for British and Irish Lions with less than 2 games?
| SELECT AVG("Tries") FROM table_75624 WHERE "Team" = 'british and irish lions' AND "Games" < '2' | wikisql |
CREATE TABLE table_name_41 (
week VARCHAR,
status VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week did the contestant finish in the bottom 2 with a Celine Dion song?
| SELECT week FROM table_name_41 WHERE status = "bottom 2" AND artist = "celine dion" | sql_create_context |
CREATE TABLE table_1342338_3 (
first_elected VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many in lost renomination results were elected first?
| SELECT first_elected FROM table_1342338_3 WHERE result = "Lost renomination" | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "29" AND prescriptions.formulary_drug_cd = "ASA300R" | mimicsql_data |
CREATE TABLE table_72585 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Corrected time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Yacht" FROM table_72585 WHERE "Sail number" = '6952' | wikisql |
CREATE TABLE table_name_50 (
november VARCHAR,
september VARCHAR,
february VARCHAR,
march VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number for November, larger than 8.53 in February, 20.21 in March, and less than 7.9 in Septemb... | SELECT COUNT(november) FROM table_name_50 WHERE february > 8.53 AND march = 20.21 AND september < 7.9 | sql_create_context |
CREATE TABLE table_2679061_8 (
nhl_team VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club is associated with draft number 155?
| SELECT nhl_team FROM table_2679061_8 WHERE pick__number = 155 | sql_create_context |
CREATE TABLE table_60742 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in the September 20, 2010 match?
| SELECT "Opponent" FROM table_60742 WHERE "Date" = 'september 20, 2010' | wikisql |
CREATE TABLE table_79821 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the Sydney that has Adelaide, Gold Coast, Melbourne, and Auckland are... | SELECT "Sydney" FROM table_79821 WHERE "Adelaide" = 'yes' AND "Gold Coast" = 'yes' AND "Melbourne" = 'yes' AND "Auckland" = 'yes' | wikisql |
CREATE TABLE table_51264 (
"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 st kilda was playing at home what was the a... | SELECT "Away team score" FROM table_51264 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_68803 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score in the game in which the Detroit Lions were the home team?
| SELECT "Final Score" FROM table_68803 WHERE "Host Team" = 'detroit lions' | wikisql |
CREATE TABLE table_4440 (
"Name" text,
"Availability" text,
"DMS/D2A Compatible" text,
"D2B Compatible" text,
"D2C Compatible" text,
"D2C2 Compatible" text,
"D2E Compatible" text,
"D3 Compatible" text,
"D3-2 / D4 Compatible" text
)
-- Using valid SQLite, answer the following questi... | SELECT "D3 Compatible" FROM table_4440 WHERE "Availability" = 'yes' AND "Name" = 'wode jukebox' | 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 allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-31704' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... | eicu |
CREATE TABLE table_11532 (
"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 away team score at Brunswick Street... | SELECT "Away team score" FROM table_11532 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_204_718 (
id number,
"date" text,
"opponent" text,
"time" text,
"score" text,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the last opponent ?
| SELECT "opponent" FROM table_204_718 ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_name_91 (
elector VARCHAR,
cardinalatial_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Elector with a Cardinalatial title of Priest of S. Sabina and Archbishop of Reims?
| SELECT elector FROM table_name_91 WHERE cardinalatial_title = "priest of s. sabina and archbishop of reims" | sql_create_context |
CREATE TABLE table_9452 (
"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 Home Team, when Tie No is 4?
| SELECT "Home team" FROM table_9452 WHERE "Tie no" = '4' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_ty... | 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, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8968" AND prescriptions.route = "ORAL" | mimicsql_data |
CREATE TABLE table_13741576_4 (
drawn VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the drawn for llandaff rfc
| SELECT drawn FROM table_13741576_4 WHERE club = "Llandaff RFC" | sql_create_context |
CREATE TABLE table_74233 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times has Sun Jin won the women's doubles?
| SELECT COUNT("Mens Doubles") FROM table_74233 WHERE "Womens Singles" = 'Sun Jin' | wikisql |
CREATE TABLE table_62886 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the number of electorates for constituenc... | SELECT SUM("Number of electorates (2009)") FROM table_62886 WHERE "Constituency number" = '56' | wikisql |
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '曹诗蕾' AND jyb... | css |
CREATE TABLE table_28740 (
"School" text,
"Nickname" text,
"Location" text,
"Colors" text,
"Join Date" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the location for black, orange
| SELECT "Location" FROM table_28740 WHERE "Colors" = 'Black, Orange' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT SUM(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 = '021-213732')) AND intakeoutput.cellpath LIKE '%o... | eicu |
CREATE TABLE table_60458 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following qu... | SELECT "2004" FROM table_60458 WHERE "2010" = 'grand slam tournaments' | wikisql |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
... | SELECT DISTINCT paperdataset.datasetid FROM author, paper, paperdataset, writes WHERE author.authorname = 'jitendra malik' AND paper.paperid = paperdataset.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_name_65 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Fitzroy are the away team, what is the average crowd size?
| SELECT AVG(crowd) FROM table_name_65 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108')) AND intakeoutput.cellpath LIKE '%intake%' AND D... | eicu |
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 qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '59317342' AND qtb.IN_HOSP_DATE BETWEEN '2001-04-05' AND '2004-07-31' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '59317342' AND gyb.IN_HOSP_DATE BETWEEN '2001-04-05' AND '2004-07-31' G... | css |
CREATE TABLE table_51142 (
"2004/ 05" text,
"2007/ 08" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2012/ 13 when the 2011/ 12 is non-ranking?
| SELECT "2012/ 13" FROM table_51142 WHERE "2011/ 12" = 'non-ranking' | wikisql |
CREATE TABLE table_26192 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of regular season for 2007
| SELECT COUNT("Regular Season") FROM table_26192 WHERE "Year" = '2007' | wikisql |
CREATE TABLE table_14760 (
"Series" text,
"Name" text,
"Hometown" text,
"Occupation" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the occupation of the person with a hometown of Hampshire?
| SELECT "Occupation" FROM table_14760 WHERE "Hometown" = 'hampshire' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '18437410268' AND NOT SOC_SRT_DIRE_NM LIKE '%缓释%' | css |
CREATE TABLE table_78035 (
"Source" text,
"Date" text,
"Cardwell" text,
"Jones" text,
"Knight" text,
"Lanier" text,
"Martin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What martin has a lanier of 6%?
| SELECT "Martin" FROM table_78035 WHERE "Lanier" = '6%' | wikisql |
CREATE TABLE table_18313 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the Georgia 6 district, what is the elected party?
| SELECT "Party" FROM table_18313 WHERE "District" = 'Georgia 6' | wikisql |
CREATE TABLE table_20118 (
"Pos." real,
"Driver" text,
"Qualifying" real,
"Race 1" text,
"Race 2" text,
"Race 3" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of positions for race 1 being 2
| SELECT COUNT("Pos.") FROM table_20118 WHERE "Race 1" = '2' | wikisql |
CREATE TABLE table_2296507_1 (
system VARCHAR,
constellation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the system for aries
| SELECT system FROM table_2296507_1 WHERE constellation = "Aries" | sql_create_context |
CREATE TABLE table_name_8 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed for the 2011 that has a 2005 of 4.2%?
| SELECT 2011 FROM table_name_8 WHERE 2005 = "4.2%" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "15" AND prescriptions.drug = "Meropenem" | mimicsql_data |
CREATE TABLE table_15873547_1 (
colors VARCHAR,
residence_hall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the colors of Howard Hall?
| SELECT colors FROM table_15873547_1 WHERE residence_hall = "Howard Hall" | sql_create_context |
CREATE TABLE table_name_96 (
score VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Location of richfield coliseum?
| SELECT score FROM table_name_96 WHERE location = "richfield coliseum" | sql_create_context |
CREATE TABLE table_name_93 (
singapore_gross VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the Singapore Gross for the film that Siu Wing directed?
| SELECT singapore_gross FROM table_name_93 WHERE director = "siu wing" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id num... | SELECT UserId AS "user_link", COUNT(*) FROM Badges WHERE Class = 1 GROUP BY UserId ORDER BY COUNT(*) DESC LIMIT 100 | sede |
CREATE TABLE table_name_40 (
award VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Award has a Category of music video acting award?
| SELECT award FROM table_name_40 WHERE category = "music video acting award" | sql_create_context |
CREATE TABLE table_name_48 (
date VARCHAR,
scorers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the scorer mccoist (3), johnston, butcher, steven?
| SELECT date FROM table_name_48 WHERE scorers = "mccoist (3), johnston, butcher, steven" | sql_create_context |
CREATE TABLE table_51506 (
"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 day did St Kilda play as the away team?
| SELECT "Date" FROM table_51506 WHERE "Away team" = 'st kilda' | wikisql |
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2686792' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.