instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_576 (
"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 "Played" FROM table_576 WHERE "Club" = 'Tumble RFC' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '7721090' AND qtb.IN_HOSP_DATE BETWEEN '2013-07-27' AND '2015-08-15' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '7721090' AND gyb.IN_HOSP_DATE BETWEEN '2013-07-27' AND '2015-08-15' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '7721090' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 613 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-1 year') | eicu |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '31775724' AND t_kc22.STA_DATE BETWEEN '2015-01-10' AND '2016-09-10' AND gwyjzb.MED_SER_ORG_NO = '4663039' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CL... | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '... | mimic_iii |
CREATE TABLE table_1341663_44 (
incumbent VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the incumbent of texas 3?
| SELECT incumbent FROM table_1341663_44 WHERE district = "Texas 3" | sql_create_context |
CREATE TABLE table_22469 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT MIN("GEO ID") FROM table_22469 WHERE "Water (sqmi)" = '0.457' | wikisql |
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
CREATE TABLE tags (
index number,
id number,
tag text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT T1.tag FROM torrents AS T2 JOIN tags AS T1 ON T1.id = T2.id WHERE T2.releasetype = "album" GROUP BY T1.tag ORDER BY SUM(T2.totalsnatched) DESC LIMIT 1 | whatcdhiphop |
CREATE TABLE table_name_93 (
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2011 which has a 2002 of , and a Model of seat marbella?
| SELECT 2011 FROM table_name_93 WHERE 2002 = "—" AND model = "seat marbella" | sql_create_context |
CREATE TABLE table_name_54 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team's score at mcg?
| SELECT home_team AS score FROM table_name_54 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_40511 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position was the World Indoor Championships in a year later than 2008?
| SELECT "Position" FROM table_40511 WHERE "Competition" = 'world indoor championships' AND "Year" > '2008' | wikisql |
CREATE TABLE table_48350 (
"Year" real,
"Award" text,
"Category" text,
"Nomination" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which award is for the category Best New Artist?
| SELECT "Award" FROM table_48350 WHERE "Category" = 'best new artist' | wikisql |
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 lab.itemid = "51213" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE el... | SELECT T1.county_name FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district GROUP BY T1.county_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_name_86 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Visitor of the game on April 2?
| SELECT visitor FROM table_name_86 WHERE date = "april 2" | sql_create_context |
CREATE TABLE table_28164986_4 (
incoming_manager VARCHAR,
manner_of_departure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many new managers replaced manager(s) who resigned?
| SELECT COUNT(incoming_manager) FROM table_28164986_4 WHERE manner_of_departure = "Resigned" | sql_create_context |
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
)
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
)
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
)
-- Using valid SQLit... | SELECT T2.author FROM acceptance AS T1 JOIN submission AS T2 ON T1.submission_id = T2.submission_id GROUP BY T2.author HAVING COUNT(DISTINCT T1.workshop_id) > 1 | spider |
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 WHERE demographic.dod_year <= "2148.0" AND diagnoses.icd9_code = "3970" | mimicsql_data |
CREATE TABLE table_name_38 (
result VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game that was attended by 80,886 people?
| SELECT result FROM table_name_38 WHERE attendance = "80,886" | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT 'query://892077/?colName=' + column_name + '|' + column_name AS "field_(click_for_tables)", COUNT(*) AS "#tables" FROM information_schema.columns WHERE (column_name LIKE '%type%' COLLATE SQL_Latin1_General_CP1_CI_AS OR column_name LIKE '%state%' COLLATE SQL_Latin1_General_CP1_CI_AS) GROUP BY column_name ORDER BY... | sede |
CREATE TABLE Staff_Roles (
role_code VARCHAR(10),
role_description VARCHAR(255)
)
CREATE TABLE Organisations (
organisation_id INTEGER,
organisation_type VARCHAR(10),
organisation_details VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_type_code VARCHAR(10),
grant... | SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description | nvbench |
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 hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i... | css |
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_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'EECS' AND semester.semester = 'WN' AND s... | advising |
CREATE TABLE table_8726 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record when the loss was to Alex Hunter in round 1?
| SELECT "Record" FROM table_8726 WHERE "Round" = '1' AND "Res." = 'loss' AND "Opponent" = 'alex hunter' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT demographic.admission_type, lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE author (
authorid int... | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'kurtis heimerl' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_42450 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Rank" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of points for the KV Racing Technology team when they use a chevrol... | SELECT COUNT("Points") FROM table_42450 WHERE "Engine" = 'chevrolet' AND "Team" = 'kv racing technology' | wikisql |
CREATE TABLE table_22097 (
"Rank" real,
"Airport Name" text,
"Location" text,
"IATA Code" text,
"Passengers" text,
"% Chg. 2009/10" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the location is Chicago, Illinois, what is the airport name?
| SELECT "Airport Name" FROM table_22097 WHERE "Location" = 'Chicago, Illinois' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '013-11660' AND patient.hospi... | eicu |
CREATE TABLE table_48024 (
"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 Score, when Player is 'Andy North'?
| SELECT "Score" FROM table_48024 WHERE "Player" = 'andy north' | wikisql |
CREATE TABLE table_16654785_2 (
number VARCHAR,
kilometer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many have a kilometers of 233?
| SELECT number FROM table_16654785_2 WHERE kilometer = 233 | sql_create_context |
CREATE TABLE table_12744399_1 (
genre VARCHAR,
english_title_translation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the genre of Fever Ranma : Hot Springs Athletic Chapter?
| SELECT genre FROM table_12744399_1 WHERE english_title_translation = "Fever Ranma ½: Hot Springs Athletic Chapter" | sql_create_context |
CREATE TABLE table_name_28 (
margin_of_victory VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Gary Player was the runner-up, what was the margin of victory?
| SELECT margin_of_victory FROM table_name_28 WHERE runner_s__up = "gary player" | 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 WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Sarcoidosis" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND microlab.culturesite = 'sputum, expectorated' AND STRFTIME('%y', ... | eicu |
CREATE TABLE table_204_226 (
id number,
"municipality/communes" text,
"coalition for the citizen" text,
"coalition for the future" text,
"other/independent" text,
"winning party/coalition" text,
"voter turnout" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT COUNT(*) FROM table_204_226 WHERE "voter turnout" > 50 | squall |
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 WHERE demographic.admityear < "2119" AND diagnoses.short_title = "Septic shock" | mimicsql_data |
CREATE TABLE table_25691 (
"Episode Number" text,
"Title" text,
"Villains" text,
"Director" text,
"Writer" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode where reg lacey (aka mr. b) play... | SELECT "Title" FROM table_25691 WHERE "Villains" = 'Reg Lacey (AKA Mr. B)' | wikisql |
CREATE TABLE table_55857 (
"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 when they're at phoenix?
| SELECT "Decision" FROM table_55857 WHERE "Visitor" = 'phoenix' | wikisql |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_name_27 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Bob Tway's To par?
| SELECT to_par FROM table_name_27 WHERE player = "bob tway" | sql_create_context |
CREATE TABLE table_22879262_7 (
high_rebounds VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of high rebounds for minnesota?
| SELECT COUNT(high_rebounds) FROM table_22879262_7 WHERE team = "Minnesota" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | SELECT COUNT(Id) FROM Posts WHERE (Tags LIKE '%cross browser%' OR Tags LIKE '%cross-browser%') | sede |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_203_444 (
id number,
"week" number,
"start date" text,
"type" text,
"tournament" text,
"surface" text,
"town" text,
"country" text,
"continent" text,
"prize money" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "tournament" FROM table_203_444 WHERE id = (SELECT id FROM table_203_444 WHERE "tournament" = 'family circle cup') - 1 | squall |
CREATE TABLE table_25794532_1 (
poles INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most poles for 64 points
| SELECT MAX(poles) FROM table_25794532_1 WHERE points = "64" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'Z83.066' AND jyjgzbb.JCZBDM = '549027' | css |
CREATE TABLE table_name_18 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the Away team is north melbourne, what's the Home team score?
| SELECT home_team AS score FROM table_name_18 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_36864 (
"Frequency" text,
"Name" text,
"Format" text,
"Call Sign" text,
"Covered Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frequency of 104.3 business radio?
| SELECT "Frequency" FROM table_36864 WHERE "Name" = '104.3 business radio' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT jybgb.BGDH 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 = '77448008' AND jybgb.BGRQ BETWEEN '2009-08-04' AND '2021-06-15' UNION... | css |
CREATE TABLE table_name_61 (
gold INTEGER,
rank VARCHAR,
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gold medals for Bulgaria (BUL) with 2 silvers and a less than 18 rank?
| SELECT SUM(gold) FROM table_name_61 WHERE silver = 2 AND nation = "bulgaria (bul)" AND rank < 18 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "76" | mimicsql_data |
CREATE TABLE table_name_23 (
home___away VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Was the game home or away when the record is 6-12?
| SELECT home___away FROM table_name_23 WHERE record = "6-12" | sql_create_context |
CREATE TABLE table_38804 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the home with record of 33-18-9
| SELECT "Home" FROM table_38804 WHERE "Record" = '33-18-9' | wikisql |
CREATE TABLE table_24810 (
"Tournament" real,
"Conference" text,
"Championship Game Opponent" text,
"Score" text,
"Location" text,
"Head Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location when 2-1 is the score?
| SELECT "Location" FROM table_24810 WHERE "Score" = '2-1' | wikisql |
CREATE TABLE table_11490 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did someone play from 1982-84?
| SELECT "Position" FROM table_11490 WHERE "Years for Jazz" = '1982-84' | wikisql |
CREATE TABLE table_name_46 (
season INTEGER,
margin VARCHAR,
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the earliest season at waverley park, a Score of 15.12 (102) 9.14 (68), and a Margin larger than 34?
| SELECT MIN(season) FROM table_name_46 WHERE venue = "waverley park" AND score = "15.12 (102) – 9.14 (68)" AND margin > 34 | sql_create_context |
CREATE TABLE table_16020 (
"Episode #" real,
"Production code" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the episode # for title 'the yindianapolis 500 / personali... | SELECT "Episode #" FROM table_16020 WHERE "Title" = 'The Yindianapolis 500 / Personality Problem' | wikisql |
CREATE TABLE table_30315 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people are shown for mens doubles when guo yue played womens s... | SELECT COUNT("Mens Doubles") FROM table_30315 WHERE "Womens Singles" = 'Guo Yue' | wikisql |
CREATE TABLE news_report (
journalist_id number,
event_id number,
work_type text
)
CREATE TABLE journalist (
journalist_id number,
name text,
nationality text,
age text,
years_working number
)
CREATE TABLE event (
event_id number,
date text,
venue text,
name text,
e... | SELECT name FROM journalist ORDER BY years_working | spider |
CREATE TABLE table_32853 (
"Date" real,
"Sport" text,
"Winner" text,
"Score" text,
"Loser" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner with the loser being russia-2?
| SELECT "Winner" FROM table_32853 WHERE "Loser" = 'russia-2' | wikisql |
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
... | SELECT bname FROM bank WHERE state = 'New York' | spider |
CREATE TABLE table_79835 (
"Year" real,
"Stage" real,
"Category" text,
"Start" text,
"Finish" text,
"Leader at the summit" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give the Finish for a Stage that is larger than 15
| SELECT "Finish" FROM table_79835 WHERE "Stage" > '15' | wikisql |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_na... | 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 (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... | atis |
CREATE TABLE table_7407 (
"Position" text,
"Name" text,
"Birthdate" text,
"Birthplace" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Position of the person with a birthplace of phoenix, new york?
| SELECT "Position" FROM table_7407 WHERE "Birthplace" = 'phoenix, new york' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT DISTINCT Score, PostId AS "post_link" FROM PostHistory INNER JOIN Posts ON Posts.Id = PostId WHERE PostHistoryTypeId IN (3, 6) AND Text LIKE '%books%' ORDER BY Score DESC | sede |
CREATE TABLE table_28455 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number where the player was jimmy demaret
| SELECT "54 holes" FROM table_28455 WHERE "Runner(s)-up" = 'Jimmy Demaret' | 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.admission_type = "URGENT" AND procedures.short_title = "Procedure-one vessel" | mimicsql_data |
CREATE TABLE table_name_73 (
opponent VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent of the 3:00 time?
| SELECT opponent FROM table_name_73 WHERE time = "3:00" | sql_create_context |
CREATE TABLE table_33606 (
"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 smallest crowd for the Richmond hom... | SELECT MIN("Crowd") FROM table_33606 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_name_41 (
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player with an overall score of 70-69-69=208?
| SELECT player FROM table_name_41 WHERE score = 70 - 69 - 69 = 208 | sql_create_context |
CREATE TABLE table_68461 (
"Series 1" text,
"Series 2" text,
"Series 3" text,
"Series 5" text,
"Series 9" text,
"Series 11" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who in series 1 corresponds with Peter Jones in series 5?
| SELECT "Series 1" FROM table_68461 WHERE "Series 5" = 'peter jones' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryT... | SELECT t.TagName, TIME_TO_STR(p.CreationDate, '%q') AS q, YEAR(p.CreationDate) AS y, COUNT(p.Id) AS NumPosts, SUM(CAST(p.AnswerCount AS INT)) AS NumAnswerCount FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE YEAR(p.CreationDate) >= 2020 AND TIME_TO_STR(p.CreationDate, '%q... | sede |
CREATE TABLE table_28211103_1 (
attendance VARCHAR,
hawthorn_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance when the hawthorn score is 18.15.123?
| SELECT attendance FROM table_28211103_1 WHERE hawthorn_score = "18.15.123" | sql_create_context |
CREATE TABLE table_name_9 (
date VARCHAR,
opponent VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was Kentucky the opponent, and Ragle lost?
| SELECT date FROM table_name_9 WHERE opponent = "kentucky" AND loss = "ragle" | sql_create_context |
CREATE TABLE table_14338 (
"Club" text,
"Visa 1" text,
"Visa 2" text,
"Visa 3" text,
"Visa 4" text,
"Visa 5" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Visa 5 has a Visa 1 of emile heskey?
| SELECT "Visa 5" FROM table_14338 WHERE "Visa 1" = 'emile heskey' | wikisql |
CREATE TABLE table_16790 (
"Season" text,
"Games" real,
"Won" real,
"Lost" real,
"Tied" real,
"Points" real,
"Pct %" text,
"Goals for" real,
"Goals against" real,
"Standing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many... | SELECT "Won" FROM table_16790 WHERE "Standing" = '2nd OHA' AND "Games" = '62' | wikisql |
CREATE TABLE table_name_25 (
record VARCHAR,
location_attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record on April 12 when the location was The Omni?
| SELECT record FROM table_name_25 WHERE location_attendance = "the omni" AND date = "april 12" | sql_create_context |
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id in... | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id | nvbench |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BIOSTAT' AND course.number = 666 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1 | advising |
CREATE TABLE table_41586 (
"County or City" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What county of city... | SELECT "County or City" FROM table_41586 WHERE "Number of households" > '9,505' AND "Median household income" = '$94,880' | 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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Rheumatic heart failure (congestive)" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '08011688869' | css |
CREATE TABLE table_1341522_24 (
incumbent VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the incumbent in district Massachusetts7?
| SELECT incumbent FROM table_1341522_24 WHERE district = "Massachusetts7" | sql_create_context |
CREATE TABLE table_54932 (
"Grade" text,
"Points" real,
"Sit-up (reps)" text,
"Standing Broad Jump (cm)" text,
"Chin-up (reps)" text,
"Shuttle Run (sec)" text,
"2.4km Run (min:sec)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which grade ... | SELECT "Grade" FROM table_54932 WHERE "Chin-up (reps)" = '9-10' | wikisql |
CREATE TABLE table_21632864_1 (
champions VARCHAR,
regional VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who got the first place when the Japanese Regional Leagues was in hokushinetsu?
| SELECT champions FROM table_21632864_1 WHERE regional = "Hokushinetsu" | sql_create_context |
CREATE TABLE table_71113 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the 150.163 qual?
| SELECT "Rank" FROM table_71113 WHERE "Qual" = '150.163' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid ... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '021-227292' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 year') | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT demographic.age FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
... | 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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D... | atis |
CREATE TABLE table_name_18 (
owner VARCHAR,
name___format VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Owner has a Name / Format of 105.3 kool fm - hot adult contemporary?
| SELECT owner FROM table_name_18 WHERE name___format = "105.3 kool fm - hot adult contemporary" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab.itemid = "51095" | mimicsql_data |
CREATE TABLE table_8780 (
"Tournament" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"Career SR" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the 1994 res... | SELECT "1994" FROM table_8780 WHERE "Career SR" = '0 / 3' | wikisql |
CREATE TABLE table_25352324_5 (
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest value for points?
| SELECT MAX(points) FROM table_25352324_5 | sql_create_context |
CREATE TABLE table_73350 (
"Episode" real,
"Song" text,
"Average grade" text,
"Detailed grades" text,
"Classification (Judges)" text,
"Classification (Viewers)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the classification for 9, 9, 8, ... | SELECT "Classification (Judges)" FROM table_73350 WHERE "Detailed grades" = '9, 9, 8, 9' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-151272')) AND DATETIME(treatment.treatmenttime, 'start of yea... | eicu |
CREATE TABLE table_21007 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Bike No" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least points for dani l willemsen / kenny van gaalen
| SELECT MIN("Points") FROM table_21007 WHERE "Driver / Passenger" = 'Daniël Willemsen / Kenny van Gaalen' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Cynthia Robinson" | mimicsql_data |
CREATE TABLE table_203_781 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many of the competitions were held in thailand before 2006 ?
| SELECT COUNT("competition") FROM table_203_781 WHERE "year" < 2006 AND "venue" = 'thailand' | squall |
CREATE TABLE bookings (
booking_id number,
customer_id number,
workshop_group_id text,
status_code text,
store_id number,
order_date time,
planned_delivery_date time,
actual_delivery_date time,
other_order_details text
)
CREATE TABLE invoices (
invoice_id number,
order_id nu... | SELECT product_name FROM products GROUP BY product_name HAVING AVG(product_price) < 1000000 | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.