instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | (SELECT jyjgzbb.JYZBLSH 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 =... | css |
CREATE TABLE table_59974 (
"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 date was the game when home team crystal palace played?
| SELECT "Date" FROM table_59974 WHERE "Home team" = 'crystal palace' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | SELECT COUNT(Votes.PostId) AS "Vote count", Votes.PostId AS "post_link" FROM Votes INNER JOIN Posts AS answer ON answer.Id = Votes.PostId INNER JOIN PostTags AS PT ON PT.PostId = answer.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE answer.PostTypeId = 2 AND Votes.VoteTypeId = 2 AND answer.Id = Votes.PostId AND... | sede |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2101' | eicu |
CREATE TABLE table_45256 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest week with an opponent of cincinnati bengals?
| SELECT MIN("Week") FROM table_45256 WHERE "Opponent" = 'cincinnati bengals' | wikisql |
CREATE TABLE table_13101 (
"Rank" real,
"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 total medal count when there are more than 1 gold and more than 2 silver medals ... | SELECT "Total" FROM table_13101 WHERE "Gold" > '1' AND "Silver" > '2' AND "Rank" < '2' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (((flight.departure_time < 1200 AND flight.flight_number = 825) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1... | atis |
CREATE TABLE table_name_80 (
home_team VARCHAR,
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team on April 13, 2008 when Itabuna was the away team?
| SELECT home_team FROM table_name_80 WHERE date = "april 13, 2008" AND away_team = "itabuna" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'nitroglycerin' ORDER BY prescriptions.startd... | mimic_iii |
CREATE TABLE table_16978 (
"Total No." real,
"Celebrity" text,
"Director" text,
"Original air date" text,
"Viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Margot Kidder had what director?
| SELECT "Director" FROM table_16978 WHERE "Celebrity" = 'Margot Kidder' | wikisql |
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,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '29958411991') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '29958411991') AND JCZBJGDL > (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '29958411991') | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Sulfameth/Trimethoprim Suspension" | mimicsql_data |
CREATE TABLE table_38294 (
"Pos." real,
"Car #" real,
"Driver" text,
"Make" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pos has a Team of circle bar racing, and a Car # smaller than 14?
| SELECT MAX("Pos.") FROM table_38294 WHERE "Team" = 'circle bar racing' AND "Car #" < '14' | 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 All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home | nvbench |
CREATE TABLE table_39058 (
"Average population (x 1,000)" real,
"Live births" real,
"Deaths" real,
"Natural change" real,
"Crude birth rate (per 1,000)" real,
"Crude death rate (per 1,000)" real,
"Natural change (per 1,000)" real
)
-- Using valid SQLite, answer the following questions for ... | SELECT MIN("Live births") FROM table_39058 WHERE "Natural change (per 1,000)" = '9.4' AND "Crude death rate (per 1,000)" > '29.3' | wikisql |
CREATE TABLE table_name_91 (
service_area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2FM for SW Ireland?
| SELECT 2 AS fm__mhz_ FROM table_name_91 WHERE service_area = "sw ireland" | sql_create_context |
CREATE TABLE table_name_79 (
tries INTEGER,
player VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of Tries with less than 28 Points for Mike Forshaw?
| SELECT AVG(tries) FROM table_name_79 WHERE player = "mike forshaw" AND points < 28 | sql_create_context |
CREATE TABLE table_name_8 (
raw_bandwidth__mbit_s_ VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Raw bandwidth (Mbit/s) for the SAS 300?
| SELECT raw_bandwidth__mbit_s_ FROM table_name_8 WHERE name = "sas 300" | sql_create_context |
CREATE TABLE table_name_82 (
total INTEGER,
nation VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high total for algeria with over 2 bronzes?
| SELECT MAX(total) FROM table_name_82 WHERE nation = "algeria" AND bronze > 2 | sql_create_context |
CREATE TABLE table_name_40 (
to_par VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par number of the person who won in 2003?
| SELECT to_par FROM table_name_40 WHERE year_s__won = "2003" | sql_create_context |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT name, ID FROM swimmer ORDER BY name | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '027-210868' AND STRFTIME('%y', patient.hospitaladmittime) >= '2104' | eicu |
CREATE TABLE table_2187178_1 (
truck_s_ VARCHAR,
crew_chief VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the trucks for scott neal
| SELECT truck_s_ FROM table_2187178_1 WHERE crew_chief = "Scott Neal" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%wellington, new zealand' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE table_26502 (
"Municipality" text,
"No. of Barangays" real,
"Area Coordinator" text,
"Population (2010)" real,
"Pop. density (per km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Barangays lived in the municipality wit... | SELECT "No. of Barangays" FROM table_26502 WHERE "Area Coordinator" = '110.95' | 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 COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3566248' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-03-26' AND '2016-11-11' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3566248' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2009-03... | css |
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 * 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 = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_52182 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the number of attendance that has a result of l 35-17
| SELECT COUNT("Attendance") FROM table_52182 WHERE "Result" = 'l 35-17' | wikisql |
CREATE TABLE table_name_17 (
attendance VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance for St Andrew's?
| SELECT attendance FROM table_name_17 WHERE venue = "st andrew's" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT * FROM Users WHERE LastAccessDate < '2014-01-01' | sede |
CREATE TABLE table_25695027_1 (
class VARCHAR,
years_built VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the engine class that was built on 1906-08?
| SELECT class FROM table_25695027_1 WHERE years_built = "1906-08" | 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 COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '4213631' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-05' AND '2006-10-29' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 690.96) AS T | css |
CREATE TABLE table_58523 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the Driver with Laps of 20
| SELECT "Driver" FROM table_58523 WHERE "Laps" = '20' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_100 | nvbench |
CREATE TABLE table_78760 (
"Birth Name" text,
"Papal Name" text,
"Papal Name As Announced in Latin" text,
"Latin declension of Papal Name" text,
"Numeral in Papal Name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What numeral is included for the ... | SELECT "Numeral in Papal Name" FROM table_78760 WHERE "Papal Name As Announced in Latin" = 'ioannis pauli' | wikisql |
CREATE TABLE table_name_57 (
nba_draft VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which NBA draft has a School of huntington high school?
| SELECT nba_draft FROM table_name_57 WHERE school = "huntington high school" | sql_create_context |
CREATE TABLE table_train_98 (
"id" int,
"mini_mental_state_examination_mmse" int,
"stroke" bool,
"lyperlipidemia_ldl" int,
"allergy_to_milk" bool,
"allergy_to_soy" bool,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables pr... | SELECT * FROM table_train_98 WHERE stroke = 1 | criteria2sql |
CREATE TABLE table_16278673_1 (
inhabitants_per_km² INTEGER,
markatal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the minimum inhabitants for markatal 49
| SELECT MIN(inhabitants_per_km²) FROM table_16278673_1 WHERE markatal = 49 | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Reticulocyte Count, Manual" | mimicsql_data |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | SELECT gender, SUM(student_capacity) FROM Dorm GROUP BY gender ORDER BY SUM(student_capacity) DESC | nvbench |
CREATE TABLE table_name_23 (
venue VARCHAR,
competition VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue for the 2002 fifa world cup qualifier, and a Result of 8-2?
| SELECT venue FROM table_name_23 WHERE competition = "2002 fifa world cup qualifier" AND result = "8-2" | sql_create_context |
CREATE TABLE table_name_67 (
league INTEGER,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of goals scored by a player in the normal league games where more than 8 total goals were scored?
| SELECT MIN(league) FROM table_name_67 WHERE total > 8 | sql_create_context |
CREATE TABLE table_54615 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Time/Retired has a Grid smaller than 3, and a Driver of mika h kkinen?
| SELECT "Time/Retired" FROM table_54615 WHERE "Grid" < '3' AND "Driver" = 'mika häkkinen' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-248902') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-36 month') ORDER BY patient.unit... | eicu |
CREATE TABLE table_66919 (
"Colt model no." text,
"Name" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Case deflector" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
... | SELECT "Barrel length" FROM table_66919 WHERE "Barrel twist" = '1:7' | wikisql |
CREATE TABLE table_name_58 (
attendance INTEGER,
date VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the Cleveland Browns game on November 11, 1979?
| SELECT MAX(attendance) FROM table_name_58 WHERE date = "november 11, 1979" AND week > 11 | 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 COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '26801950' AND mzjzjlb.JZKSRQ BETWEEN '2010-08-07' AND '2015-02-03' | css |
CREATE TABLE table_name_77 (
pali VARCHAR,
sanskrit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pali word for r ga in sanskrit?
| SELECT pali FROM table_name_77 WHERE sanskrit = "rāga" | sql_create_context |
CREATE TABLE table_name_70 (
season VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which season was there a competition in the Champions League?
| SELECT season FROM table_name_70 WHERE competition = "champions league" | sql_create_context |
CREATE TABLE table_name_8 (
leading_scorer VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the leading scorer on April 7?
| SELECT leading_scorer FROM table_name_8 WHERE date = "april 7" | sql_create_context |
CREATE TABLE table_73164 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Directed by" FROM table_73164 WHERE "Production code" = '4AKJ01' | wikisql |
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id ... | SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY brand | nvbench |
CREATE TABLE table_33429 (
"State" text,
"Born/Died" text,
"Active service" text,
"Chief Judge" text,
"Senior status" text,
"Appointed by" text,
"Reason for termination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which active services ye... | SELECT "Active service" FROM table_33429 WHERE "Reason for termination" = 'death' AND "Senior status" = '1972–2005' | wikisql |
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
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_29453 (
"University" text,
"Varsity Name" text,
"City" text,
"Province" text,
"Founded" real,
"Soccer Stadium" text,
"Stadium Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the soccer stadium with the var... | SELECT "Soccer Stadium" FROM table_29453 WHERE "Varsity Name" = 'Citadins' | wikisql |
CREATE TABLE table_17179 (
"Name of ground" text,
"Location" text,
"Year" text,
"FC matches" real,
"LA matches" real,
"T20 matches" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum fc matches at the racecourse... | SELECT MAX("FC matches") FROM table_17179 WHERE "Name of ground" = 'The Racecourse' | wikisql |
CREATE TABLE table_203_27 (
id number,
"number" number,
"serial no" number,
"entered service" text,
"withdrawn" text,
"kilometres travelled" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which locomotive entered service first : 4107 or 4103 ?... | SELECT "number" FROM table_203_27 WHERE "number" IN (4107, 4103) ORDER BY "entered service" LIMIT 1 | squall |
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 WHERE demographic.gender = "M" AND demographic.dob_year < "2073" | mimicsql_data |
CREATE TABLE table_39882 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result with a Venue that is filbert street?
| SELECT "Result" FROM table_39882 WHERE "Venue" = 'filbert street' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress ... | SELECT * FROM Users AS U WHERE U.Location LIKE '%lgeria%' ORDER BY U.Reputation DESC | sede |
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Ag... | SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY Home_city | nvbench |
CREATE TABLE table_23323 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lo... | SELECT MIN("Game") FROM table_23323 WHERE "High assists" = 'S. Johnson (3)' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) 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 diagnosis (
diagnosisid number... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2105... | eicu |
CREATE TABLE student_addresses (
student_id number,
address_id number,
date_address_from time,
date_address_to time,
monthly_rental number,
other_details text
)
CREATE TABLE assessment_notes (
notes_id number,
student_id number,
teacher_id number,
date_of_notes time,
text_of... | SELECT T1.zip_postcode FROM addresses AS T1 JOIN teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = "Lyla" | spider |
CREATE TABLE table_203_466 (
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.
-- largest medal differential between countries
| SELECT MAX("total") - MIN("total") FROM table_203_466 | squall |
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
languages varchar2(20),
releasedate Date,
resolution number(10)
)
CREATE TABLE files (
f_id number(10),
artist_name varchar2... | SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats | nvbench |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%##country##%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_202_173 (
id number,
"track" number,
"title" text,
"translation" text,
"composer" text,
"recorded" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tracks are in this album ?
| SELECT COUNT("track") FROM table_202_173 | squall |
CREATE TABLE table_68119 (
"Margin" real,
"Score" text,
"Opponent" text,
"Venue" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most year for brookvale oval
| SELECT MAX("Year") FROM table_68119 WHERE "Venue" = 'brookvale oval' | wikisql |
CREATE TABLE table_53449 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many golds for nations ranked below 4, over 5 medals, and under 6 silvers?
| SELECT COUNT("Gold") FROM table_53449 WHERE "Rank" > '4' AND "Total" > '5' AND "Silver" < '6' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth extraoc mus-tend op') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61339) AND ... | mimic_iii |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '预防保健科' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-07-03' AND '2008-09-09' AND t_kc21.IN_DIAG_DIS_CD = 'G15.489' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE customers (
customer_id number,
customer_type_code text,
address_line_1 text,
address_line_2 text,
town_city text,
state text,
email_address text,
phone_number text
)
CREATE TABLE complaints (
complaint_id number,
product_id number,
customer_id number,
compl... | SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = "Product Failure" GROUP BY complaint_status_code | spider |
CREATE TABLE table_494 (
"Rank" real,
"Fastest time (s)" text,
"Wind (m/s)" text,
"Athlete" text,
"Country" text,
"Date" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is Dwain Chambers from
| SELECT "Location" FROM table_494 WHERE "Athlete" = 'Dwain Chambers' | wikisql |
CREATE TABLE table_name_8 (
laps INTEGER,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mean number of laps when the grid was 8?
| SELECT AVG(laps) FROM table_name_8 WHERE grid = 8 | sql_create_context |
CREATE TABLE table_name_5 (
branding VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the branding for frequency 1233khz?
| SELECT branding FROM table_name_5 WHERE frequency = "1233khz" | sql_create_context |
CREATE TABLE table_name_40 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team at MCG?
| SELECT home_team FROM table_name_40 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 632 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste... | advising |
CREATE TABLE table_39252 (
"Rank" real,
"Town" text,
"Population" real,
"Year" real,
"Borough" text,
"Definition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Borough of harrogate, and a Rank smaller than 6, and a Definition o... | SELECT "Year" FROM table_39252 WHERE "Borough" = 'harrogate' AND "Rank" < '6' AND "Definition" = 'civil parish' | wikisql |
CREATE TABLE table_29661 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ... | SELECT MAX("Prod. code") FROM table_29661 WHERE "Directed by" = 'Sean McNamara' | wikisql |
CREATE TABLE table_1473672_5 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Bernie Germain's nationality?
| SELECT nationality FROM table_1473672_5 WHERE player = "Bernie Germain" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_203_794 (
id number,
"year" number,
"location" text,
"attendance" number,
"theme phrase" text,
"top messages" text,
"host" text,
"opening general session guest(s)" text,
"closing general session guest(s)" text,
"sunday night reception" text,
"wednesday nigh... | SELECT SUM("attendance") FROM table_203_794 WHERE "year" = 2000 | squall |
CREATE TABLE table_11889 (
"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.
-- Which date has a game where the away team had a ... | SELECT "Date" FROM table_11889 WHERE "Away team score" = '10.8 (68)' | wikisql |
CREATE TABLE table_name_84 (
injured INTEGER,
place VARCHAR,
killed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of people injured at incidents located at Rohtas, Bihar where fewer than 13 were killed?
| SELECT MAX(injured) FROM table_name_84 WHERE place = "rohtas, bihar" AND killed < 13 | sql_create_context |
CREATE TABLE table_name_28 (
bronze VARCHAR,
silver VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of bronze medals, and 4 silver medals, and 2 gold medals?
| SELECT COUNT(bronze) FROM table_name_28 WHERE silver = 4 AND gold > 2 | sql_create_context |
CREATE TABLE table_name_88 (
team VARCHAR,
wins VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had more than 10 wins with a champion of Mat Mladin?
| SELECT team FROM table_name_88 WHERE wins > 10 AND champion = "mat mladin" | sql_create_context |
CREATE TABLE table_27614707_1 (
song_choice VARCHAR,
week__number VARCHAR,
original_artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Marisa Monte song choice was song during top 5?
| SELECT song_choice FROM table_27614707_1 WHERE week__number = "Top 5" AND original_artist = "Marisa Monte" | sql_create_context |
CREATE TABLE table_name_29 (
stadium VARCHAR,
final_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At what stadium was the game with the final score of 26-24 played?
| SELECT stadium FROM table_name_29 WHERE final_score = "26-24" | sql_create_context |
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT studio FROM film GROUP BY studio HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_name_74 (
a_score INTEGER,
t_score VARCHAR,
e_score VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total of A Score when the E Score was greater than 9.383, total was less than 19.716 and the T Score was... | SELECT SUM(a_score) FROM table_name_74 WHERE e_score > 9.383 AND total < 19.716 AND t_score > 4 | sql_create_context |
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 intakeoutput (
intakeou... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-14220' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_204_616 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
)
-- U... | SELECT COUNT("township") FROM table_204_616 WHERE "population" > 2000 | squall |
CREATE TABLE table_name_75 (
time VARCHAR,
notes VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time of the Player with a Rank of 1 or 2 and Notes of FA?
| SELECT time FROM table_name_75 WHERE notes = "fa" AND rank < 2 | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... | eicu |
CREATE TABLE table_21501511_1 (
song_choice VARCHAR,
week__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Lambert's song choice in the top 13?
| SELECT song_choice FROM table_21501511_1 WHERE week__number = "Top 13" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id nu... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'furosemide' AND admissions.subject_id = 86791 AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'st... | mimic_iii |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID | nvbench |
CREATE TABLE table_72886 (
"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 d... | SELECT "Date" FROM table_72886 WHERE "Team" = 'Miami' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.