instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_54008 (
"Year" text,
"TCKL" real,
"SACK" real,
"P/KO RET" real,
"YARDS" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of TCKL in 2000 with a P/KO RET less than 14?
| SELECT COUNT("TCKL") FROM table_54008 WHERE "Year" = '2000' AND "P/KO RET" < '14' | wikisql |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
-- Using valid SQLite... | SELECT DISTINCT major FROM student | spider |
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 = "Perinat GI sys dis NEC" AND prescriptions.route = "PO/NG" | mimicsql_data |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar... | SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%Rudolph Ware%' AND NOT instructor.name LIKE '%Ryan Baxter%') AND course.course_id = course_offering.course_id AND course.department = 'AERO' AND course.number = 410 AND offering_instructor.instructor_id =... | advising |
CREATE TABLE table_name_85 (
points INTEGER,
points_against VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Points when the Points Against is 594, and Losses is more than 3?
| SELECT AVG(points) FROM table_name_85 WHERE points_against = 594 AND losses > 3 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "17519" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "4131" | mimicsql_data |
CREATE TABLE table_name_32 (
date VARCHAR,
competition VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was a friendly match held at Auckland?
| SELECT date FROM table_name_32 WHERE competition = "friendly match" AND venue = "auckland" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-201... | eicu |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_76665 (
"Round #" real,
"Pick" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which pick came from Texas El-Paso?
| SELECT SUM("Pick") FROM table_76665 WHERE "College" = 'texas el-paso' | wikisql |
CREATE TABLE table_13565 (
"Year" real,
"Stage" real,
"Start of stage" text,
"Distance (km)" text,
"Category of climb" text,
"Stage winner" text,
"Yellow jersey" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the distance for Jos -Ma... | SELECT "Distance (km)" FROM table_13565 WHERE "Stage" < '16' AND "Stage winner" = 'josé-manuel fuente' | wikisql |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.long_title = "Acute diastolic heart failure" | mimicsql_data |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedb... | SELECT SUM(BountyAmount) FROM Votes WHERE NOT BountyAmount IS NULL AND VoteTypeId = 8 | sede |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3414056' AND IN_HOSP_DATE BETWEEN '2010-04-01' AND '2019-07-01' AND IN_DIAG_DIS_CD <> OUT_DIAG_DIS_CD | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE table_name_48 (
model_number VARCHAR,
socket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What model number uses standard voltage socket?
| SELECT model_number FROM table_name_48 WHERE socket = "standard voltage" | sql_create_context |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT meter_500, ID FROM swimmer ORDER BY ID DESC | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97733 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'thiamine hcl' ORDER BY prescriptions.startdat... | mimic_iii |
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_ye... | SELECT T1.birth_country FROM player AS T1 JOIN hall_of_fame AS T2 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y" GROUP BY T1.birth_country ORDER BY COUNT(*) DESC LIMIT 10 | thehistoryofbaseball |
CREATE TABLE table_18847456_2 (
opponents INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did the opposing team score on Dec. 19, 1982?
| SELECT MAX(opponents) FROM table_18847456_2 WHERE date = "Dec. 19" | sql_create_context |
CREATE TABLE table_name_14 (
company VARCHAR,
director VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What company does Simon Stone direct earlier than 2011?
| SELECT company FROM table_name_14 WHERE director = "simon stone" AND year < 2011 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT demographic.days_stay, demographic.admission_location FROM demographic WHERE demographic.name = "Mary Davis" | mimicsql_data |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_73 (
distance VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Distance has a Time of 2:20.00?
| SELECT distance FROM table_name_73 WHERE time = "2:20.00" | sql_create_context |
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 fasting_plasma_glucose <= 240 | criteria2sql |
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 lab (
subject_id text,
hadm_id text,
... | SELECT demographic.days_stay, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "8323" | mimicsql_data |
CREATE TABLE table_17989 (
"No." real,
"Air Date" text,
"Rating" text,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" text,
"Night" real,
"Timeslot" real,
"Overall" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are al... | SELECT "Rating" FROM table_17989 WHERE "Viewers (m)" = '2.61' | wikisql |
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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.age >= "71" | mimicsql_data |
CREATE TABLE table_12039 (
"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.
-- Who did Hawthorn play against at their home matc... | SELECT "Away team" FROM table_12039 WHERE "Home team" = 'hawthorn' | wikisql |
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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.short_title = "Parox ventric tachycard" | mimicsql_data |
CREATE TABLE table_243664_1 (
game_cost VARCHAR,
real_life_eventual_outcome VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the game cost for merged with new york central to form penn central
| SELECT game_cost FROM table_243664_1 WHERE real_life_eventual_outcome = "Merged with New York Central to form Penn Central" | sql_create_context |
CREATE TABLE table_name_64 (
year VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Rank of 25?
| SELECT year FROM table_name_64 WHERE rank = "25" | sql_create_context |
CREATE TABLE driver (
home_city VARCHAR,
age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show home city where at least two drivers older than 40 are from.
| SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE home_game (
year INTEGER,
league_id TEXT,
team_id TEXT,
park_id TEXT,
span_first TEXT,
span_last TEXT,
games INTEGER,
openings INTEGER,
attendance INTEGER
)
CREATE TABLE college (
college_id TEXT,
name_full TEXT,
city TEXT,
state TEXT,
country TEXT
)... | SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year DESC | nvbench |
CREATE TABLE table_204_414 (
id number,
"name" text,
"armenian" text,
"location" text,
"# of prisoners designed for" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- besides vardashen , what other correctional facility was designed... | SELECT "name" FROM table_204_414 WHERE "name" <> 'vardashen' AND "# of prisoners designed for" < 200 | squall |
CREATE TABLE table_204_842 (
id number,
"institution" text,
"city" text,
"state" text,
"team name" text,
"affiliation" text,
"enrollment" number,
"home conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which state has the most m... | SELECT "state" FROM table_204_842 GROUP BY "state" ORDER BY COUNT("institution") DESC LIMIT 1 | 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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "2156" | mimicsql_data |
CREATE TABLE table_9987 (
"Team" text,
"Region" text,
"Coach" text,
"Home ground" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home ground in region NZL?
| SELECT "Home ground" FROM table_9987 WHERE "Region" = 'nzl' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE m... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND medicat... | eicu |
CREATE TABLE Services (
Service_ID INTEGER,
Service_name VARCHAR(40)
)
CREATE TABLE First_Notification_of_Loss (
FNOL_ID INTEGER,
Customer_ID INTEGER,
Policy_ID INTEGER,
Service_ID INTEGER
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Effective_Date DATE,
... | SELECT Customer_name, Customer_ID FROM Customers ORDER BY Customer_ID | nvbench |
CREATE TABLE table_50635 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has the score of 67-72=139?
| SELECT "Player" FROM table_50635 WHERE "Score" = '67-72=139' | wikisql |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar... | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name | nvbench |
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,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | 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 = 'COLUMBUS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWA... | atis |
CREATE TABLE table_203_55 (
id number,
"japanese title" text,
"western title" text,
"regions" text,
"release" number,
"platform(s)" text,
"genre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was the last super chinese game released ?
| SELECT MAX("release") FROM table_203_55 | squall |
CREATE TABLE table_52952 (
"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 top crowd when collingwood played h... | SELECT MAX("Crowd") FROM table_52952 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE table_45773 (
"Rank" text,
"Figures" text,
"Player" text,
"Opponent" text,
"Venue" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Venue, when Figures is 5/29?
| SELECT "Venue" FROM table_45773 WHERE "Figures" = '5/29' | wikisql |
CREATE TABLE assets (
asset_id number,
maintenance_contract_id number,
supplier_company_id number,
asset_details text,
asset_make text,
asset_model text,
asset_acquired_date time,
asset_disposed_date time,
other_asset_details text
)
CREATE TABLE parts (
part_id number,
part_... | SELECT T1.skill_id, T1.skill_description FROM skills AS T1 JOIN skills_required_to_fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8025333' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING AVG(t_kc21.IN_HOSP_DAYS) > 9) AS T | css |
CREATE TABLE table_22514845_4 (
reporters VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the reporters for the year of 1984?
| SELECT reporters FROM table_22514845_4 WHERE year = 1984 | sql_create_context |
CREATE TABLE table_name_47 (
name VARCHAR,
losses VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has 5 losses and has played 11 matches?
| SELECT name FROM table_name_47 WHERE losses = "5" AND matches = "11" | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "5059" | mimicsql_data |
CREATE TABLE university (
school_id number,
school text,
location text,
founded number,
affiliation text,
enrollment number,
nickname text,
primary_conference text
)
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text... | SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1 | spider |
CREATE TABLE table_204_628 (
id number,
"trial number" text,
"date" text,
"name of trial" text,
"celebrity/ies taking part" text,
"winner/number of stars" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- jan and scott took part i... | SELECT "celebrity/ies taking part" FROM table_204_628 WHERE "trial number" = 10 - 1 | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND demographic.dod_year <= "2115.0" | mimicsql_data |
CREATE TABLE table_204_506 (
id number,
"seasons" number,
"team" text,
"ch.wins" number,
"promotions" number,
"relegations" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- other than scafati basket , who appeared in 9 seasons ?
| SELECT "team" FROM table_204_506 WHERE "team" <> 'scafati basket' AND "seasons" = 9 | squall |
CREATE TABLE table_80181 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What finish qualified at 141.071?
| SELECT "Finish" FROM table_80181 WHERE "Qual" = '141.071' | wikisql |
CREATE TABLE table_name_68 (
constructor VARCHAR,
grid VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the constructor for grid less than 20 and Laps of 6
| SELECT constructor FROM table_name_68 WHERE grid < 20 AND laps = 6 | sql_create_context |
CREATE TABLE table_67405 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What chassis has more than 0 points?
| SELECT "Chassis" FROM table_67405 WHERE "Points" > '0' | wikisql |
CREATE TABLE table_27754 (
"Series" real,
"Season" text,
"Played in" text,
"First Match" text,
"Tests played (sched)" text,
"Tests won by Australia" real,
"Tests won by England" real,
"Tests drawn" real,
"Series result" text,
"Holder at series end" text
)
-- Using valid SQLite,... | SELECT "Series result" FROM table_27754 WHERE "Season" = '1998' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 269)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | mimic_iii |
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 COUNT(*) FROM prescriptions WHERE prescriptions.drug = '0.83% sodium chloride' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE table_name_1 (
runners_up VARCHAR,
result VARCHAR,
champions VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Runners-up of the game with a Result of 4 1 and Champions of Wonju Dongbu Promy?
| SELECT runners_up FROM table_name_1 WHERE result = "4–1" AND champions = "wonju dongbu promy" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT demographic.expire_flag FROM demographic WHERE demographic.name = "Charles Nilsson" | mimicsql_data |
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
-- Using valid SQLite, answer the ... | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY COUNT(Venue) DESC | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-4763' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitalad... | eicu |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.BBCJBW 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 = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '2002-02-06' UNI... | css |
CREATE TABLE table_58753 (
"\"Long\" vowels" text,
"17th c." text,
"American" text,
"British" text,
"Australian" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the American pronunciation when the Australian is ?
| SELECT "American" FROM table_58753 WHERE "Australian" = 'əʉ' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE table_name_97 (
class VARCHAR,
wheels VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for the item 'Class' when the value of the item 'Wheels' is 137?
| SELECT class FROM table_name_97 WHERE wheels = 137 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT patient.age FROM patient WHERE patient.uniquepid = '015-23047' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_204_654 (
id number,
"year" number,
"song" text,
"u.s." number,
"u.s.\nr&b" number,
"u.s.\nac" number,
"uk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many songs from the album intentions charte... | SELECT COUNT("uk") FROM table_204_654 WHERE "album" = 'intentions' | squall |
CREATE TABLE table_60904 (
"Name" text,
"Mail transfer agent" text,
"Mail storage type" text,
"IMAP server" text,
"IMAP shared" text,
"Calendar format" text,
"Calendar shared" text,
"IM server" text,
"WebDAV" text,
"Web UI" text,
"Contacts shared" text,
"Files shared" tex... | SELECT "IMAP shared" FROM table_60904 WHERE "Web UI" = 'web ui' | wikisql |
CREATE TABLE table_204_959 (
id number,
"club" text,
"founded" number,
"nickname" text,
"location" text,
"home ground" text,
"entered competition" number,
"most recent promotion" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which foo... | SELECT "club" FROM table_204_959 WHERE "most recent promotion" = (SELECT "most recent promotion" FROM table_204_959 WHERE "club" = 'heidelberg football club') - 1 | squall |
CREATE TABLE table_59677 (
"Abbr" text,
"Common English" text,
"French" text,
"Italian" text,
"Romansh" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the italian word for Glarus?
| SELECT "Italian" FROM table_59677 WHERE "Common English" = 'glarus' | 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, MIN(basePrice) FROM Rooms GROUP BY decor | nvbench |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '82293410' AND hz_info.YLJGDM = '6552603' AND zyjzjlb.JZKSMC LIKE '%免疫病%' | css |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(... | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY dept_name | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.diagnosis = "S/P HANGING" | mimicsql_data |
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor... | SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE" ORDER BY T1.investor_id | nvbench |
CREATE TABLE table_name_34 (
year VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the score 269?
| SELECT COUNT(year) FROM table_name_34 WHERE score = 269 | sql_create_context |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CR... | 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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI... | atis |
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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "DEAD/EXPIRED" | mimicsql_data |
CREATE TABLE table_53326 (
"Unit" text,
"Reactor Type" text,
"Net Capacity" text,
"Gross Capacity" text,
"Construction Start" text,
"Grid Connection" text,
"Commercial Operation" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Gross Capacity" FROM table_53326 WHERE "Reactor Type" = 'abwr' | wikisql |
CREATE TABLE table_21917 (
"Year" real,
"Date" text,
"Driver" text,
"Manufacturer" text,
"Laps" real,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the winning rac... | SELECT MAX("Year") FROM table_21917 WHERE "Race Time" = '1:55:13' | wikisql |
CREATE TABLE director (
did int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE copyright (
id int,
msid int,
cid int
)
CREATE TABLE genre (
gid int,
genre text
)
CREATE TABLE writer (
wid int,
gender text,
name text,
... | SELECT COUNT(DISTINCT (movie.title)) FROM actor, cast, movie WHERE actor.name = 'Jennifer Aniston' AND cast.aid = actor.aid AND movie.mid = cast.msid AND movie.release_year > 2010 | imdb |
CREATE TABLE table_28394 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined MAC" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What institution(s) are located in wilkes-barre, pen... | SELECT "Institution" FROM table_28394 WHERE "Location" = 'Wilkes-Barre, Pennsylvania' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '6389409' AND IN_HOSP_DATE BETWEEN '2004-09-26' AND '2012-04-01') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '6389409' AND IN_HOSP_DATE BETWEEN '2004-09-26' AND '2012-04-01' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')) | css |
CREATE TABLE tweets (
uid VARCHAR
)
CREATE TABLE user_profiles (
name VARCHAR,
uid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of the user who tweeted more than once, and number of tweets tweeted by them.
| SELECT T1.name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_name_56 (
season VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the season for runner up of judean rebels
| SELECT season FROM table_name_56 WHERE runner_up = "judean rebels" | sql_create_context |
CREATE TABLE table_name_14 (
tournament VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Howard Twitty was the runner-up of what tournament?
| SELECT tournament FROM table_name_14 WHERE runner_s__up = "howard twitty" | sql_create_context |
CREATE TABLE table_298550_1 (
population__1_july_2005_est_ INTEGER,
area__km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest value for population when area is 9104?
| SELECT MAX(population__1_july_2005_est_) FROM table_298550_1 WHERE area__km²_ = 9104 | sql_create_context |
CREATE TABLE table_8970 (
"City" text,
"Chinese" text,
"Pinyin" text,
"Province" text,
"Urban Population (2010)" real,
"Administrative Population (2010)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the urban population for the city of... | SELECT AVG("Urban Population (2010)") FROM table_8970 WHERE "City" = 'fuzhou' | wikisql |
CREATE TABLE table_67449 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the smallest week that had a result of t 17 17?
| SELECT MIN("Week") FROM table_67449 WHERE "Result" = 't 17–17' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restrict... | 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 = 'ATLANTA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND d... | atis |
CREATE TABLE table_name_28 (
revenue__ INTEGER,
team VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average revenue for Bayern Munich with a rank greater than 4?
| SELECT AVG(revenue__) AS $m_ FROM table_name_28 WHERE team = "bayern munich" AND rank > 4 | 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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '彭博艺' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 1800.54) | css |
CREATE TABLE table_15606 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the qual for rank 18 in 1964?
| SELECT "Qual" FROM table_15606 WHERE "Rank" = '18' AND "Year" = '1964' | wikisql |
CREATE TABLE table_name_61 (
high_points VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the highest points on March 27?
| SELECT high_points FROM table_name_61 WHERE date = "march 27" | sql_create_context |
CREATE TABLE table_78115 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Rams points" real,
"Opponents" real,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance where the recor... | SELECT MIN("Attendance") FROM table_78115 WHERE "Record" = '8-4' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.