instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_22822559_4 (
location_attendance VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the location and number of fans in attendance for game 7/
| SELECT COUNT(location_attendance) FROM table_22822559_4 WHERE game = 7 | sql_create_context |
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 medication (
medi... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'creatinine') | eicu |
CREATE TABLE table_name_61 (
enrollment VARCHAR,
ihsaa_class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total enrollment of the aa IHSAA class?
| SELECT COUNT(enrollment) FROM table_name_61 WHERE ihsaa_class = "aa" | sql_create_context |
CREATE TABLE table_37464 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for April 22?
| SELECT "Record" FROM table_37464 WHERE "Date" = 'april 22' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE <= 20 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE <= 20 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE <= 20 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER... | css |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.route = "ORAL" | mimicsql_data |
CREATE TABLE table_72725 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by:" text,
"Written by:" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was 'The Magic Necklace' written by?
| SELECT "Written by:" FROM table_72725 WHERE "Title" = 'The Magic Necklace' | wikisql |
CREATE TABLE table_14286908_1 (
year_of_last_win VARCHAR,
total_finals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was the total finals at 10?
| SELECT year_of_last_win FROM table_14286908_1 WHERE total_finals = 10 | sql_create_context |
CREATE TABLE table_67664 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record after the April 6 game?
| SELECT "Record" FROM table_67664 WHERE "Date" = 'april 6' | wikisql |
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 treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-188709' AND patient.hospitaldischargetime IS NULL)) AND treat... | eicu |
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 AVG(vitalperiodic.systemicsystolic) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND NOT vitalperiodic.systemicsy... | eicu |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuest... | SELECT Id AS "user_link", Reputation, CreationDate, DisplayName, LastAccessDate FROM Users WHERE (Reputation > '##rep##') AND (DisplayName LIKE '%user%') ORDER BY Reputation | sede |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_c... | SELECT DISTINCT flight_id FROM flight WHERE ((((departure_time = (SELECT MAX(FLIGHTalias1.departure_time) FROM flight AS FLIGHTalias1 WHERE ((FLIGHTalias1.flight_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHER... | atis |
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_i... | css |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | SELECT datasource.SameDayAcceptedAnswer, datasource.TotalQuestions, CAST(datasource.SameDayAcceptedAnswer AS FLOAT) / CAST(datasource.TotalQuestions AS FLOAT) AS Ratio FROM (SELECT COUNT(acceptedresponses.questionid) AS SameDayAcceptedAnswer, allquestions.totalcount AS TotalQuestions FROM (SELECT question.Id AS questio... | sede |
CREATE TABLE table_70228 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class has a Team of kouros racing team?
| SELECT "Class" FROM table_70228 WHERE "Team" = 'kouros racing team' | wikisql |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text... | SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'DAL' AND flight.from_airport = airport.airport_code | atis |
CREATE TABLE airport (
id VARCHAR,
country VARCHAR,
name VARCHAR
)
CREATE TABLE flight (
pilot VARCHAR,
airport_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the different pilot names who had piloted a flight in the country 'United ... | SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport' | sql_create_context |
CREATE TABLE table_50848 (
"Ride" text,
"Year Opened" real,
"Ride Manufacturer and Type" text,
"Minimum Height" text,
"Rating" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has the ride flight deck and a rating of less than 5?
| SELECT COUNT("Year Opened") FROM table_50848 WHERE "Ride" = 'flight deck' AND "Rating" < '5' | wikisql |
CREATE TABLE table_1840 (
"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 (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT COUNT("Directed by") FROM table_1840 WHERE "Title" = 'Born Under a Bad Sign' | wikisql |
CREATE TABLE table_204_428 (
id number,
"season" text,
"east superleague" text,
"east premier league" text,
"east region south division" text,
"east region central division" text,
"east region north division" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "east region south division" FROM table_204_428 WHERE "east region south division" IN ('fauldhouse united', 'newtongrange star') GROUP BY "east region south division" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_22247 (
"Name" text,
"Notability" text,
"Reason for Seeking Refuge" text,
"Country" text,
"City" text,
"Missions Country" text,
"Start Date" text,
"End Date" text,
"Resolution" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "City" FROM table_22247 WHERE "Missions Country" = 'Australia' | wikisql |
CREATE TABLE table_name_83 (
drawn INTEGER,
games INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest drawn that has games less than 7?
| SELECT MIN(drawn) FROM table_name_83 WHERE games < 7 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | SELECT Id AS "user_link", Reputation, DisplayName, AboutMe FROM Users WHERE LOWER(AboutMe) LIKE '%ciro santilli%' OR LOWER(DisplayName) LIKE '%ciro santilli%' OR LOWER(AboutMe) LIKE '%895245%' OR LOWER(DisplayName) LIKE '%895245%' ORDER BY Reputation DESC LIMIT 256 | sede |
CREATE TABLE table_name_96 (
team VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team, when Game is '32'?
| SELECT team FROM table_name_96 WHERE game = 32 | sql_create_context |
CREATE TABLE table_204_217 (
id number,
"camp" text,
"div sec\ndivision" text,
"admin\ndistrict" text,
"9 feb" number,
"11 feb" number,
"16 feb" number,
"25 feb" number,
"27 feb" number,
"2 mar" number,
"4 mar" number,
"6 mar" number,
"11 mar" number,
"13 mar" num... | SELECT "camp" FROM table_204_217 ORDER BY "9 feb" DESC LIMIT 1 | squall |
CREATE TABLE table_name_40 (
shooter VARCHAR,
score_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Shooter has Score points of olympic silver medalist?
| SELECT shooter FROM table_name_40 WHERE score_points = "olympic silver medalist" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABL... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'unarmed fight or b... | mimic_iii |
CREATE TABLE table_1123802_1 (
_takeoff VARCHAR,
power VARCHAR,
engine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the engine is Wasp Jr. T1B2, what is the number needed for takeoff power?
| SELECT COUNT(power), _takeoff FROM table_1123802_1 WHERE engine = "Wasp Jr. T1B2" | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'W21.X35' AND hz_info.RYB... | css |
CREATE TABLE table_name_64 (
games INTEGER,
assists INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest amount of Games recorded that have more than 10 assists?
| SELECT MAX(games) FROM table_name_64 WHERE assists > 10 | sql_create_context |
CREATE TABLE table_42934 (
"State" text,
"White (%)" real,
"Brown (%)" real,
"Black (%)" real,
"Asian or Amerindian (%)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of White (%), when Black (%) is less than 5,8, and when Asian or ... | SELECT SUM("White (%)") FROM table_42934 WHERE "Black (%)" < '5,8' AND "Asian or Amerindian (%)" < '0,2' | wikisql |
CREATE TABLE table_name_76 (
guest VARCHAR,
score__first_match_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the guest team wehn the match score was 3:0 (0:2)?
| SELECT guest FROM table_name_76 WHERE score__first_match_ = "3:0 (0:2)" | sql_create_context |
CREATE TABLE table_name_86 (
opponent VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the opponent when the score was 7 1?
| SELECT opponent FROM table_name_86 WHERE score = "7–1" | sql_create_context |
CREATE TABLE table_15135 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which surface was the score w/o?
| SELECT "Surface" FROM table_15135 WHERE "Score" = 'w/o' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT CYZTDM FROM zyjzjlb WHERE JZLSH = '99842963848' | css |
CREATE TABLE table_203_581 (
id number,
"club" text,
"chinese" text,
"city" text,
"home stadium" text,
"capacity" number,
"average attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many clubs are listed in the table ?
| SELECT COUNT("club") FROM table_203_581 | squall |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2098" AND prescriptions.drug = "Clonazepam" | mimicsql_data |
CREATE TABLE table_25346763_1 (
Major VARCHAR,
facility VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is the Washington Corrections Center for Women (WCCW) a major facility?
| SELECT Major AS facility FROM table_25346763_1 WHERE facility = "Washington Corrections Center for Women (WCCW)" | sql_create_context |
CREATE TABLE table_12647 (
"Year" real,
"Champion" text,
"Runner-Up" text,
"Score" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What champion has north melbourne as the runner-up?
| SELECT "Champion" FROM table_12647 WHERE "Runner-Up" = 'north melbourne' | wikisql |
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 TABLE weekly_weather (
station_id int,
day_of_week text... | SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id ORDER BY COUNT(*) | nvbench |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
t... | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building ORDER BY COUNT(building) | nvbench |
CREATE TABLE table_19068566_1 (
written_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 3t7458 is the production code who are the writers?
| SELECT written_by FROM table_19068566_1 WHERE production_code = "3T7458" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_70401 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the week with a date of October 9, 1983, and attendance smaller than 40,492?
| SELECT COUNT("Week") FROM table_70401 WHERE "Date" = 'october 9, 1983' AND "Attendance" < '40,492' | wikisql |
CREATE TABLE table_name_60 (
season VARCHAR,
opponent VARCHAR,
location VARCHAR,
decision VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season was played at Safeco Field, against the Boston Red Sox, with a decision of L?
| SELECT season FROM table_name_60 WHERE location = "safeco field" AND decision = "l" AND opponent = "boston red sox" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "55" AND lab.label = "WBC, Other Fluid" | mimicsql_data |
CREATE TABLE table_18639 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In how many districts is the incumbent Dave E. Satterfield, Jr.
| SELECT COUNT("Result") FROM table_18639 WHERE "Incumbent" = 'Dave E. Satterfield, Jr.' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name | 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.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2184" | mimicsql_data |
CREATE TABLE table_name_93 (
long VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the long for charles frederick
| SELECT long FROM table_name_93 WHERE player = "charles frederick" | sql_create_context |
CREATE TABLE table_name_61 (
october VARCHAR,
november VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is in October when Carina Ragnarsson is in November?
| SELECT october FROM table_name_61 WHERE november = "carina ragnarsson" | sql_create_context |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20165)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... | mimic_iii |
CREATE TABLE table_204_240 (
id number,
"name" text,
"current use" text,
"completed" text,
"namesake" text,
"info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which building is after the bonds hall ?
| SELECT "name" FROM table_204_240 WHERE id = (SELECT id FROM table_204_240 WHERE "name" = 'bonds hall') + 1 | squall |
CREATE TABLE airport (
id int,
City text,
Country text,
IATA text,
ICAO text,
name text
)
CREATE TABLE flight (
id int,
Vehicle_Flight_number text,
Date text,
Pilot text,
Velocity real,
Altitude real,
airport_id int,
company_id int
)
CREATE TABLE operate_company... | SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY Type ORDER BY Type DESC | nvbench |
CREATE TABLE table_name_36 (
nationality VARCHAR,
round VARCHAR,
college_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Nationality, when Round is less than 2, and when College/Team is 'CB L'Hospitalet'?
| SELECT nationality FROM table_name_36 WHERE round < 2 AND college_team = "cb l'hospitalet" | sql_create_context |
CREATE TABLE table_26708 (
"Major version" text,
"Minor version" text,
"WebKit version" text,
"Operating System" text,
"Release date" text,
"Features" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the webkit version when the minor versi... | SELECT "WebKit version" FROM table_26708 WHERE "Minor version" = '3.1.2' | wikisql |
CREATE TABLE table_name_90 (
percentage___percentage_ VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage for Russian?
| SELECT percentage___percentage_ FROM table_name_90 WHERE language = "russian" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2184" | mimicsql_data |
CREATE TABLE table_66226 (
"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.
-- Which High re... | SELECT "High rebounds" FROM table_66226 WHERE "Score" = 'w 81-69' | wikisql |
CREATE TABLE table_name_17 (
song VARCHAR,
issue_date_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Song has an Issue date(s) of 29 may - 26 june?
| SELECT song FROM table_name_17 WHERE issue_date_s_ = "29 may - 26 june" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '云成双' AND hz_info.YLJGDM = '5772837' AND zyjzjlb.JZKSMC LIKE '%免疫科%' | css |
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.marital_status = "DIVORCED" AND demographic.admityear < "2120" | mimicsql_data |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "68" | mimicsql_data |
CREATE TABLE table_14670060_1 (
transmitting_from VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times does the call sign XEZV appear?
| SELECT COUNT(transmitting_from) FROM table_14670060_1 WHERE call_sign = "XEZV" | sql_create_context |
CREATE TABLE table_8813 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does the player from Mississippi state play?
| SELECT "Position" FROM table_8813 WHERE "College" = 'mississippi state' | wikisql |
CREATE TABLE table_name_30 (
year VARCHAR,
bärenklau VARCHAR,
schwante VARCHAR,
eichstädt VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has a Schwante smaller than 2.043, an Eichst dt smaller than 848, and a B renklau smaller than 1.262?
| SELECT COUNT(year) FROM table_name_30 WHERE schwante < 2.043 AND eichstädt < 848 AND bärenklau < 1.262 | sql_create_context |
CREATE TABLE table_name_46 (
venue VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the competition take place that had a 4-2 result?
| SELECT venue FROM table_name_46 WHERE result = "4-2" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Medicare" | mimicsql_data |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE CL... | SELECT DEPT_ADDRESS, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) DESC LIMIT 3 | nvbench |
CREATE TABLE table_name_15 (
points INTEGER,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have Wins larger than 1?
| SELECT AVG(points) FROM table_name_15 WHERE wins > 1 | sql_create_context |
CREATE TABLE table_1341549_10 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the district of lawrence j. smith
| SELECT district FROM table_1341549_10 WHERE incumbent = "Lawrence J. Smith" | sql_create_context |
CREATE TABLE table_21740 (
"Number" text,
"Builder" text,
"Type" text,
"Date built" text,
"Heritage" text,
"Disposition" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of builders for number 96
| SELECT COUNT("Builder") FROM table_21740 WHERE "Number" = '96' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '88247382' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6145.72) | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_97 (
leading_scorer VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the leading scorer of the game with an attendance of 14,096?
| SELECT leading_scorer FROM table_name_97 WHERE attendance = "14,096" | sql_create_context |
CREATE TABLE table_15650 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date is associated with the label Village Records?
| SELECT "Date" FROM table_15650 WHERE "Label" = 'village records' | wikisql |
CREATE TABLE table_18269 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what district was the incumbent Michael Bilirakis?
| SELECT "District" FROM table_18269 WHERE "Incumbent" = 'Michael Bilirakis' | wikisql |
CREATE TABLE table_name_56 (
debut_year INTEGER,
player VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest debut year for player Joe Youlden, with goals larger than 0?
| SELECT MAX(debut_year) FROM table_name_56 WHERE player = "joe youlden" AND goals > 0 | sql_create_context |
CREATE TABLE table_22496344_1 (
high_school VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which highschool has senior (rs) for the year?
| SELECT high_school FROM table_22496344_1 WHERE year = "Senior (RS)" | sql_create_context |
CREATE TABLE table_57826 (
"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 bronze medals for the nation with less than 1 total?
| SELECT MAX("Bronze") FROM table_57826 WHERE "Total" < '1' | wikisql |
CREATE TABLE table_2009095_2 (
championship VARCHAR,
outcome VARCHAR,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the championship for winner and judy tegart dalton lesley turner bowrey
| SELECT COUNT(championship) FROM table_2009095_2 WHERE outcome = "Winner" AND opponents = "Judy Tegart Dalton Lesley Turner Bowrey" | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE... | SELECT Id AS "post_link", Tags, ViewCount, CreationDate, Title FROM Posts WHERE LastActivityDate > DATEADD(m, -12, GETDATE()) AND Tags LIKE '<##Tag##>' AND NOT Title LIKE '<##Tag##>' AND NOT Title LIKE '<##ExcludeTitle##>' ORDER BY ViewCount DESC | sede |
CREATE TABLE table_24485 (
"Day" text,
"Stage" text,
"Time (EET)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time when ss1... | SELECT "Time" FROM table_24485 WHERE "Stage" = 'SS12' | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2131.0" AND procedures.icd9_code = "9907" | mimicsql_data |
CREATE TABLE table_18598175_2 (
method_of_elimination VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the styled used to defeat the opponent within the time frame of 32:32?
| SELECT method_of_elimination FROM table_18598175_2 WHERE time = "32:32" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "60000" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.