instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_44714 (
"Team" text,
"Average" real,
"Points" real,
"Played" real,
"2006" text,
"2007" text,
"2008" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Points, when Played is greater than 126?
| SELECT AVG("Points") FROM table_44714 WHERE "Played" > '126' | wikisql |
CREATE TABLE table_58283 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When there are more than 12 total medals and less than 5 gold medals, how many bronze medals... | SELECT COUNT("Bronze") FROM table_58283 WHERE "Total" > '12' AND "Gold" < '5' | wikisql |
CREATE TABLE table_56044 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the team with 1 bronze and 0 gold medals?
| SELECT "Rank" FROM table_56044 WHERE "Bronze" = '1' AND "Gold" = '0' | wikisql |
CREATE TABLE table_42557 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the set 5 if the Date is jun 7, and a Set 4 is 21-... | SELECT "Set 5" FROM table_42557 WHERE "Date" = 'jun 7' AND "Set 4" = '21-25' | wikisql |
CREATE TABLE table_name_92 (
game INTEGER,
decision VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the first game in which Weekes scored the decision goal and the record was 7-4-2?
| SELECT MIN(game) FROM table_name_92 WHERE decision = "weekes" AND record = "7-4-2" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '60507668' AND qtb.MED_SER_ORG_NO = '9524641' AND qtb.OUT_DIAG_DOC_NM LIKE '陶%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '60507668' AND gyb.MED_SER_ORG_NO = '9524641' AND gyb.OUT_DIAG_DOC_NM LIKE '... | css |
CREATE TABLE table_204_741 (
id number,
"rank" number,
"name" text,
"nationality" text,
"1,62" text,
"1,67" text,
"1,72" text,
"1,75" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what name is just before thea lafond o... | SELECT "name" FROM table_204_741 WHERE id = (SELECT id FROM table_204_741 WHERE "name" = 'thea lafond') - 1 | squall |
CREATE TABLE table_name_55 (
bronze VARCHAR,
total VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When there are more than 12 total medals and less than 5 gold medals, how many bronze medals are there?
| SELECT COUNT(bronze) FROM table_name_55 WHERE total > 12 AND gold < 5 | sql_create_context |
CREATE TABLE table_34559 (
"Year" text,
"Team" text,
"Progress" text,
"Score" text,
"Opponents" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has Opponents of valencia, and a Year of 2011 12?
| SELECT "Score" FROM table_34559 WHERE "Opponents" = 'valencia' AND "Year" = '2011–12' | wikisql |
CREATE TABLE table_47535 (
"Frequency" text,
"Call sign" text,
"Location" text,
"Name / Format" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Location has a Call sign of cjtw-fm?
| SELECT "Location" FROM table_47535 WHERE "Call sign" = 'cjtw-fm' | wikisql |
CREATE TABLE table_name_70 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality has jon koncak as the player?
| SELECT nationality FROM table_name_70 WHERE player = "jon koncak" | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 662 AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_77 (
d_50 VARCHAR,
d_43 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the D 50 when the D 43 is r 43?
| SELECT d_50 FROM table_name_77 WHERE d_43 = "r 43" | sql_create_context |
CREATE TABLE table_name_14 (
supercopa_1996 VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What racing club team made supercopa 1996?
| SELECT supercopa_1996 FROM table_name_14 WHERE team = "racing club" | sql_create_context |
CREATE TABLE table_61070 (
"Match Day" real,
"Date" text,
"Opponent" text,
"Venue" text,
"Score" text,
"Attendance" real,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent on 12 May, when the match day was more tha... | SELECT "Opponent" FROM table_61070 WHERE "Match Day" > '33' AND "Date" = '12 may' | wikisql |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
-- Using valid SQLite, answer the ... | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID | nvbench |
CREATE TABLE table_name_55 (
endowment_as_of_2008 VARCHAR,
established VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the endowment in 2008 of the college that was established in 1961?
| SELECT endowment_as_of_2008 FROM table_name_55 WHERE established = 1961 | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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,
H... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3530897' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING AVG(t_kc21.IN_HOSP_DAYS) > 26) AS T | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" | mimicsql_data |
CREATE TABLE table_35799 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest against value with less than... | SELECT MIN("Against") FROM table_35799 WHERE "Points" < '9' AND "Lost" > '6' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
U... | SELECT Body FROM Posts | sede |
CREATE TABLE table_25058269_1 (
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In season 2005 06, who is 3rd place?
| SELECT 3 AS rd_place FROM table_25058269_1 WHERE season = "2005–06" | sql_create_context |
CREATE TABLE table_name_17 (
years_for_jazz VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which years have a School/Club Team of colorado state?
| SELECT years_for_jazz FROM table_name_17 WHERE school_club_team = "colorado state" | sql_create_context |
CREATE TABLE table_57309 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Chinese Title Ranking #7 ha... | SELECT "Chinese title" FROM table_57309 WHERE "Average" = '32' AND "Peak" < '38' AND "Rank" = '7' | wikisql |
CREATE TABLE table_name_4 (
year VARCHAR,
points VARCHAR,
wins VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of years for wins less than 2 and class of 50cc with points of 15
| SELECT COUNT(year) FROM table_name_4 WHERE wins < 2 AND class = "50cc" AND points = 15 | sql_create_context |
CREATE TABLE table_38816 (
"Year" real,
"Tournament" text,
"Winner" text,
"Country" text,
"Score" text,
"To par" text,
"Margin of victory" text,
"Winner's share ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many strokes to pa... | SELECT "To par" FROM table_38816 WHERE "Score" = '1 up' | wikisql |
CREATE TABLE table_32457 (
"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 is the home team that scored 14.19 (103)?
| SELECT "Home team" FROM table_32457 WHERE "Home team score" = '14.19 (103)' | wikisql |
CREATE TABLE table_11677691_6 (
hometown VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is lincoln high school located?
| SELECT hometown FROM table_11677691_6 WHERE school = "Lincoln High school" | sql_create_context |
CREATE TABLE table_name_30 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date where the away team is Richmond?
| SELECT date FROM table_name_30 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | (SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_68148 (
"Championship" text,
"Champion(s)" text,
"Previous champion(s)" text,
"Date Won" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the champion of the title previously held by Lash?
| SELECT "Champion(s)" FROM table_68148 WHERE "Previous champion(s)" = 'lash' | wikisql |
CREATE TABLE table_34996 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What home has February 10 as the date?
| SELECT "Home" FROM table_34996 WHERE "Date" = 'february 10' | wikisql |
CREATE TABLE table_15221 (
"Team" text,
"Car(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What crew chief has an owner name Jack Roush and driver Greg Biffle?... | SELECT "Crew Chief" FROM table_15221 WHERE "Owner(s)" = 'jack roush' AND "Driver(s)" = 'greg biffle' | wikisql |
CREATE TABLE table_13758243_1 (
draft_year INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was jerry marion drafted?
| SELECT MAX(draft_year) FROM table_13758243_1 WHERE player = "Jerry Marion" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 countries (
COUNTRY_ID... | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC | nvbench |
CREATE TABLE APPELLATIONS (
Appelation VARCHAR,
County VARCHAR
)
CREATE TABLE WINE (
Appelation VARCHAR
)
CREATE TABLE wine (
price INTEGER,
Appelation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the average price of wines that are not ... | SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma') | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CREATE TABLE guests (
guest_id number,
ge... | SELECT T1.building_address FROM apartment_buildings AS T1 JOIN apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2 | spider |
CREATE TABLE table_45961 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had Richard Krajicek as a finalist?
| SELECT "Tournament" FROM table_45961 WHERE "Finalist" = 'richard krajicek' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
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,
... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_inf... | css |
CREATE TABLE table_27821519_1 (
manufacturer VARCHAR,
no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the manufacturer is no.50?
| SELECT manufacturer FROM table_27821519_1 WHERE no = 50 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2197" | mimicsql_data |
CREATE TABLE table_74614 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position was for Arizona State?
| SELECT "Position" FROM table_74614 WHERE "School/Country" = 'arizona state' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'antidepressant - vanafaxine (effexor)' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year') | eicu |
CREATE TABLE table_203_510 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n(/mi2)" number,
"population\ndensity\n(/km2)" number,
"land area\n(mi2)" number,
"land area\n(km2)" number,
"water area\n(mi2)" number,
... | SELECT "township" FROM table_203_510 ORDER BY "land area\n(mi2)" DESC LIMIT 1 | squall |
CREATE TABLE table_name_18 (
start VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the start of lap 55?
| SELECT start FROM table_name_18 WHERE laps = 55 | sql_create_context |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Pla... | SELECT Date_Stored, COUNT(Date_Stored) FROM All_Documents AS T1 JOIN Ref_Calendar AS T2 ON T1.Date_Stored = T2.Calendar_Date | nvbench |
CREATE TABLE table_60821 (
"Player" text,
"Position" text,
"Ekstraklasa" real,
"Polish Cup" real,
"Puchat Ligi" real,
"UEFA Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Ekstraklasa has a Total smaller than 3?
| SELECT SUM("Ekstraklasa") FROM table_60821 WHERE "Total" < '3' | 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 * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '韩子安' AND gwyjzb.MED_SER_ORG_NO = '1397845' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%普外科%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '韩子安' AND fgwyjzb.MED_SER_ORG_NO = '1397845' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%普外科%' | css |
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_labitems (
row_id number,
itemid number,
label te... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) A... | mimic_iii |
CREATE TABLE table_71021 (
"Draw" real,
"Artist" text,
"Song" text,
"Votes" real,
"Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average place for the song called 'homme' that has voes larger than 1320?
| SELECT AVG("Place") FROM table_71021 WHERE "Song" = 'homme' AND "Votes" > '1320' | wikisql |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar... | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY COUNT(title) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Angioneurotic edema" | mimicsql_data |
CREATE TABLE table_31359 (
"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.
-- When b... | SELECT "Record" FROM table_31359 WHERE "Team" = 'Boston University' | wikisql |
CREATE TABLE table_31882 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the 2008 for 2012 of 4r and 2009 of a
| SELECT "2008" FROM table_31882 WHERE "2012" = '4r' AND "2009" = 'a' | wikisql |
CREATE TABLE table_1751142_2 (
level INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest possible level?
| SELECT MAX(level) FROM table_1751142_2 | sql_create_context |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops 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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =... | atis |
CREATE TABLE table_43545 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which week was the attendance 47,218?
| SELECT SUM("Week") FROM table_43545 WHERE "Attendance" = '47,218' | wikisql |
CREATE TABLE table_43832 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home city when Mladen Fran i is the manager?
| SELECT "Home city" FROM table_43832 WHERE "Manager" = 'mladen frančić' | wikisql |
CREATE TABLE table_67541 (
"Week" real,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Volume Lbs." real,
"Peak Intensity(Last Set)" text,
"% of 1 Rep Max(Last Set)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Set 3" FROM table_67541 WHERE "Week" = '6' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Congestive heart failure, unspecified" | mimicsql_data |
CREATE TABLE table_22181917_2 (
original_air_date VARCHAR,
season__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many original airdates did season 20 have?
| SELECT COUNT(original_air_date) FROM table_22181917_2 WHERE season__number = 20 | sql_create_context |
CREATE TABLE table_32785 (
"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.
-- On which date was St Kilda the home team?
| SELECT "Date" FROM table_32785 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_76541 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface for finalist Justine Henin?
| SELECT "Surface" FROM table_76541 WHERE "Finalist" = 'justine henin' | wikisql |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar... | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget DESC | nvbench |
CREATE TABLE table_43375 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for Set 5 when the Total was 77 - 65?
| SELECT "Set 5" FROM table_43375 WHERE "Total" = '77 - 65' | wikisql |
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT AVG(T2.number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id WHERE T1.low_estimate > 10000 | spider |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.itemid = "51108" | mimicsql_data |
CREATE TABLE table_12321870_32 (
goals VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were scored by the player who played 17 matches?
| SELECT goals FROM table_12321870_32 WHERE matches = "17" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | SELECT Id, Score, LENGTH(Body) AS size FROM Posts WHERE PostTypeId = 1 ORDER BY Score DESC LIMIT 1000 | sede |
CREATE TABLE Staff (
Staff_ID INTEGER,
Staff_Details VARCHAR(255)
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Claim_Headers (
Claim_Header_ID INTEGER,
Claim_Status_Code CHAR(15),
Claim_Type_Code CHAR(15),
Policy_ID INTEGER,
Date_of_C... | SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_16467 (
"No. in season" real,
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episo... | SELECT "Written by" FROM table_16467 WHERE "Original air date" = 'April 17, 2011' | wikisql |
CREATE TABLE table_name_37 (
top_25 VARCHAR,
cuts_made VARCHAR,
wins VARCHAR
)
-- 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 was 62, and for which Wins were less than 1?
| SELECT COUNT(top_25) FROM table_name_37 WHERE cuts_made = 62 AND wins < 1 | sql_create_context |
CREATE TABLE table_58134 (
"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 the Away team had a score of 14.11 (95), wh... | SELECT "Away team" FROM table_58134 WHERE "Away team score" = '14.11 (95)' | wikisql |
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
-- Using valid SQLite, answer the following questions for the ... | SELECT Name, COUNT(Name) FROM editor GROUP BY Name | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_66778 (
"Counting Method" text,
"Basis" text,
"Name" text,
"Directed / Undirected" text,
"Induced / Non-Induced" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the algorithm with a directed/undirected of both a... | SELECT "Name" FROM table_66778 WHERE "Directed / Undirected" = 'both' AND "Basis" = 'subgraph-centric' | wikisql |
CREATE TABLE table_56421 (
"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 date where the attendance was 31,220?
| SELECT "Date" FROM table_56421 WHERE "Attendance" = '31,220' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id numbe... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'mucinex' AND STRFTIME('%y', prescriptions.startdate) <= '2104') A... | mimic_iii |
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 prescriptions... | SELECT demographic.admission_type, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_67 (
score VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the NY Islanders was the visiting team?
| SELECT score FROM table_name_67 WHERE visitor = "ny islanders" | sql_create_context |
CREATE TABLE table_38450 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Record is on March of 12
| SELECT "Record" FROM table_38450 WHERE "March" = '12' | 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE... | atis |
CREATE TABLE table_203_385 (
id number,
"material" text,
"formula" text,
"refractive\nindex(es)\n589.3 nm" text,
"dispersion\n431 - 687 nm" number,
"hardness\n(mohs'\nscale)" text,
"density\n(g/cm3)" text,
"thermal\ncond." text,
"state of\nthe art" text
)
-- Using valid SQLite, ans... | SELECT "material" FROM table_203_385 WHERE "thermal\ncond." = 'high' | squall |
CREATE TABLE table_1341865_11 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party did Don Fuqua belong to?
| SELECT party FROM table_1341865_11 WHERE incumbent = "Don Fuqua" | sql_create_context |
CREATE TABLE table_80419 (
"Year" text,
"Carries" real,
"Rushing Yards" real,
"Average" real,
"Touchdowns" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most number of touchdowns that have fewer than 105 points, avera... | SELECT MAX("Touchdowns") FROM table_80419 WHERE "Points" < '105' AND "Average" > '4.7' AND "Rushing Yards" < '487' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_42860 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the option from Italy with general television content, a... | SELECT "Package/Option" FROM table_42860 WHERE "Country" = 'italy' AND "Content" = 'general television' AND "Television service" = 'cielo' | wikisql |
CREATE TABLE table_20361783_1 (
womens_doubles VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won womens doubles in 2010
| SELECT womens_doubles FROM table_20361783_1 WHERE year = 2010 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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... | css |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.PERSON_NM, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE, t_kc21.IDENTITY_CARD FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '04488736077' | css |
CREATE TABLE table_name_88 (
bats VARCHAR,
first VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bats does Todd have?
| SELECT bats FROM table_name_88 WHERE first = "todd" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistoryTypes (
Id number,
Name te... | SELECT *, CAST(100.0 * a.answered / a.total AS FLOAT(10, 2)) AS PercentAnswered FROM (SELECT t.TagName, SUM(CASE WHEN p.AnswerCount + p.CommentCount > 0 THEN 1 ELSE 0 END) AS answered, COUNT(p.Id) AS total FROM Posts AS p JOIN PostTags AS pTags ON pTags.PostId = p.Id JOIN Tags AS t ON pTags.TagId = t.Id GROUP BY t.TagN... | sede |
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 treatment (
treat... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10559')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | SELECT u.Id AS "user_link", Reputation, Location FROM Users AS u WHERE LOWER(Location) LIKE LOWER('%##countryname##%') OR LOWER(Location) LIKE LOWER('%##countryname1##%') OR LOWER(Location) LIKE LOWER('%##countryname2##%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_41084 (
"Airline" text,
"Fleet Size" real,
"Notes" text,
"IOSA (IATA)" text,
"EASA (EU)" text,
"IASA (FAA)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- hat is the Airline when the EASA (EU) is yes?
| SELECT "Airline" FROM table_41084 WHERE "EASA (EU)" = 'yes' | wikisql |
CREATE TABLE table_name_76 (
name__english_ VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the English Name of the Location in Chester?
| SELECT name__english_ FROM table_name_76 WHERE location = "chester" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '5:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'SPANISH' AND course.num... | advising |
CREATE TABLE table_45947 (
"Ethnicity" text,
"Islam" text,
"Christianity" text,
"Judaism" text,
"Buddhism" text,
"Other" text,
"Atheism" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of Judaism associated with Christi... | SELECT "Judaism" FROM table_45947 WHERE "Christianity" = '2.51%' | wikisql |
CREATE TABLE table_15888 (
"Season" real,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"Draft Pick #" text,
"Draft Class" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did the #10 draft ... | SELECT "Position" FROM table_15888 WHERE "Draft Pick #" = '10' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.