instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) | nvbench |
CREATE TABLE table_name_9 (
goals_for INTEGER,
draws VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT ARE THE GOALS WITH DRAWS SMALLER THAN 6, AND LOSSES SMALLER THAN 7?
| SELECT AVG(goals_for) FROM table_name_9 WHERE draws < 6 AND losses < 7 | sql_create_context |
CREATE TABLE table_57762 (
"Name" text,
"Pennant" text,
"Builder" text,
"Laid Down" text,
"Launched" text,
"Commissioned" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the building for the r90 pennant?
| SELECT "Builder" FROM table_57762 WHERE "Pennant" = 'r90' | wikisql |
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 Type_Of_Restaurant (
ResID INTEGER,
ResTypeID INTEGER
)
CREATE TABLE Restaurant_Type (
ResTypeID INTE... | SELECT Fname, COUNT(Fname) FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F' GROUP BY Fname ORDER BY Fname | nvbench |
CREATE TABLE table_29545993_3 (
l INTEGER,
pa VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is maximum loss record when the pa record is 47?
| SELECT MAX(l) FROM table_29545993_3 WHERE pa = 47 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2114" | mimicsql_data |
CREATE TABLE table_24602 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game in week 3?
| SELECT "Date" FROM table_24602 WHERE "Week" = '3' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'normal saline administration' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME... | eicu |
CREATE TABLE table_name_11 (
pick INTEGER,
year VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest pick for a year after 2010, and a round smaller than 1?
| SELECT MAX(pick) FROM table_name_11 WHERE year > 2010 AND round < 1 | sql_create_context |
CREATE TABLE table_name_92 (
kickoff_time VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the kickoff time for the game in week of 17?
| SELECT kickoff_time FROM table_name_92 WHERE week = 17 | sql_create_context |
CREATE TABLE table_38718 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date when streak was won 8?
| SELECT "Date" FROM table_38718 WHERE "Streak" = 'won 8' | wikisql |
CREATE TABLE table_20679 (
"Dates (MDY)" text,
"Position" real,
"Gross sales" text,
"Tickets sold / available" text,
"Sellout (%)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who many dates are in position 9 and the sellout is 81%?
| SELECT COUNT("Dates (MDY)") FROM table_20679 WHERE "Position" = '9' AND "Sellout (%)" = '81%' | wikisql |
CREATE TABLE table_203_19 (
id number,
"number" number,
"builder" text,
"type" text,
"date" number,
"length" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of cars listed ?
| SELECT COUNT(*) FROM table_203_19 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MAGO140" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_31750 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Start Time" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the number of weeks for bye
| SELECT COUNT("Week") FROM table_31750 WHERE "Date" = 'bye' | wikisql |
CREATE TABLE table_name_44 (
mac_os_x VARCHAR,
gnu_linux VARCHAR,
windows VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Mac OSX's GNU/Linux was yes when Windows was no?
| SELECT mac_os_x FROM table_name_44 WHERE gnu_linux = "yes" AND windows = "no" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT Id, DisplayName FROM Users WHERE DisplayName LIKE '% %' OR DisplayName LIKE '% %' OR DisplayName LIKE '% %' | sede |
CREATE TABLE table_name_18 (
games VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games were played by the player at FB?
| SELECT COUNT(games) AS ↑ FROM table_name_18 WHERE position = "fb" | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '3982250' AND JZKSRQ BETWEEN '2005-02-09' AND '2017-11-19' AND WDBZ > 0 | css |
CREATE TABLE table_45306 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the To par for United States golfer fred couples?
| SELECT "To par" FROM table_45306 WHERE "Country" = 'united states' AND "Player" = 'fred couples' | wikisql |
CREATE TABLE table_204_517 (
id number,
"name" text,
"date of birth" text,
"club" text,
"division" text,
"appointed" text,
"time as manager" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is older - francis bosschaerts or peter maes ?
| SELECT "name" FROM table_204_517 WHERE "name" IN ('francis bosschaerts', 'peter maes') ORDER BY "date of birth" LIMIT 1 | squall |
CREATE TABLE table_4651 (
"Total" real,
"Builder" text,
"Model" text,
"Year built" real,
"Numbers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the numbers for lc models built in 2009?
| SELECT "Numbers" FROM table_4651 WHERE "Model" = 'lc' AND "Year built" = '2009' | 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 JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC | nvbench |
CREATE TABLE table_name_62 (
podiums VARCHAR,
wins VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for Podiums when the value for Wins is 2, and when the Season is 2008?
| SELECT podiums FROM table_name_62 WHERE wins = "2" AND season = 2008 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'I65.176' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE table_14975415_1 (
result VARCHAR,
english_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Was diary for my loves nominated?
| SELECT result FROM table_14975415_1 WHERE english_title = "Diary for My Loves" | sql_create_context |
CREATE TABLE table_21100348_10 (
period VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What period was there a career average of 48.15?
| SELECT period FROM table_21100348_10 WHERE average = "48.15" | sql_create_context |
CREATE TABLE table_204_874 (
id number,
"year" number,
"winner" text,
"runner-up" text,
"final score" text,
"third" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the only winner of the ukrainian basketball super league to win winner onc... | SELECT "winner" FROM table_204_874 GROUP BY "winner" HAVING COUNT(*) = 1 | squall |
CREATE TABLE table_2508633_4 (
pick__number VARCHAR,
college VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number draft pick was Oklahoma State's Greg Hill in 1983?
| SELECT pick__number FROM table_2508633_4 WHERE college = "Oklahoma State" AND player = "Greg Hill" | sql_create_context |
CREATE TABLE table_204_96 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- besides the philadelphia eagles , who were the other 2 opponents in october ?
| SELECT "opponent" FROM table_204_96 WHERE "opponent" <> 'philadelphia eagles' AND "date" = 10 | squall |
CREATE TABLE table_204_530 (
id number,
"type" text,
"stage" number,
"cyclist" text,
"team" text,
"reason" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what cyclist is listed next after matteo ?
| SELECT "cyclist" FROM table_204_530 WHERE id = (SELECT id FROM table_204_530 WHERE "cyclist" = 'matteo bono') + 1 | squall |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | SELECT COUNT(DISTINCT p1.OwnerUserId) FROM Posts AS p1 INNER JOIN PostTags AS pt ON pt.TagId = @TagId INNER JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.PostTypeId = 2 AND pt.PostId = p2.Id | sede |
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 SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '98623889538' | css |
CREATE TABLE table_72261 (
"Year" real,
"Premier One" text,
"Premier Two" text,
"Bristol & Somerset" text,
"Glos & Wilts" text,
"Bristol & N. Som" text,
"Somerset" text,
"Gloucestershire" text,
"Wiltshire" text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT "Year" FROM table_72261 WHERE "Glos & Wilts" = 'Gloucester City Winget' | wikisql |
CREATE TABLE table_name_65 (
episodes INTEGER,
last_airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were in the season that ended on April 29, 1986?
| SELECT AVG(episodes) FROM table_name_65 WHERE last_airdate = "april 29, 1986" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number... | SELECT PostHistory.PostId AS "post_link", PostHistoryTypes.Name, PostHistory.CreationDate, Comment, Text FROM PostHistory JOIN PostHistoryTypes ON PostHistory.PostHistoryTypeId = PostHistoryTypes.Id WHERE PostHistory.UserId = '##UserId##' ORDER BY PostHistory.CreationDate DESC LIMIT 50 | sede |
CREATE TABLE table_name_61 (
name VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name with Goals that are 135?
| SELECT name FROM table_name_61 WHERE goals = 135 | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL' | atis |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER... | atis |
CREATE TABLE table_59119 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country had a total of 295?
| SELECT "Country" FROM table_59119 WHERE "Total" = '295' | wikisql |
CREATE TABLE table_203_449 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the first person born ?
| SELECT "name" FROM table_203_449 ORDER BY "lifetime" LIMIT 1 | squall |
CREATE TABLE table_52428 (
"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.
-- When collingwood played as the home team who was... | SELECT "Away team" FROM table_52428 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT jyjgzbb.JYZBLSH 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.BGDH WHERE hz... | css |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
C... | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Nepal%' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE employment (
company_id number,
people_id number,
year_working number
)
CREATE TABLE people (
people_id number,
age number,
name text,
nationality text,
graduation_college text
)
CREATE TABLE company (
company_id number,
name text,
headquarters text,
indust... | SELECT headquarters FROM company GROUP BY headquarters HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_2517159_1 (
name_of_bowl VARCHAR,
last_appearance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the name of bowl for 2006 season
| SELECT COUNT(name_of_bowl) FROM table_2517159_1 WHERE last_appearance = "2006 Season" | sql_create_context |
CREATE TABLE table_203_95 (
id number,
"year" text,
"democratic\nparty" number,
"republican\nparty" number,
"independent\n/ other" text,
"majority" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the 1865 majority is how much greater than in 19... | SELECT (SELECT "majority" FROM table_203_95 WHERE "year" = 1865) - (SELECT "majority" FROM table_203_95 WHERE "year" = 1966) | squall |
CREATE TABLE table_31387 (
"Name (Namesake)" text,
"Builder Dimensions Displacement, Hull Speed Complement" text,
"Machinery Boiler, Bunkers Engines Armament" text,
"Ordered Laid down Launched Trials" text,
"Commissioned Decommissioned Afterward" text
)
-- Using valid SQLite, answer the following ... | SELECT "Name (Namesake)" FROM table_31387 | wikisql |
CREATE TABLE table_train_279 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"fasting_plasma_glucose" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLit... | SELECT * FROM table_train_279 WHERE body_mass_index_bmi >= 27 AND body_mass_index_bmi <= 42 | criteria2sql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | SELECT Location, COUNT(*) AS UserCount, SUM(Reputation) AS TotalRep, CAST(SUM(Reputation) AS FLOAT(12, 3)) / COUNT(*) AS AvgRep FROM Users WHERE Location != '' GROUP BY Location HAVING COUNT(*) >= 100 ORDER BY UserCount DESC, TotalRep DESC, AvgRep DESC LIMIT 1000 | sede |
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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dod_year <= "2112.0" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2425 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'stool' ORDER BY microbiologye... | mimic_iii |
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 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 = '006-195541') AND NOT patient.unitdischargetime I... | eicu |
CREATE TABLE table_28498999_3 (
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country for the score 72-63-71-68=274?
| SELECT country FROM table_28498999_3 WHERE score = 72 - 63 - 71 - 68 = 274 | sql_create_context |
CREATE TABLE table_76147 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Pick # lower than 223 and a Defensive End Position?
| SELECT "Player" FROM table_76147 WHERE "Pick #" < '223' AND "Position" = 'defensive end' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1034558' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 29 | css |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60347 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'ipratropium bromide neb' | mimic_iii |
CREATE TABLE documents (
document_name VARCHAR,
document_code VARCHAR
)
CREATE TABLE document_sections (
document_name VARCHAR,
document_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the name of documents without any sections.
| SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections) | sql_create_context |
CREATE TABLE table_57049 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Club" FROM table_57049 WHERE "Goals against" > '46' AND "Wins" = '10' AND "Goal Difference" = '-24' | wikisql |
CREATE TABLE table_name_72 (
crowd VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the listed crowd when hawthorn is away?
| SELECT COUNT(crowd) FROM table_name_72 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE nomination (
artwork_id number,
festival_id number,
result text
)
CREATE TABLE festival_detail (
festival_id number,
festival_name text,
chair_name text,
location text,
year number,
num_of_audience number
)
CREATE TABLE artwork (
artwork_id number,
type text,
... | SELECT DISTINCT T2.type FROM nomination AS T1 JOIN artwork AS T2 ON T1.artwork_id = T2.artwork_id JOIN festival_detail AS T3 ON T1.festival_id = T3.festival_id WHERE T3.year = 2007 | spider |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2168" AND procedures.long_title = "Procedure on two vessels" | mimicsql_data |
CREATE TABLE table_2752 (
"Team" text,
"SEC Wins" real,
"SEC Losses" real,
"Percentage" text,
"Home Record" text,
"Road Record" text,
"Overall Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Auburn's percentage?
| SELECT "Percentage" FROM table_2752 WHERE "Team" = 'Auburn' | wikisql |
CREATE TABLE table_5019 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins d... | SELECT "Wins" FROM table_5019 WHERE "Podiums" = '5' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267) AND prescriptions.route = 'im' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '30282836' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2014-12-28' AND '2016-11-01' | css |
CREATE TABLE table_78707 (
"Tournament" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text
)
-- Using valid SQLite, answer... | SELECT "2005" FROM table_78707 WHERE "1998" = 'f' AND "2002" = '2r' | wikisql |
CREATE TABLE table_name_26 (
class_aA VARCHAR,
school_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Class AA in School Year 1994-95?
| SELECT class_aA FROM table_name_26 WHERE school_year = "1994-95" | sql_create_context |
CREATE TABLE table_204_332 (
id number,
"administrative\narea" text,
"area\nkm2" number,
"area\nsq mi" number,
"population" number,
"administrative\ncentre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in population betw... | SELECT (SELECT "population" FROM table_204_332 WHERE "administrative\narea" = 'ascension island') - (SELECT "population" FROM table_204_332 WHERE "administrative\narea" = 'gough island') | squall |
CREATE TABLE table_79217 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text,
"Arena" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record when the score was 2 0?
| SELECT "Record" FROM table_79217 WHERE "Score" = '2–0' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
ha... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'aortocoronary bypass') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59941 AND NOT admissions.dischti... | mimic_iii |
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 All_Neutral, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'vaccination... | mimic_iii |
CREATE TABLE table_name_37 (
score VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Sheffield United was the home team?
| SELECT score FROM table_name_37 WHERE home_team = "sheffield united" | sql_create_context |
CREATE TABLE table_64945 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name for lane 1, from Mauritius?
| SELECT "Name" FROM table_64945 WHERE "Lane" = '1' AND "Nationality" = 'mauritius' | wikisql |
CREATE TABLE table_name_15 (
pieces INTEGER,
release VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest number of pieces for a board released in 1984?
| SELECT MIN(pieces) FROM table_name_15 WHERE release = 1984 | sql_create_context |
CREATE TABLE table_41817 (
"Year" real,
"Tournament Name" text,
"Champions" text,
"Runners-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the name of the tournament that Gianni Ocleppo was the runner-up?
| SELECT "Tournament Name" FROM table_41817 WHERE "Runners-up" = 'gianni ocleppo' | wikisql |
CREATE TABLE table_5912 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Circuit" FROM table_5912 WHERE "Winning driver" = 'michael andretti' | wikisql |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3519597' AND qtb.IN_HOSP_DATE BETWEEN '2013-12-23' AND '2020-10-22' AND qtb.IN_DIAG_DIS_CD <> qtb.OUT_DIAG_DIS_CD UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3519597' AND gyb.IN_HOSP_DATE BETWEEN '2013-12-23' AND '2020-10-22' AND gyb.IN_DIAG_DIS_CD <> ... | css |
CREATE TABLE table_name_73 (
rank VARCHAR,
qual VARCHAR,
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the total number of rank for Grid less than 20 and dick rathmann and Qual more than 130.92
| SELECT COUNT(rank) FROM table_name_73 WHERE grid < 20 AND driver = "dick rathmann" AND qual > 130.92 | sql_create_context |
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,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '84177470' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_162 (
"Year" real,
"Title" text,
"Format" text,
"Studio" text,
"Release Date" text,
"Copyright Information" text,
"Catalog Number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many studios have the catalog number 'ca... | SELECT COUNT("Studio") FROM table_162 WHERE "Catalog Number" = 'CAL03 / 0091037137333' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 31696 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_50 (
date VARCHAR,
beat_by VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date in which Chic won at CHS?
| SELECT date FROM table_name_50 WHERE beat_by = "won" AND location = "chs" | sql_create_context |
CREATE TABLE table_74709 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did they play at candlestick park?
| SELECT "Date" FROM table_74709 WHERE "Game site" = 'candlestick park' | wikisql |
CREATE TABLE table_15466 (
"Year" real,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least year for les triplettes de belleville
| SELECT MIN("Year") FROM table_15466 WHERE "Original title" = 'les triplettes de belleville' | wikisql |
CREATE TABLE table_37417 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college, junior, or club team did Victor Ignatjev play for?
| SELECT "College/Junior/Club Team" FROM table_37417 WHERE "Player" = 'victor ignatjev' | wikisql |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
win... | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY COUNT(local_authority) DESC | nvbench |
CREATE TABLE table_11814 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the Competition of europe/africa zone, group i, round robin, with a res... | SELECT "Date" FROM table_11814 WHERE "Competition" = 'europe/africa zone, group i, round robin' AND "Result" = 'loss' AND "Location" = 'antalya' AND "Score" = '1–2' | wikisql |
CREATE TABLE table_64774 (
"Year" real,
"Category" text,
"Recipients and nominees" text,
"Role/Episode" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the recipients in 1994?
| SELECT "Recipients and nominees" FROM table_64774 WHERE "Year" = '1994' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Wegener's granulomatosis" AND prescriptions.route = "SL" | mimicsql_data |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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,
... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ... | css |
CREATE TABLE captain (
rank VARCHAR,
CLASS VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the captain rank that has some captains in both Cutter and Armed schooner classes.
| SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner' | sql_create_context |
CREATE TABLE table_929 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the opponent with stadium being jeppesen stadium
| SELECT "Opponent" FROM table_929 WHERE "Stadium" = 'Jeppesen Stadium' | wikisql |
CREATE TABLE table_23285805_8 (
record VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record where arco arena 17361 is location attendance?
| SELECT record FROM table_23285805_8 WHERE location_attendance = "Arco Arena 17361" | sql_create_context |
CREATE TABLE department (
dept_code VARCHAR,
dept_name VARCHAR
)
CREATE TABLE professor (
prof_office VARCHAR,
emp_num VARCHAR,
dept_code VARCHAR,
prof_high_degree VARCHAR
)
CREATE TABLE employee (
emp_fname VARCHAR,
emp_num VARCHAR
)
-- Using valid SQLite, answer the following quest... | SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.' | sql_create_context |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Fo... | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY Minister DESC | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE pr... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'free skin graft nec') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT (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 = '027-122814')) AND lab.labname = 'chloride' AND lab.labresulttime = '2103-01-19 ... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.short_title = "Packed cell transfusion" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.