instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_58 (
song VARCHAR,
composer VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What song was composed by V. Selvaganesh later than 2010?
| SELECT song FROM table_name_58 WHERE composer = "v. selvaganesh" AND year > 2010 | 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 allergy (
allergy... | SELECT COUNT(*) > 0 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 STRFTIME('%y', microlab.culturetakentime) = '2105' | eicu |
CREATE TABLE table_1827690_4 (
assembled VARCHAR,
elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1472 was the elected when was the assembled?
| SELECT assembled FROM table_1827690_4 WHERE elected = "1472" | sql_create_context |
CREATE TABLE table_10593 (
"Location" text,
"Venue" text,
"Promotion" text,
"Event" text,
"Inductee(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the promotion when the arena was the venue and the event of legends of the arena?
| SELECT "Promotion" FROM table_10593 WHERE "Venue" = 'the arena' AND "Event" = 'legends of the arena' | wikisql |
CREATE TABLE table_2192067_4 (
district VARCHAR,
vacator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the district where the vacator is vacant?
| SELECT district FROM table_2192067_4 WHERE vacator = "Vacant" | sql_create_context |
CREATE TABLE table_name_69 (
actor_in_original_production VARCHAR,
gameplan VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the actor in the original production when Troy Stephens is the GamePlan?
| SELECT actor_in_original_production FROM table_name_69 WHERE gameplan = "troy stephens" | sql_create_context |
CREATE TABLE table_name_83 (
year_built VARCHAR,
church_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Hopperstad Stavkyrkje built?
| SELECT year_built FROM table_name_83 WHERE church_name = "hopperstad stavkyrkje" | sql_create_context |
CREATE TABLE table_name_8 (
hand_guards VARCHAR,
name VARCHAR,
barrel_twist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the hand guards for ar-15a2 government carbine and barrel twist of 1:9
| SELECT hand_guards FROM table_name_8 WHERE name = "ar-15a2 government carbine" AND barrel_twist = "1:9" | sql_create_context |
CREATE TABLE table_name_78 (
elevated VARCHAR,
order VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's listed for the Elevated category that has an Order of Cardinal-Bishop?
| SELECT elevated FROM table_name_78 WHERE order = "cardinal-bishop" | sql_create_context |
CREATE TABLE ship (
Nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the nations that have more than two ships.
| SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2 | sql_create_context |
CREATE TABLE table_203_429 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was mayer 's best result : i.e his longest throw ?
| SELECT "notes" FROM table_203_429 ORDER BY "notes" DESC LIMIT 1 | squall |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 te... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '97962620644' | css |
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TAB... | SELECT stuid, SUM(hours_played) FROM plays_games GROUP BY stuid | spider |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87232) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
s... | SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M' | spider |
CREATE TABLE table_204_388 (
id number,
"#" number,
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text,
"pts" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell me the number of points the blackhawks had on march 4 ... | SELECT "pts" FROM table_204_388 WHERE "date" = 'march 4' | squall |
CREATE TABLE table_name_2 (
decile INTEGER,
years VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest decile with 1-6 years and area of Maitland?
| SELECT MIN(decile) FROM table_name_2 WHERE years = "1-6" AND area = "maitland" | sql_create_context |
CREATE TABLE table_name_33 (
score_in_the_final VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On September 25, 1994 what was the final score?
| SELECT score_in_the_final FROM table_name_33 WHERE date = "september 25, 1994" | sql_create_context |
CREATE TABLE table_name_20 (
partner VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the partner with opponent of micha lla krajicek eleni daniilidou
| SELECT partner FROM table_name_20 WHERE opponent = "michaëlla krajicek eleni daniilidou" | sql_create_context |
CREATE TABLE table_7965 (
"Player" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Challenge Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest league for a less than 0 league cup?
| SELECT MIN("League") FROM table_7965 WHERE "League Cup" < '0' | wikisql |
CREATE TABLE table_name_5 (
sign VARCHAR,
fall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which sign has a fall of Venus?
| SELECT sign FROM table_name_5 WHERE fall = "venus" | sql_create_context |
CREATE TABLE table_14035 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score when the home team is queens park rangers?
| SELECT "Score" FROM table_14035 WHERE "Home team" = 'queens park rangers' | wikisql |
CREATE TABLE Faculty (
building VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which building has most faculty members?
| SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | advising |
CREATE TABLE table_204_970 (
id number,
"year" number,
"award" text,
"category" text,
"title" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for what title did mr. borgnine receive the most awards ?
| SELECT "title" FROM table_204_970 GROUP BY "title" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_1876825_6 (
no_in_season INTEGER,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season episode is written by neil thompson?
| SELECT MIN(no_in_season) FROM table_1876825_6 WHERE written_by = "Neil Thompson" | sql_create_context |
CREATE TABLE table_73658 (
"Episode no." real,
"Airdate" text,
"Viewers" real,
"BBC Three weekly ranking" text,
"Cable rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many viewers were there for airdate is 22 october 2009?
| SELECT MAX("Viewers") FROM table_73658 WHERE "Airdate" = '22 October 2009' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Triiodothyronine (T3)" | mimicsql_data |
CREATE TABLE table_63777 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest played with more than 0 draws, less than 3 losses, and less than 27 po... | SELECT MAX("Played") FROM table_63777 WHERE "Drawn" > '0' AND "Lost" < '3' AND "Points" < '27' | wikisql |
CREATE TABLE table_68073 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team for school of milford
| SELECT "Team" FROM table_68073 WHERE "School" = 'milford' | wikisql |
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.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '13358901' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '13358901' GROUP BY gyb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT zyb.MED_SER_ORG_NO FROM zyb WHERE zyb.PERSON_ID = '13358901' GR... | css |
CREATE TABLE table_name_24 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the away team Bournemouth?
| SELECT date FROM table_name_24 WHERE away_team = "bournemouth" | sql_create_context |
CREATE TABLE table_2668169_2 (
candidates VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the candidates for the Pennsylvania 11 district?
| SELECT candidates FROM table_2668169_2 WHERE district = "Pennsylvania 11" | sql_create_context |
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 COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '8585428' AND jybgb.BGRQ BETWEEN '2006-12-22' AND '2015-03-05' GROUP BY jybgb.KSBM HAVING COUNT(*) > 7 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb J... | css |
CREATE TABLE table_77047 (
"Star" text,
"Episode 2" real,
"Episode 3" text,
"Episode 4" text,
"Episode 5" text,
"Episode 6" text,
"Episode 7" text,
"Episode 8" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode 4 has a Star of ... | SELECT "Episode 4" FROM table_77047 WHERE "Star" = 'anna powierza' | wikisql |
CREATE TABLE table_name_17 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game at Lake Oval?
| SELECT date FROM table_name_17 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')... | eicu |
CREATE TABLE table_76709 (
"Year" real,
"Artist" text,
"Title" text,
"Label" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Title has a Type of album in 1983?
| SELECT "Title" FROM table_76709 WHERE "Type" = 'album' AND "Year" = '1983' | wikisql |
CREATE TABLE table_7035 (
"Season" real,
"Overall" text,
"Slalom" text,
"Giant Slalom" text,
"Super G" text,
"Downhill" text,
"Combined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Giant Slalom has a Slalom of 45?
| SELECT "Giant Slalom" FROM table_7035 WHERE "Slalom" = '45' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.itemid = "51257" | mimicsql_data |
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 Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 | nvbench |
CREATE TABLE table_16278349_1 (
un_region VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the un region for 3314000 population
| SELECT un_region FROM table_16278349_1 WHERE population = 3314000 | sql_create_context |
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(80),
line_2 VARCHAR(80),
city VARCHAR(50),
zip_postcode CHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50)
)
CREATE TABLE Candidate_Assessments (
candidate_id INTEGER,
qualification CHAR(15),
assessment_da... | SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY COUNT(last_name) DESC | nvbench |
CREATE TABLE table_26757_4 (
slovene VARCHAR,
belarusian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When (r ba) is the belarusian how many slovenes are there?
| SELECT COUNT(slovene) FROM table_26757_4 WHERE belarusian = "рыба (rýba)" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT * FROM Posts WHERE Posts.ParentId = 234075 ORDER BY Posts.Score DESC | sede |
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 T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_72360 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the results for incumbent Jim McCrery?
| SELECT "Results" FROM table_72360 WHERE "Incumbent" = 'Jim McCrery' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '水凯复' AND hz_info.YLJGDM = '0439258' AND NOT mzjzjlb.JZZDSM LIKE '%酒精%' | css |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType | nvbench |
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.marital_status = "MARRIED" AND lab.itemid = "51214" | mimicsql_data |
CREATE TABLE table_39259 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the score on november 15
| SELECT "Score" FROM table_39259 WHERE "Date" = 'november 15' | wikisql |
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Channels (
Channel_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Event_... | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY Product_Name | nvbench |
CREATE TABLE table_70761 (
"Class" text,
"Type" text,
"Names" text,
"Quantity made" text,
"Manufacturer" text,
"Date made" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the class of the locomotive with a quantity made of 1 and a 0-6-0t ... | SELECT "Class" FROM table_70761 WHERE "Quantity made" = '1' AND "Type" = '0-6-0t' | wikisql |
CREATE TABLE table_34135 (
"Year" text,
"Title" text,
"Director" text,
"Distributor(s)" text,
"Box office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Three Men and a Little Lady from Touchstone Pictures was from what year?
| SELECT "Year" FROM table_34135 WHERE "Distributor(s)" = 'touchstone pictures' AND "Title" = 'three men and a little lady' | wikisql |
CREATE TABLE table_40165 (
"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.
-- Can yo... | SELECT "Score" FROM table_40165 WHERE "Date" = 'april 8' | wikisql |
CREATE TABLE table_name_11 (
transfer_fee VARCHAR,
moving_to VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The player moving to Villa Rio has what transfer fee?
| SELECT transfer_fee FROM table_name_11 WHERE moving_to = "villa rio" | sql_create_context |
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 i... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT... | 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 (SELECT COUNT(*) 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 = '12121203' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-05-07' AND '2020-07-12' UNION SELECT COUNT(*) FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjz... | css |
CREATE TABLE table_name_42 (
floors VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many floors are in little Italy?
| SELECT COUNT(floors) FROM table_name_42 WHERE location = "little italy" | sql_create_context |
CREATE TABLE table_27917 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the domi... | SELECT "Dominant religion (2002)" FROM table_27917 WHERE "Cyrillic Name Other Names" = 'Нови Сад' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Formation of cutaneous uretero-ileostomy" | mimicsql_data |
CREATE TABLE table_name_65 (
loss VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss of the game that had a score of 9-7?
| SELECT loss FROM table_name_65 WHERE score = "9-7" | sql_create_context |
CREATE TABLE table_name_34 (
format VARCHAR,
conductor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What format was conductor Erich Leinsdorf's album released on?
| SELECT format FROM table_name_34 WHERE conductor = "erich leinsdorf" | sql_create_context |
CREATE TABLE table_19588 (
"Number of episode" real,
"Number of season" real,
"Title (original)" text,
"Title (English)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original title of season number 3?
| SELECT "Title (original)" FROM table_19588 WHERE "Number of season" = '3' | wikisql |
CREATE TABLE table_35516 (
"Year" text,
"Champion" text,
"Subchampion" text,
"Scoreboard" text,
"Fronton" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Championship has a Scoreboard that is 22-14?
| SELECT "Champion" FROM table_35516 WHERE "Scoreboard" = '22-14' | wikisql |
CREATE TABLE table_11935 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player with TD's more than 1 and long less than 24 with avg less than 11.4
| SELECT "Player" FROM table_11935 WHERE "Avg." < '11.4' AND "Long" < '24' AND "TD's" > '1' | wikisql |
CREATE TABLE table_59026 (
"Stage" text,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Points Classification" text,
"Sprints classification" text,
"Team Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Points Classification" FROM table_59026 WHERE "Stage" = 'final' | 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(*) FROM txmzjzjlb WHERE txmzjzjlb.ZZYSGH = '25408740' AND txmzjzjlb.JZKSRQ BETWEEN '2011-01-20' AND '2019-07-19' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZZYSGH = '25408740' AND ftxmzjzjlb.JZKSRQ BETWEEN '2011-01-20' AND '2019-07-19' | css |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | (SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.B... | css |
CREATE TABLE table_76321 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day in January was the game greater than 49 and had @ Montreal Canadiens as opponents?
| SELECT SUM("January") FROM table_76321 WHERE "Opponent" = '@ montreal canadiens' AND "Game" > '49' | wikisql |
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 hz_info (
KH text,
KLX number... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM ... | css |
CREATE TABLE table_27380 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did the tight end draft pick for New England Patriots come from?
| SELECT "College" FROM table_27380 WHERE "NFL Team" = 'New England Patriots' AND "Position" = 'Tight end' | wikisql |
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY date_account_opened | nvbench |
CREATE TABLE table_28039032_1 (
round VARCHAR,
winners_from_previous_round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the round that had 32 winners from previous round?
| SELECT round FROM table_28039032_1 WHERE winners_from_previous_round = "32" | sql_create_context |
CREATE TABLE table_35552 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest with a capacity of greater than 4,000 and an average of 615?
| SELECT MAX("Highest") FROM table_35552 WHERE "Average" = '615' AND "Capacity" > '4,000' | wikisql |
CREATE TABLE table_73693 (
"Player" text,
"Starts" real,
"Cuts made" real,
"Best finish" text,
"Money list rank" real,
"Earnings ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum money list rank for Matt Hansen?
| SELECT MAX("Money list rank") FROM table_73693 WHERE "Player" = 'Matt Hansen' | 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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Kidney dialysis as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of pro... | mimicsql_data |
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year int,
Team text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Orde... | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position | nvbench |
CREATE TABLE table_44443 (
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps have 0 laps led and 13 points?
| SELECT "Laps" FROM table_44443 WHERE "Laps Led" = '0' AND "Points" = '13' | wikisql |
CREATE TABLE table_28709 (
"Rank" real,
"Athlete" text,
"Country" text,
"Height" text,
"Points" real,
"Adjusted Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country of Paavo Yrj l ?
| SELECT "Country" FROM table_28709 WHERE "Athlete" = 'Paavo Yrjölä' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bronchodilator - ipratropium' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT pati... | eicu |
CREATE TABLE table_2818 (
"Month" text,
"Week" real,
"Overall" text,
"Offensive" text,
"Defensive" text,
"Transition" text,
"Rookie" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the week for steve toll
| SELECT "Week" FROM table_2818 WHERE "Transition" = 'Steve Toll' | wikisql |
CREATE TABLE documents_to_be_destroyed (
document_id number,
destruction_authorised_by_employee_id number,
destroyed_by_employee_id number,
planned_destruction_date time,
actual_destruction_date time,
other_details text
)
CREATE TABLE document_locations (
document_id number,
location_co... | SELECT destroyed_by_employee_id FROM documents_to_be_destroyed UNION SELECT destruction_authorised_by_employee_id FROM documents_to_be_destroyed | spider |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 10 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_10802 (
"Episode" real,
"Title" text,
"Airdate" text,
"Rating" real,
"Share" real,
"18-49" real,
"Viewers" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title has a rating over 9.3, but where the 18... | SELECT "Title" FROM table_10802 WHERE "Rating" > '9.3' AND "18-49" < '5.5' AND "Airdate" = 'january 11, 2007' | wikisql |
CREATE TABLE table_1953 (
"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.
-- What episode number in the ... | SELECT MAX("No. in series") FROM table_1953 WHERE "Original air date" = 'February 8, 2004' | wikisql |
CREATE TABLE table_name_13 (
fuml INTEGER,
att VARCHAR,
long VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the average Fuml for Att of 5 and long more than 7
| SELECT AVG(fuml) FROM table_name_13 WHERE att = 5 AND long > 7 | sql_create_context |
CREATE TABLE table_73219 (
"Starting price" text,
"Number" real,
"Name" text,
"Age" real,
"Weight (st, lb)" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Colours" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name... | SELECT "Name" FROM table_73219 WHERE "Owner" = 'David Johnson' | wikisql |
CREATE TABLE table_name_36 (
laps INTEGER,
driver VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Laps for mike spence, with a Grid smaller than 8?
| SELECT MIN(laps) FROM table_name_36 WHERE driver = "mike spence" AND grid < 8 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT wdmzjzjlb.ZZYSGH, wdmzjzjlb.QTJZYSGH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '67977476641' UNION SELECT bdmzjzjlb.ZZYSGH, bdmzjzjlb.QTJZYSGH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '67977476641' | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,... | SELECT SUM(inputevents_cv.amount) 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 = 5142)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(),... | mimic_iii |
CREATE TABLE table_11879 (
"Player" text,
"Position" text,
"Tries" real,
"Goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the lowest points for tries of 39 and goals more than 0
| SELECT MIN("Points") FROM table_11879 WHERE "Tries" = '39' AND "Goals" > '0' | wikisql |
CREATE TABLE table_name_43 (
lane INTEGER,
heat VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Sara Isakovi 's lane number that had a heat of 3?
| SELECT SUM(lane) FROM table_name_43 WHERE heat = 3 AND name = "sara isakovič" | sql_create_context |
CREATE TABLE table_name_56 (
date VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which date was there a win?
| SELECT date FROM table_name_56 WHERE result = "win" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_24871 (
"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.
-- when was the episode premi... | SELECT COUNT("Original air date") FROM table_24871 WHERE "Production code" = '11.19' | wikisql |
CREATE TABLE table_name_79 (
pick__number INTEGER,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Pick #, when College is Laurier?
| SELECT SUM(pick__number) FROM table_name_79 WHERE college = "laurier" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
C... | SELECT Id, CreationDate, Score, ViewCount, Body, OwnerUserId, Title, Tags, AnswerCount FROM Posts WHERE Tags LIKE '%<android%' AND PostTypeId = 1 AND CreationDate BETWEEN '2010-01-01' AND '2010-12-31' ORDER BY CreationDate | sede |
CREATE TABLE table_16293 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Title" FROM table_16293 WHERE "U.S. viewers (millions)" = '10.34' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22449) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.