instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_204_727 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which countries won the more than five silver medals ?
| SELECT "nation" FROM table_204_727 WHERE "silver" > 5 | squall |
CREATE TABLE table_name_41 (
name VARCHAR,
rank VARCHAR,
altitude__meters_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What name is associated with a rank of less than 24, and an altitude (meters) of 3085?
| SELECT name FROM table_name_41 WHERE rank < 24 AND altitude__meters_ = 3085 | sql_create_context |
CREATE TABLE table_10956 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest year a game was played in Athens?
| SELECT MIN("Year") FROM table_10956 WHERE "Location" = 'athens' | wikisql |
CREATE TABLE table_28436909_4 (
organization VARCHAR,
founding_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1873-12-25 is the founding date how many organizations are there?
| SELECT COUNT(organization) FROM table_28436909_4 WHERE founding_date = "1873-12-25" | sql_create_context |
CREATE TABLE table_name_80 (
away_team VARCHAR,
ground VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team score when Waverley Park was the ground and the home team was collingwood?
| SELECT away_team AS score FROM table_name_80 WHERE ground = "waverley park" AND home_team = "collingwood" | sql_create_context |
CREATE TABLE table_24969173_1 (
drying_shrinkage___percentage_ VARCHAR,
dry_density__kg_m3_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the dry density is 800, what is the drying shrinkage %?
| SELECT drying_shrinkage___percentage_ FROM table_24969173_1 WHERE dry_density__kg_m3_ = 800 | sql_create_context |
CREATE TABLE table_1886270_1 (
built VARCHAR,
hr_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When river ness is the hr name how many builts are there?
| SELECT COUNT(built) FROM table_1886270_1 WHERE hr_name = "River Ness" | sql_create_context |
CREATE TABLE employees (
department_id VARCHAR,
manager_id VARCHAR,
employee_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the ids of the departments where any manager is managing 4 or more employees.
| SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4 | sql_create_context |
CREATE TABLE table_3803 (
"Stage" real,
"Winner" text,
"General classification" text,
"Mountains Classification" text,
"Points classification" text,
"Sprints Classification" text,
"Team Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT COUNT("Mountains Classification") FROM table_3803 WHERE "Winner" = 'Robert Gesink' | wikisql |
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 demographic (
subject_id text,
hadm_id t... | SELECT demographic.days_stay, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "91588" | mimicsql_data |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5659309' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-02-01' AND '2007-12-20' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 6358.78) AS T | css |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department LIKE '%RCIDIV%' AND program_course.course_id = course.course_id AND program_course.workload < 3 | advising |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT T1.pname FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T2.decision = 'yes' AND T2.ppos = 'striker' | spider |
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE writer (
wid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE company (
id int,
name text,
country_code va... | SELECT COUNT(DISTINCT (company.name)) FROM actor, cast, company, copyright, movie WHERE actor.name = 'Gabriele Ferzetti' AND cast.aid = actor.aid AND copyright.cid = company.id AND movie.mid = cast.msid AND movie.mid = copyright.msid | imdb |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
pro... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.departure_time <= 0 AND flight.departure_time >= 800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flig... | atis |
CREATE TABLE table_29032 (
"No. in series" 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 above.
-- What is the numb... | SELECT COUNT("No. in series") FROM table_29032 WHERE "Written by" = 'Teresa Lin' | wikisql |
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club (
Club_ID int,
name tex... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type | nvbench |
CREATE TABLE table_77778 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player from Beaumont, Texas?
| SELECT "Position" FROM table_77778 WHERE "Hometown" = 'beaumont, texas' | wikisql |
CREATE TABLE table_name_15 (
score VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score during the Season in which the Winner was C.F. Atlante?
| SELECT score FROM table_name_15 WHERE winner = "c.f. atlante" | sql_create_context |
CREATE TABLE table_name_18 (
award VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What award is featured in 1992?
| SELECT award FROM table_name_18 WHERE year = 1992 | sql_create_context |
CREATE TABLE table_51120 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the place with a to par of E and a score of 69-69-72=210?
| SELECT "Place" FROM table_51120 WHERE "To par" = 'e' AND "Score" = '69-69-72=210' | wikisql |
CREATE TABLE table_name_50 (
league_goals VARCHAR,
league_apps VARCHAR,
fa_cup_goals VARCHAR,
fa_cup_apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the league goals when the fa cup goals is higher than 0, the fa cup apps is 2 and the lea... | SELECT league_goals FROM table_name_50 WHERE fa_cup_goals > 0 AND fa_cup_apps = "2" AND league_apps = "45" | sql_create_context |
CREATE TABLE table_38571 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Frequency MHz has a ERP W of 250?
| SELECT MAX("Frequency MHz") FROM table_38571 WHERE "ERP W" = '250' | wikisql |
CREATE TABLE table_name_78 (
height VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Alex Poythress height?
| SELECT height FROM table_name_78 WHERE player = "alex poythress" | sql_create_context |
CREATE TABLE table_562 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the followi... | SELECT "Tries against" FROM table_562 WHERE "Won" = '14' | wikisql |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8... | SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name | nvbench |
CREATE TABLE table_name_85 (
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent at the week 4 game?
| SELECT opponent FROM table_name_85 WHERE week = 4 | sql_create_context |
CREATE TABLE table_79263 (
"Constructor" text,
"Chassis" text,
"Starts" real,
"Finishes" real,
"Wins" real,
"Podiums" real,
"Stage wins" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest podiums when the s... | SELECT MAX("Podiums") FROM table_79263 WHERE "Stage wins" = '91' AND "Points" < '140' | wikisql |
CREATE TABLE table_245695_2 (
mls_cup_playoffs VARCHAR,
concacaf_champions_cup___concacaf_champions_league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the mls cup playoffs when concacaf champions cup / concacaf champions league was quarter-finals... | SELECT mls_cup_playoffs FROM table_245695_2 WHERE concacaf_champions_cup___concacaf_champions_league = "Quarter-Finals (09-10)" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-64961')) AND lab.labname = 'rdw' AND STRFTIME('%y-%m', lab.labresulttime) >= '2... | eicu |
CREATE TABLE table_58472 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for a CD format with a Region of Europe?
| SELECT "Date" FROM table_58472 WHERE "Region" = 'europe' AND "Format" = 'cd' | wikisql |
CREATE TABLE table_name_91 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Away team plays at the Venue vfl park?
| SELECT away_team FROM table_name_91 WHERE venue = "vfl park" | sql_create_context |
CREATE TABLE table_28967275_2 (
original_air_date VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original airdate of episode #31?
| SELECT original_air_date FROM table_28967275_2 WHERE episode__number = 31 | sql_create_context |
CREATE TABLE table_30566 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Michal Pivonka's pick number?
| SELECT COUNT("Pick #") FROM table_30566 WHERE "Player" = 'Michal Pivonka' | wikisql |
CREATE TABLE table_name_94 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2011 when 2010 is 2r
| SELECT 2011 FROM table_name_94 WHERE 2010 = "2r" | sql_create_context |
CREATE TABLE table_204_337 (
id number,
"festival" text,
"year" number,
"award" text,
"nominee" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the last festival ?
| SELECT "festival" FROM table_204_337 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_name_22 (
home_captain VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the home captain that played at Edgbaston?
| SELECT home_captain FROM table_name_22 WHERE venue = "edgbaston" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2129" AND diagnoses.icd9_code = "5718" | mimicsql_data |
CREATE TABLE table_40532 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the 2014 World Cup Qualification?
| SELECT "Score" FROM table_40532 WHERE "Competition" = '2014 world cup qualification' | wikisql |
CREATE TABLE table_name_29 (
city VARCHAR,
country VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for country of spain and iata of ibz, what's the city?
| SELECT city FROM table_name_29 WHERE country = "spain" AND iata = "ibz" | sql_create_context |
CREATE TABLE table_22750 (
"Character" text,
"Original Broadway performer" text,
"Original Australian performer" text,
"Original West End performer" text,
"2005 World AIDS Day Benefit Dream Cast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is... | SELECT "Original West End performer" FROM table_22750 WHERE "Character" = 'Martha' | wikisql |
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 jybgb JOIN jyjgzbb JOIN jybgb_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.YLJG... | css |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3637568' AND IN_HOSP_DATE BETWEEN '2001-10-23' AND '2008-01-21' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_name_62 (
authors VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which writer is named mongolbittacus?
| SELECT authors FROM table_name_62 WHERE name = "mongolbittacus" | sql_create_context |
CREATE TABLE table_24765815_2 (
player VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player that played in the UEFA Euro 2012 qualifying Group A competition?
| SELECT player FROM table_24765815_2 WHERE competition = "UEFA Euro 2012 qualifying Group A" | sql_create_context |
CREATE TABLE table_name_62 (
athletes VARCHAR,
rank VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which athlete is ranked below 5 and is from China?
| SELECT athletes FROM table_name_62 WHERE rank < 5 AND country = "china" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT diagnoses.icd9_code, prescriptions.drug FROM diagnoses INNER JOIN prescriptions ON diagnoses.hadm_id = prescriptions.hadm_id WHERE diagnoses.subject_id = "65652" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2121" | 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 lab (
subject_id text,
hadm_id text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "GANGRENE" | mimicsql_data |
CREATE TABLE table_name_45 (
works_number INTEGER,
date VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total work number of Gowrie after 1875?
| SELECT SUM(works_number) FROM table_name_45 WHERE date > 1875 AND name = "gowrie" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT procedures.icd9_code, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Mary Davis" | mimicsql_data |
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 lab (
subject_id text,
hadm_id text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "DEAD/EXPIRED" | mimicsql_data |
CREATE TABLE room (
roomnumber number,
roomtype text,
blockfloor number,
blockcode number,
unavailable boolean
)
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificationexpires time
)
CREATE TABLE physician (
employeeid number,
nam... | SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn JOIN prescribes AS T3 ON T3.patient = T2.ssn JOIN medication AS T4 ON T3.medication = T4.code WHERE room = 111 | spider |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE table_3386 (
"Episode #" text,
"Original Air Date (UK)" text,
"Episode Title" text,
"Director" text,
"Writer" text,
"Cast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the episode title is Pressures, what are the names of the c... | SELECT "Cast" FROM table_3386 WHERE "Episode Title" = 'Pressures' | wikisql |
CREATE TABLE table_58162 (
"Release title" text,
"Released as" text,
"Release type" text,
"Label" text,
"Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Ethereal 77, which has a CD album release type?
| SELECT "Year" FROM table_58162 WHERE "Release type" = 'cd album' AND "Released as" = 'ethereal 77' | wikisql |
CREATE TABLE table_9458 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the outcome of the tournamen... | SELECT "Outcome" FROM table_9458 WHERE "Partner" = 'ilie năstase' | wikisql |
CREATE TABLE table_13834 (
"Rank" real,
"Peak" text,
"Country" text,
"Island" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Prominence (m) has an Elevation (m) of 2,797, ... | SELECT SUM("Prominence (m)") FROM table_13834 WHERE "Elevation (m)" = '2,797' AND "Col (m)" < '0' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 9 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_name_21 (
average INTEGER,
state VARCHAR,
interview VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Average for South Carolina with an Interview less than 9.626?
| SELECT SUM(average) FROM table_name_21 WHERE state = "south carolina" AND interview < 9.626 | sql_create_context |
CREATE TABLE table_204_44 (
id number,
"face value" number,
"\u20ac0.01" number,
"\u20ac0.02" number,
"\u20ac0.05" number,
"\u20ac0.10" number,
"\u20ac0.20" number,
"\u20ac0.50" number,
"\u20ac1.00" number,
"\u20ac2.00" number
)
-- Using valid SQLite, answer the following quest... | SELECT "face value" FROM table_204_44 WHERE id = (SELECT id FROM table_204_44 WHERE "face value" = '2006') + 1 | 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 procedures.long_title FROM procedures WHERE procedures.icd9_code = "640" | mimicsql_data |
CREATE TABLE table_14349 (
"Pick" real,
"Player" text,
"Country of Origin*" text,
"PBA team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the country of origin for patrick madarang
| SELECT "Country of Origin*" FROM table_14349 WHERE "Player" = 'patrick madarang' | wikisql |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE... | SELECT name, distance FROM aircraft ORDER BY distance | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 98177) ORDER BY diagnoses_icd.charttime DESC LIMIT 1) | mimic_iii |
CREATE TABLE table_29696 (
"Team" text,
"Chairman" text,
"Head Coach" text,
"Captain" text,
"Kitmaker" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many captains when the shirt sponsor is toshiba?
| SELECT COUNT("Captain") FROM table_29696 WHERE "Shirt sponsor" = 'Toshiba' | wikisql |
CREATE TABLE table_203_263 (
id number,
"alumni chapters and clubs" text,
"location" text,
"founding date" text,
"years active" text,
"province" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many chapters or clubs were founded in or before ... | SELECT COUNT("alumni chapters and clubs") FROM table_203_263 WHERE "founding date" <= 1950 | squall |
CREATE TABLE Customers (
customer_id INTEGER,
coupon_id INTEGER,
good_or_bad_customer VARCHAR(4),
first_name VARCHAR(80),
last_name VARCHAR(80),
gender_mf VARCHAR(1),
date_became_customer DATETIME,
date_last_hire DATETIME
)
CREATE TABLE Payments (
payment_id INTEGER,
booking_id ... | SELECT T1.customer_id, COUNT(*) FROM Customers AS T1 JOIN Bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21134)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin... | mimic_iii |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'packed cell... | mimic_iii |
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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2065" AND procedures.icd9_code = "46" | mimicsql_data |
CREATE TABLE table_name_6 (
b_score VARCHAR,
a_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the b score when the a score is 6.9?
| SELECT b_score FROM table_name_6 WHERE a_score = 6.9 | sql_create_context |
CREATE TABLE table_22904780_1 (
original_air_date VARCHAR,
rank__week_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the original air date for week 5.
| SELECT original_air_date FROM table_22904780_1 WHERE rank__week_ = 5 | sql_create_context |
CREATE TABLE table_14397 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Kerry has 70.2% and 1,439,724, what is the Bush#?
| SELECT MAX("Bush#") FROM table_14397 WHERE "Kerry%" = '70.2%' AND "Kerry#" > '1,439,724' | wikisql |
CREATE TABLE table_3455 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of the episode ... | SELECT "Original air date" FROM table_3455 WHERE "Directed by" = 'Frederick E. O. Toye' | wikisql |
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
... | SELECT Season, COUNT(Season) FROM game ORDER BY Season DESC | nvbench |
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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7375 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilir... | mimic_iii |
CREATE TABLE table_name_69 (
rank VARCHAR,
scorer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Rank has a Scorer of lee sang-cheol?
| SELECT rank FROM table_name_69 WHERE scorer = "lee sang-cheol" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id n... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND prescriptions.drug = '5% dextrose' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | mimic_iii |
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.days_stay > "13" AND lab.itemid = "50891" | mimicsql_data |
CREATE TABLE table_name_15 (
placings VARCHAR,
total VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the placing value for a total less than 96.07 in the United States?
| SELECT placings FROM table_name_15 WHERE total < 96.07 AND nation = "united states" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Other shock without mention of trauma" | mimicsql_data |
CREATE TABLE table_198175_2 (
swedish_name VARCHAR,
residence_city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every Swedish name for residence city is Loviisa?
| SELECT swedish_name FROM table_198175_2 WHERE residence_city = "Loviisa" | sql_create_context |
CREATE TABLE table_51059 (
"Year" real,
"Beer Name" text,
"Prize" text,
"Category" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did maggs magnificent mild win a gold medal in the mild and porter category at the siba s... | SELECT AVG("Year") FROM table_51059 WHERE "Beer Name" = 'maggs magnificent mild' AND "Prize" = 'gold medal' AND "Category" = 'mild and porter' AND "Competition" = 'siba south east region beer competition' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2105' GROUP BY procedures_icd.icd9_code) AS t1 ... | mimic_iii |
CREATE TABLE table_17634290_7 (
country VARCHAR,
moving_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the country where moving from is listed as bristol city?
| SELECT country FROM table_17634290_7 WHERE moving_from = "Bristol City" | sql_create_context |
CREATE TABLE table_52122 (
"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 Away team score has a Home team of melbour... | SELECT "Away team score" FROM table_52122 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescription... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 62298 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | 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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2484766' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-05-25' AND '2014-06-18' AND t_kc21.CLINIC_TYPE = '门诊' | 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 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 table_name_72 (
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the surface for 16 april 2007
| SELECT surface FROM table_name_72 WHERE date = "16 april 2007" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | 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.icd9_code = "48249" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_66 (
population_2006_census INTEGER,
local_government_area VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2006 population for the local government area of alexandrina council whose rank was smaller than ... | SELECT AVG(population_2006_census) FROM table_name_66 WHERE local_government_area = "alexandrina council" AND rank < 19 | sql_create_context |
CREATE TABLE table_57075 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On average, what is the number of silver medals for nations ranking higher than 7, with a to... | SELECT AVG("Silver") FROM table_57075 WHERE "Rank" > '7' AND "Total" = '6' AND "Bronze" < '2' | wikisql |
CREATE TABLE table_name_14 (
team VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For what Team is Narain Karthikeyan the Driver?
| SELECT team FROM table_name_14 WHERE driver = "narain karthikeyan" | sql_create_context |
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT country FROM market ORDER BY country | spider |
CREATE TABLE table_14330096_4 (
total_number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total number?
| SELECT MAX(total_number) FROM table_14330096_4 | sql_create_context |
CREATE TABLE table_name_1 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team's score when Geelong was the away team?
| SELECT home_team AS score FROM table_name_1 WHERE away_team = "geelong" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.