instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_69354 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Time" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on August 19?
| SELECT "Score" FROM table_69354 WHERE "Date" = 'august 19' | wikisql |
CREATE TABLE table_48625 (
"Team" text,
"Head coach" text,
"Team captain" text,
"Kitmaker" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the head coach of the team, whose shirt sponsor is karstadt quelle versicherungen?... | SELECT "Head coach" FROM table_48625 WHERE "Shirt sponsor" = 'karstadt quelle versicherungen' | 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 treatment (
... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '022-6959') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicat... | eicu |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT AVG(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 = 'vitamin b12')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.had... | mimic_iii |
CREATE TABLE table_17058116_5 (
location_attendance VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In how many locations did Game 13 take place?
| SELECT COUNT(location_attendance) FROM table_17058116_5 WHERE game = 13 | sql_create_context |
CREATE TABLE table_name_6 (
region VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the region for the 38xa-5 catalog?
| SELECT region FROM table_name_6 WHERE catalog = "38xa-5" | sql_create_context |
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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "GANGRENE" AND demographic.admityear >= "2164" | mimicsql_data |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Fluconazole" | mimicsql_data |
CREATE TABLE table_59375 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the post-week 2 game with a result of l 16 10?
| SELECT "Date" FROM table_59375 WHERE "Week" > '2' AND "Result" = 'l 16–10' | wikisql |
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Payment_Methods ... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code | nvbench |
CREATE TABLE table_train_65 (
"id" int,
"intention_to_arterial_catheter" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"central_venous_pressure_cvp" int,
"receiving_vasopressor" bool,
"pulmonary_artery_occlusive_pressure_paop" int,
"septic_shock" bool,
"a... | SELECT * FROM table_train_65 WHERE steroid_therapy = 1 AND septic_shock = 1 | criteria2sql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12410)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... | mimic_iii |
CREATE TABLE table_204_779 (
id number,
"network name" text,
"flagship" text,
"programming type" text,
"owner" text,
"affiliates" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- azteca 7 and azteca 13 are both owned by whom ?
| SELECT "owner" FROM table_204_779 WHERE "network name" = 'azteca 7' | squall |
CREATE TABLE Ref_Attraction_Types (
Attraction_Type_Code CHAR(15),
Attraction_Type_Description VARCHAR(255)
)
CREATE TABLE Photos (
Photo_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(255),
Description VARCHAR(255),
Filename VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE T... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY Visit_Date DESC | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'warfarin sodium 5 mg po tabs' AND patient.uniquepid = '010-1155' AND DATETIME(medication.drugstarttime, 'start of month')... | eicu |
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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
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 vitalperiodi... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 =... | eicu |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-22327')) AND diagnosis.diagnosisname = 'cardiomyopathy' AND D... | eicu |
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 author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Li Dong' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori... | scholar |
CREATE TABLE table_name_44 (
frame_size VARCHAR,
color_sampling VARCHAR,
audio_coding VARCHAR,
format_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What frame size has pcm 4 ch/16 bit/48khz as audio coding and dvcam as the format name and 4:1:1... | SELECT frame_size FROM table_name_44 WHERE audio_coding = "pcm 4 ch/16 bit/48khz" AND format_name = "dvcam" AND color_sampling = "4:1:1" | sql_create_context |
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '77448008' AND jybgb.BGRQ BETWEEN '2009-08-04' AND '2021-06-15' UNION... | css |
CREATE TABLE table_name_1 (
year INTEGER,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed as the highest Year that's also got a Bronze of Wataru Haraguchi?
| SELECT MAX(year) FROM table_name_1 WHERE bronze = "wataru haraguchi" | sql_create_context |
CREATE TABLE table_200_35 (
id number,
"party" text,
"active voters" number,
"inactive voters" number,
"total voters" number,
"percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- as of october 25 , 2005 , how many active voters are there ... | SELECT SUM("active voters") FROM table_200_35 | squall |
CREATE TABLE table_80134 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Men's Double the same year as Florenti... | SELECT "Men's doubles" FROM table_80134 WHERE "Women's singles" = 'florentina petre' | wikisql |
CREATE TABLE table_name_48 (
points INTEGER,
fgm___fga VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the point average for the game that has FGM-FGA of 11-28 and a number smaller than 7?
| SELECT AVG(points) FROM table_name_48 WHERE fgm___fga = "11-28" AND number < 7 | sql_create_context |
CREATE TABLE table_name_59 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Attendance in Week 10?
| SELECT attendance FROM table_name_59 WHERE week = 10 | sql_create_context |
CREATE TABLE table_32666 (
"Player" text,
"Nationality" text,
"Position" text,
"From" real,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position is the player from 1987?
| SELECT "Position" FROM table_32666 WHERE "From" = '1987' | wikisql |
CREATE TABLE table_name_15 (
average INTEGER,
number_of_dances VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest average that has 6 dances and a total of over 128?
| SELECT MAX(average) FROM table_name_15 WHERE number_of_dances = 6 AND total > 128 | sql_create_context |
CREATE TABLE table_74756 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What label is associated with the United Kingdom and the chem036 catalog?
| SELECT "Label" FROM table_74756 WHERE "Region" = 'united kingdom' AND "Catalog" = 'chem036' | wikisql |
CREATE TABLE table_63482 (
"Year" real,
"Title" text,
"Director" text,
"Studio(s)" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What studio has the director Philip Frank Messina?
| SELECT "Studio(s)" FROM table_63482 WHERE "Director" = 'philip frank messina' | wikisql |
CREATE TABLE table_2308381_1 (
year VARCHAR,
avg_start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the year for avg start being 22.4
| SELECT year FROM table_2308381_1 WHERE avg_start = "22.4" | sql_create_context |
CREATE TABLE table_name_33 (
location_attendance VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the location and attendance for the game against New Jersey?
| SELECT location_attendance FROM table_name_33 WHERE team = "new jersey" | sql_create_context |
CREATE TABLE table_22255 (
"Canton" text,
"Years of Kindergarten" real,
"Years of Kindergarten provided" text,
"Years of Kindergarten legally required" text,
"Length of Primary School" real,
"Length of mandatory Secondary School" real,
"Separate Secondary Schools?" text,
"Cooperative Sec... | SELECT "Integrated Secondary Schools?" FROM table_22255 WHERE "Canton" = 'Basel-Stadt' | wikisql |
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
)
CREATE TAB... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC | nvbench |
CREATE TABLE table_21753 (
"Gatchaman" text,
"Battle of the Planets" text,
"G-Force" text,
"Eagle Riders" text,
"OVA (Harmony Gold Dub)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which battle of the planets where ova (harmony gold dub) is solar... | SELECT "Battle of the Planets" FROM table_21753 WHERE "OVA (Harmony Gold Dub)" = 'Solaris' | wikisql |
CREATE TABLE table_name_46 (
date VARCHAR,
serial VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for the 10b serial?
| SELECT date FROM table_name_46 WHERE serial = "10b" | 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 demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Rafael Stewart" | mimicsql_data |
CREATE TABLE table_32300 (
"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.
-- What was the away team's score in the match at V... | SELECT "Away team score" FROM table_32300 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dep... | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building | nvbench |
CREATE TABLE table_name_57 (
date VARCHAR,
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date had a tie no of replay, and an away team of watford?
| SELECT date FROM table_name_57 WHERE tie_no = "replay" AND away_team = "watford" | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_name_18 (
korean_dialect VARCHAR,
rr_romaja VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Korean dialect with a jeolla RR Romaja?
| SELECT korean_dialect FROM table_name_18 WHERE rr_romaja = "jeolla" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'ENGR' AND course.number = 151 AND semester.semester = 'WN' AND semester.semester_id = course_off... | advising |
CREATE TABLE table_73001 (
"Round" real,
"Date" text,
"Grand Prix" text,
"Circuit" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the fastest lap in the Dutch TT Grand Pri... | SELECT "Fastest Lap" FROM table_73001 WHERE "Grand Prix" = 'Dutch TT' | wikisql |
CREATE TABLE table_79039 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Circuit has a Date of 25 july?
| SELECT "Circuit" FROM table_79039 WHERE "Date" = '25 july' | wikisql |
CREATE TABLE table_20526 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the team named the... | SELECT MAX("Founded") FROM table_20526 WHERE "Team Nickname" = 'Raiders' | wikisql |
CREATE TABLE table_75343 (
"Station" text,
"Services" text,
"Local authority" text,
"Zone 2007" text,
"Zone 2008" text,
"Zone 2010" text,
"Zone 2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Station has a Zone 2008 of 8, and a Zo... | SELECT "Station" FROM table_75343 WHERE "Zone 2008" = '8' AND "Zone 2007" = 'outside zones' AND "Services" = 'london overground' | wikisql |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor | nvbench |
CREATE TABLE table_40097 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year for Team Oreca?
| SELECT AVG("Year") FROM table_40097 WHERE "Team" = 'team oreca' | wikisql |
CREATE TABLE table_204_287 (
id number,
"outcome" text,
"no." number,
"date" number,
"championship" 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.
-- how many champion... | SELECT COUNT("championship") FROM table_204_287 | squall |
CREATE TABLE table_33785 (
"Rank" real,
"City" text,
"State" text,
"GDP in $ID B" text,
"Population M (LUZ)" real,
"GDP per capita $ID K" text,
"Eurozone" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Eurozone result for Populat... | SELECT "Eurozone" FROM table_33785 WHERE "Population M (LUZ)" = '3.08' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | SELECT p.Id AS "post_link", c.Text AS Comment, c.CreationDate FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE p.OwnerDisplayName = '##Name:string##' ORDER BY c.CreationDate DESC | sede |
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.admityear < "2187" AND diagnoses.long_title = "Cardiac tamponade" | mimicsql_data |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT Id AS "post_link", Score, Body FROM Posts ORDER BY Score LIMIT 100 | sede |
CREATE TABLE table_42722 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Opponents on a clay surface with christophe rochus as partner?
| SELECT "Opponents" FROM table_42722 WHERE "Surface" = 'clay' AND "Partner" = 'christophe rochus' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the... | SELECT Writer, COUNT(Writer) FROM book GROUP BY Writer ORDER BY Writer | nvbench |
CREATE TABLE table_51069 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Jay Nixon" text,
"Republican: Kenny Hulshof" text,
"Lead Margin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lead margin when Nixon had 48% and repo... | SELECT COUNT("Lead Margin") FROM table_51069 WHERE "Democrat: Jay Nixon" = '48%' AND "Poll Source" = 'rasmussen reports' | wikisql |
CREATE TABLE table_name_61 (
poles INTEGER,
position VARCHAR,
wins VARCHAR,
top_5 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest poles that have 0 as a win, 0 as the top 5, with 66th as the postion?
| SELECT MIN(poles) FROM table_name_61 WHERE wins = 0 AND top_5 = 0 AND position = "66th" | sql_create_context |
CREATE TABLE table_22096 (
"Rank" real,
"Airport Name" text,
"Location" text,
"IATA Code" text,
"Passengers" text,
"% Chg. 2009/10" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the passengers are 15,505,566, what is the iata code?
| SELECT "IATA Code" FROM table_22096 WHERE "Passengers" = '15,505,566' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'gi bleeding' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELEC... | eicu |
CREATE TABLE table_23292220_13 (
first_broadcast VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes are numbered 12x03?
| SELECT COUNT(first_broadcast) FROM table_23292220_13 WHERE episode = "12x03" | sql_create_context |
CREATE TABLE table_78271 (
"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.
-- On which date was a game played at Junction Oval... | SELECT "Date" FROM table_78271 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_19121 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Points against" FROM table_19121 WHERE "Tries against" = '75' | wikisql |
CREATE TABLE table_13681_2 (
currency_name VARCHAR,
highest_monthly_inflation_rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the currency name with highest monthly inflation rate being 29,500%
| SELECT currency_name FROM table_13681_2 WHERE highest_monthly_inflation_rate = "29,500%" | sql_create_context |
CREATE TABLE table_48467 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the game played against the... | SELECT "Location Attendance" FROM table_48467 WHERE "Team" = 'l.a. lakers' | 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, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_3 (
venue VARCHAR,
against VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the match on 10/11/2001 against 15?
| SELECT venue FROM table_name_3 WHERE against = 15 AND date = "10/11/2001" | sql_create_context |
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 COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6692074' AND gwyjzb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6692074' AND fgwyjzb.HOSP_STS > 0 | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.age < "56" | mimicsql_data |
CREATE TABLE table_name_60 (
year VARCHAR,
nominee VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year was michele assaf nominated
| SELECT year FROM table_name_60 WHERE nominee = "michele assaf" | sql_create_context |
CREATE TABLE cinema (
cinema_id number,
name text,
openning_year number,
capacity number,
location text
)
CREATE TABLE schedule (
cinema_id number,
film_id number,
date text,
show_times_per_day number,
price number
)
CREATE TABLE film (
film_id number,
rank_in_series nu... | SELECT location FROM cinema WHERE openning_year >= 2010 GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_47654 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which NFL team has a player that came from a college in Washington?
| SELECT "NFL Team" FROM table_47654 WHERE "College" = 'washington' | wikisql |
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 Month, COUNT(*) AS count FROM (SELECT Id, PostTypeId, DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month" FROM Posts LEFT JOIN PostTags ON PostId = Id WHERE TagId = 4452) AS tmp GROUP BY Month, PostTypeId ORDER BY Month, PostTypeId | sede |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLic... | WITH UserAvgAnswerScore AS (SELECT Users.Id AS UserId, COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVI... | sede |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Microscopic hematuria" | mimicsql_data |
CREATE TABLE table_73841 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT MAX("Series #") FROM table_73841 WHERE "Title" = 'Sound and Vision' | wikisql |
CREATE TABLE table_5148 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of laps that has a time/retired that is +19.475?
| SELECT SUM("Laps") FROM table_5148 WHERE "Time/Retired" = '+19.475' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_76254 (
"Date From" text,
"Date To" text,
"Position" text,
"Name" text,
"From" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the from for the Date From of 2007-08-08?
| SELECT "From" FROM table_76254 WHERE "Date From" = '2007-08-08' | wikisql |
CREATE TABLE table_77264 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT COLLEGE HAS A ROUND LARGER THAN 9, WITH BUTCH WEBSTER?
| SELECT "College" FROM table_77264 WHERE "Round" > '9' AND "Player" = 'butch webster' | wikisql |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE restriction ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((DAT... | atis |
CREATE TABLE table_55759 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total Silver has a Bronze larger than 19 and a Total smaller than 125?
| SELECT SUM("Silver") FROM table_55759 WHERE "Bronze" > '19' AND "Total" < '125' | wikisql |
CREATE TABLE table_7441 (
"geohash length" real,
"lat bits" real,
"lng bits" real,
"lat error" text,
"lng error" text,
"km error" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest geohash length when the lat error is 0.00068, an... | SELECT MAX("geohash length") FROM table_7441 WHERE "lat error" = '±0.00068' AND "lat bits" > '17' | wikisql |
CREATE TABLE table_2126 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest rank?
| SELECT MIN("Rank") FROM table_2126 | wikisql |
CREATE TABLE table_71531 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "2012" FROM table_71531 WHERE "2002" = 'q1' AND "2010" = '1r' | wikisql |
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'albumin human 25%' AND STRFTIME('%y', medication.dr... | eicu |
CREATE TABLE table_name_29 (
conference VARCHAR,
awards VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where the Vancouver Grizzlies is the awards, what is the conference?
| SELECT conference FROM table_name_29 WHERE awards = "vancouver grizzlies" | sql_create_context |
CREATE TABLE table_name_3 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country for the player Tiger Woods?
| SELECT country FROM table_name_3 WHERE player = "tiger woods" | sql_create_context |
CREATE TABLE table_42421 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the pick numbers for the player that went to San Miguel Beermen who played... | SELECT SUM("Pick") FROM table_42421 WHERE "PBA team" = 'san miguel beermen' AND "College" = 'san sebastian' | wikisql |
CREATE TABLE table_67044 (
"Ship" text,
"Pennant number" text,
"Laid down" text,
"Launched" text,
"Commissioned" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Laid down has a Ship of fearless?
| SELECT "Laid down" FROM table_67044 WHERE "Ship" = 'fearless' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | 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 = '004-13127')) AND vitalperiodic.temperature < 37.778 AND NOT vitalper... | eicu |
CREATE TABLE table_203_353 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many songs are at most 3 minutes long ?
| SELECT COUNT("title") FROM table_203_353 WHERE "time" < 3 | squall |
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 MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2402730' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 14 | css |
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 medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-172277') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medic... | eicu |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_... | css |
CREATE TABLE pilot_record (
record_id number,
pilot_id number,
aircraft_id number,
date text
)
CREATE TABLE pilot (
pilot_id number,
pilot_name text,
rank number,
age number,
nationality text,
position text,
join_year number,
team text
)
CREATE TABLE aircraft (
airc... | SELECT position FROM pilot WHERE join_year < 2000 INTERSECT SELECT position FROM pilot WHERE join_year > 2005 | spider |
CREATE TABLE table_name_30 (
record VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game with 28,135 people in attendance?
| SELECT record FROM table_name_30 WHERE attendance = "28,135" | sql_create_context |
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machi... | SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY Team DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.