instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'prone position' AND STRFTIME('%y', treat... | eicu |
CREATE TABLE table_name_4 (
year INTEGER,
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Year, when Rank is less than 19?
| SELECT SUM(year) FROM table_name_4 WHERE rank < 19 | sql_create_context |
CREATE TABLE table_11111116_6 (
no_in_series INTEGER,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode in the series drew 3.6 million U.S. viewers?
| SELECT MIN(no_in_series) FROM table_11111116_6 WHERE us_viewers__million_ = "3.6" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_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 = 'iatrogenc hypotnsion nec')) | mimic_iii |
CREATE TABLE table_55430 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for the game with an attendance of 35,305?
| SELECT "Record" FROM table_55430 WHERE "Attendance" = '35,305' | wikisql |
CREATE TABLE table_55865 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was ... | SELECT "Deleted" FROM table_55865 WHERE "Listed" = '09/21/1984' AND "Name" = 'stauffer chemical company (lemoyne plant)' | wikisql |
CREATE TABLE table_55752 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For Jo Siffert, what was the highest grid with the number of laps above 12?
| SELECT MAX("Grid") FROM table_55752 WHERE "Driver" = 'jo siffert' AND "Laps" > '12' | wikisql |
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 aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT LA... | atis |
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 COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_in... | css |
CREATE TABLE table_204_455 (
id number,
"rd." number,
"grand prix" text,
"date" text,
"location" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"constructor" text,
"report" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT COUNT(*) FROM table_204_455 WHERE "rd." < (SELECT "rd." FROM table_204_455 WHERE "pole position" = 'alain prost' ORDER BY "rd." LIMIT 1) | squall |
CREATE TABLE table_2527063_3 (
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least rank
| SELECT MIN(rank) FROM table_2527063_3 | sql_create_context |
CREATE TABLE table_26561 (
"DVD Name" text,
"Ep #" text,
"Region 1 (US)" text,
"Region 1 (CAN)" text,
"Region 2 (UK)" text,
"Region 2 (Germany)" text,
"Region 4 (Australia)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many region 4 da... | SELECT COUNT("Region 4 (Australia)") FROM table_26561 WHERE "Region 2 (UK)" = 'July 9, 2007' | wikisql |
CREATE TABLE table_name_69 (
game VARCHAR,
opponent VARCHAR,
january VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of games of the team against the Los Angeles Kings after January 5?
| SELECT COUNT(game) FROM table_name_69 WHERE opponent = "los angeles kings" AND january > 5 | sql_create_context |
CREATE TABLE table_name_30 (
diameter__km_ VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the diameter of kaiwan fluctus?
| SELECT diameter__km_ FROM table_name_30 WHERE name = "kaiwan fluctus" | sql_create_context |
CREATE TABLE table_204_775 (
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.
-- which country came in first with 7 gold medals ?
| SELECT "nation" FROM table_204_775 WHERE "gold" = 7 | squall |
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.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in... | css |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
hadm_id number,
admittime time,
... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'efavirenz') | mimic_iii |
CREATE TABLE table_204_111 (
id number,
"name" text,
"animal type" text,
"introduced" number,
"reintroduced" text,
"retired" number,
"beanie baby resembled" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the last pillow p... | SELECT "name" FROM table_204_111 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_78527 (
"Superlative" text,
"Actor" text,
"Record Set" text,
"Year" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the notes in 1981?
| SELECT "Notes" FROM table_78527 WHERE "Year" = '1981' | wikisql |
CREATE TABLE table_26354 (
"Team" text,
"Location" text,
"Home Ground" text,
"First year in Qld Cup" real,
"Last year in Qld Cup" real,
"Qld Cup Premierships" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every entry in the QLD Cup Prem... | SELECT "Qld Cup Premierships" FROM table_26354 WHERE "Home Ground" = 'Dairy Farmers Stadium' | wikisql |
CREATE TABLE table_name_41 (
oklahoma VARCHAR,
nebraska VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the oklahoma has Bush from Nebraska in year 2004?
| SELECT oklahoma FROM table_name_41 WHERE nebraska = "bush" AND year = "2004" | sql_create_context |
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real... | SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id | nvbench |
CREATE TABLE table_35294 (
"Round" real,
"Player" text,
"Nationality" text,
"NHL team" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which NHL team has a College/Junior/Club Team (League) of shattuck-saint ... | SELECT "NHL team" FROM table_35294 WHERE "College/Junior/Club Team (League)" = 'shattuck-saint mary''s school (midget major aaa)' | wikisql |
CREATE TABLE table_39972 (
"Year" real,
"Venue" text,
"Winner" text,
"Country" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Country of england, and a Year larger than 1971?
| SELECT "Score" FROM table_39972 WHERE "Country" = 'england' AND "Year" > '1971' | wikisql |
CREATE TABLE table_45782 (
"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 Tie number for the match that had away team of Scunthorpe & Lindsey United?
| SELECT "Tie no" FROM table_45782 WHERE "Away team" = 'scunthorpe & lindsey united' | wikisql |
CREATE TABLE table_36172 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record at the game on November 13, 1932?
| SELECT "Record" FROM table_36172 WHERE "Date" = 'november 13, 1932' | wikisql |
CREATE TABLE table_2509113_2 (
quillacollo_municipality INTEGER,
vinto_municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the Vinto Municipality is 18630, what is the Quillacollo Municipality?
| SELECT MAX(quillacollo_municipality) FROM table_2509113_2 WHERE vinto_municipality = 18630 | sql_create_context |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | SELECT Number_of_matches, COUNT(Number_of_matches) FROM injury_accident WHERE Injury <> 'Knee problem' GROUP BY Number_of_matches ORDER BY COUNT(Number_of_matches) DESC | nvbench |
CREATE TABLE table_name_73 (
sydney VARCHAR,
auckland VARCHAR,
perth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Sydney has Auckland cancelled and Perth yes?
| SELECT sydney FROM table_name_73 WHERE auckland = "cancelled" AND perth = "yes" | sql_create_context |
CREATE TABLE table_name_53 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is south melbourne's home side score?
| SELECT home_team AS score FROM table_name_53 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE table_name_82 (
mountain_range VARCHAR,
region VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Mountain Range has a Region of haiti, and a Location of 18.3601 n 71.9764 w?
| SELECT mountain_range FROM table_name_82 WHERE region = "haiti" AND location = "18.3601°n 71.9764°w" | sql_create_context |
CREATE TABLE table_name_46 (
attendance INTEGER,
home VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance of the Florida vs. Montreal game?
| SELECT AVG(attendance) FROM table_name_46 WHERE home = "florida" AND visitor = "montreal" | sql_create_context |
CREATE TABLE table_37899 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is First elected that has republican Party and a Result of retired democratic gain?
| SELECT "First elected" FROM table_37899 WHERE "Party" = 'republican' AND "Result" = 'retired democratic gain' | wikisql |
CREATE TABLE table_name_71 (
diameter__km_ VARCHAR,
longitude VARCHAR,
latitude VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What in Xenia's Diameter in km, with a latitude of 14 and a longitude of 249.4?
| SELECT COUNT(diameter__km_) FROM table_name_71 WHERE latitude < 14 AND name = "xenia" AND longitude > 249.4 | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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 t... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_41370 (
"Party" text,
"Marplan" text,
"Gallup" text,
"National Opinion Polls (NOP)" text,
"Opinion Research Centre (OPC)" text,
"Harris" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opinion Research Centre (OPC), whe... | SELECT "Opinion Research Centre (OPC)" FROM table_41370 WHERE "Party" = 'conservative' | wikisql |
CREATE TABLE table_name_11 (
legs_lost VARCHAR,
player VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many legs were lost for Trina Gulliver with more than 3 played?
| SELECT COUNT(legs_lost) FROM table_name_11 WHERE player = "trina gulliver" AND played > 3 | sql_create_context |
CREATE TABLE table_2226817_9 (
production_code VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code of the episode directed by Stacie Lipp?
| SELECT production_code FROM table_2226817_9 WHERE written_by = "Stacie Lipp" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... | advising |
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.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2200" | mimicsql_data |
CREATE TABLE table_73445 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the market income per capita of the coun... | SELECT "Market Income Per Capita" FROM table_73445 WHERE "Poverty Rate" = '9.4%' | wikisql |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb... | css |
CREATE TABLE table_36442 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what City was Bulgaria the Opponent with Results of 1:0?
| SELECT "City" FROM table_36442 WHERE "Results\u00b9" = '1:0' AND "Opponent" = 'bulgaria' | wikisql |
CREATE TABLE table_204_64 (
id number,
"place" text,
"code" number,
"area (km2)" number,
"population" number,
"most spoken language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- is the population of brandfort the same as the population of boip... | SELECT (SELECT "population" FROM table_204_64 WHERE "place" = 'brandfort') = (SELECT "population" FROM table_204_64 WHERE "place" = 'boipatong') | squall |
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar ch... | SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY COUNT(Publication_Date) DESC | nvbench |
CREATE TABLE table_name_88 (
rank INTEGER,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rank for athlete hauffe, seifert, kaeufer, adamski?
| SELECT SUM(rank) FROM table_name_88 WHERE athlete = "hauffe, seifert, kaeufer, adamski" | sql_create_context |
CREATE TABLE table_49709 (
"Exit Date" text,
"Pos." text,
"Player" text,
"To club" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Teerasil Dangda who had a to club of released plays what position?
| SELECT "Pos." FROM table_49709 WHERE "To club" = 'released' AND "Player" = 'teerasil dangda' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '01420537' AND t_kc21.MED_SER_ORG_NO = '2864800' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%脑瘫%' | css |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '72157551077' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ... | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacterials - linezolid (zyvox)' AND ... | eicu |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime ... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') ORDER BY labevents.... | mimic_iii |
CREATE TABLE table_51240 (
"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.
-- On the... | SELECT COUNT("Game") FROM table_51240 WHERE "Date" = 'april 11' | wikisql |
CREATE TABLE table_53461 (
"Area in m\u00b2" text,
"Completion" text,
"City" text,
"Country" text,
"Denomination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country with area of 3,170 in m ?
| SELECT "Country" FROM table_53461 WHERE "Area in m\u00b2" = '3,170' | wikisql |
CREATE TABLE table_24989 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Team" FROM table_24989 WHERE "Average Speed (mph)" = '107.063' | wikisql |
CREATE TABLE table_name_27 (
goal INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of goals for a game held at Hannover?
| SELECT MAX(goal) FROM table_name_27 WHERE venue = "hannover" | sql_create_context |
CREATE TABLE table_78860 (
"Week" real,
"Event" text,
"Air Date" text,
"Winning team" text,
"Winners club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has an Air Date of august 2, 2008?
| SELECT "Week" FROM table_78860 WHERE "Air Date" = 'august 2, 2008' | wikisql |
CREATE TABLE table_name_90 (
position VARCHAR,
mls_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position is the MLS team, Los Angeles Galaxy in?
| SELECT position FROM table_name_90 WHERE mls_team = "los angeles galaxy" | sql_create_context |
CREATE TABLE table_29773 (
"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 i... | SELECT MAX("Game") FROM table_29773 | wikisql |
CREATE TABLE table_name_40 (
total_goals VARCHAR,
fa_cup_goals VARCHAR,
total_apps VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the total apps 1 and the fa cup goals less than 0 for bob mountain?
| SELECT COUNT(total_goals) FROM table_name_40 WHERE total_apps = "1" AND name = "bob mountain" AND fa_cup_goals < 0 | sql_create_context |
CREATE TABLE table_name_41 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the opponent on 03/18/08?
| SELECT opponent FROM table_name_41 WHERE date = "03/18/08" | sql_create_context |
CREATE TABLE table_name_69 (
gloss VARCHAR,
pronunciation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gloss for [ d m]
| SELECT gloss FROM table_name_69 WHERE pronunciation = "[χdəm]" | sql_create_context |
CREATE TABLE table_73754 (
"Season" real,
"Winner" text,
"Runner-Up" text,
"Third Place" text,
"Contestants" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many contestants were there when the runner-up was S rgio Abreu?
| SELECT MAX("Contestants") FROM table_73754 WHERE "Runner-Up" = 'Sérgio Abreu' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | 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 = '006-70268')) AND intakeoutput.celllabel = 'lr iv... | eicu |
CREATE TABLE diagnoses (
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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2129" AND lab.itemid = "50993" | mimicsql_data |
CREATE TABLE table_203_60 (
id number,
"outcome" text,
"no." number,
"date" text,
"championship" text,
"surface" text,
"opponent in the final" text,
"score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what were the total ... | SELECT COUNT(*) FROM table_203_60 WHERE "championship" = 'italy' | squall |
CREATE TABLE table_train_165 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"visual_impairment" bool,
"blood_glucose" int,
"body_mass_index_bmi" float,
"a1c" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT * FROM table_train_165 WHERE (gender = 'male' OR gender = 'female') AND age > 60 | criteria2sql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '46058434' AND t_kc21.IN_HOSP_DATE BETWEEN '2013-02-11' AND '2014-03-22' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "10" | mimicsql_data |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AN... | eicu |
CREATE TABLE table_16777 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the report for the Silverstone circuit?
| SELECT "Report" FROM table_16777 WHERE "Circuit" = 'Silverstone' | wikisql |
CREATE TABLE table_name_42 (
college VARCHAR,
round VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which College has a Round of 11, and a Position of wr?
| SELECT college FROM table_name_42 WHERE round = 11 AND position = "wr" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID) | nvbench |
CREATE TABLE table_3846 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How man... | SELECT COUNT("Team") FROM table_3846 WHERE "High rebounds" = 'Chris Bosh , LeBron James (8)' | wikisql |
CREATE TABLE table_65370 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Position of 2nd, and Notes of -63kg, and a Venue of manchester?
| SELECT "Year" FROM table_65370 WHERE "Position" = '2nd' AND "Notes" = '-63kg' AND "Venue" = 'manchester' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Hyperacusis" | mimicsql_data |
CREATE TABLE table_204_70 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many defensive backs are there ?
| SELECT COUNT(*) FROM table_204_70 WHERE "position" = 'defensive back' | squall |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 ORDER BY JOB_TITLE | nvbench |
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 d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 70516 AND STRFTIME('%y', admissions.admittime) >= '2104' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9146406' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '91464... | css |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_5126 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the Mosport Park circuit?
| SELECT "Date" FROM table_5126 WHERE "Circuit" = 'mosport park' | wikisql |
CREATE TABLE table_25345002_1 (
date_of_death VARCHAR,
date_of_birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the dates of death of those politicians whose date of birth 1938-08-30 30 august 1938?
| SELECT COUNT(date_of_death) FROM table_25345002_1 WHERE date_of_birth = "1938-08-30 30 August 1938" | sql_create_context |
CREATE TABLE table_11803648_20 (
player VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is in round 5?
| SELECT player FROM table_11803648_20 WHERE round = 5 | sql_create_context |
CREATE TABLE table_name_98 (
royal_house VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which royal house is in the state of chu?
| SELECT royal_house FROM table_name_98 WHERE state = "chu" | sql_create_context |
CREATE TABLE table_24018112_1 (
frequency VARCHAR,
brand_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What frequency does the Pentium processor use?
| SELECT frequency FROM table_24018112_1 WHERE brand_name = "Pentium" | sql_create_context |
CREATE TABLE table_name_94 (
score VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On 15/04/07 in the competition Super League XII, what was the score?
| SELECT score FROM table_name_94 WHERE competition = "super league xii" AND date = "15/04/07" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14203) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE table_59583 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team of the game with a 2-0 record?
| SELECT "Home" FROM table_59583 WHERE "Record" = '2-0' | wikisql |
CREATE TABLE table_40136 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Socialist Labor ticket" text,
"Prohibition ticket" text,
"Independent Citizens' ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Re... | SELECT "Republican ticket" FROM table_40136 WHERE "Prohibition ticket" = 'stephen mead wing' | wikisql |
CREATE TABLE table_203_654 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT("team") FROM table_203_654 WHERE "points" > (SELECT "points" FROM table_203_654 WHERE "team" = 'silex') | squall |
CREATE TABLE table_18602462_21 (
quarterfinals VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When bas van erp was the athlete what was the quarterfinals?
| SELECT quarterfinals FROM table_18602462_21 WHERE athlete = "Bas van Erp" | sql_create_context |
CREATE TABLE table_34071 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the leading scorer of the game with an attendance of... | SELECT "Leading scorer" FROM table_34071 WHERE "Attendance" = '14,096' | wikisql |
CREATE TABLE table_59061 (
"Place" text,
"Competitor" text,
"Downhill points" real,
"Slalom points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the total points for the skier with 3.18 slalom points?
| SELECT "Total" FROM table_59061 WHERE "Slalom points" = '3.18' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 A... | atis |
CREATE TABLE table_51439 (
"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.
-- Can you tell me the Away team that has the Away ... | SELECT "Away team" FROM table_51439 WHERE "Away team score" = '6.11 (47)' | wikisql |
CREATE TABLE table_name_26 (
attendance INTEGER,
venue VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average attendance at a game held at Firhill for the 5(r) round?
| SELECT AVG(attendance) FROM table_name_26 WHERE venue = "firhill" AND round = "5(r)" | sql_create_context |
CREATE TABLE table_10786 (
"Player" text,
"Att." real,
"Yards" real,
"Avg." real,
"Long" real,
"FumL" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the most Att with a long of 27 with yards longer than 27
| SELECT MAX("Att.") FROM table_10786 WHERE "Long" = '27' AND "Yards" > '27' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.