instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 procedures.short_title, procedures.long_title FROM procedures WHERE procedures.icd9_code = "45" | mimicsql_data |
CREATE TABLE table_68868 (
"Rank" text,
"Score" text,
"Player" text,
"Club" text,
"Opponent" text,
"Year" text,
"Round" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent in 1992?
| SELECT "Opponent" FROM table_68868 WHERE "Year" = '1992' | wikisql |
CREATE TABLE table_14265 (
"Year" real,
"Competition" text,
"Location" text,
"Weight Category" text,
"Snatch" text,
"Clean and Jerk" text,
"Total" text,
"Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest place re... | SELECT MAX("Place") FROM table_14265 WHERE "Year" = '2010' AND "Clean and Jerk" = '224kg' | wikisql |
CREATE TABLE table_60614 (
"English translation" text,
"Original album" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Original Album, when English Translation is 'With You'?
| SELECT "Original album" FROM table_60614 WHERE "English translation" = 'with you' | wikisql |
CREATE TABLE phone (
Accreditation_level VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the accreditation level that more than 3 phones use.
| SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING COUNT(*) > 3 | sql_create_context |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY Country DESC | nvbench |
CREATE TABLE table_name_32 (
tail_number VARCHAR,
fatalities VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the tail number with 3/3 fatalities?
| SELECT tail_number FROM table_name_32 WHERE fatalities = "3/3" | sql_create_context |
CREATE TABLE table_20331 (
"No." real,
"Name" text,
"Livery" text,
"Locomotive type" text,
"Wheel Arrangement" text,
"Builder" text,
"Year built" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many locomotives have a l... | SELECT COUNT("Name") FROM table_20331 WHERE "Livery" = 'Highland Railway green' | wikisql |
CREATE TABLE table_27615445_1 (
episode_air_date VARCHAR,
guest_fourth_judge VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all episode air dates where Luiza Possi was the guest fourth judge?
| SELECT episode_air_date FROM table_27615445_1 WHERE guest_fourth_judge = "Luiza Possi" | sql_create_context |
CREATE TABLE table_35023 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Game smaller than 70, and a Record of 43 16 8 is what opponent?
| SELECT "Opponent" FROM table_35023 WHERE "Game" < '70' AND "Record" = '43–16–8' | wikisql |
CREATE TABLE table_name_97 (
score VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game with the Broadview Hawks as the home team?
| SELECT score FROM table_name_97 WHERE home = "broadview hawks" | sql_create_context |
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | SELECT Name, COUNT(Name) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_11630008_4 (
season_no INTEGER,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first season written by joseph hampton & dani renee?
| SELECT MIN(season_no) FROM table_11630008_4 WHERE written_by = "Joseph Hampton & Dani Renee" | sql_create_context |
CREATE TABLE table_203_538 (
id number,
"flight" text,
"date" text,
"payload nickname" text,
"payload" text,
"orbit" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many partial failures of h ii flights were there ?
| SELECT COUNT(*) FROM table_203_538 WHERE "result" = 'partial failure' | squall |
CREATE TABLE table_name_49 (
pick__number VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Pick #, when Round is '10'?
| SELECT pick__number FROM table_name_49 WHERE round = 10 | sql_create_context |
CREATE TABLE table_203_834 (
id number,
"rank" number,
"census subdivision" text,
"province" text,
"type" text,
"land area\n(km2, 2011)" number,
"population 2011" number,
"population 2006" number,
"population 2001" number,
"population 1996" number,
"change in % 2006-2011" num... | SELECT SUM("population 2006") FROM table_203_834 WHERE id IN (SELECT id FROM table_203_834 WHERE "province" = 'ontario' ORDER BY "population 2006" DESC LIMIT 5) | squall |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "5185" | mimicsql_data |
CREATE TABLE table_69265 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponent with score of 1 6, 6 4, 6 4
| SELECT "Opponent" FROM table_69265 WHERE "Score" = '1–6, 6–4, 6–4' | wikisql |
CREATE TABLE table_31634 (
"Conference" text,
"# of Bids" real,
"Record" text,
"Win %" text,
"Round of 32" text,
"Elite Eight" text,
"Final Four" text,
"Championship Game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many elite eig... | SELECT "Elite Eight" FROM table_31634 WHERE "Conference" = 'atlantic 10' | wikisql |
CREATE TABLE table_5930 (
"Country" text,
"Project Name" text,
"Year startup" text,
"Operator" text,
"Peak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the startup year for the project with a nioc operator?
| SELECT "Year startup" FROM table_5930 WHERE "Operator" = 'nioc' | wikisql |
CREATE TABLE table_37155 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whic... | SELECT "Team Name" FROM table_37155 WHERE "Poles" = '0' AND "Final Placing" = '29th' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-42758' AND NOT patient.hospit... | eicu |
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 SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-35416')) AND intakeoutput.cellpath LIKE '%ou... | eicu |
CREATE TABLE table_name_17 (
result VARCHAR,
score VARCHAR,
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result at dakar , senegal, on 3 september 2011, and with a Score of 2 0?
| SELECT result FROM table_name_17 WHERE venue = "dakar , senegal" AND date = "3 september 2011" AND score = "2–0" | sql_create_context |
CREATE TABLE table_20280 (
"Name" text,
"Overs Bowled" text,
"Maidens" real,
"Runs Conceded" real,
"Wickets" real,
"Extras" real,
"E.R." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runs conceded for chaminda vaas?
| SELECT "Runs Conceded" FROM table_20280 WHERE "Name" = 'Chaminda Vaas' | wikisql |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CR... | SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY COUNT(services) DESC | nvbench |
CREATE TABLE table_25468520_1 (
printing_process VARCHAR,
theme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many time is the theme rotary international : 100 years in canada?
| SELECT COUNT(printing_process) FROM table_25468520_1 WHERE theme = "Rotary International : 100 Years in Canada" | sql_create_context |
CREATE TABLE table_64198 (
"Province" text,
"Inhabitants" real,
"established" real,
"President" text,
"Party" text,
"Election" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest election result for President Leonardo Marras with ... | SELECT MIN("Election") FROM table_64198 WHERE "President" = 'leonardo marras' AND "Inhabitants" < '227,063' | wikisql |
CREATE TABLE table_name_26 (
départ_de_la_main_gauche VARCHAR,
mode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Depart de la main gauche of the do Mode?
| SELECT départ_de_la_main_gauche FROM table_name_26 WHERE mode = "do" | sql_create_context |
CREATE TABLE table_name_8 (
molecules VARCHAR,
percent_of_mass VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the molecules when the percent mass is 1.0?
| SELECT molecules FROM table_name_8 WHERE percent_of_mass = "1.0" | sql_create_context |
CREATE TABLE table_13705 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score in the final of the tournament with a ... | SELECT "Score in the final" FROM table_13705 WHERE "Surface" = 'clay' AND "Date" = '18 april 2011' | wikisql |
CREATE TABLE table_51072 (
"Date" text,
"Distance" text,
"Handler" text,
"Event" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event has a distance of ft10in (m)?
| SELECT "Event" FROM table_51072 WHERE "Distance" = 'ft10in (m)' | wikisql |
CREATE TABLE table_18994724_1 (
language_s_ VARCHAR,
film_title_used_in_nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language was spoken in Everlasting Moments?
| SELECT language_s_ FROM table_18994724_1 WHERE film_title_used_in_nomination = "Everlasting Moments" | sql_create_context |
CREATE TABLE table_39261 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has a Rank of 5?
| SELECT "Country" FROM table_39261 WHERE "Rank" = '5' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC | nvbench |
CREATE TABLE table_name_32 (
position INTEGER,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Played larger than 9?
| SELECT SUM(position) FROM table_name_32 WHERE played > 9 | sql_create_context |
CREATE TABLE table_204_845 (
id number,
"round" number,
"circuit" text,
"location" text,
"date" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"headline event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- wh... | SELECT "location" FROM table_204_845 WHERE "date" < (SELECT "date" FROM table_204_845 WHERE "location" = 'montreal' AND "date" = 'august 24') ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_name_44 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2010 for the grand slam tournaments of 2007?
| SELECT 2010 FROM table_name_44 WHERE 2007 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_name_10 (
date VARCHAR,
winner VARCHAR,
race_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did Dick Johnson with at Calder?
| SELECT date FROM table_name_10 WHERE winner = "dick johnson" AND race_title = "calder" | sql_create_context |
CREATE TABLE table_73834 (
"meas. num" real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- HOw many no votes were there when... | SELECT MIN("NO votes") FROM table_73834 WHERE "% YES" = '45.60%' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7012895' AND t_kc22.STA_DATE BETWEEN '2002-05-20' AND '2014-02-26' | css |
CREATE TABLE table_203_30 (
id number,
"place" number,
"team" text,
"played" number,
"won" number,
"draw" number,
"lost" number,
"goals\nscored" number,
"goals\nconceded" number,
"+/-" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "goals\nscored" FROM table_203_30 WHERE "team" = 'a.d. isidro metapan' | squall |
CREATE TABLE table_name_35 (
driver VARCHAR,
time_retired VARCHAR,
constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has a ime/Retired of +1 lap, and a Constructor of bar - honda?
| SELECT driver FROM table_name_35 WHERE time_retired = "+1 lap" AND constructor = "bar - honda" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
r... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14154 AND admissions.dischtime IS NULL) AND transfers.careunit = 'csru' ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE member (
Member_ID int,
Card_Number text,
Name text,
Hometown text,
Level int
)
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,... | SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY COUNT(Hometown) DESC | 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 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.dob_year < "2069" AND lab.label = "Amylase" | mimicsql_data |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB 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 jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '40747707754' | css |
CREATE TABLE table_name_36 (
pages INTEGER,
translated_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the sum of pages for thistle among roses
| SELECT SUM(pages) FROM table_name_36 WHERE translated_title = "thistle among roses" | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)... | SELECT tag, COUNT(*) FROM Posts AS p JOIN LATERAL (SELECT tag = REPLACE(value, '<', '') FROM STRING_SPLIT(SUBSTRING(Tags, 2, LENGTH(Tags) - 2), '>')) AS tags WHERE PostTypeId = 1 AND Tags LIKE '%<bigdata>%' GROUP BY tag ORDER BY 2 DESC | sede |
CREATE TABLE table_204_855 (
id number,
"year" number,
"date" text,
"winner" text,
"result" text,
"loser" text,
"attendance" number,
"location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total games did the chicago bears win... | SELECT COUNT(*) FROM table_204_855 WHERE "winner" = 'chicago bears' | squall |
CREATE TABLE table_name_26 (
timeslot VARCHAR,
air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the timeslot for the episode that aired April 28, 2009?
| SELECT timeslot FROM table_name_26 WHERE air_date = "april 28, 2009" | sql_create_context |
CREATE TABLE table_11464746_1 (
composition VARCHAR,
house_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the benue house made of?
| SELECT composition FROM table_11464746_1 WHERE house_name = "Benue" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT 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 = '022-187132' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'lactate' ORD... | eicu |
CREATE TABLE table_78357 (
"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.
-- Which Venue is the one for the footscray Home te... | SELECT "Venue" FROM table_78357 WHERE "Home team" = 'footscray' | 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer | nvbench |
CREATE TABLE table_name_52 (
country VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country placed t3 with a score of 70-65=135?
| SELECT country FROM table_name_52 WHERE place = "t3" AND score = 70 - 65 = 135 | sql_create_context |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier | nvbench |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby... | SELECT DISTINCT writes.authorid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = pape... | scholar |
CREATE TABLE table_name_50 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What away team played against Footscray as the home team?
| SELECT away_team FROM table_name_50 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PSYCH' AND course.number = 359 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.... | advising |
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 diagnoses_icd (
row_id number,
subject_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year') | mimic_iii |
CREATE TABLE table_742 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What candidates ran in the election that included john shelley?
| SELECT "Candidates" FROM table_742 WHERE "Incumbent" = 'John Shelley' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '87239192' AND t_kc22.STA_DATE BETWEEN '2008-09-22' AND '2012-04-12' AND t_kc21.MED_SER_ORG_NO = '3998921' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
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 prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Hydrocerin" | mimicsql_data |
CREATE TABLE table_203_521 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total times has this team finished 1st in mid... | SELECT COUNT(*) FROM table_203_521 WHERE "regular season" = '1st, mid south' | squall |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID DESC | nvbench |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_name_26 (
executions_in_effigie VARCHAR,
tribunal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How man executions in effigie took place at the Lamego tribunal?
| SELECT executions_in_effigie FROM table_name_26 WHERE tribunal = "lamego" | sql_create_context |
CREATE TABLE table_name_96 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On June 29, who was the opponent?
| SELECT opponent FROM table_name_96 WHERE date = "june 29" | sql_create_context |
CREATE TABLE table_name_4 (
ends_won INTEGER,
ends_lost VARCHAR,
shot__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of ends won of 47 Ends Lost and a Shot % less than 73?
| SELECT MAX(ends_won) FROM table_name_4 WHERE ends_lost = 47 AND shot__percentage < 73 | sql_create_context |
CREATE TABLE table_73525 (
"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's... | SELECT "Game" FROM table_73525 WHERE "High rebounds" = 'Carlos Boozer (8)' | wikisql |
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 lab (
la... | 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 = '005-77687' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_name_61 (
format VARCHAR,
region VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Format has a Region of united states, and a Catalog of kem 072?
| SELECT format FROM table_name_61 WHERE region = "united states" AND catalog = "kem 072" | sql_create_context |
CREATE TABLE table_name_1 (
round VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Round was a player from College of Connecticut drafted?
| SELECT round FROM table_name_1 WHERE college = "connecticut" | sql_create_context |
CREATE TABLE professor (
dept_code VARCHAR
)
CREATE TABLE department (
dept_code VARCHAR,
dept_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many professors who are from either Accounting or Biology department?
| SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology' | sql_create_context |
CREATE TABLE table_14199 (
"Rank" real,
"Heat" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is Erin Donohue?
| SELECT "Nationality" FROM table_14199 WHERE "Name" = 'erin donohue' | wikisql |
CREATE TABLE table_12800 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest pick of player paul stasiuk from a round greater than 12?
| SELECT MIN("Pick") FROM table_12800 WHERE "Player" = 'paul stasiuk' AND "Round" > '12' | wikisql |
CREATE TABLE table_204_899 (
id number,
"event" text,
"date" text,
"area" text,
"tornadoes" number,
"casualties" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the total number of tornado events that occurred in 1960 i... | SELECT SUM("tornadoes") FROM table_204_899 WHERE "date" = 1960 | squall |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bronchitis') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosis... | eicu |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedb... | SELECT t.TagName AS "tagname", t.Count AS TagCount FROM Tags AS t LEFT JOIN Posts AS e ON t.ExcerptPostId = e.Id LEFT JOIN TagSynonyms AS ts ON ts.SourceTagName = t.TagName WHERE LENGTH(e.Body) < 10 GROUP BY t.TagName, t.Count ORDER BY t.Count DESC | sede |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
med... | SELECT (SELECT 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 = '031-11804' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_1341718_14 (
candidates VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times was it the district illinois 18?
| SELECT COUNT(candidates) FROM table_1341718_14 WHERE district = "Illinois 18" | sql_create_context |
CREATE TABLE table_203_521 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the team 's playoff result in the year after ... | SELECT "playoffs" FROM table_203_521 WHERE "year" = (SELECT "year" FROM table_203_521 WHERE "playoffs" = 'champions') + 1 | squall |
CREATE TABLE table_19759 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Jockey" text,
"Winner/2nd" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the 55 kg partic... | SELECT "Date" FROM table_19759 WHERE "Weight (kg)" = '55' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(15),
customer_number VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(255),
customer_phone VARCHAR(80),
customer_email VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
product_type_cod... | SELECT date_from, COUNT(date_from) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id | nvbench |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE View_Unit_Status (
apt_id INTEG... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_68525 (
"Season" text,
"League" text,
"Winner" text,
"Goals" real,
"Assists" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the WCHL League, what is the last Assists with less than 65 Goals?
| SELECT MIN("Assists") FROM table_68525 WHERE "League" = 'wchl' AND "Goals" < '65' | wikisql |
CREATE TABLE table_name_58 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when their record was 35 23 15?
| SELECT score FROM table_name_58 WHERE record = "35–23–15" | sql_create_context |
CREATE TABLE table_name_19 (
school_club_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college team did Derek Fisher play for?
| SELECT school_club_team FROM table_name_19 WHERE player = "derek fisher" | sql_create_context |
CREATE TABLE table_23654 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the 3-da... | SELECT "3-dart Average" FROM table_23654 WHERE "Player" = 'Raymond van Barneveld' | wikisql |
CREATE TABLE table_77970 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is th... | SELECT "Date" FROM table_77970 WHERE "Winning driver" = 'graham hill' AND "Circuit" = 'nürburgring' | wikisql |
CREATE TABLE table_name_62 (
react INTEGER,
country VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest of the athlete from sri lanka who has a lane greater than 8?
| SELECT MIN(react) FROM table_name_62 WHERE country = "sri lanka" AND lane > 8 | sql_create_context |
CREATE TABLE table_204_783 (
id number,
"position" text,
"player" text,
"free agency\ntag" text,
"date signed" text,
"2013 team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- geno hayes and nick roach both played which position ?
| SELECT "position" FROM table_204_783 WHERE "player" = 'geno hayes' | squall |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minu... | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON... | atis |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZ... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_i... | css |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airp... | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TOR... | atis |
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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral | nvbench |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%singapore%' OR UPPER(Location) LIKE '%SINGAPORE%' OR Location LIKE '%singapore%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 25 | sede |
CREATE TABLE table_name_71 (
margin_of_victory VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the runner(s)-up when the winning score was 10 (69-68-74-67=278)?
| SELECT margin_of_victory FROM table_name_71 WHERE winning_score = –10(69 - 68 - 74 - 67 = 278) | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.