instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microl... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 50 AND 59 | eicu |
CREATE TABLE table_53478 (
"Grid" real,
"Driver" text,
"Constructor" text,
"Qual" real,
"Rank" real,
"Laps" real,
"Time/Retired" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps did Chuck Stevenson have with a grid of less than 1... | SELECT COUNT("Laps") FROM table_53478 WHERE "Driver" = 'chuck stevenson' AND "Grid" < '11' | wikisql |
CREATE TABLE table_name_6 (
away_team VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team at the game attended by 81?
| SELECT away_team FROM table_name_6 WHERE attendance = "81" | 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 = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dod_year <= "2115.0" | mimicsql_data |
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.DOSE_FORM, t_kc22.SPEC FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '54296151099' AND t_kc22.SOC_SRT_DIRE_NM = '抗病毒口服液' | css |
CREATE TABLE table_name_14 (
winning_score VARCHAR,
championship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score in the PGA Championship?
| SELECT winning_score FROM table_name_14 WHERE championship = "pga championship" | sql_create_context |
CREATE TABLE table_11677100_11 (
hometown VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT TOWN IS WEST BROOK SENIOR HIGH SCHOOL FROM?
| SELECT hometown FROM table_11677100_11 WHERE school = "West Brook Senior High school" | sql_create_context |
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE student (
stu_num number,
stu_lname t... | SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1 | spider |
CREATE TABLE table_47164 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a Player of sammy okpro?
| SELECT AVG("Round") FROM table_47164 WHERE "Player" = 'sammy okpro' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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,
r... | 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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 2 AND date_day.month_number =... | atis |
CREATE TABLE table_name_70 (
democratic_ticket VARCHAR,
office VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was on the Democratic ticket for the Office of Attorney General?
| SELECT democratic_ticket FROM table_name_70 WHERE office = "attorney general" | sql_create_context |
CREATE TABLE Documents_to_be_destroyed (
Destroyed_by_Employee_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the ids of all employees who have destroyed a document.
| SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed | sql_create_context |
CREATE TABLE table_79572 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment 08-09" real,
"IHSAA Class" text,
"IHSAA Class Football" text,
"County" text,
"Year Joined" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school i... | SELECT "School" FROM table_79572 WHERE "County" = '36 jackson' | wikisql |
CREATE TABLE table_2094 (
"Season" text,
"Final Venue" text,
"Champion" text,
"Result" text,
"Finalist" text,
"MVP" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the finalist when the final venue was Varese?
| SELECT "Finalist" FROM table_2094 WHERE "Final Venue" = 'Varese' | wikisql |
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE ... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code DESC | nvbench |
CREATE TABLE table_203_877 (
id number,
"year" number,
"single" text,
"us cashbox" number,
"us hot 100" number,
"uk singles" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the total number of singles in 1974 ?
| SELECT COUNT("single") FROM table_203_877 WHERE "year" = 1974 | squall |
CREATE TABLE table_2668401_17 (
first_elected VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the incumbent first elected in the district where the result was a democratic-republican gain?
| SELECT first_elected FROM table_2668401_17 WHERE result = "Democratic-Republican gain" | sql_create_context |
CREATE TABLE table_name_19 (
publisher VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which publisher is responsible for spec ops: stealth patrol?
| SELECT publisher FROM table_name_19 WHERE name = "spec ops: stealth patrol" | sql_create_context |
CREATE TABLE table_name_41 (
drawn INTEGER,
points_difference VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games drawn with a Points difference of 31 - 33, and under 4 games lost?
| SELECT SUM(drawn) FROM table_name_41 WHERE points_difference = "31 - 33" AND lost < 4 | sql_create_context |
CREATE TABLE table_74500 (
"Aircraft" text,
"Origin" text,
"Type" text,
"Versions" text,
"In service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the aircraft for pzl-104
| SELECT "Aircraft" FROM table_74500 WHERE "Versions" = 'pzl-104' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_address_id INTEGER,
customer_status_code VARCHAR(15),
date_became_customer DATETIME,
date_of_birth DATETIME,
first_name VARCHAR(80),
last_name VARCHAR(80),
amount_outstanding DOUBLE,
email_address VARCHAR(250),
phone_number V... | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY COUNT(*) | nvbench |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.days_stay = "11" | mimicsql_data |
CREATE TABLE ref_incident_type (
incident_type_code text,
incident_type_description text
)
CREATE TABLE teachers (
teacher_id number,
address_id number,
first_name text,
middle_name text,
last_name text,
gender text,
cell_mobile_number text,
email_address text,
other_details... | SELECT T1.teacher_id, T2.last_name FROM detention AS T1 JOIN teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = "AFTER" GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_35 (
nominating_festival VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Nominating Festival took place in Germany?
| SELECT nominating_festival FROM table_name_35 WHERE country = "germany" | sql_create_context |
CREATE TABLE table_26825349_1 (
no_in_season VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode number of the episode with a production code of 4aky14?
| SELECT no_in_season FROM table_26825349_1 WHERE production_code = "4AKY14" | sql_create_context |
CREATE TABLE table_20643 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Language(s)" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the 2009 (82nd) awards?
| SELECT "Result" FROM table_20643 WHERE "Year (Ceremony)" = '2009 (82nd)' | wikisql |
CREATE TABLE table_11116 (
"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 team was the away team when Footscray was t... | SELECT "Away team" FROM table_11116 WHERE "Home team" = 'footscray' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '99601428429' | css |
CREATE TABLE table_name_54 (
content VARCHAR,
sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the content for sign of g e
| SELECT content FROM table_name_54 WHERE sign = "g e" | sql_create_context |
CREATE TABLE table_1923 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If ... | SELECT MIN("GEO ID") FROM table_1923 WHERE "Longitude" = '-97.473110' | wikisql |
CREATE TABLE table_61078 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of Tie no 9?
| SELECT "Date" FROM table_61078 WHERE "Tie no" = '9' | wikisql |
CREATE TABLE table_49838 (
"Rank" real,
"Player" text,
"Country" text,
"Events" real,
"Prize money( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank for the player with events greater than 23 and prize money in excess of $823,783... | SELECT COUNT("Rank") FROM table_49838 WHERE "Events" > '23' AND "Prize money( $ )" > '823,783' | wikisql |
CREATE TABLE table_name_19 (
opponents VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the opponent for the Sutton tournament?
| SELECT opponents FROM table_name_19 WHERE tournament = "sutton" | sql_create_context |
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),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '48698459' AND jybgb.BGRQ BETWEEN '2000-09-24... | css |
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_ID text,
Register_Year text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Year text,
Total_pounds real
)
CREATE TABLE member (
Member_ID int,
Card_Number text,
Name text,
Hometown text,
Level int... | SELECT City, COUNT(City) FROM branch GROUP BY City ORDER BY Open_year | nvbench |
CREATE TABLE table_71070 (
"Year" real,
"Country" text,
"Nominated work" text,
"Award" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for song of the year award in 1994?
| SELECT "Result" FROM table_71070 WHERE "Year" = '1994' AND "Award" = 'song of the year' | wikisql |
CREATE TABLE table_name_67 (
apparent_magnitude INTEGER,
declination___j2000__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Apparent magnitude of a Declination (J2000) of 39 45 ?
| SELECT MIN(apparent_magnitude) FROM table_name_67 WHERE declination___j2000__ = "°39′45″" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepi... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-10988')) AND vitalperiodic.heartrate > 97.0 AND... | eicu |
CREATE TABLE table_23855 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directedby" text,
"Writtenby" text,
"Originalairdate" text,
"Production code" text,
"U.S.viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Production code" FROM table_23855 WHERE "U.S.viewers (million)" = '3.38' | wikisql |
CREATE TABLE table_name_10 (
grid INTEGER,
laps VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Oriol Servia's average Grid on races with more than 43 laps?
| SELECT AVG(grid) FROM table_name_10 WHERE laps > 43 AND driver = "oriol servia" | sql_create_context |
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
la... | SELECT formats, COUNT(*) FROM files GROUP BY formats | nvbench |
CREATE TABLE table_22050544_1 (
winner VARCHAR,
dateca VARCHAR,
event__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winner of event # 1h and dateca is Apr 2?
| SELECT winner FROM table_22050544_1 WHERE dateca = "Apr 2" AND event__number = "1H" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Drug detoxification" | mimicsql_data |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
... | SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'QW' | atis |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TAB... | SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY SUM(share_count) DESC | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_i... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_train_132 (
"id" int,
"loss_of_consciousness" bool,
"deep_venous_thrombosis" bool,
"unstable_angina" bool,
"thromboembolic_vascular_disease" bool,
"head_injury" bool,
"stroke" bool,
"cerebrovascular_disease" bool,
"mental_retardation" bool,
"psychiatric_disease... | SELECT * FROM table_train_132 WHERE mental_illness = 1 OR cardiac_disease = 1 OR thromboembolic_vascular_disease = 1 OR (arrythmias = 1 OR unstable_angina = 1 OR cva = 1 OR deep_venous_thrombosis = 1 OR pulmonary_embolus = 1) | criteria2sql |
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, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2131.0" AND prescriptions.formulary_drug_cd = "CEPACOL1" | mimicsql_data |
CREATE TABLE table_name_39 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the size of the crowd for the game where the away team South Melbourne played?
| SELECT AVG(crowd) FROM table_name_39 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE procedures_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 TABL... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime LIMIT 1) | mimic_iii |
CREATE TABLE table_13523 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text,
"Year Joined" real,
"Previous Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the schoo... | SELECT "School" FROM table_13523 WHERE "Enrollment" > '441' AND "Mascot" = 'chargers' | wikisql |
CREATE TABLE table_name_93 (
opened_in INTEGER,
ride_name VARCHAR,
manufacture VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest year a ride opened that was manufactured by Zamperla, was a convoy ride, and had a name of ... | SELECT MAX(opened_in) FROM table_name_93 WHERE manufacture = "zamperla" AND type = "convoy ride" AND ride_name = "tiny truckers" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | SELECT p.Id, p.Body, a.* FROM Posts AS p INNER JOIN Posts AS a ON p.Id = a.ParentId WHERE p.Id = 30439064 | sede |
CREATE TABLE table_55509 (
"Stations" text,
"Place" text,
"Managed By" text,
"Platforms" real,
"Zone" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What would be the highest Platforms for the Centrale Tram Stop Stations?
| SELECT MAX("Platforms") FROM table_55509 WHERE "Stations" = 'centrale tram stop' | wikisql |
CREATE TABLE Addresses (
address_id INTEGER,
line_1_number_building VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50)
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_... | SELECT product_type_code, COUNT(product_type_code) FROM Products WHERE product_price > 1000 OR product_price < 500 GROUP BY product_type_code ORDER BY product_type_code DESC | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID) | nvbench |
CREATE TABLE directed_by (
id int,
msid int,
did int
)
CREATE TABLE company (
id int,
name text,
country_code varchar
)
CREATE TABLE movie (
mid int,
title text,
release_year int,
title_aka text,
budget text
)
CREATE TABLE classification (
id int,
msid int,
gid... | SELECT COUNT(DISTINCT (company.name)) FROM company, copyright, movie WHERE copyright.cid = company.id AND movie.mid = copyright.msid AND movie.title = 'Camp X-Ray' | imdb |
CREATE TABLE table_16010376_1 (
bullet_weight VARCHAR,
source VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weight of the bullet used in a Remington?
| SELECT bullet_weight FROM table_16010376_1 WHERE source = "Remington" | sql_create_context |
CREATE TABLE table_test_23 (
"id" int,
"previous_mi" bool,
"anemia" bool,
"left_ventricular_ejection_fraction_lvef" int,
"tolerate_gadolinium_contrast_media" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"tolerate_magnet... | SELECT * FROM table_test_23 WHERE renal_disease = 1 OR creatinine_clearance_cl > 250 | criteria2sql |
CREATE TABLE table_57244 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text,
"Apparent magnitude" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the right ascensu... | SELECT "Right ascension ( J2000 )" FROM table_57244 WHERE "Object type" = 'globular cluster' AND "Apparent magnitude" = '8.5' AND "NGC number" = '6273' | wikisql |
CREATE TABLE table_name_38 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game on June 1?
| SELECT score FROM table_name_38 WHERE date = "june 1" | sql_create_context |
CREATE TABLE table_name_67 (
matches INTEGER,
overs VARCHAR,
economy_rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many matches were played that resulted in less than 59.1 overs and a 6.78 Economy rate?
| SELECT SUM(matches) FROM table_name_67 WHERE overs < 59.1 AND economy_rate > 6.78 | sql_create_context |
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 zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGDH = '46227016809' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb.BGDH = '46227016809' | css |
CREATE TABLE table_name_53 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the Jays play on August 30?
| SELECT opponent FROM table_name_53 WHERE date = "august 30" | sql_create_context |
CREATE TABLE table_1601792_4 (
network VARCHAR,
television_station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the network(s) for tv1?
| SELECT network FROM table_1601792_4 WHERE television_station = "TV1" | sql_create_context |
CREATE TABLE table_203_425 (
id number,
"season" number,
"driver" text,
"equipment" text,
"position" number,
"points" number,
"races" number,
"wins" number,
"second" number,
"third" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT "driver" FROM table_203_425 WHERE "season" IN (2009, 2010) ORDER BY "points" DESC LIMIT 1 | squall |
CREATE TABLE table_name_39 (
attendance INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Attendance when the away team was Wrexham?
| SELECT MAX(attendance) FROM table_name_39 WHERE away_team = "wrexham" | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT RelatedPostId AS "Original", q.Id AS "Dupe" FROM PostLinks JOIN Posts AS q ON q.Id = RelatedPostId WHERE LinkTypeId = 3 | sede |
CREATE TABLE table_27956_3 (
percentage_change_yoy VARCHAR,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the percentage change yoy for presbyterian college
| SELECT percentage_change_yoy FROM table_27956_3 WHERE institution = "Presbyterian College" | sql_create_context |
CREATE TABLE table_train_158 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"moca_score" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT * FROM table_train_158 WHERE systolic_blood_pressure_sbp > 150 AND diastolic_blood_pressure_dbp > 90 | criteria2sql |
CREATE TABLE table_204_207 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- opponent for highest attended home game
| SELECT "opponent" FROM table_204_207 WHERE "opponent" = 'home' ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_48540 (
"Gatchaman" text,
"Eagle Riders" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (Eagle Riders)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Weapon" FROM table_48540 WHERE "Mecha" = 'motorcycle' | wikisql |
CREATE TABLE table_46701 (
"Class" text,
"Leading bits" real,
"Size of network number bit field" text,
"Size of rest bit field" text,
"Number of networks" text,
"Addresses per network" text,
"Start address" text,
"End address" text
)
-- Using valid SQLite, answer the following question... | SELECT "Size of rest bit field" FROM table_46701 WHERE "Leading bits" > '110' AND "Start address" = '224.0.0.0' | wikisql |
CREATE TABLE table_name_94 (
state VARCHAR,
major_city_served VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the greatest 2010 for Miami, Fl?
| SELECT MAX(2010) FROM table_name_94 WHERE state = "fl" AND major_city_served = "miami" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId... | SELECT MONTH(CreationDate), COUNT(Id) FROM Users WHERE YEAR(CreationDate) = '##Year##' GROUP BY MONTH(CreationDate) ORDER BY MONTH(CreationDate) | sede |
CREATE TABLE table_25015 (
"English name" text,
"Georgian name" text,
"Transliteration" text,
"Date" text,
"Author" text,
"Period covered" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the auther when the transliteration is lasha-giorgis... | SELECT "Author" FROM table_25015 WHERE "Transliteration" = 'lasha-giorgis droindeli matiane' | wikisql |
CREATE TABLE table_15621965_16 (
years_in_orlando VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did the player who's school is Clemson spend in Orlando?
| SELECT years_in_orlando FROM table_15621965_16 WHERE school_club_team = "Clemson" | sql_create_context |
CREATE TABLE table_53723 (
"Year" real,
"Theme" text,
"Face Values" text,
"Artist" text,
"Issue Price" text,
"Mintage" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the Endangered Wildlife Series from the Royal Canadian Mi... | SELECT "Theme" FROM table_53723 WHERE "Mintage" = '700' | wikisql |
CREATE TABLE table_203_425 (
id number,
"season" number,
"driver" text,
"equipment" text,
"position" number,
"points" number,
"races" number,
"wins" number,
"second" number,
"third" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT "driver" FROM table_203_425 WHERE "driver" IN ('daniel willemsen', 'modris stelle') GROUP BY "driver" ORDER BY SUM("points") DESC LIMIT 1 | squall |
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.admityear < "2180" AND diagnoses.long_title = "Other alteration of consciousness" | mimicsql_data |
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 MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'comp-oth vasc dev/graft')) AND DATETIME(cost.chargetime) >= DAT... | mimic_iii |
CREATE TABLE table_name_77 (
hindu VARCHAR,
us__1912_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1912 when the U.S used sapphire, what was the Hindu birthstone?
| SELECT hindu FROM table_name_77 WHERE us__1912_ = "sapphire" | sql_create_context |
CREATE TABLE table_26782 (
"Railroad" text,
"Game Cost" text,
"Real-Life Years of Operation" text,
"Real-Life Eventual Outcome" text,
"Currently\u00b9 Part Of..." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the game coast for chicago and nor... | SELECT "Game Cost" FROM table_26782 WHERE "Railroad" = 'Chicago and North Western' | wikisql |
CREATE TABLE table_name_81 (
stadium VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the stadium for akovec?
| SELECT stadium FROM table_name_81 WHERE team = "čakovec" | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE station (
name VARCHAR,
total_passengers VARCHAR,
LOCATION VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names and total passengers for all train stations not in London.
| SELECT name, total_passengers FROM station WHERE LOCATION <> 'London' | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) AN... | eicu |
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 Name, SUM(Price) FROM Products GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE ... | SELECT AVG(campusfee) FROM csu_fees WHERE year = 2005 | spider |
CREATE TABLE table_name_93 (
total VARCHAR,
player VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number that Tom Watson parred larger than 10?
| SELECT COUNT(total) FROM table_name_93 WHERE player = "tom watson" AND to_par > 10 | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '2157657' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-01-04' AND '2012-06-01' | css |
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 COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '1552619' AND txmzjzjlb.JZKSRQ BETWEEN '2005-04-17' AND '2019-12-11' AND txmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '1552619' AND ftxmzjzjlb.JZKSRQ BETWEEN '2005-04-17' AND '2019-12-11' AND ftxmzjzjlb.ZZBZ > 0 | css |
CREATE TABLE table_48155 (
"Portfolio" text,
"Minister" text,
"Took office" text,
"Left office" text,
"Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party was Andrea Ronchi from?
| SELECT "Party" FROM table_48155 WHERE "Minister" = 'andrea ronchi' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99205) AND prescriptions.drug = 'labetalol' AND STRFTIME('%y-%m', prescriptions.startdate) = '2102-12' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_48000 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a score of 71-72-73-69=285?
| SELECT "Country" FROM table_48000 WHERE "Score" = '71-72-73-69=285' | wikisql |
CREATE TABLE table_73581 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the name of... | SELECT "Title" FROM table_73581 WHERE "Directed by" = 'Laura Innes' AND "U.S. viewers (millions)" = '9.63' | wikisql |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.