instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_13 (
attendance VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Attendance has a Tie # of 32?
| SELECT attendance FROM table_name_13 WHERE tie_no = "32" | sql_create_context |
CREATE TABLE table_name_66 (
race VARCHAR,
position VARCHAR,
speed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which race has a position of 3rd and a speed of 126.452?
| SELECT race FROM table_name_66 WHERE position = "3rd" AND speed = "126.452" | 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 zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '31223495008' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '31223495008' | css |
CREATE TABLE table_59444 (
"Party" text,
"% votes" real,
"% change" real,
"Seats" real,
"Change" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seats does the party of others have with a change of -1 and more than 0% votes?
| SELECT SUM("Seats") FROM table_59444 WHERE "Change" = '-1' AND "Party" = 'others' AND "% votes" > '0' | wikisql |
CREATE TABLE table_31652 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the date for goal of 5
| SELECT "Date" FROM table_31652 WHERE "Goal" = '5' | wikisql |
CREATE TABLE table_12093 (
"Edition" text,
"Round" text,
"Date" text,
"Partnering" text,
"Against" text,
"Surface" text,
"Opponents" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface when the result was 6... | SELECT "Surface" FROM table_12093 WHERE "Result" = '6–7 (6–7) , 7–6 (9–7) , 6–7 (4–7) , 7–5, 3–6' | wikisql |
CREATE TABLE table_name_65 (
res VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the resolution of the fight when tim hague had a record of 15-7?
| SELECT res FROM table_name_65 WHERE record = "15-7" | sql_create_context |
CREATE TABLE table_32904 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Young rider classification" text,
"Team classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is guido bontempi's... | SELECT "General classification" FROM table_32904 WHERE "Winner" = 'guido bontempi' AND "Stage" = '6' | wikisql |
CREATE TABLE view_unit_status (
apt_id number,
apt_booking_id number,
status_date time,
available_yn others
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CRE... | SELECT COUNT(*) FROM apartment_bookings | spider |
CREATE TABLE table_name_29 (
week INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the latest week that the Tampa Bay Buccaneers were an opponent?
| SELECT MAX(week) FROM table_name_29 WHERE opponent = "tampa bay buccaneers" | sql_create_context |
CREATE TABLE table_203_391 (
id number,
"season" text,
"greek league" text,
"greek cup" text,
"europe" text,
"coach" text,
"roster" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many years did the greek league have a finalist ?
| SELECT COUNT("season") FROM table_203_391 WHERE "greek league" = 'finalist' | squall |
CREATE TABLE table_15475116_1 (
colors VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Middletown High School uses which colors
| SELECT colors FROM table_15475116_1 WHERE school = "Middletown High school" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | 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-129568') AND NOT patient.unitdischargetime I... | eicu |
CREATE TABLE table_76640 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for a friendly match?
| SELECT "Result" FROM table_76640 WHERE "Competition" = 'friendly match' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.language = "SPAN" AND demographic.diagnosis = "LEFT FEMUR FRACTURE" | mimicsql_data |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
a... | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code | nvbench |
CREATE TABLE table_74275 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most pick for evgeny korolev
| SELECT MAX("Pick") FROM table_74275 WHERE "Player" = 'Evgeny Korolev' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | SELECT t.TagName, t2.TagName, COUNT(*) AS cnt FROM PostTags AS pt INNER JOIN Tags AS t ON t.Id = pt.TagId LEFT OUTER JOIN PostTags AS pt2 ON pt2.PostId = pt.PostId LEFT OUTER JOIN Tags AS t2 ON t2.Id = pt2.TagId LEFT JOIN Posts ON Posts.Id = pt.PostId WHERE t.TagName IN ('angular', 'reactjs', 'vue.js') AND t.TagName !=... | sede |
CREATE TABLE table_34536 (
"Name" text,
"Town/City" text,
"Borough" text,
"Region" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Type of museum is the Valdez museum?
| SELECT "Type" FROM table_34536 WHERE "Name" = 'valdez museum' | 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 COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.IN_DIAG_DIS_CD = 'J29.030' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.IN_DIAG_DIS_CD = 'J29.030' UNION SELECT COUNT(zyb.PERSON_ID) FROM zyb WHERE zyb.IN_DIAG_DIS_CD = 'J29.030' UNION SELECT COUNT(mzb.PERSON_ID) FROM mzb WHERE mzb.IN_DIAG_DIS_CD = 'J29.030' | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
... | SELECT OwnerUserId, COUNT(*) FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId HAVING COUNT(*) > 50 | sede |
CREATE TABLE table_43341 (
"Year" real,
"Title" text,
"Label" text,
"RIAA Sales Certification" text,
"Billboard 200 Peak" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Title was awarded the gold RIAA Sales Certification?
| SELECT "Title" FROM table_43341 WHERE "RIAA Sales Certification" = 'gold' | wikisql |
CREATE TABLE table_13077 (
"Helium" text,
"Neon" text,
"Argon" text,
"Krypton" text,
"Xenon" text,
"Radon" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What neon has a krypton of 213?
| SELECT "Neon" FROM table_13077 WHERE "Krypton" = '213' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-133605' AND patient.unitdischargetime IS NULL | eicu |
CREATE TABLE table_204_862 (
id number,
"rank" number,
"bib" number,
"athlete" text,
"country" text,
"run 1" text,
"run 2" text,
"total" text,
"behind" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished after felix loch ?
| SELECT "athlete" FROM table_204_862 WHERE id = (SELECT id FROM table_204_862 WHERE "athlete" = 'felix loch') + 1 | squall |
CREATE TABLE table_65977 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position has 7 as the round, with a pick # less than 214?
| SELECT "Position" FROM table_65977 WHERE "Round" = '7' AND "Pick #" < '214' | wikisql |
CREATE TABLE table_name_97 (
crowd INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the smallest crowd at a home game for essendon?
| SELECT MIN(crowd) FROM table_name_97 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_27654988_1 (
result VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the game where the opponent is Innsbrucker Kilmarnock CSK VVS Samara?
| SELECT result FROM table_27654988_1 WHERE opponent = "Innsbrucker Kilmarnock CSK VVS Samara" | sql_create_context |
CREATE TABLE table_name_34 (
method VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the method when the opponent is Andre Roberts?
| SELECT method FROM table_name_34 WHERE opponent = "andre roberts" | 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 = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "43" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'intravenous diuretic - iv furosemide' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CU... | eicu |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Gentamicin" | mimicsql_data |
CREATE TABLE professor (
prof_office VARCHAR,
emp_num VARCHAR,
dept_code VARCHAR
)
CREATE TABLE department (
dept_code VARCHAR,
dept_name VARCHAR
)
CREATE TABLE employee (
emp_lname VARCHAR,
emp_num VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' | sql_create_context |
CREATE TABLE table_50723 (
"Line" text,
"Operator" text,
"Line length (kilometres)" real,
"Number of stations" real,
"Annual ridership (1998)" real,
"Annual ridership (2008)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Annual ridership ... | SELECT MIN("Annual ridership (2008)") FROM table_50723 WHERE "Number of stations" > '70' AND "Annual ridership (1998)" < '451,971,849' | wikisql |
CREATE TABLE table_15324 (
"Version" text,
"Code name" text,
"Release date" text,
"API level" real,
"Distribution" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- with distribution of 20.6% what is the code name?
| SELECT "Code name" FROM table_15324 WHERE "Distribution" = '20.6%' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE... | SELECT MIN(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 = 'phenytoin')) AND STRFTIME('%y', cost.chargetime) <= '2104' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_17326036_5 (
high_rebounds VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the most high rebounds in the game played on November 1?
| SELECT high_rebounds FROM table_17326036_5 WHERE date = "November 1" | sql_create_context |
CREATE TABLE table_65144 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College/Junior/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which College/Junior/Club Team has a Pick larger than 70, and a Round smaller than 7?
| SELECT "College/Junior/Club Team" FROM table_65144 WHERE "Pick" > '70' AND "Round" < '7' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2058" AND lab.fluid = "Joint Fluid" | mimicsql_data |
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 WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "BRADYCARDIA" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number... | SELECT COUNT(*) > 0 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 = 12775)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst... | mimic_iii |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_30121075_1 (
barony VARCHAR,
townland VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entries are in barony when the townland is derrigra?
| SELECT COUNT(barony) FROM table_30121075_1 WHERE townland = "Derrigra" | sql_create_context |
CREATE TABLE table_name_87 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the 2008 of the Australian Open when the 2011 was 1R?
| SELECT 2008 FROM table_name_87 WHERE 2011 = "1r" AND tournament = "australian open" | sql_create_context |
CREATE TABLE table_11960610_7 (
date VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the Bulls play the LA Lakers?
| SELECT date FROM table_11960610_7 WHERE team = "LA Lakers" | 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 COUNT(Id) FROM Users WHERE LOWER(DisplayName) LIKE 'user%' | sede |
CREATE TABLE table_12640 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest value for Draws, when South West DFL is 'Tyrendarra', and when B... | SELECT MIN("Draws") FROM table_12640 WHERE "South West DFL" = 'tyrendarra' AND "Byes" > '0' | wikisql |
CREATE TABLE VISITS (
Visit_Date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the distinct visit dates?
| SELECT DISTINCT Visit_Date FROM VISITS | sql_create_context |
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition (
Competition_ID in... | SELECT Country, COUNT(Country) FROM competition GROUP BY Country ORDER BY Country DESC | nvbench |
CREATE TABLE table_31273 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did the team new york red bulls pick?
| SELECT "Position" FROM table_31273 WHERE "MLS team" = 'New York Red Bulls' | wikisql |
CREATE TABLE table_11346 (
"Position" real,
"Name" text,
"Affiliation" text,
"Total" real,
"Percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name has a percentage of 0.59%?
| SELECT "Name" FROM table_11346 WHERE "Percentage" = '0.59%' | wikisql |
CREATE TABLE table_27952 (
"meas. num" real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the type of ballot measu... | SELECT "type" FROM table_27952 WHERE "% YES" = '32.47%' | wikisql |
CREATE TABLE table_9941 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the bronze when silver is 1, gold is 0 the rank is 11 and the total is more than 1?
| SELECT MAX("Bronze") FROM table_9941 WHERE "Silver" = '1' AND "Gold" = '0' AND "Rank" = '11' AND "Total" > '1' | wikisql |
CREATE TABLE zyb (
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 JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '64675893' AND t_kc22.STA_DATE BETWEEN '2006-03-30' AND '2013-06-05' AND qtb.MED_SER_ORG_NO = '0643879' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_3 (
points VARCHAR,
details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of points scored during the 1951 NSWRFL Grand Final?
| SELECT COUNT(points) FROM table_name_3 WHERE details = "1951 nswrfl grand final" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
... | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 AN... | atis |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions... | mimic_iii |
CREATE TABLE table_name_11 (
name VARCHAR,
presentation_of_credentials VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who presented their credentials at an unknown date?
| SELECT name FROM table_name_11 WHERE presentation_of_credentials = "unknown" | sql_create_context |
CREATE TABLE table_name_90 (
bronze VARCHAR,
silver VARCHAR,
gold VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of bronze medals for Sweden (SWE) having less than 1 gold and silver?
| SELECT COUNT(bronze) FROM table_name_90 WHERE gold < 1 AND nation = "sweden (swe)" AND silver < 1 | sql_create_context |
CREATE TABLE table_name_95 (
date VARCHAR,
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of @mil, and a Record of 45-16 happened on what date?
| SELECT date FROM table_name_95 WHERE opponent = "@mil" AND record = "45-16" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TA... | SELECT DISTINCT fare.fare_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, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE tourist_attraction_features (
tourist_attraction_id number,
feature_id number
)
CREATE TABLE visitors (
tourist_id number,
tourist_details text
)
CREATE TABLE museums (
museum_id number,
museum_details text
)
CREATE TABLE locations (
location_id number,
location_name text... | SELECT T1.name FROM tourist_attractions AS T1 JOIN tourist_attraction_features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN features AS T3 ON T2.feature_id = T3.feature_id WHERE T3.feature_details = 'park' UNION SELECT T1.name FROM tourist_attractions AS T1 JOIN tourist_attraction_features AS T2 ON... | spider |
CREATE TABLE product (
product_id number,
product_name text,
product_details text
)
CREATE TABLE problem_log (
problem_log_id number,
assigned_to_staff_id number,
problem_id number,
problem_category_code text,
problem_status_code text,
log_entry_date time,
log_entry_description ... | SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_7 (
player VARCHAR,
to_par VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player from Australia with a to par of +5?
| SELECT player FROM table_name_7 WHERE to_par = "+5" AND country = "australia" | 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.diagnosis = "GANGRENE" AND demographic.days_stay > "20" | mimicsql_data |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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,
... | SELECT COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_NM = '周雅韶' AND t_kc21.IN_HOSP_DATE BETWEEN '2015-04-12' AND '2020-11-25' | css |
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 prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47295 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'oral' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_72619 (
"English gloss" text,
"Santee-Sisseton" text,
"Yankton-Yanktonai" text,
"Northern Lakota" text,
"Southern Lakota" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the southern lakota for h ha na
| SELECT "Southern Lakota" FROM table_72619 WHERE "Yankton-Yanktonai" = 'híŋhaŋna' | wikisql |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH ... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '褚宏放' AND hz_info.YLJGDM = '6199140' AND zyjzjlb.CYKSMC LIKE '%肿瘤科%' | css |
CREATE TABLE Parts (
part_id INTEGER,
part_name VARCHAR(255),
chargeable_yn VARCHAR(1),
chargeable_amount VARCHAR(20),
other_part_details VARCHAR(255)
)
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Fault_Log (... | SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_status ORDER BY COUNT(fault_status) | nvbench |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId n... | SELECT DATE(Comments.CreationDate), COUNT(Comments.Id) FROM Comments INNER JOIN Users ON Comments.UserId = Users.Id WHERE Users.Location LIKE '%, Germany' AND Comments.CreationDate <= '2017-12-31' AND Comments.CreationDate >= '2017-01-01' GROUP BY DATE(Comments.CreationDate) | sede |
CREATE TABLE table_name_63 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date against the Tampa bay Storm?
| SELECT date FROM table_name_63 WHERE opponent = "tampa bay storm" | sql_create_context |
CREATE TABLE table_name_58 (
alternate VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Alternate for Sweden?
| SELECT alternate FROM table_name_58 WHERE nation = "sweden" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Exc/des hrt les,endovasc" | mimicsql_data |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
... | SELECT q.Id AS "post_link", q.Tags, q.CreationDate, q.ViewCount, q.Score, q.AnswerCount, q.OwnerUserId AS "user_link", q.OwnerDisplayName FROM Posts AS q WHERE (q.Tags LIKE '%<##tag1?abstract-algebra##>%') AND q.CreationDate >= '2020-02-01' AND q.CreationDate < '2020-04-30' ORDER BY q.CreationDate DESC | sede |
CREATE TABLE table_name_46 (
date VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date that has a Round of semifinal?
| SELECT date FROM table_name_46 WHERE round = "semifinal" | sql_create_context |
CREATE TABLE table_name_9 (
engine VARCHAR,
rounds VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which engine is in all rounds with Tsugio Matsuda driving?
| SELECT engine FROM table_name_9 WHERE rounds = "all" AND driver = "tsugio matsuda" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Context%' OR course.description LIKE '%Context%' OR course.name LIKE '%Context%') AND program_co... | advising |
CREATE TABLE table_18817 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High assists" FROM table_18817 WHERE "Team" = 'Charlotte' | wikisql |
CREATE TABLE table_41202 (
"Year" real,
"Competition" text,
"Club" text,
"Nation" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Competition when the Club was costa rica u-20?
| SELECT "Competition" FROM table_41202 WHERE "Club" = 'costa rica u-20' | wikisql |
CREATE TABLE table_29332810_14 (
sprint_classification VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the sprint classification where Francisco Ventoso wins?
| SELECT sprint_classification FROM table_29332810_14 WHERE winner = "Francisco Ventoso" | sql_create_context |
CREATE TABLE table_24351 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what type of record was made where result/games is 10 games (29,606 avg.)
| SELECT "Type of Record" FROM table_24351 WHERE "Result/Games" = '10 games (29,606 avg.)' | wikisql |
CREATE TABLE table_202_250 (
id number,
"year" text,
"name" text,
"source" text,
"definition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the nation called before the book of esther called it hodu ?
| SELECT "name" FROM table_202_250 WHERE id < (SELECT id FROM table_202_250 WHERE "name" = 'hodu' AND "source" = 'book of esther') | squall |
CREATE TABLE table_66957 (
"D 48" text,
"D 47" text,
"D 46" text,
"D 45" text,
"D 44" text,
"D 43" text,
"D 42" text,
"D 41" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the D 42 with D 43 of d 14
| SELECT "D 42" FROM table_66957 WHERE "D 43" = 'd 14' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id n... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'clarithromycin') AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_name_78 (
lane INTEGER,
heat VARCHAR,
nationality VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average lane of the athlete from japan with a time of 4:37.35 and a heat less than 3?
| SELECT AVG(lane) FROM table_name_78 WHERE nationality = "japan" AND time = "4:37.35" AND heat < 3 | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.drug = "Mycophenolate Mofetil" | mimicsql_data |
CREATE TABLE table_58409 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which away team is from junction oval?
| SELECT "Away team" FROM table_58409 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_47274 (
"Player" text,
"Position" text,
"Round" real,
"Pick" real,
"NFL Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the round of the new york jets NFL club, which has a pick less than 166?
| SELECT SUM("Round") FROM table_47274 WHERE "NFL Club" = 'new york jets' AND "Pick" < '166' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | WITH base AS (SELECT DISTINCT q.Id AS qid, q.CreationDate AS qdate FROM Posts AS q JOIN PostHistory AS ph ON (q.Id = ph.PostId) WHERE (q.PostTypeId = 1) AND (ph.PostHistoryTypeId != 36)), ordered AS (SELECT ROW_NUMBER() OVER (ORDER BY qdate) AS rownumber, qid, qdate FROM base) SELECT rownumber, qid AS "post_link", qdat... | sede |
CREATE TABLE table_name_42 (
commercial_operation VARCHAR,
unit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Hamaoka-4 unit commercial operation date?
| SELECT commercial_operation FROM table_name_42 WHERE unit = "hamaoka-4" | sql_create_context |
CREATE TABLE table_43671 (
"Match" text,
"Date" text,
"Location" text,
"Lineup" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Location has a Date of 1995-06-15?
| SELECT "Location" FROM table_43671 WHERE "Date" = '1995-06-15' | wikisql |
CREATE TABLE table_2964 (
"Year" real,
"Champions" text,
"Runners-up" text,
"Score in the final" text,
"3rd-place" text,
"4th-place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team finished in 4th place in 2007?
| SELECT "4th-place" FROM table_2964 WHERE "Year" = '2007' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD... | css |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE T... | 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 = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASH... | atis |
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INT... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations ORDER BY Date_in_Locaton_To DESC | nvbench |
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '75340002' AND t_kc22.STA_DATE BETWEEN '2004-08-08' AND '2019-09-03' AND t_kc22.SELF_PAY_AMO > 8808.11 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '7534... | css |
CREATE TABLE table_name_53 (
goals INTEGER,
debut_in_europe INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the lowest goals with a debut before 1961 in Europe?
| SELECT MIN(goals) FROM table_name_53 WHERE debut_in_europe < 1961 | sql_create_context |
CREATE TABLE table_37438 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which circuit has a length of 45 minutes and is held on August 6?
| SELECT "Circuit" FROM table_37438 WHERE "Length" = '45 minutes' AND "Date" = 'august 6' | wikisql |
CREATE TABLE courses (
course_id number,
author_id number,
subject_id number,
course_name text,
course_description text
)
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE student_tests_taken (
registration_id number,
date_test_taken time,
test_result ... | SELECT T1.date_of_enrolment, T1.date_of_completion FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie" | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.