instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849')) AND medication.drugname = 'metoprolol inj' AND DATE... | eicu |
CREATE TABLE table_79102 (
"Year" real,
"Theme" text,
"Face Value" text,
"Weight" text,
"Diameter" text,
"Mintage" real,
"Issue Price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the MIntage after 2006 of the Ruby-Throated Humming... | SELECT MAX("Mintage") FROM table_79102 WHERE "Year" > '2006' AND "Theme" = 'ruby-throated hummingbird' | wikisql |
CREATE TABLE table_23916539_3 (
record VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record if the location is Clarke Stadium?
| SELECT record FROM table_23916539_3 WHERE location = "Clarke Stadium" | sql_create_context |
CREATE TABLE table_name_44 (
money___$__ VARCHAR,
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For a country of Spain, place of t6, what is the Money ($)?
| SELECT money___$__ FROM table_name_44 WHERE place = "t6" AND country = "spain" | sql_create_context |
CREATE TABLE table_name_84 (
year_s__won VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year(s) won with a To par of 12?
| SELECT year_s__won FROM table_name_84 WHERE to_par = 12 | sql_create_context |
CREATE TABLE table_204_300 (
id number,
"date from" text,
"date to" text,
"pos." text,
"name" text,
"from" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the previous loan before jacob butterfield ?
| SELECT "name" FROM table_204_300 WHERE "date from" < (SELECT "date from" FROM table_204_300 WHERE "name" = 'jacob butterfield') ORDER BY "date from" DESC LIMIT 1 | squall |
CREATE TABLE table_26860595_2 (
directx VARCHAR,
core___mhz__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the model's DirectX if it has a Core of 700 700 mhz?
| SELECT directx FROM table_26860595_2 WHERE core___mhz__ = "700 700" | sql_create_context |
CREATE TABLE table_name_55 (
date VARCHAR,
set_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Set 3 of 21 25?
| SELECT date FROM table_name_55 WHERE set_3 = "21–25" | sql_create_context |
CREATE TABLE table_43857 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which men's singles has mixed doubles with Chen Hu... | SELECT "Men's singles" FROM table_43857 WHERE "Mixed doubles" = 'chen hung-ling chou chia-chi' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dischtime IS NULL)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WH... | mimic_iii |
CREATE TABLE table_name_23 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team for the home team wigan athletic?
| SELECT away_team FROM table_name_23 WHERE home_team = "wigan athletic" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE table_2216 (
"Poll source" text,
"Dates administered" text,
"Tom Emmer (R)" text,
"Matt Entenza (DFL)" text,
"Tom Horner (I)" text,
"Undecided" text,
"Sampling error" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many polls... | SELECT COUNT("Tom Emmer (R)") FROM table_2216 WHERE "Matt Entenza (DFL)" = '38%' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | 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.icd9_code = "4523" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT demographic.dob, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_20571 (
"Year ended" text,
"Revenue (S$m)" text,
"Expenditure (S$m)" text,
"Operating profit (S$m)" text,
"Profit before taxation (S$m)" text,
"Profit attributable to equity holders (S$m)" text,
"EPS after tax \u2013 diluted (cents)" text
)
-- Using valid SQLite, answer ... | SELECT "Expenditure (S$m)" FROM table_20571 WHERE "Operating profit (S$m)" = '717.1' | wikisql |
CREATE TABLE table_283203_1 (
home_venue VARCHAR,
founded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the home venue of the team founded in 1993?
| SELECT home_venue FROM table_283203_1 WHERE founded = 1993 | sql_create_context |
CREATE TABLE table_36496 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was she ranked 16th with over 12 points?
| SELECT COUNT("Year") FROM table_36496 WHERE "Rank" = '16th' AND "Points" > '12' | wikisql |
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE conference (
cid int,
homepage varcha... | SELECT COUNT(DISTINCT (publication.title)) FROM author AS AUTHOR_0, author AS AUTHOR_1, author AS AUTHOR_2, publication, writes AS WRITES_0, writes AS WRITES_1, writes AS WRITES_2 WHERE AUTHOR_0.name = 'Cong Yu' AND AUTHOR_1.name = 'H. V. Jagadish' AND AUTHOR_2.name = 'Yunyao Li' AND WRITES_0.aid = AUTHOR_0.aid AND WRI... | academic |
CREATE TABLE table_15980 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the NHL team that has Peter Strom?
| SELECT "NHL team" FROM table_15980 WHERE "Player" = 'Peter Strom' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC | 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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder | nvbench |
CREATE TABLE table_name_82 (
videoconferencing VARCHAR,
data_conferencing VARCHAR,
web_conferencing VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Videoconferencing, when Data Conferencing is 'No', and when Web Conferencing is 'No'?
| SELECT videoconferencing FROM table_name_82 WHERE data_conferencing = "no" AND web_conferencing = "no" | sql_create_context |
CREATE TABLE table_name_12 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue on 26 jan 2005
| SELECT venue FROM table_name_12 WHERE date = "26 jan 2005" | sql_create_context |
CREATE TABLE table_75603 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Call sign of k231bg has what sum of erp w?
| SELECT SUM("ERP W") FROM table_75603 WHERE "Call sign" = 'k231bg' | wikisql |
CREATE TABLE table_name_27 (
home VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team of the April 14 game?
| SELECT home FROM table_name_27 WHERE date = "april 14" | sql_create_context |
CREATE TABLE table_26008 (
"Pos" real,
"Constructor" text,
"Chassis" text,
"Starts" real,
"Finishes" real,
"Wins" real,
"Podiums" real,
"Stage wins" real,
"Power stage wins" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("Power stage wins") FROM table_26008 WHERE "Wins" = '10' | wikisql |
CREATE TABLE table_79417 (
"Time" text,
"Wind" text,
"Athlete" text,
"Nationality" text,
"Location of race" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the athlete with a wind of 1.7 and from the United States?
| SELECT "Athlete" FROM table_79417 WHERE "Nationality" = 'united states' AND "Wind" = '1.7' | wikisql |
CREATE TABLE table_66833 (
"Club" text,
"Played" 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 following questions f... | SELECT "Played" FROM table_66833 WHERE "Points for" = '473' | wikisql |
CREATE TABLE table_32477 (
"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.
-- At what venue did the home team score 12.10 (82)... | SELECT "Venue" FROM table_32477 WHERE "Home team score" = '12.10 (82)' | wikisql |
CREATE TABLE party_host (
party_id number,
host_id number,
is_main_in_charge others
)
CREATE TABLE party (
party_id number,
party_theme text,
location text,
first_year text,
last_year text,
number_of_hosts number
)
CREATE TABLE host (
host_id number,
name text,
national... | SELECT nationality, COUNT(*) FROM host GROUP BY nationality | spider |
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 COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '59997347' AND mzjzjlb.JZKSRQ BETWEEN '2014-05-11' AND '2016-10-25' | css |
CREATE TABLE table_4353 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the position for pick of 146
| SELECT "Position" FROM table_4353 WHERE "Pick" = '146' | wikisql |
CREATE TABLE table_21585 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which ... | SELECT "Game" FROM table_21585 WHERE "Team" = 'Milwaukee' | wikisql |
CREATE TABLE table_203_206 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country won the most silver medals ?
| SELECT "nation" FROM table_203_206 ORDER BY "silver" DESC LIMIT 1 | squall |
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 PostNoticeTypes (
Id number,
ClassId ... | SELECT COUNT(*) AS answer FROM Users WHERE (DisplayName LIKE '%John%' OR DisplayName LIKE '%Ivan%') | sede |
CREATE TABLE table_10432351_1 (
spectral_type VARCHAR,
star__pismis24__number_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the spectral types for star mismis24-# is 1sw?
| SELECT spectral_type FROM table_10432351_1 WHERE star__pismis24__number_ = "1SW" | sql_create_context |
CREATE TABLE table_name_48 (
silver VARCHAR,
bronze VARCHAR,
nation VARCHAR,
gold VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Gold smaller than 2, and a Rank of 4, and a Nation of hungary (hun), and a Bronze smaller than 1 had wh... | SELECT COUNT(silver) FROM table_name_48 WHERE gold < 2 AND rank = "4" AND nation = "hungary (hun)" AND bronze < 1 | sql_create_context |
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
... | SELECT Season, COUNT(Season) FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.Injury = 'Foot injury' OR T3.Injury = 'Knee problem' ORDER BY COUNT(Season) | nvbench |
CREATE TABLE table_55225 (
"Event" text,
"Record" text,
"Athlete" text,
"Nationality" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event was Fatima Whitbread Trine Hattestad in?
| SELECT "Event" FROM table_55225 WHERE "Athlete" = 'fatima whitbread trine hattestad' | wikisql |
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 COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195541')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-104 month') | eicu |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '痴呆' AND jyjgzbb.JCZBMC = '白蛋白' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "PNEUMONIA" | mimicsql_data |
CREATE TABLE table_14525 (
"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 was the average number of silver medals won by France when they are ranked higher than ... | SELECT AVG("Silver") FROM table_14525 WHERE "Nation" = 'france' AND "Rank" > '8' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ns/40gm ca glu' AND... | mimic_iii |
CREATE TABLE table_22496344_1 (
position VARCHAR,
home_town VARCHAR,
high_school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the position when houston, tx is the hometown and worthing is the high school?
| SELECT position FROM table_22496344_1 WHERE home_town = "Houston, TX" AND high_school = "Worthing" | sql_create_context |
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts... | SELECT T1.Location, T1.Railway_ID FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intracranial injury - with concussion' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1)... | eicu |
CREATE TABLE table_8557 (
"School" text,
"Base" text,
"Bask" real,
"Golf" text,
"Soccer" text,
"Swimming" text,
"Tennis" text,
"Indoor track" text,
"Outdoor track" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What... | SELECT MAX("Total") FROM table_8557 WHERE "Bask" = '3' AND "Base" = '3' | wikisql |
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 T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_48409 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team at the Win Entertainment Centre?
| SELECT "Away team" FROM table_48409 WHERE "Venue" = 'win entertainment centre' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d... | atis |
CREATE TABLE table_68907 (
"Model" text,
"Codename" text,
"Released" text,
"Fab ( nm )" real,
"SATA" text,
"USB 2.0+1.1" text,
"USB 3.0" text,
"Parallel ATA 1" text,
"RAID" real,
"Gb Ethernet MAC" text,
"Package" text,
"TDP ( W )" real
)
-- Using valid SQLite, answer th... | SELECT COUNT("TDP ( W )") FROM table_68907 WHERE "Codename" = 'sb850' | wikisql |
CREATE TABLE table_name_93 (
time_retired VARCHAR,
car_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the time/retired of car number 6.
| SELECT time_retired FROM table_name_93 WHERE car_no = "6" | sql_create_context |
CREATE TABLE table_name_69 (
event VARCHAR,
horse VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which event did Fabuleux 5 get a result smaller than 70.88?
| SELECT event FROM table_name_69 WHERE horse = "fabuleux 5" AND result < 70.88 | sql_create_context |
CREATE TABLE table_31036 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode with... | SELECT "Written by" FROM table_31036 WHERE "Production code" = 'IP03007' | wikisql |
CREATE TABLE table_train_16 (
"id" int,
"bleeding" int,
"brain_hernia" bool,
"allergy_to_granisetron" bool,
"intraperitoneal_infection" bool,
"intestinal_obstruction" bool,
"tumor" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT * FROM table_train_16 WHERE intestinal_obstruction = 1 | criteria2sql |
CREATE TABLE table_30 (
"Player" text,
"Total W\u2013L" text,
"Singles W\u2013L" text,
"Doubles W\u2013L" text,
"Ties played" real,
"Debut" real,
"Years played" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of total... | SELECT COUNT("Total W\u2013L") FROM table_30 WHERE "Doubles W\u2013L" = '11–11' | wikisql |
CREATE TABLE table_41881 (
"Aces" real,
"Player" text,
"Opponent" text,
"Event" text,
"Sets" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At the 2001 Davis Cup, what Opponent had less than 50 Aces?
| SELECT "Opponent" FROM table_41881 WHERE "Aces" < '50' AND "Event" = '2001 davis cup' | wikisql |
CREATE TABLE table_2668352_14 (
district VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the district for first elected 1810
| SELECT district FROM table_2668352_14 WHERE first_elected = "1810" | sql_create_context |
CREATE TABLE zyb (
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 qtb WHERE qtb.MED_SER_ORG_NO = '4580460' AND qtb.IN_HOSP_DATE BETWEEN '2003-05-27' AND '2017-01-18' AND qtb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4580460' AND gyb.IN_HOSP_DATE BETWEEN '2003-05-27' AND '2017-01-18' AND gyb.INSURED_STS = '未就业' UNION SELECT COU... | css |
CREATE TABLE table_name_12 (
wins INTEGER,
latest_win VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total wins with the latest win at the 1999 Italian Grand Prix at a rank of 15?
| SELECT SUM(wins) FROM table_name_12 WHERE latest_win = "1999 italian grand prix" AND rank > 15 | sql_create_context |
CREATE TABLE table_19748 (
"Institution" text,
"Location" text,
"Team Nickname" text,
"Tenure" text,
"New Conference" text,
"New Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is California Lutheran University located?
| SELECT COUNT("Location") FROM table_19748 WHERE "Institution" = 'California Lutheran University' | wikisql |
CREATE TABLE table_32258 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did he finish after 1998 and a note time of 2:31:40?
| SELECT "Position" FROM table_32258 WHERE "Year" > '1998' AND "Notes" = '2:31:40' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dx ultrasound-thorax nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10539 AND ... | mimic_iii |
CREATE TABLE table_name_86 (
upper_stage VARCHAR,
launches_to_date VARCHAR,
version VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Upper stage has Launches to date of 0, and Version of 532?
| SELECT upper_stage FROM table_name_86 WHERE launches_to_date = 0 AND version = "532" | 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 demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-200601')) AND lab.labname = 'total bilirubin' AND DATETIME(lab.labresulttime, ... | eicu |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性支气管炎' AND jyjgzbb.JCZBDM = '001097' | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 12) | css |
CREATE TABLE table_name_47 (
total INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Total for Seve Ballesteros?
| SELECT SUM(total) FROM table_name_47 WHERE player = "seve ballesteros" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_8944 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place did Keith Clearwater get?
| SELECT "Place" FROM table_8944 WHERE "Player" = 'keith clearwater' | wikisql |
CREATE TABLE table_29919 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What n... | SELECT MAX("Game") FROM table_29919 WHERE "Date" = 'April 5' | wikisql |
CREATE TABLE table_24495 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is every successor for the Washington 3rd District?
| SELECT "Successor" FROM table_24495 WHERE "District" = 'Washington 3rd' | wikisql |
CREATE TABLE table_53893 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the Continental Qualifier on February 23, 2003?
| SELECT "Score" FROM table_53893 WHERE "Competition" = 'continental qualifier' AND "Date" = 'february 23, 2003' | wikisql |
CREATE TABLE table_52640 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the venue for score of 82-0
| SELECT "Venue" FROM table_52640 WHERE "Score" = '82-0' | wikisql |
CREATE TABLE table_name_59 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game on February 25, 2008?
| SELECT record FROM table_name_59 WHERE date = "february 25, 2008" | sql_create_context |
CREATE TABLE table_name_71 (
year INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the highest Year with a Score of 4 1?
| SELECT MAX(year) FROM table_name_71 WHERE score = "4–1" | 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 gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '47602760755' UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '47602760755' | css |
CREATE TABLE table_name_68 (
hometown VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown for tre madden?
| SELECT hometown FROM table_name_68 WHERE player = "tre madden" | sql_create_context |
CREATE TABLE table_2400 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Matchups/Result" text,
"Payout ( US$ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the city when the Television network was... | SELECT "City" FROM table_2400 WHERE "Television" = 'NFL Network' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '8444341' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 30 | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Ulcer of other part of foot" | mimicsql_data |
CREATE TABLE table_203_151 (
id number,
"no." number,
"date" text,
"tournament" text,
"winning score" text,
"margin of\nvictory" text,
"runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more strokes were in the klm open t... | SELECT (SELECT "margin of\nvictory" FROM table_203_151 WHERE "tournament" = 'klm open') - (SELECT "margin of\nvictory" FROM table_203_151 WHERE "tournament" = 'barclays scottish open') | squall |
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE movie (
mid int,
title text,
release_year int,
title_aka text,
budget text
)
CREATE TABLE director (
did int,
gender text,
name text,
natio... | SELECT actor.name FROM actor, cast, movie WHERE cast.aid = actor.aid AND cast.role = 'Alan Turing' AND movie.mid = cast.msid AND movie.title = 'The Imitation Game' | imdb |
CREATE TABLE table_name_93 (
year INTEGER,
winning_team VARCHAR,
usa_captain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year that Europe won, when the USA's Captain was Kathy Whitworth?
| SELECT MAX(year) FROM table_name_93 WHERE winning_team = "europe" AND usa_captain = "kathy whitworth" | sql_create_context |
CREATE TABLE table_dev_55 (
"id" int,
"gender" string,
"serum_potassium_abnormality" float,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"renal_disease" bool,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following qu... | SELECT * FROM table_dev_55 WHERE renal_disease = 1 OR ((serum_creatinine >= 1.4 AND gender = 'male') OR (serum_creatinine >= 1.3 AND gender = 'female')) OR (serum_potassium_abnormality < 3.4 OR serum_potassium_abnormality > 5.5) | criteria2sql |
CREATE TABLE table_name_20 (
date VARCHAR,
opponents_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has opponents, Claire De Gubernatis Alexandra Dulgheru, in the final?
| SELECT date FROM table_name_20 WHERE opponents_in_the_final = "claire de gubernatis alexandra dulgheru" | sql_create_context |
CREATE TABLE table_10818465_1 (
max_processors VARCHAR,
max_memory VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What max processor has a maximum memory of 256 gb?
| SELECT max_processors FROM table_10818465_1 WHERE max_memory = "256 GB" | sql_create_context |
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 "voter turnout" FROM table_204_226 WHERE "municipality/communes" = 'fratar' | squall |
CREATE TABLE table_name_42 (
civil_liberties_2013 VARCHAR,
political_rights_2011 VARCHAR,
political_rights_2010 VARCHAR,
civil_liberties_2012 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many civil liberties 2013 values are associated with a 20... | SELECT COUNT(civil_liberties_2013) FROM table_name_42 WHERE political_rights_2010 = 6 AND civil_liberties_2012 > 5 AND political_rights_2011 < 6 | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt ... | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE entrepreneur (
Money_Requested INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average money requested by all entrepreneurs?
| SELECT AVG(Money_Requested) FROM entrepreneur | sql_create_context |
CREATE TABLE table_34892 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the person that has 119.5 m?
| SELECT "Name" FROM table_34892 WHERE "1st (m)" = '119.5' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
lan... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 25965 AND STRFTIME('%y', admissions.admittime) <= '2102' | mimic_iii |
CREATE TABLE table_64627 (
"League" text,
"number of seasons" real,
"total games" real,
"Draw" real,
"Loss" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of games for less than 2 seasons and more than 7 draws?
| SELECT SUM("total games") FROM table_64627 WHERE "number of seasons" < '2' AND "Draw" > '7' | wikisql |
CREATE TABLE table_23673 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many votes did McCain get in the county where Obama got 50.7% of the votes?
| SELECT MAX("McCain#") FROM table_23673 WHERE "Obama%" = '50.7%' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.age, demographic.language FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.