instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT T2.name FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid GROUP BY T1.rid HAVING COUNT(*) >= 3 | spider |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7494699' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-02-11' AND '2009-08-18' | css |
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 intakeoutput (
in... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10407')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2100' | eicu |
CREATE TABLE table_23284271_10 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for game 78?
| SELECT score FROM table_23284271_10 WHERE game = 78 | sql_create_context |
CREATE TABLE table_54502 (
"Tournament" text,
"Date" text,
"City" text,
"Country" text,
"Surface" text,
"Singles champions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Singles Champions in Trieste, Italy?
| SELECT "Singles champions" FROM table_54502 WHERE "Country" = 'italy' AND "City" = 'trieste' | wikisql |
CREATE TABLE table_204_265 (
id number,
"no." number,
"title (latin)" text,
"title (english translation)" text,
"subject" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the last title ?
| SELECT "title (latin)" FROM table_204_265 ORDER BY "no." DESC LIMIT 1 | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'wound, decubitus' AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | eicu |
CREATE TABLE screen_mode (
graphics_mode number,
char_cells text,
pixels text,
hardware_colours number,
used_kb number,
map text,
type text
)
CREATE TABLE phone (
company_name text,
hardware_model_name text,
accreditation_type text,
accreditation_level text,
date text,
... | SELECT company_name FROM phone GROUP BY company_name HAVING COUNT(*) > 1 | spider |
CREATE TABLE table_train_5 (
"id" int,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"protein_c" int,
"liver_disease" bool,
"chronic_respiratory_disease" bool,
"child_pugh_score" int,
"septic_shock" bool,
"myocardial_infarction" bool,
"NOUSE" float
)
-- Using valid SQLit... | SELECT * FROM table_train_5 WHERE myocardial_infarction = 1 | criteria2sql |
CREATE TABLE table_name_82 (
lane INTEGER,
mark VARCHAR,
heat VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest lane value for a mark of 2:02.27 NR, with heats under 2?
| SELECT MAX(lane) FROM table_name_82 WHERE mark = "2:02.27 nr" AND heat < 2 | sql_create_context |
CREATE TABLE table_51742 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the away team score 13.13 (91) ... | SELECT "Date" FROM table_51742 WHERE "Crowd" > '15,601' AND "Away team score" = '13.13 (91)' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGui... | SELECT TIME_TO_STR(p.LastActivityDate, '%q') AS q, YEAR(p.LastActivityDate) AS y, COUNT(p.Id) AS NumPosts, Tags FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId WHERE YEAR(p.LastActivityDate) = 2016 GROUP BY TIME_TO_STR(p.LastActivityDate, '%q'), YEAR(p.LastActivityDate), Tags ORDER BY y, q, NumPosts DESC | sede |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId numbe... | SELECT q.Id AS "post_link", q.Score, q.Tags, q.CreationDate FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE a.PostTypeId = 2 AND a.OwnerUserId = '##UserId:int##' AND LOWER(q.Body) LIKE '%' + LOWER('##SearchStr:string##') + '%' | sede |
CREATE TABLE table_name_53 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent led to a 56-59 record?
| SELECT opponent FROM table_name_53 WHERE record = "56-59" | sql_create_context |
CREATE TABLE table_name_19 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team at Essendon?
| SELECT away_team AS score FROM table_name_19 WHERE away_team = "essendon" | sql_create_context |
CREATE TABLE table_14882588_2 (
race_number VARCHAR,
sail_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If sail number is AUS 03, what are all associated race numbers?
| SELECT race_number FROM table_14882588_2 WHERE sail_number = "AUS 03" | sql_create_context |
CREATE TABLE table_203_321 (
id number,
"sheriff" text,
"start of term" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when did the first sheriff 's term start ?
| SELECT MIN("start of term") FROM table_203_321 | squall |
CREATE TABLE table_name_25 (
bronze VARCHAR,
silver VARCHAR,
total VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was the total more than 1, the nation was east germany and silver was more than 1?
| SELECT COUNT(bronze) FROM table_name_25 WHERE total > 1 AND nation = "east germany" AND silver > 1 | sql_create_context |
CREATE TABLE table_66315 (
"Rank" real,
"Athletes" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country does Adam van Koeverden play for?
| SELECT "Country" FROM table_66315 WHERE "Athletes" = 'adam van koeverden' | wikisql |
CREATE TABLE table_12206918_2 (
number VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was iran barkley an opponent?
| SELECT number FROM table_12206918_2 WHERE opponent = "Iran Barkley" | 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 WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2105" | mimicsql_data |
CREATE TABLE table_56878 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the c... | SELECT "Circuit" FROM table_56878 WHERE "Fastest lap" = 'john surtees' AND "Winning driver" = 'john surtees' | wikisql |
CREATE TABLE table_204_613 (
id number,
"title" text,
"year" number,
"peak chart positions\nus" number,
"peak chart positions\nus\nr&b" number,
"peak chart positions\nus\nrap" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- te... | SELECT COUNT(*) FROM table_204_613 WHERE "album" = 'non-album singles' | squall |
CREATE TABLE table_name_58 (
iata VARCHAR,
airport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA of gale o airport?
| SELECT iata FROM table_name_58 WHERE airport = "galeão airport" | 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 wdmzjzjlb.JLSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '03946875795' UNION SELECT bdmzjzjlb.JLSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '03946875795' | css |
CREATE TABLE table_name_50 (
year INTEGER,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the latest year with a hometown of san carlos, pangasinan?
| SELECT MAX(year) FROM table_name_50 WHERE hometown = "san carlos, pangasinan" | sql_create_context |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citi... | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Kaiming He' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_46691 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which method took place against Chris Herring?
| SELECT "Method" FROM table_46691 WHERE "Opponent" = 'chris herring' | wikisql |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
... | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_4656 (
"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.
-- What was the away team when the home team scored ... | SELECT "Away team" FROM table_4656 WHERE "Home team score" = '7.11 (53)' | wikisql |
CREATE TABLE table_60167 (
"Model" text,
"Screen size" text,
"Bluetooth" text,
"FM transmitter" text,
"Flash" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Does the S90i model have bluetooth?
| SELECT "Bluetooth" FROM table_60167 WHERE "Model" = 's90i' | wikisql |
CREATE TABLE table_52332 (
"Pac-12" text,
"Lost" real,
"Tied" real,
"Pct." real,
"Years" real,
"Total Games" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of games tied for teams with under 551 games and a percentage ... | SELECT MAX("Tied") FROM table_52332 WHERE "Pct." < '0.5593' AND "Lost" = '551' | wikisql |
CREATE TABLE table_170969_2 (
status VARCHAR,
official_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status for Saint George?
| SELECT status FROM table_170969_2 WHERE official_name = "Saint George" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid ... | 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 = '007-7646')) AND STRFTIME('%y', treatment.treatmenttime) >= '2105'... | eicu |
CREATE TABLE table_44164 (
"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 is the position of the player from the college of North Carolina with an overall le... | SELECT "Position" FROM table_44164 WHERE "Overall" < '100' AND "College" = 'north carolina' | wikisql |
CREATE TABLE table_67920 (
"Program" text,
"Frequency MHz" real,
"ERP kW" real,
"Polarisation" text,
"Antenna Diagram around (ND) / directional (D)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average MHz Frequency of radio rezonans?
| SELECT AVG("Frequency MHz") FROM table_67920 WHERE "Program" = 'radio rezonans' | wikisql |
CREATE TABLE table_name_47 (
h_s_asst_principal VARCHAR,
glendale_principal VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the H.S. Asst. principal with a Glendale principal Joyce Brace during 2002-2003?
| SELECT h_s_asst_principal FROM table_name_47 WHERE glendale_principal = "joyce brace" AND year = "2002-2003" | sql_create_context |
CREATE TABLE table_2140071_7 (
episode VARCHAR,
coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes have Valerie?
| SELECT COUNT(episode) AS Summary FROM table_2140071_7 WHERE coach = "Valerie" | 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 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 = "70724" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c... | advising |
CREATE TABLE table_name_60 (
venue VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Venue is in 1994?
| SELECT venue FROM table_name_60 WHERE year = 1994 | sql_create_context |
CREATE TABLE table_14011 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the bronze medal count of Spain that has less than 39 Gold, 3 silver, and a rank bett... | SELECT "Bronze" FROM table_14011 WHERE "Gold" < '39' AND "Silver" = '3' AND "Rank" < '35' AND "Nation" = 'spain' | wikisql |
CREATE TABLE table_train_274 (
"id" int,
"gender" string,
"serum_bicarbonate" int,
"randomization_bg" int,
"positive_serum" bool,
"diabetic_ketoacidosis" bool,
"urinary_ketones" bool,
"diastolic_blood_pressure_dbp" int,
"heart_rate" int,
"body_mass_index_bmi" float,
"age" flo... | SELECT * FROM table_train_274 WHERE heart_rate >= 65 AND heart_rate <= 90 | criteria2sql |
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT T2.name FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T1.stars = 4 | spider |
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE useracct (
u_id number,
name text
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
)
-- Usi... | SELECT T1.name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id | spider |
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '躁狂型精神病' AND jyjgzbb.JCZBDM = '758740' | css |
CREATE TABLE table_71223 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rank of an athlete that holds a time higher than 53.38?
| SELECT AVG("Rank") FROM table_71223 WHERE "Time" > '53.38' | wikisql |
CREATE TABLE table_67670 (
"Position" text,
"Player" text,
"County team" text,
"Club team(s)" text,
"Team Number" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many team numbers have john keane as the player?
| SELECT COUNT("Team Number") FROM table_67670 WHERE "Player" = 'john keane' | wikisql |
CREATE TABLE table_4665 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is the guard from ucla?
| SELECT "Nationality" FROM table_4665 WHERE "Position" = 'guard' AND "School/Country" = 'ucla' | wikisql |
CREATE TABLE table_name_56 (
driver VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has a 166 c 500 chassis?
| SELECT driver FROM table_name_56 WHERE chassis = "166 c 500" | sql_create_context |
CREATE TABLE regions (
region_id number,
region_name text
)
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_i... | SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id | spider |
CREATE TABLE table_71379 (
"Polling Firm" text,
"Date" text,
"Link" text,
"PSOE" text,
"Others" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is lead for the Election Results polling firm and has a PSOE of 39.6% 175?
| SELECT "Lead" FROM table_71379 WHERE "Polling Firm" = 'election results' AND "PSOE" = '39.6% 175' | wikisql |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Visua... | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY SUM(MIN(T1.stars)) | nvbench |
CREATE TABLE table_name_41 (
losses INTEGER,
byes INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the losses when the byes were less than 0?
| SELECT MIN(losses) FROM table_name_41 WHERE byes < 0 | sql_create_context |
CREATE TABLE table_54616 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are toranosuke takagi's average laps?
| SELECT AVG("Laps") FROM table_54616 WHERE "Driver" = 'toranosuke takagi' | wikisql |
CREATE TABLE table_204_874 (
id number,
"year" number,
"winner" text,
"runner-up" text,
"final score" text,
"third" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who has won the league the most ?
| SELECT "winner" FROM table_204_874 GROUP BY "winner" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Other specified disorders of skin" | mimicsql_data |
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
)
CREATE TABLE people (
people_id number,
name text,
a... | SELECT DISTINCT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id WHERE T1.total_points > 57.5 | spider |
CREATE TABLE table_30205 (
"No." real,
"Title" text,
"Lyricist" text,
"Composer" text,
"Arrangement" text,
"Sound Engineer" text,
"Length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which number was the lyricist ahmed metwally?
| SELECT "No." FROM table_30205 WHERE "Lyricist" = 'Ahmed Metwally' | wikisql |
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 (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '褚静婉' AND mzjzjlb.JZKSRQ BETWEEN '2000-05-09' AND '2010-03-17') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE table_14889048_2 (
points INTEGER,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When a team wins 4, how much is the Maximum amount of points?
| SELECT MAX(points) FROM table_14889048_2 WHERE wins = 4 | sql_create_context |
CREATE TABLE table_2468961_7 (
directed_by VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 123 is the number in series who is the director?
| SELECT directed_by FROM table_2468961_7 WHERE no_in_series = 123 | 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2124" | mimicsql_data |
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
... | SELECT COUNT(*), project_id FROM documents WHERE document_type_code = "BK" GROUP BY project_id | spider |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor | nvbench |
CREATE TABLE table_200_7 (
id number,
"afrikaans" text,
"ipa" text,
"dutch" text,
"english" text,
"german" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- translate the following into english : 'n bietjie .
| SELECT "english" FROM table_200_7 WHERE "afrikaans" = "'n bietjie" | squall |
CREATE TABLE table_name_1 (
episode_title VARCHAR,
original_airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the episode that originally aired on March 31, 2008?
| SELECT episode_title FROM table_name_1 WHERE original_airdate = "march 31, 2008" | sql_create_context |
CREATE TABLE table_8477 (
"Election" real,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earlest election with a 0.9% share of votes?
| SELECT MIN("Election") FROM table_8477 WHERE "Share of votes" = '0.9%' | wikisql |
CREATE TABLE table_name_31 (
score VARCHAR,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is T7 Place Player Justin Leonard's Score?
| SELECT score FROM table_name_31 WHERE place = "t7" AND player = "justin leonard" | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.route = "SL" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_19630743_2 (
to_par VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many to par has the winning score of 69-66-68=203.
| SELECT to_par FROM table_19630743_2 WHERE winning_score = 69 - 66 - 68 = 203 | sql_create_context |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGE... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY COUNT(date_of_completion) DESC | nvbench |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking... | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" | nvbench |
CREATE TABLE table_name_45 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Venue, when Date is '7 September'?
| SELECT venue FROM table_name_45 WHERE date = "7 september" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "86" AND procedures.short_title = "Endosc remove bile stone" | mimicsql_data |
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
lng REAL,
alt TEXT,
url TEXT
)
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
url TEXT
)
CREATE TA... | SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY COUNT(year) DESC | nvbench |
CREATE TABLE table_15187735_11 (
segment_b VARCHAR,
series_ep VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In seris episode 11-04, what is the B segment titled?
| SELECT segment_b FROM table_15187735_11 WHERE series_ep = "11-04" | sql_create_context |
CREATE TABLE table_38405 (
"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 silver medals does China have?
| SELECT COUNT("Silver") FROM table_38405 WHERE "Nation" = 'china' | wikisql |
CREATE TABLE table_74103 (
"Status" text,
"2001 number (,000)" real,
"2001 %" text,
"2011 number (,000)" real,
"2011 %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest 2011 number (,000)?
| SELECT MIN("2011 number (,000)") FROM table_74103 | wikisql |
CREATE TABLE table_44913 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid for the driver with an electrical time/retired and 51 laps?
| SELECT "Grid" FROM table_44913 WHERE "Time/Retired" = 'electrical' AND "Laps" = '51' | wikisql |
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
C... | SELECT author.name FROM author, domain, domain_author, organization WHERE domain_author.aid = author.aid AND domain.did = domain_author.did AND domain.name = 'Databases' AND organization.name = 'University of Michigan' AND organization.oid = author.oid | academic |
CREATE TABLE table_21676617_1 (
odds_of_winner VARCHAR,
horse VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were Gentleman's odds of winner?
| SELECT odds_of_winner FROM table_21676617_1 WHERE horse = "Gentleman" | sql_create_context |
CREATE TABLE table_name_26 (
place VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Place has a To par smaller than 15, and a Score of 74-74-74-75=297?
| SELECT place FROM table_name_26 WHERE to_par < 15 AND score = 74 - 74 - 74 - 75 = 297 | sql_create_context |
CREATE TABLE table_52018 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MIN("Goals against") FROM table_52018 WHERE "Goal Difference" = '7' AND "Losses" > '13' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 19) | css |
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 intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-8370')) AND intakeoutput.cellpath LIKE '%intake%'... | eicu |
CREATE TABLE table_26351260_1 (
team_nickname VARCHAR,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Kent State University's team nickname?
| SELECT team_nickname FROM table_26351260_1 WHERE institution = "Kent State University" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5905) AND prescriptions.drug = 'carvedilol' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-45 month') ORDER BY prescriptions.startdate DESC LIMIT... | mimic_iii |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags ... | SELECT Id, Title, CreationDate, LastActivityDate, Score, ViewCount, Body, AnswerCount, Tags FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%firebase%' | sede |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID | nvbench |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '9519720' GROUP BY qtb.MED_ORG_DEPT_CD HAVING AVG(qtb.IN_HOSP_DAYS) > 4 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '9519720' GROUP BY gyb.MED_ORG_DEPT_CD HAVING AVG(gyb.IN_HOSP_DAYS) > 4 UNION SELECT zyb.MED_O... | css |
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 lab (
labid numbe... | SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 10... | eicu |
CREATE TABLE table_77782 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Decision listed when the Home was Colorado?
| SELECT "Decision" FROM table_77782 WHERE "Home" = 'colorado' | wikisql |
CREATE TABLE table_name_53 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2007 value with a 2r in 2012 and 1r in 2002?
| SELECT 2007 FROM table_name_53 WHERE 2012 = "2r" AND 2002 = "1r" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '08630771' AND t_kc22.STA_DATE BETWEEN '2001-09-16' AND '2021-07-12' AND t_kc21.MED_SER_ORG_NO = '8807369' AND t_kc22.MED_INV... | css |
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 prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Lidocaine 1%" | mimicsql_data |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '75363192461' AND t_kc22.UP_LIMIT_AMO > 3738.33 | css |
CREATE TABLE table_14160 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" text,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time of the match with a Record of 3-3?
| SELECT "Time" FROM table_14160 WHERE "Record" = '3-3' | 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 transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20441) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.