instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNT... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_name_62 (
total VARCHAR,
nation VARCHAR,
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many medals for spain that has 1 silver and 1 bronze?
| SELECT COUNT(total) FROM table_name_62 WHERE silver = "1" AND bronze = "1" AND nation = "spain" | sql_create_context |
CREATE TABLE table_27698941_6 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the game with the record of 3 12?
| SELECT score FROM table_27698941_6 WHERE record = "3–12" | 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 wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '26603451' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz... | css |
CREATE TABLE table_41842 (
"Episode number" real,
"Season" text,
"Original airing" text,
"Total viewers" text,
"Audience share (average)" text,
"Season viewer average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode number has an aud... | SELECT COUNT("Episode number") FROM table_41842 WHERE "Audience share (average)" = '10%' | wikisql |
CREATE TABLE table_57672 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest grid that has 55 laps?
| SELECT MAX("Grid") FROM table_57672 WHERE "Laps" = '55' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "38842" | mimicsql_data |
CREATE TABLE table_51690 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which years did the Rockets number 6 play?
| SELECT "Years for Rockets" FROM table_51690 WHERE "No.(s)" = '6' | wikisql |
CREATE TABLE table_name_24 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team at Victoria Park?
| SELECT away_team AS score FROM table_name_24 WHERE venue = "victoria park" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "HYDZ20I" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_name_66 (
undecided VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Undecided on 2009-05-24?
| SELECT undecided FROM table_name_66 WHERE date = "2009-05-24" | sql_create_context |
CREATE TABLE category (
category_id number,
name text,
last_update time
)
CREATE TABLE store (
store_id number,
manager_staff_id number,
address_id number,
last_update time
)
CREATE TABLE staff (
staff_id number,
first_name text,
last_name text,
address_id number,
pictu... | SELECT COUNT(DISTINCT language_id) FROM film | spider |
CREATE TABLE table_50350 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place had a score of 71-70-73-71=285?
| SELECT "Place" FROM table_50350 WHERE "Score" = '71-70-73-71=285' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dob_year < "2120" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) > 0 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 = 14054)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sc 20 fe... | mimic_iii |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC | nvbench |
CREATE TABLE table_72173 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the fastest lap in the B... | SELECT "Fastest Lap" FROM table_72173 WHERE "Grand Prix" = 'Belgian Grand Prix' | wikisql |
CREATE TABLE table_70831 (
"Name" text,
"Frequency" text,
"Language" text,
"City" text,
"Website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which english website has a daily frequency ?
| SELECT "Website" FROM table_70831 WHERE "Language" = 'english' AND "Frequency" = 'daily' | wikisql |
CREATE TABLE table_name_1 (
player VARCHAR,
round VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Round larger than 5, and a Position of (g)?
| SELECT player FROM table_name_1 WHERE round > 5 AND position = "(g)" | sql_create_context |
CREATE TABLE table_25057928_1 (
institute VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most 2012/13 for university of cambridge
| SELECT MAX(2012 AS _13) FROM table_25057928_1 WHERE institute = "University of Cambridge" | sql_create_context |
CREATE TABLE table_1638437_2 (
pinyin VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the pinyin for 487 area
| SELECT pinyin FROM table_1638437_2 WHERE area = "487" | sql_create_context |
CREATE TABLE table_49470 (
"Game" text,
"Date" text,
"Home team" text,
"Result" text,
"Road team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Home team of philadelphia, and a Result of 104 110?
| SELECT "Date" FROM table_49470 WHERE "Home team" = 'philadelphia' AND "Result" = '104–110' | wikisql |
CREATE TABLE table_204_595 (
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.
-- how many nations won at least two gold medals ?
| SELECT COUNT("nation") FROM table_204_595 WHERE "gold" >= 2 | squall |
CREATE TABLE table_name_65 (
party VARCHAR,
state VARCHAR,
member VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party is Peter Fisher from Vic serve in office?
| SELECT party FROM table_name_65 WHERE state = "vic" AND member = "peter fisher" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "KETR30I" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_name_18 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Retief Goosen from?
| SELECT country FROM table_name_18 WHERE player = "retief goosen" | sql_create_context |
CREATE TABLE table_23234 (
"Office" text,
"Branch" text,
"Location" text,
"Elected" real,
"Term began" text,
"Term ended" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What branch was involved when the term began in January 3, 1985?
| SELECT "Branch" FROM table_23234 WHERE "Term began" = 'January 3, 1985' | wikisql |
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 COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-40970')) AND vitalperiodic.respiration BETWEEN respiration_lower... | eicu |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | SELECT * FROM Users WHERE Id = @UserId | sede |
CREATE TABLE table_name_9 (
overall INTEGER,
name VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Overall is the highest one that has a Name of gregory spann, and a Pick # larger than 19?
| SELECT MAX(overall) FROM table_name_9 WHERE name = "gregory spann" AND pick__number > 19 | sql_create_context |
CREATE TABLE table_name_18 (
language VARCHAR,
english_translation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the language when the english translation is come to me?
| SELECT language FROM table_name_18 WHERE english_translation = "come to me" | sql_create_context |
CREATE TABLE table_name_59 (
format VARCHAR,
label VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the format on july 27, 1994 for alfa records
| SELECT format FROM table_name_59 WHERE label = "alfa records" AND date = "july 27, 1994" | sql_create_context |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_34 (
school VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school is in Brookville?
| SELECT school FROM table_name_34 WHERE city = "brookville" | sql_create_context |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int... | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Luke Zettlemoyer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE Problem_Status_Codes (
problem_status_code VARCHAR(20),
problem_status_description VARCHAR(80)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_first_name VARCHAR(80),
staff_last_name VARCHAR(80),
other_staff_details VARCHAR(255)
)
CREATE TABLE Product (
product_id INTEGER,
... | SELECT log_entry_date, problem_log_id FROM Problem_Log WHERE problem_id = 10 ORDER BY log_entry_date | nvbench |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... | SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 10... | eicu |
CREATE TABLE table_12807904_3 (
points_for VARCHAR,
try_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- HOW MANY GAMES HAD BONUS POINTS OF 6?
| SELECT points_for FROM table_12807904_3 WHERE try_bonus = "6" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId nu... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%bournemouth%' OR UPPER(Location) LIKE '%BOURNEMOUTH%' OR Location LIKE '%bournemouth%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 10 | sede |
CREATE TABLE table_name_67 (
right_ascension___j2000__ VARCHAR,
constellation VARCHAR,
ngc_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Pegasus' right ascension with a 7318a NGC?
| SELECT right_ascension___j2000__ FROM table_name_67 WHERE constellation = "pegasus" AND ngc_number = "7318a" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy... | css |
CREATE TABLE table_name_64 (
attendance INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the greatest attendance when the opponent is the chicago bears
| SELECT MAX(attendance) FROM table_name_64 WHERE opponent = "chicago bears" | sql_create_context |
CREATE TABLE table_60571 (
"Measure" text,
"Bombali" real,
"Bonthe" real,
"Kailahun" real,
"Kambia" text,
"Kenema" real,
"Koinadugu" real,
"Kono" real,
"Moyamba" text,
"Port Loko" text,
"Pujehun" real,
"Tonkolili" real
)
-- Using valid SQLite, answer the following quest... | SELECT SUM("Kono") FROM table_60571 WHERE "Bonthe" > '21,238' | wikisql |
CREATE TABLE table_name_80 (
_percentage_hydropower INTEGER,
_percentage_nuclear_power VARCHAR,
_percentage_oil VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest % hydropower when the % oil is less than 24.5, country... | SELECT MAX(_percentage_hydropower) FROM table_name_80 WHERE _percentage_oil < 24.5 AND country = "united arab emirates" AND _percentage_nuclear_power < 0 | sql_create_context |
CREATE TABLE table_18955077_1 (
interval_name VARCHAR,
size__cents_ VARCHAR,
just_ratio VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the just ratio is 11:8 and the cents size is 560, what is the interval name?
| SELECT interval_name FROM table_18955077_1 WHERE size__cents_ = 560 AND just_ratio = "11:8" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COLANGITIS" AND demographic.dob_year < "2111" | mimicsql_data |
CREATE TABLE table_13190 (
"Date" text,
"Ship" text,
"Tonnage" text,
"Nationality" text,
"Fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tonnage is on 25 july 1942?
| SELECT "Tonnage" FROM table_13190 WHERE "Date" = '25 july 1942' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-61209')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_name_8 (
opponent_in_the_final VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in the final of the Senegal f2 tournament>
| SELECT opponent_in_the_final FROM table_name_8 WHERE tournament = "senegal f2" | sql_create_context |
CREATE TABLE exhibition (
artist_id VARCHAR,
year VARCHAR
)
CREATE TABLE artist (
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all artist names who didn't have an exhibition in 2004.
| SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004 | sql_create_context |
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificationexpires time
)
CREATE TABLE on_call (
nurse number,
blockfloor number,
blockcode number,
oncallstart time,
oncallend time
)
CREATE TABLE department (
departmentid number,
name... | SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.physician = T2.employeeid | spider |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETI... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-240586')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.c... | eicu |
CREATE TABLE table_40356 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"2008\u20132009 Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowes... | SELECT MIN("Jersey #") FROM table_40356 WHERE "Height (cm)" = '191' AND "2008\u20132009 Team" = 'new jersey devils' | wikisql |
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Scor... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type | nvbench |
CREATE TABLE table_203_320 (
id number,
"rank in\n2011" number,
"name of\nconcern" text,
"location of\nheadquarters" text,
"revenue\n(thou.\npln)" number,
"profit\n(thou.\npln)" number,
"employees" number
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "name of\nconcern" FROM table_203_320 ORDER BY "employees" DESC LIMIT 1 | squall |
CREATE TABLE table_47351 (
"District" real,
"Representative" text,
"Party" text,
"First elected" real,
"Residence" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What residence has representative Quincy Murphy?
| SELECT "Residence" FROM table_47351 WHERE "Representative" = 'quincy murphy' | wikisql |
CREATE TABLE table_name_72 (
rank VARCHAR,
qual VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the car with a qual of 134.288, what was the rank?
| SELECT rank FROM table_name_72 WHERE qual = "134.288" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '02480290' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-04-19' AND '2001-04-10' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride, whole blood')) AND STRFTIME('%y', cost.chargetime) <= '2103' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID | nvbench |
CREATE TABLE table_17516967_1 (
preliminary VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the preliminary for north carolina
| SELECT preliminary FROM table_17516967_1 WHERE state = "North Carolina" | sql_create_context |
CREATE TABLE table_63801 (
"Draw" real,
"Televote Points" text,
"Jury Points" text,
"Total" text,
"Final Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Jury Points value when there were 3 Televote Points?
| SELECT "Jury Points" FROM table_63801 WHERE "Televote Points" = '3' | wikisql |
CREATE TABLE table_23917 (
"Year" text,
"Head Coach" text,
"Regular Season Record (W-L)" text,
"NEC Record" text,
"Standing" text,
"NEC Tournament Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the year for standing 9th
| SELECT "Year" FROM table_23917 WHERE "Standing" = '9th' | wikisql |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
... | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination DESC | nvbench |
CREATE TABLE table_13555999_1 (
specification VARCHAR,
senior_high_school__15_18_yrs_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the specification where senior high school is 25mm?
| SELECT specification FROM table_13555999_1 WHERE senior_high_school__15_18_yrs_ = "25mm" | sql_create_context |
CREATE TABLE table_name_96 (
seats_up_for_election INTEGER,
election_result VARCHAR,
staying_councillors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Seats up for election have an Election result larger than 8, and Staying councillors of 24?
| SELECT MAX(seats_up_for_election) FROM table_name_96 WHERE election_result > 8 AND staying_councillors = 24 | sql_create_context |
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 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.discharge_location = "HOME" AND procedures.icd9_code = "309" | mimicsql_data |
CREATE TABLE table_name_63 (
date VARCHAR,
distance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Distance of 3,000 m?
| SELECT date FROM table_name_63 WHERE distance = "3,000 m" | sql_create_context |
CREATE TABLE table_204_692 (
id number,
"publication" text,
"score" text,
"review" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which publication only received a letter score ?
| SELECT "publication" FROM table_204_692 WHERE "score" IS NULL | squall |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT AVG(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 = 7742) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid I... | mimic_iii |
CREATE TABLE institution (
institution_id text,
institution text,
location text,
founded number,
type text,
enrollment number,
team text,
primary_conference text,
building_id text
)
CREATE TABLE building (
building_id text,
name text,
street_address text,
years_as_ta... | SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE products (
product_name VARCHAR,
product_price VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of the most expensive product.
| SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1 | sql_create_context |
CREATE TABLE Royal_Family (
Royal_Family_ID INTEGER,
Royal_Family_Details VARCHAR(255)
)
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15),
star_rating_description VARCHAR(80)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(40),
Other_... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID | nvbench |
CREATE TABLE table_3896 (
"Rnd" real,
"Circuit" text,
"LMP1 Winning Team" text,
"LMP2 Winning Team" text,
"LMPC Winning Team" text,
"GT Winning Team" text,
"GTC Winning Team" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "Results" FROM table_3896 WHERE "LMPC Winning Team" = '#89 Intersport Racing' | wikisql |
CREATE TABLE table_2468961_3 (
title VARCHAR,
written_by VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode written by Bob Rosenfarb and directed by Richard Correll?
| SELECT title FROM table_2468961_3 WHERE written_by = "Bob Rosenfarb" AND directed_by = "Richard Correll" | sql_create_context |
CREATE TABLE table_50140 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Name origin has a Longitude of 332.5e?
| SELECT "Name origin" FROM table_50140 WHERE "Longitude" = '332.5e' | wikisql |
CREATE TABLE table_name_47 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which venue did the competition on 11 October 2008 take place?
| SELECT venue FROM table_name_47 WHERE date = "11 october 2008" | sql_create_context |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_24807774_1 (
colombian VARCHAR,
bangladeshi VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many colombia in bangladesh is serbian
| SELECT colombian FROM table_24807774_1 WHERE bangladeshi = "Serbian" | sql_create_context |
CREATE TABLE table_53083 (
"Height (m.)" text,
"No. of times visited" real,
"No. of HC climbs" real,
"First time as HC climb" real,
"Most recent" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height with more than 2 HC climbs more recen... | SELECT "Height (m.)" FROM table_53083 WHERE "No. of HC climbs" > '2' AND "Most recent" = '2012' AND "No. of times visited" < '48' AND "First time as HC climb" = '1989' | wikisql |
CREATE TABLE table_50651 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest area for locations named Centreville having populations over 532... | SELECT MAX("Area km 2") FROM table_50651 WHERE "Population" > '532' AND "Official Name" = 'centreville' | wikisql |
CREATE TABLE table_19048 (
"SUBJECT" text,
"FRESHMAN (Grade 7)" text,
"SOPHOMORE (Grade 8)" text,
"JUNIOR (3rd Year)" text,
"SENIOR (4th Year)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many classes between senior and junior year for world ... | SELECT COUNT("SENIOR (4th Year)") FROM table_19048 WHERE "JUNIOR (3rd Year)" = 'World History' | wikisql |
CREATE TABLE table_66077 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has w 14-10 as the result?
| SELECT "Date" FROM table_66077 WHERE "Result" = 'w 14-10' | wikisql |
CREATE TABLE table_54130 (
"Date of Issue" text,
"Denomination" text,
"Design" text,
"Paper Type" text,
"First Day Cover Cancellation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Date of Issue for Design of Katalin Kovats?
| SELECT "Date of Issue" FROM table_54130 WHERE "Design" = 'katalin kovats' | wikisql |
CREATE TABLE table_4726 (
"Network" text,
"Origin of Programming" text,
"Language" text,
"Genre" text,
"Service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Network has Punjabi as the Language?
| SELECT "Network" FROM table_4726 WHERE "Language" = 'punjabi' | wikisql |
CREATE TABLE table_35713 (
"Province" text,
"Kibaki" text,
"Raila" text,
"Wamalwa" text,
"Ngilu" text,
"Others" text,
"Registered Voters" text,
"Turnout %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's listed for the Registered V... | SELECT "Registered Voters" FROM table_35713 WHERE "Ngilu" = '3,429' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGui... | SELECT COUNT(*) FROM (SELECT Id FROM Posts WHERE Id IN (SELECT PostId FROM PostTags WHERE TagId IN ((SELECT Id FROM Tags WHERE TagName LIKE '%ios%'))) INTERSECT (SELECT Id FROM Posts WHERE Id IN (SELECT PostId FROM PostTags WHERE TagId IN ((SELECT Id FROM Tags WHERE TagName LIKE '%swift%'))) UNION SELECT Id FROM Posts ... | sede |
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 AVG(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35195')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT... | eicu |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT zyjzjlb.JZKSDM, zyjzjlb.JZKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '88382463379' | css |
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(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '015-76260' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' | eicu |
CREATE TABLE table_name_92 (
semi_finalists VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the semi finalists when the runner-up was Alexandra Fusai Wiltrud Probst?
| SELECT semi_finalists FROM table_name_92 WHERE runner_up = "alexandra fusai wiltrud probst" | sql_create_context |
CREATE TABLE table_80201 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue which has a Wi by 8 wkts?
| SELECT "Venue" FROM table_80201 WHERE "Result" = 'wi by 8 wkts' | wikisql |
CREATE TABLE table_25004 (
"Character" text,
"Original Manchester Performer" text,
"Original West End Performer" text,
"Original Broadway Performer" text,
"Original UK Tour Performer" text,
"Original Non-Equity US Tour Performer" text,
"Original Italian Tour Performer" text,
"Original So... | SELECT "Original Broadway Performer" FROM table_25004 WHERE "Original West End Performer" = 'Sharon D. Clarke' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-14712')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE table_31583 (
"Name" text,
"Location" text,
"Launched" real,
"Acquired" text,
"Capacity, mln tpa" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the average launced for capacity mln tpa of 15,0
| SELECT AVG("Launched") FROM table_31583 WHERE "Capacity, mln tpa" = '15,0' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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... | SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course... | advising |
CREATE TABLE table_8022 (
"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 tie no when scunthorpe united was the away team?
| SELECT "Tie no" FROM table_8022 WHERE "Away team" = 'scunthorpe united' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '6085358' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 1... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.