instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '58560026' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2003-02-05') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE table_27700530_10 (
date VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date when jameer nelson (10) had the high assists?
| SELECT date FROM table_27700530_10 WHERE high_assists = "Jameer Nelson (10)" | sql_create_context |
CREATE TABLE table_52306 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constructor was there for the race with 25 laps?
| SELECT "Constructor" FROM table_52306 WHERE "Laps" = '25' | wikisql |
CREATE TABLE player_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first text
)
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_st... | SELECT T1.player_id, T1.award_id, MAX(T1.year - T2.birth_year) FROM player_award AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id | thehistoryofbaseball |
CREATE TABLE table_name_31 (
quantity_made VARCHAR,
wheel_arrangement VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Quantity made, when Wheel Arrangement is '2-6-0', and when Class is 'D-3'?
| SELECT quantity_made FROM table_name_31 WHERE wheel_arrangement = "2-6-0" AND class = "d-3" | sql_create_context |
CREATE TABLE table_name_81 (
name VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of 1sts that Martin Schmitt had where he less than 235.7 points?
| SELECT COUNT(1 AS st__m_) FROM table_name_81 WHERE name = "martin schmitt" AND points < 235.7 | sql_create_context |
CREATE TABLE table_name_59 (
wins INTEGER,
against VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins for the team with more than 1282 against and fewer than 14 losses?
| SELECT MIN(wins) FROM table_name_59 WHERE against > 1282 AND losses < 14 | sql_create_context |
CREATE TABLE table_14889988_1 (
title VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title for the episode written by Robert Carlock & Dana Klein Borkow?
| SELECT title FROM table_14889988_1 WHERE written_by = "Robert Carlock & Dana Klein Borkow" | sql_create_context |
CREATE TABLE table_65262 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" text,
"Release date" text,
"reissue?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the title that was directed by Friz Freleng and... | SELECT "Title" FROM table_65262 WHERE "Director" = 'friz freleng' AND "Production Number" = '443' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clu... | SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club" | spider |
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_year text,
death_month text,
death_day text,
death_country text,
death_state text,
death_city text,
name_first tex... | SELECT league_id FROM salary GROUP BY league_id ORDER BY MAX(salary) - MIN(salary) DESC LIMIT 1 | thehistoryofbaseball |
CREATE TABLE table_37616 (
"Length/Fuel" text,
"Model" text,
"Year Built" text,
"Quantity" real,
"Floor Styling" text,
"Wheelchair access" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Length/Fuel of the bus built between 2000-2003 ... | SELECT "Length/Fuel" FROM table_37616 WHERE "Floor Styling" = 'high' AND "Year Built" = '2000-2003' | wikisql |
CREATE TABLE staff (
staff_id VARCHAR,
staff_gender VARCHAR
)
CREATE TABLE staff_department_assignments (
staff_id VARCHAR,
job_title_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the staff ids and genders of all staffs whose job titl... | SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Department Manager" | sql_create_context |
CREATE TABLE table_47054 (
"Year" real,
"Music video" text,
"Length" text,
"Album" text,
"Official MV on YouTube" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which music video was from the album Map of the Human Soul?
| SELECT "Music video" FROM table_47054 WHERE "Album" = 'map of the human soul' | wikisql |
CREATE TABLE table_30087 (
"\u2116" real,
"#" 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 above.
-- What episo... | SELECT "\u2116" FROM table_30087 WHERE "U.S. viewers (million)" = '4.87' | wikisql |
CREATE TABLE table_name_45 (
pick__number VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick number for the College of Central Missouri State?
| SELECT pick__number FROM table_name_45 WHERE college = "central missouri state" | sql_create_context |
CREATE TABLE table_name_96 (
money___ INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of money player jim colbert has?
| SELECT MIN(money___) AS $__ FROM table_name_96 WHERE player = "jim colbert" | sql_create_context |
CREATE TABLE fgwyjzb (
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 gwyjzb WHERE gwyjzb.PERSON_ID = '49189270' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-04-30' AND '2019-03-21' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '49189270' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2006-04-30' AND '2019-03-21' AND fgwyjzb.CLINIC_TYPE = '住院... | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Fat Emulsion 20%" | mimicsql_data |
CREATE TABLE table_name_24 (
date_of_vacancy VARCHAR,
team VARCHAR,
date_of_appointment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of vacancy of team fc bayern munich, which had a date of appointment on 27 April 2009?
| SELECT date_of_vacancy FROM table_name_24 WHERE team = "fc bayern munich" AND date_of_appointment = "27 april 2009" | sql_create_context |
CREATE TABLE table_name_97 (
platform___os VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Platform / OS has a Name of altova umodel?
| SELECT platform___os FROM table_name_97 WHERE name = "altova umodel" | 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 cost (
costid num... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'beta blocker - esmolol' AND STRFTIME('%y', treatment.treatmenttime) >= '2... | eicu |
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '30139154' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 4566.82) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '30139154' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CL... | css |
CREATE TABLE table_name_83 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the away team when the game was played at vfl park?
| SELECT away_team AS score FROM table_name_83 WHERE venue = "vfl park" | 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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2180" | mimicsql_data |
CREATE TABLE table_7206 (
"Objects" text,
"Date" text,
"SiO 2" real,
"Al 2 O 3" real,
"Fe 2 O 3" real,
"K 2 O" real,
"Na 2 O" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average SiO 2, when Na 2 O is 7.53, and when Al 2 O 3 is les... | SELECT AVG("SiO 2") FROM table_7206 WHERE "Na 2 O" = '7.53' AND "Al 2 O 3" < '2.13' | wikisql |
CREATE TABLE table_60074 (
"Players" text,
"Position" text,
"Year" text,
"Ht/Wt" text,
"Bats/Throws" text,
"Hometown (Last School)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What side does Ryan Overland Bat/Throws from?
| SELECT "Bats/Throws" FROM table_60074 WHERE "Players" = 'ryan overland' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-12267') AND NOT patient.unitdischargetime IS NULL O... | eicu |
CREATE TABLE Organisations (
organisation_id INTEGER,
organisation_type VARCHAR(10),
organisation_details VARCHAR(255)
)
CREATE TABLE Document_Types (
document_type_code VARCHAR(10),
document_description VARCHAR(255)
)
CREATE TABLE Project_Outcomes (
project_id INTEGER,
outcome_code VARCHA... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'neo*po*dexamethasone' | mimic_iii |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT zzmzjzjlb.YLJGDM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '68891668' UNION SELECT fzzmzjzjlb.YLJGDM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_i... | css |
CREATE TABLE table_23265 (
"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.
-- Name the total party for north carolina 7
| SELECT COUNT("Party") FROM table_23265 WHERE "District" = 'North Carolina 7' | wikisql |
CREATE TABLE table_9962 (
"Party" text,
"Ward" real,
"PR top-up" real,
"Total" real,
"Percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE TOTAL NUMBER WITH A WARD SMALLER THAN 0?
| SELECT COUNT("Total") FROM table_9962 WHERE "Ward" < '0' | wikisql |
CREATE TABLE table_55365 (
"Title" text,
"Original story author" text,
"Director" text,
"Original U.S. air-date" text,
"Original Canadian air-date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Original U.S. air-date for the Original Ca... | SELECT "Original U.S. air-date" FROM table_55365 WHERE "Original Canadian air-date" = 'december 9, 2007' | wikisql |
CREATE TABLE table_name_15 (
draw INTEGER,
points VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for the draw with 0 points, and less than 14 lost?
| SELECT SUM(draw) FROM table_name_15 WHERE points = 0 AND lost < 14 | 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 zyjzjlb.ZYBMLX, zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '29694116748' | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "51" AND prescriptions.route = "PB" | mimicsql_data |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requiremen... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%hardware%' AND student_record.student_id = 1 | advising |
CREATE TABLE table_45494 (
"Company name" text,
"Network brand name" text,
"Country" text,
"Accreditation type" text,
"Accreditation level" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Deutsche Telekom's accreditation type... | SELECT "Accreditation type" FROM table_45494 WHERE "Network brand name" = 'deutsche telekom' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | (SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ... | css |
CREATE TABLE table_22050544_3 (
date VARCHAR,
event__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Event number 38m was held on which date?
| SELECT date FROM table_22050544_3 WHERE event__number = "38M" | sql_create_context |
CREATE TABLE table_name_59 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date was the Score 6 4, 6 2?
| SELECT date FROM table_name_59 WHERE score = "6–4, 6–2" | sql_create_context |
CREATE TABLE table_name_96 (
label VARCHAR,
catalog__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the label for the album with a catalog number of 83061-2?
| SELECT label FROM table_name_96 WHERE catalog__number = "83061-2" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 ... | css |
CREATE TABLE table_name_95 (
february VARCHAR,
game VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much February has a Game larger than 37, and an Opponent of chicago black hawks?
| SELECT COUNT(february) FROM table_name_95 WHERE game > 37 AND opponent = "chicago black hawks" | sql_create_context |
CREATE TABLE table_73153 (
"#" real,
"Episode" text,
"UK air date" text,
"Timeslot" text,
"Viewers (millions)" text,
"Audience share in timeslot" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the uk air date for audience share in timeslot ... | SELECT "UK air date" FROM table_73153 WHERE "Audience share in timeslot" = '7.3%' | wikisql |
CREATE TABLE table_37200 (
"School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text,
"Primary conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the primary conference that was fo... | SELECT "Primary conference" FROM table_37200 WHERE "Founded" < '1866' AND "Affiliation" = 'private/catholic' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other disorders of the pituitary and other syndromes of diencephalohypophyseal origin" | mimicsql_data |
CREATE TABLE table_name_89 (
tournament VARCHAR,
total VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tournament titles for texas with over 0 total?
| SELECT COUNT(tournament) FROM table_name_89 WHERE total > 0 AND team = "texas" | sql_create_context |
CREATE TABLE table_name_21 (
points INTEGER,
artist VARCHAR,
draw VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points does catcat have with more than 2 draws?
| SELECT AVG(points) FROM table_name_21 WHERE artist = "catcat" AND draw > 2 | sql_create_context |
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 qtb.PERSON_NM, qtb.PERSON_SEX, qtb.PERSON_AGE, qtb.IDENTITY_CARD FROM qtb WHERE qtb.MED_CLINIC_ID = '86429402057' UNION SELECT gyb.PERSON_NM, gyb.PERSON_SEX, gyb.PERSON_AGE, gyb.IDENTITY_CARD FROM gyb WHERE gyb.MED_CLINIC_ID = '86429402057' UNION SELECT zyb.PERSON_NM, zyb.PERSON_SEX, zyb.PERSON_AGE, zyb.IDENTITY... | css |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_16025 (
"Assembly Type" text,
"Adhesive Type" text,
"Time(Sec)" text,
"Temp (\u00b0C)" text,
"Pressure" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- HOW MANY TEMPERATURE INTERVALS ARE POSSIBLE TO USE WITH ACRYL?
| SELECT COUNT("Temp (\u00b0C)") FROM table_16025 WHERE "Adhesive Type" = 'Acryl' | wikisql |
CREATE TABLE table_10784 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the FCC info for frequency Mhz of 95.3 fm
| SELECT "FCC info" FROM table_10784 WHERE "Frequency MHz" = '95.3 fm' | wikisql |
CREATE TABLE table_42648 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "2002" FROM table_42648 WHERE "2010" = '69' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1034558' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 29 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_k... | css |
CREATE TABLE table_203_559 (
id number,
"no." number,
"name" text,
"took office" text,
"left office" text,
"president served under" text,
"notable for" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many commissioners have there been ?
| SELECT COUNT(DISTINCT "no.") FROM table_203_559 | squall |
CREATE TABLE table_13551 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is t... | SELECT "Date of vacancy" FROM table_13551 WHERE "Manner of departure" = 'contract terminated' AND "Position in table" = '23rd' AND "Date of appointment" = '31 december 2008' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId numb... | SELECT * FROM Posts WHERE Id = 60850239 | sede |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "45" AND lab.label = "Protein" | mimicsql_data |
CREATE TABLE table_24268 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Marc Parenteau's position?
| SELECT "Position" FROM table_24268 WHERE "Player" = 'Marc Parenteau' | wikisql |
CREATE TABLE table_name_95 (
type VARCHAR,
year VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type of disc by Logistics after 2004?
| SELECT type FROM table_name_95 WHERE year > 2004 AND artist = "logistics" | 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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "SNF" AND lab.label = "Reticulocyte Count, Automated" | mimicsql_data |
CREATE TABLE table_70567 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did the Tyrrell Racing Organisation have?
| SELECT "Points" FROM table_70567 WHERE "Entrant" = 'tyrrell racing organisation' | wikisql |
CREATE TABLE table_31248 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the episode that was directed by Chris... | SELECT "Original air date" FROM table_31248 WHERE "Directed by" = 'Christian I. Nyby II' | wikisql |
CREATE TABLE table_61656 (
"Game Title" text,
"Year Released" real,
"Platform" text,
"GameRankings" text,
"Metacritic" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the GameRankings Released of 2011 with a Metacritic of 83/100?
| SELECT "GameRankings" FROM table_61656 WHERE "Metacritic" = '83/100' AND "Year Released" = '2011' | wikisql |
CREATE TABLE table_name_64 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record for may 31
| SELECT record FROM table_name_64 WHERE date = "may 31" | sql_create_context |
CREATE TABLE table_25714995_2 (
Ends VARCHAR,
stolen_ends VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ends won catagories are listed when there are 8 stolen ends?
| SELECT COUNT(Ends) AS won FROM table_25714995_2 WHERE stolen_ends = 8 | sql_create_context |
CREATE TABLE Claims (
Amount_Settled VARCHAR,
Amount_Claimed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.
| SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_9635 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent at the IFA: Clash of the Champions?
| SELECT "Opponent" FROM table_9635 WHERE "Event" = 'ifa: clash of the champions' | wikisql |
CREATE TABLE table_44183 (
"Season" text,
"Division" text,
"Wins" text,
"Ties" text,
"Final Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the final position for the season 2012?
| SELECT "Final Position" FROM table_44183 WHERE "Season" = '2012' | wikisql |
CREATE TABLE table_39449 (
"PRINT NAME" text,
"NICKNAME" text,
"NUMBER OF COLORS" text,
"FRAMED SIZE" text,
"DATE COMPLETED" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frame size that was nicknamed Grand Central?
| SELECT "FRAMED SIZE" FROM table_39449 WHERE "NICKNAME" = 'grand central' | wikisql |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'pseudoephedrine' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_name_41 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the Home Team was Sydney, what did the Away team score?
| SELECT away_team AS score FROM table_name_41 WHERE home_team = "sydney" | sql_create_context |
CREATE TABLE table_70826 (
"Match" real,
"Date" text,
"Competition or tour" text,
"Ground" text,
"Opponent" text,
"Score1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the match higher than 8 on ground A against Guiseley?
| SELECT "Date" FROM table_70826 WHERE "Match" > '8' AND "Ground" = 'a' AND "Opponent" = 'guiseley' | wikisql |
CREATE TABLE table_name_77 (
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the grid of Alex Yoong?
| SELECT grid FROM table_name_77 WHERE driver = "alex yoong" | sql_create_context |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
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... | SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY SUM(T1.CRS_CREDIT) | nvbench |
CREATE TABLE table_203_595 (
id number,
"year" number,
"division" number,
"league" text,
"reg. season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year is the first usl second division league listed ... | SELECT MIN("year") FROM table_203_595 WHERE "league" = 'usl second division' | squall |
CREATE TABLE table_50409 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Branding has a frequency of 1080khz?
| SELECT "Branding" FROM table_50409 WHERE "Frequency" = '1080khz' | wikisql |
CREATE TABLE table_71587 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What term did hon ralph hunt serve in office?
| SELECT "Term in office" FROM table_71587 WHERE "Member" = 'hon ralph hunt' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE table_name_26 (
value__ INTEGER,
revenue__$m_ VARCHAR,
debt_as__percentageof_value VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest value of a team with revenue less than 374 and a debt of 84%?
| SELECT MIN(value__) AS $m_ FROM table_name_26 WHERE revenue__$m_ < 374 AND debt_as__percentageof_value = "84" | sql_create_context |
CREATE TABLE table_1875157_2 (
avg_finish VARCHAR,
winnings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average finish for winnings of $1,400?
| SELECT avg_finish FROM table_1875157_2 WHERE winnings = "$1,400" | sql_create_context |
CREATE TABLE table_name_37 (
title VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Gongbo's title?
| SELECT title FROM table_name_37 WHERE name = "gongbo" | sql_create_context |
CREATE TABLE table_name_74 (
gold INTEGER,
silver VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the gold medals of the nation with 4 silvers and more than 6 total medals?
| SELECT SUM(gold) FROM table_name_74 WHERE silver = 4 AND total > 6 | sql_create_context |
CREATE TABLE table_204_479 (
id number,
"defendant" text,
"arrested" text,
"charge" text,
"result" text,
"sentence" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many defedants were arrested in december of 1955 ?
| SELECT COUNT("defendant") FROM table_204_479 WHERE "arrested" = 12 AND "arrested" = 1955 | squall |
CREATE TABLE table_name_57 (
clubs VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the clubs with 46 matches?
| SELECT clubs FROM table_name_57 WHERE matches = 46 | sql_create_context |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Ra... | SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_name DESC | nvbench |
CREATE TABLE table_5767 (
"Opposition" text,
"Score" text,
"Venue" text,
"City" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which number of Years has a Venue of old trafford, and an Opposition of yorkshire?
| SELECT COUNT("Year") FROM table_5767 WHERE "Venue" = 'old trafford' AND "Opposition" = 'yorkshire' | wikisql |
CREATE TABLE table_12886178_4 (
played VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games ended up with 16 points?
| SELECT played FROM table_12886178_4 WHERE points = "16" | sql_create_context |
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 OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4746068' GROUP BY OUT_DIAG_DIS_NM | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '64770032' AND jybgb.BGRQ BETWEEN '2000-06-13' AND '2019-11-17' UNI... | css |
CREATE TABLE table_49563 (
"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.
-- Who was the opponent when the record was 11-6-2?
| SELECT "Opponent" FROM table_49563 WHERE "Record" = '11-6-2' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Aortocor bypas-2 cor art" | mimicsql_data |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SEC... | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY PROF_OFFICE | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price) | nvbench |
CREATE TABLE table_name_86 (
attendance VARCHAR,
location VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance for the game at groves stadium winston-salem, nc with a result of L 0-14?
| SELECT COUNT(attendance) FROM table_name_86 WHERE location = "groves stadium • winston-salem, nc" AND result = "l 0-14" | sql_create_context |
CREATE TABLE table_name_80 (
game INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game was played on December 8?
| SELECT AVG(game) FROM table_name_80 WHERE date = "december 8" | sql_create_context |
CREATE TABLE table_29446183_2 (
runner_up VARCHAR,
fourth_place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the runner up the season that Sagawa Express came in fourth?
| SELECT runner_up FROM table_29446183_2 WHERE fourth_place = "Sagawa Express" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.