instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" | mimicsql_data |
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
... | SELECT COUNT(DISTINCT crs_code) FROM class | spider |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Des... | SELECT u.Reputation FROM Badges AS b LEFT JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'Constituent' AND CAST((JULIANDAY(Date) - JULIANDAY('2018-08-06')) * 1440.0 AS INT) > 0 | sede |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | SELECT county_name, population FROM county | spider |
CREATE TABLE table_name_36 (
week VARCHAR,
venue VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of weeks where the venue was memorial stadium and the attendance was less than 41,252?
| SELECT COUNT(week) FROM table_name_36 WHERE venue = "memorial stadium" AND attendance < 41 OFFSET 252 | sql_create_context |
CREATE TABLE table_204_123 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, april 13') > (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, may 11') | squall |
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '慢性牙周炎' AND jyjgzbb.JCZBDM = '261843' UNION SELECT jyjgzbb.CKZFWXX,... | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" AND demographic.admityear < "2203" | mimicsql_data |
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
CREATE TABLE manager_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE manager... | SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JO... | spider |
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | mimicsql_data |
CREATE TABLE table_66233 (
"Year" real,
"Stage" real,
"Start" text,
"Finish" text,
"Leader at the summit" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was finish Toulouse, and stage was larger than 12?
| SELECT SUM("Year") FROM table_66233 WHERE "Finish" = 'toulouse' AND "Stage" > '12' | wikisql |
CREATE TABLE table_36288 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHICH Outcome IS ON 18 july 1993?
| SELECT "Outcome" FROM table_36288 WHERE "Date" = '18 july 1993' | 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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ventr... | eicu |
CREATE TABLE table_name_48 (
wins VARCHAR,
draws INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Wins, when Draws is less than 2?
| SELECT COUNT(wins) FROM table_name_48 WHERE draws < 2 | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
item... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 3939 ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_66047 (
"Hull Number" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the USS Cambridge laid down?
| SELECT "Laid down" FROM table_66047 WHERE "Name" = 'uss cambridge' | wikisql |
CREATE TABLE table_name_89 (
rank INTEGER,
player VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of Lee Trevino, who had less than 27 wins?
| SELECT SUM(rank) FROM table_name_89 WHERE player = "lee trevino" AND wins < 27 | sql_create_context |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE va... | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE DESC | nvbench |
CREATE TABLE table_1507852_5 (
cancelable VARCHAR,
bubbles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the cancelable with bubbles being yes
| SELECT cancelable FROM table_1507852_5 WHERE bubbles = "Yes" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_37107 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest numbered pick from round 7?
| SELECT MAX("Pick") FROM table_37107 WHERE "Round" = '7' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '5043128' AND JZKSRQ BETWEEN '2004-03-08' AND '2005-12-26' AND WDBZ > 0 | css |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_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 = 'ac/chr syst/dia hrt fail') AND DATETIME(diagnoses_icd.charttime) >= DATETI... | mimic_iii |
CREATE TABLE table_name_38 (
premiere VARCHAR,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the premiere that had a 20.9 rating?
| SELECT premiere FROM table_name_38 WHERE rating = "20.9" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '奚子平' AND NOT ... | css |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 | nvbench |
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 WHERE demographic.marital_status = "MARRIED" AND demographic.age < "31" | mimicsql_data |
CREATE TABLE table_28062 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many field goals did Donald Green score?
| SELECT COUNT("Field goals") FROM table_28062 WHERE "Player" = 'Donald Green' | wikisql |
CREATE TABLE aircraft (
Aircraft VARCHAR,
Aircraft_ID VARCHAR
)
CREATE TABLE MATCH (
Location VARCHAR,
Winning_Aircraft VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please list the location and the winning aircraft name.
| SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft | sql_create_context |
CREATE TABLE table_name_60 (
lms_spr VARCHAR,
car_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the LMS SPR when the car number was 15?
| SELECT lms_spr FROM table_name_60 WHERE car_no = "15" | sql_create_context |
CREATE TABLE table_77470 (
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Run 4 has a Run 3 of 1:26.63?
| SELECT "Run 4" FROM table_77470 WHERE "Run 3" = '1:26.63' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2115.0" | mimicsql_data |
CREATE TABLE table_80101 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Before 1956, what Chassis has Gordini Straight-4 engine with 3 points?
| SELECT "Chassis" FROM table_80101 WHERE "Year" < '1956' AND "Engine" = 'gordini straight-4' AND "Points" = '3' | 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 COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime) >= DATETIME(CURRE... | eicu |
CREATE TABLE table_name_4 (
rank INTEGER,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of American Pie 2?
| SELECT MIN(rank) FROM table_name_4 WHERE title = "american pie 2" | sql_create_context |
CREATE TABLE table_60905 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total for the wc belgrade event with 10 rank points?
| SELECT "Total" FROM table_60905 WHERE "Event" = 'wc belgrade' AND "Rank points" = '10' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.age < "85" | mimicsql_data |
CREATE TABLE table_54933 (
"Year" text,
"Team" text,
"Comp" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the comp 33?
| SELECT "Year" FROM table_54933 WHERE "Comp" = '33' | wikisql |
CREATE TABLE table_15615 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has a Record of 22-22?
| SELECT "Date" FROM table_15615 WHERE "Record" = '22-22' | wikisql |
CREATE TABLE table_name_12 (
round VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round did the spartak moscow club play?
| SELECT round FROM table_name_12 WHERE club = "spartak moscow" | sql_create_context |
CREATE TABLE table_72293 (
"Season" text,
"League" text,
"Rank" real,
"Games" real,
"Points" real,
"GF" real,
"GA" real,
"Manager" text,
"Top Scorer" text,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the manager... | SELECT "Manager" FROM table_72293 WHERE "Rank" = '16' | wikisql |
CREATE TABLE table_20385 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Was there HDT... | SELECT "HDTV" FROM table_20385 WHERE "Television service" = 'PRIVÈ' | wikisql |
CREATE TABLE table_1181375_1 (
builder VARCHAR,
withdrawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the builder where withdrawn is 1954 1958
| SELECT builder FROM table_1181375_1 WHERE withdrawn = "1954–1958" | sql_create_context |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TA... | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services | nvbench |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of_club (
stuid number,
clu... | SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore" | spider |
CREATE TABLE table_name_94 (
date VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the Outback Steakhouse Pro-Am Tournament?
| SELECT date FROM table_name_94 WHERE tournament = "outback steakhouse pro-am" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '025-66662' | eicu |
CREATE TABLE table_41009 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Conference Matchups" text,
"Payout ( US$ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What stadium was the December 29, 2008 game... | SELECT "Stadium" FROM table_41009 WHERE "Date" = 'december 29, 2008' | wikisql |
CREATE TABLE table_name_37 (
third INTEGER,
club VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of third place earned for the Es Sahel at a rank less than 3?
| SELECT MIN(third) FROM table_name_37 WHERE club = "es sahel" AND rank < 3 | sql_create_context |
CREATE TABLE table_17625749_1 (
club VARCHAR,
tries_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the club for when tries for is 32
| SELECT club FROM table_17625749_1 WHERE tries_for = "32" | sql_create_context |
CREATE TABLE table_17209 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position is the player Jordan Fransoo in?
| SELECT "Position" FROM table_17209 WHERE "Player" = 'Jordan Fransoo' | wikisql |
CREATE TABLE table_name_71 (
competition VARCHAR,
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Venue of klfa stadium, cheras, and a Score of 3-3 had what competition?
| SELECT competition FROM table_name_71 WHERE venue = "klfa stadium, cheras" AND score = "3-3" | sql_create_context |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | SELECT date, mean_temperature_f FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 | nvbench |
CREATE TABLE table_204_871 (
id number,
"ano" text,
"title" text,
"role" text,
"channel" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tv shows did natalia oreiro between 1998 and 2002 ?
| SELECT COUNT("title") FROM table_204_871 WHERE "ano" >= 1998 AND "ano" <= 2002 | squall |
CREATE TABLE table_8011 (
"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 date when Grimsby Town is the home team?
| SELECT "Date" FROM table_8011 WHERE "Home team" = 'grimsby town' | wikisql |
CREATE TABLE table_21956 (
"Name" text,
"Map colour" text,
"First operated" real,
"Type" text,
"Length" text,
"No. Sta" real,
"Current Stock" text,
"Future Stock" text,
"Trips per annum (\u00d71000)" real,
"Avg. trips per mile (\u00d71000)" real
)
-- Using valid SQLite, answer ... | SELECT "Current Stock" FROM table_21956 WHERE "Avg. trips per mile (\u00d71000)" = '4744' | wikisql |
CREATE TABLE table_1000181_1 (
current_series VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the current series where the new series began in June 2011?
| SELECT current_series FROM table_1000181_1 WHERE notes = "New series began in June 2011" | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE fare_basis (
far... | 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, fare, flight, flight_fare WHERE ((((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.yea... | atis |
CREATE TABLE table_204_795 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"location" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team did this team face against next after beating minnes... | SELECT "opponent" FROM table_204_795 WHERE "date" > (SELECT "date" FROM table_204_795 WHERE "date" = 'january 29, 1949') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_54709 (
"Catches" text,
"Player" text,
"Versus" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date had a versus of source: cricinfo.com?
| SELECT "Date" FROM table_54709 WHERE "Versus" = 'source: cricinfo.com' | wikisql |
CREATE TABLE table_16698 (
"Year" real,
"Winners" text,
"Grand Finalist" text,
"Scores" text,
"Venue" text,
"Crowd" real,
"Margin" real,
"Season Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the grand finalist where winne... | SELECT "Grand Finalist" FROM table_16698 WHERE "Winners" = 'Collingwood' | wikisql |
CREATE TABLE table_12283 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue with the Friendly Competition?
| SELECT "Venue" FROM table_12283 WHERE "Competition" = 'friendly' | wikisql |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREAT... | SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY gender DESC | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.cellpath LIKE '%output%' AND DA... | eicu |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i... | mimic_iii |
CREATE TABLE table_name_38 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match played on 5 September 2001?
| SELECT score FROM table_name_38 WHERE date = "5 september 2001" | sql_create_context |
CREATE TABLE table_69759 (
"First game" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of matches played that has a year of first match before 2000, fewer than 21 lost, and... | SELECT SUM("Played") FROM table_69759 WHERE "First game" < '2000' AND "Lost" < '21' AND "Drawn" < '0' | wikisql |
CREATE TABLE table_name_66 (
against INTEGER,
played VARCHAR,
drawn VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average against that has a drawn less than 7, points greater than 22, and 19 for the played?
| SELECT AVG(against) FROM table_name_66 WHERE drawn < 7 AND points > 22 AND played = 19 | 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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.icd9_code = "30501" | mimicsql_data |
CREATE TABLE table_name_67 (
round INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round played by Chris Phillips?
| SELECT MAX(round) FROM table_name_67 WHERE player = "chris phillips" | sql_create_context |
CREATE TABLE course (
course_id VARCHAR,
dept_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different courses offered by Physics department?
| SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics' | sql_create_context |
CREATE TABLE table_34236 (
"Season" text,
"Order" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Penalties" real,
"Points For" real,
"Points Against" real,
"Points Diff" real,
"Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT COUNT("Lost") FROM table_34236 WHERE "Order" = '2nd' AND "Played" > '13' | wikisql |
CREATE TABLE table_train_53 (
"id" int,
"immune_suppression" bool,
"need_hemodialysis" bool,
"steroid_therapy" bool,
"cardiogenic_shock" bool,
"hematologic_disease" bool,
"coronary_syndrome" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT * FROM table_train_53 WHERE immune_suppression = 1 OR steroid_therapy = 1 | criteria2sql |
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(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '5309668' AND jybgb.BGRQ BETWEEN '2007-09-27' AND '2008-01-04' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 20) AS T | css |
CREATE TABLE table_30552 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Reset points" real,
"Events" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the person there the numbers is 2343
| SELECT "Player" FROM table_30552 WHERE "Points" = '2343' | wikisql |
CREATE TABLE table_23329 (
"(Virtual)" text,
"Callsign" text,
"Affiliation" text,
"Branding" text,
"Channel" text,
"Programming" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the virtual callsign if is wnet
| SELECT "(Virtual)" FROM table_23329 WHERE "Callsign" = 'WNET' | wikisql |
CREATE TABLE table_name_7 (
pick VARCHAR,
round VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the pick number for the kicker in round 8?
| SELECT COUNT(pick) FROM table_name_7 WHERE round = "round 8" AND position = "kicker" | sql_create_context |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
... | SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY CRS_CODE | nvbench |
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "4233" | mimicsql_data |
CREATE TABLE table_2758 (
"Pos" text,
"##" real,
"Name" text,
"Team" text,
"Lap One" text,
"Lap Two" text,
"Lap Three" text,
"Lap Four" text,
"Total Time" text,
"Avg. Speed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many... | SELECT COUNT("Pos") FROM table_2758 WHERE "Total Time" = '1:30.4135' | wikisql |
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Transplant cadaver donor" | mimicsql_data |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_37550 (
"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.
-- What day did Yugoslavia play Luxembourg?
| SELECT "Date" FROM table_37550 WHERE "Opponent" = 'luxembourg' | wikisql |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartment_Buildin... | SELECT apt_number, room_count FROM Apartments ORDER BY apt_number DESC | nvbench |
CREATE TABLE table_name_85 (
lungchang VARCHAR,
halang VARCHAR,
rera VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lungchang has a Halang of , and a Rera of o ?
| SELECT lungchang FROM table_name_85 WHERE halang = "ʒɯ²" AND rera = "ʒo²" | sql_create_context |
CREATE TABLE table_68773 (
"Estimate" text,
"Name" text,
"Nat." text,
"Ship type" text,
"Where sunk" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nation had a ship named Roma?
| SELECT "Nat." FROM table_68773 WHERE "Name" = 'roma' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | SELECT MIN(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 = 3229) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid I... | mimic_iii |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQ... | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '金正志' AND hz_info.YLJGDM = '8629178' AND NOT wdmzjzjlb.CYKSMC LIKE '%胃肠%' UNION SELECT * FROM person_info JO... | css |
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 Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY Age | nvbench |
CREATE TABLE table_15887683_17 (
dar VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the dar for telenord
| SELECT dar FROM table_15887683_17 WHERE television_service = "Telenord" | sql_create_context |
CREATE TABLE table_name_81 (
position VARCHAR,
birthplace VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Position of the person with a birthplace of phoenix, new york?
| SELECT position FROM table_name_81 WHERE birthplace = "phoenix, new york" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) 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 = mzjzjl... | css |
CREATE TABLE table_name_50 (
against INTEGER,
wins VARCHAR,
draws VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Against has a Draws larger than 0, a Losses smaller than 16, and a Wins smaller than 4?
| SELECT MAX(against) FROM table_name_50 WHERE draws > 0 AND losses < 16 AND wins < 4 | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Bleed esoph var oth dis" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_name_35 (
builder VARCHAR,
country VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Builder, when Country is 'United Kingdom', and when Location is 'Chatham, Kent'?
| SELECT builder FROM table_name_35 WHERE country = "united kingdom" AND location = "chatham, kent" | sql_create_context |
CREATE TABLE table_8560 (
"Episode Number" real,
"Air Date" text,
"Event 1" text,
"Event 2" text,
"Event 3" text,
"Event 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest episode aired on 8 June 2008?
| SELECT MIN("Episode Number") FROM table_8560 WHERE "Air Date" = '8 june 2008' | wikisql |
CREATE TABLE table_71446 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2009 value wi... | SELECT "2009" FROM table_71446 WHERE "2006" = 'q1' AND "Tournament" = 'french open' | wikisql |
CREATE TABLE table_name_20 (
elevation VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the elevation for oslo
| SELECT elevation FROM table_name_20 WHERE county = "oslo" | sql_create_context |
CREATE TABLE table_73201 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"Television order" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who wrote s01e06
| SELECT "Written by" FROM table_73201 WHERE "Television order" = 'S01E06' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2125" AND lab.itemid = "51484" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.