instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_203_38 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many songs are at least 4 minutes long ?
| SELECT COUNT("title") FROM table_203_38 WHERE "length" >= 4 | squall |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmit... | eicu |
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE member (
member_id number,
card_number text,
name text,
hometown text,
... | SELECT DISTINCT city FROM branch WHERE membership_amount >= 100 | spider |
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
-- U... | SELECT Country, COUNT(*) FROM member GROUP BY Country | nvbench |
CREATE TABLE table_name_30 (
pole_position VARCHAR,
fastest_lap VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pole position was Rubens Barrichello when he had the fastest lap and a round larger than 11?
| SELECT pole_position FROM table_name_30 WHERE fastest_lap = "rubens barrichello" AND round > 11 | sql_create_context |
CREATE TABLE table_76511 (
"Finished" text,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Odds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Finished place for da'tara trained by Nick zito?
| SELECT "Finished" FROM table_76511 WHERE "Trainer" = 'nick zito' AND "Horse" = 'da''tara' | wikisql |
CREATE TABLE table_5160 (
"Round" text,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the players name in the guard position?
| SELECT "Name" FROM table_5160 WHERE "Position" = 'guard' | wikisql |
CREATE TABLE museums (
museum_id number,
museum_details text
)
CREATE TABLE tourist_attraction_features (
tourist_attraction_id number,
feature_id number
)
CREATE TABLE visitors (
tourist_id number,
tourist_details text
)
CREATE TABLE locations (
location_id number,
location_name text... | SELECT star_rating_code, AVG(price_range) FROM hotels GROUP BY star_rating_code | spider |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT SUBSTRING(CAST(TIME_TO_STR(CreationDate, '%H:%M:%S') AS TEXT(30)), 0, 6), COUNT(Id) FROM Posts WHERE OwnerUserId = '##UserId##' GROUP BY SUBSTRING(CAST(TIME_TO_STR(CreationDate, '%H:%M:%S') AS TEXT(30)), 0, 6) | sede |
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE member (
member_id number,
card_number text,
name text,
hometown text,
level number
)
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
regi... | SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch) | spider |
CREATE TABLE table_17357929_1 (
lost INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest number of games lost?
| SELECT MIN(lost) FROM table_17357929_1 | sql_create_context |
CREATE TABLE table_55812 (
"Locomotive" text,
"Serial No" text,
"Entered service" text,
"Gauge" text,
"Livery" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the livery of the locomotive with a serial number 83-1010?
| SELECT "Livery" FROM table_55812 WHERE "Serial No" = '83-1010' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-65 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_name_43 (
loss VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What loss happened june 8?
| SELECT loss FROM table_name_43 WHERE date = "june 8" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_2327 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment (fall 2010)" real,
"Founded" real,
"Accreditation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the control for the school accred... | SELECT "Control" FROM table_2327 WHERE "Accreditation" = 'The Higher Learning Commission ( NCA ), CCNE' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
C... | SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS Month, COUNT(DATEADD(month, DATEDIFF(month, 0, CreationDate), 0)) AS "Monthly Joins" FROM Users GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) ORDER BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) | sede |
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 demographic.admission_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "17787" | mimicsql_data |
CREATE TABLE table_203_47 (
id number,
"game" number,
"date" text,
"opponent" text,
"location" text,
"score" text,
"ot" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which date had the most people... | SELECT "date" FROM table_203_47 ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_name_53 (
bbc_two_rank VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the rank of BBC 2 in 2005?
| SELECT bbc_two_rank FROM table_name_53 WHERE year = "2005" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_22 (
country VARCHAR,
swimsuit VARCHAR,
average VARCHAR,
interview VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has swimsuit more than 9.46 and interview more than 9.22 with average less than 9.6?
| SELECT country FROM table_name_22 WHERE average < 9.6 AND interview > 9.22 AND swimsuit > 9.46 | sql_create_context |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank i... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) DESC | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_descriptio... | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DTW' AND city.city_code = airport_service.city_code AND city.city_name = 'MILWAUKEE' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code | atis |
CREATE TABLE table_name_44 (
score VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game when there was a loss of Kern (0-2)?
| SELECT score FROM table_name_44 WHERE loss = "kern (0-2)" | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE table_17848578_1 (
record VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record when the game was at the San Diego Stadium?
| SELECT record FROM table_17848578_1 WHERE game_site = "San Diego Stadium" | sql_create_context |
CREATE TABLE table_49258 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score at North Shore Events Centre?
| SELECT "Score" FROM table_49258 WHERE "Venue" = 'north shore events centre' | wikisql |
CREATE TABLE table_5021 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Round that has a Position of Tackle and the Player Fred Neilsen?
| SELECT MAX("Round") FROM table_5021 WHERE "Position" = 'tackle' AND "Player" = 'fred neilsen' | wikisql |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '陈颖然' AND t_kc21.MED_SER_ORG_NO = '5544241') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
C... | SELECT COUNT(*) FROM Posts AS Questions INNER JOIN Votes ON Votes.PostId = Questions.AcceptedAnswerId WHERE VoteTypeId = 1 AND CAST((JULIANDAY(CreationDate) - JULIANDAY(Questions.CreationDate)) * 24.0 AS INT) > 24 * 28 AND Questions.Tags LIKE '%identify-this-game%' | sede |
CREATE TABLE table_10701133_1 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode where u.s. viewers (million) is 12.90?
| SELECT directed_by FROM table_10701133_1 WHERE us_viewers__million_ = "12.90" | sql_create_context |
CREATE TABLE table_204_957 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | SELECT MIN("games") FROM table_204_957 WHERE "team" = 'buf' | squall |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '32352612' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-03-18' AND '2021-05-07' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_name_23 (
ratings VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Ratings did the 2013 Year have?
| SELECT ratings FROM table_name_23 WHERE year = 2013 | sql_create_context |
CREATE TABLE table_68023 (
"Team" text,
"Truck(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the crew chief, of driver Matt kurzejewski?
| SELECT "Crew Chief" FROM table_68023 WHERE "Driver(s)" = 'matt kurzejewski' | wikisql |
CREATE TABLE table_name_33 (
league VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What league has a 3-1 home?
| SELECT league FROM table_name_33 WHERE home = "3-1" | sql_create_context |
CREATE TABLE table_name_92 (
outcome VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The match against Paul-Henri Mathieu had what outcome?
| SELECT outcome FROM table_name_92 WHERE opponent = "paul-henri mathieu" | sql_create_context |
CREATE TABLE table_name_45 (
apparent_magnitude INTEGER,
ngc_number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of Apparent magnitudes for an NGC number larger than 3293?
| SELECT SUM(apparent_magnitude) FROM table_name_45 WHERE ngc_number > 3293 | sql_create_context |
CREATE TABLE table_29355 (
"Programs" text,
"World" real,
"Africa" real,
"Americas" real,
"Asia" real,
"Australasia" real,
"Europe" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did Australasia received a program if the Ameri... | SELECT COUNT("Australasia") FROM table_29355 WHERE "Americas" = '115' | wikisql |
CREATE TABLE table_27189 (
"#" real,
"Episode" text,
"Air Date" text,
"Timeslot (EST)" text,
"Rating" text,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" text,
"Weekly Rank (#)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Rating" FROM table_27189 WHERE "Episode" = 'In Which Cooper Finds a Port In His Storm' | wikisql |
CREATE TABLE table_29200 (
"model" text,
"Speed (GHz)" text,
"L3 Cache (MB)" real,
"QPI speed (GT/s)" text,
"DDR3 Clock (MHz)" real,
"TDP (W)" real,
"Cores" real,
"Threads" real,
"Turbo-Boost" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("Cores") FROM table_29200 WHERE "Speed (GHz)" = '2.53' | wikisql |
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 t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2103' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_571 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the followi... | SELECT "Drawn" FROM table_571 WHERE "Points against" = '416' | 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 demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Miguel Hodges" | mimicsql_data |
CREATE TABLE table_name_50 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on September 1, 1996?
| SELECT result FROM table_name_50 WHERE date = "september 1, 1996" | sql_create_context |
CREATE TABLE table_12184 (
"Draft" text,
"Round" text,
"Pick" text,
"Nationality" text,
"Position" text,
"College/High School/Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which year was the Pick #46?
| SELECT "Draft" FROM table_12184 WHERE "Pick" = '46' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | SELECT DISTINCT name FROM course WHERE department = 'MILSCI' AND number = 302 | advising |
CREATE TABLE table_name_54 (
surface VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surface has a Place of lappeenranta?
| SELECT surface FROM table_name_54 WHERE place = "lappeenranta" | sql_create_context |
CREATE TABLE table_name_73 (
ground VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Ground, when Away Team is Sydney?
| SELECT ground FROM table_name_73 WHERE away_team = "sydney" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE table_name_68 (
location_attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location and attendance for the game on December 12?
| SELECT location_attendance FROM table_name_68 WHERE date = "december 12" | sql_create_context |
CREATE TABLE table_name_92 (
first_elected INTEGER,
result VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average year Charles N. Felton was re-elected?
| SELECT AVG(first_elected) FROM table_name_92 WHERE result = "re-elected" AND incumbent = "charles n. felton" | sql_create_context |
CREATE TABLE table_name_17 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Home team that has a Venue of Windy Hill?
| SELECT home_team FROM table_name_17 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE table_15463188_7 (
school_club_team VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Nametheh school team for norman gonzales
| SELECT school_club_team FROM table_15463188_7 WHERE name = "Norman Gonzales" | sql_create_context |
CREATE TABLE table_70912 (
"Year" real,
"Total Region" real,
"Belyando" real,
"Broadsound" real,
"Nebo" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Total Region that has a Year after 2001, and a Broadsound greater than 6,843?
| SELECT MIN("Total Region") FROM table_70912 WHERE "Year" > '2001' AND "Broadsound" > '6,843' | wikisql |
CREATE TABLE table_name_52 (
score VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score that has an Attendance of 4 679?
| SELECT score FROM table_name_52 WHERE attendance = "4 679" | sql_create_context |
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country 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_result (
Competition... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type | nvbench |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | 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 '%Gender , Sexuality , and Premodern China%' OR course.description LIKE '%Gender , Sexuality , and... | advising |
CREATE TABLE table_name_35 (
rank VARCHAR,
player VARCHAR,
titles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rankings are associated with giuseppe meazza holding over 3 titles?
| SELECT COUNT(rank) FROM table_name_35 WHERE player = "giuseppe meazza" AND titles > 3 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-70965')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME()... | eicu |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty... | SELECT building FROM faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_79695 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of cuts made for events played more than 3 times and unde... | SELECT COUNT("Cuts made") FROM table_79695 WHERE "Events" > '3' AND "Top-25" < '2' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_c... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'streptococcus group b') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') G... | mimic_iii |
CREATE TABLE table_16651 (
"#" real,
"Episode" text,
"Air Date" text,
"Rating" text,
"Share" real,
"Rating/Share 18\u201349" text,
"Viewers (m)" text,
"Timeslot Rank" real,
"Night Rank" text,
"Overall Rank" real
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "Viewers (m)" FROM table_16651 WHERE "Episode" = 'Legacy' | wikisql |
CREATE TABLE table_63453 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total rank and fc notes from South Africa?
| SELECT COUNT("Rank") FROM table_63453 WHERE "Notes" = 'fc' AND "Country" = 'south africa' | wikisql |
CREATE TABLE table_203_420 (
id number,
"#" number,
"stadium" text,
"capacity" number,
"city" text,
"home team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which city has the stadium that can hold the most people ?
| SELECT "city" FROM table_203_420 ORDER BY "capacity" DESC LIMIT 1 | squall |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Personal history of allergy to penicillin" | mimicsql_data |
CREATE TABLE table_67300 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows as the Time/Retired for Grid 8?
| SELECT "Time/Retired" FROM table_67300 WHERE "Grid" = '8' | wikisql |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '70036243187' AND t_kc22.AMOUNT > (SELECT MIN(t_kc22.AMOUNT) 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.ME... | css |
CREATE TABLE table_49485 (
"Rifle" text,
"Danish Krag-J\u00f8rgensen 1889" text,
"US Krag-J\u00f8rgensen M1892" text,
"Norwegian Krag-J\u00f8rgensen M1894" text,
"Japanese Type 38 Rifle" text,
"German Gewehr 98" text,
"British Lee-Enfield (data for late model)" text
)
-- Using valid SQLite... | SELECT "US Krag-J\u00f8rgensen M1892" FROM table_49485 WHERE "Norwegian Krag-J\u00f8rgensen M1894" = '126.8cm' | wikisql |
CREATE TABLE table_name_22 (
date VARCHAR,
type VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Type of 4-6-0, and a Number larger than 11?
| SELECT date FROM table_name_22 WHERE type = "4-6-0" AND number > 11 | sql_create_context |
CREATE TABLE Royal_Family (
Royal_Family_ID INTEGER,
Royal_Family_Details VARCHAR(255)
)
CREATE TABLE Locations (
Location_ID INTEGER,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Theme_Parks (
Theme_Park_ID INTEGER,
Theme_Park_Details VAR... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID | nvbench |
CREATE TABLE table_13619027_7 (
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the player with high assists on january 22?
| SELECT high_assists FROM table_13619027_7 WHERE date = "January 22" | sql_create_context |
CREATE TABLE table_54069 (
"Rank" real,
"Name" text,
"Location" text,
"State" text,
"Designer, Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is pine valley?
| SELECT "Location" FROM table_54069 WHERE "Name" = 'pine valley' | wikisql |
CREATE TABLE table_58802 (
"Song" text,
"International Jury" text,
"Lule\u00e5" text,
"Ume\u00e5" text,
"Sundsvall" text,
"Falun" text,
"Karlstad" text,
"\u00d6rebro" text,
"Norrk\u00f6ping" text,
"G\u00f6teborg" text,
"V\u00e4xj\u00f6" text,
"Malm\u00f6" text,
"Stock... | SELECT "\u00d6rebro" FROM table_58802 WHERE "Ume\u00e5" = '2' | wikisql |
CREATE TABLE table_name_56 (
constructor VARCHAR,
time_retired VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who constructed the car that has a Time/Retired of engine, and over 50 laps?
| SELECT constructor FROM table_name_56 WHERE time_retired = "engine" AND laps > 50 | sql_create_context |
CREATE TABLE table_204_957 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | SELECT SUM("games") FROM table_204_957 | squall |
CREATE TABLE table_60109 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Attendance, when Date is 'Febr... | SELECT MIN("Attendance") FROM table_60109 WHERE "Date" = 'february 4' AND "Points" < '57' | wikisql |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGR... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '抽动秽语综合征' GROUP BY person_info.JGDM | css |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskSt... | SELECT LEFT(REPLACE(f.Comment, 'to http://', ''), STR_POSITION(REPLACE(f.Comment, 'to http://', ''), '/') - 1), LEFT(REPLACE(t.Comment, 'from http://', ''), STR_POSITION(REPLACE(t.Comment, 'from http://', ''), '/') - 1), COUNT(DISTINCT f.PostId) FROM PostHistory AS f JOIN PostHistory AS t ON f.PostId = t.PostId WHERE f... | sede |
CREATE TABLE table_21013 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"GPU frequency" text,
"L2 cache" text,
"I/O bus" text,
"Memory" text,
"Voltage" text,
"TDP" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" ... | SELECT "TDP" FROM table_21013 WHERE "Release price ( USD )" = '$72' | wikisql |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Fluoxetine HCl" | mimicsql_data |
CREATE TABLE candidate_assessments (
candidate_id VARCHAR,
asessment_outcome_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find id of candidates whose assessment code is 'Pass'?
| SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass" | sql_create_context |
CREATE TABLE table_1220 (
"Year" real,
"Class" text,
"Team name" text,
"Bike" text,
"Riders" text,
"Races" text,
"Wins" real,
"Podiums" real,
"Poles" real,
"F.laps" real,
"Points" text,
"Pos." text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Riders" FROM table_1220 WHERE "Team name" = 'JiR Team Scot MotoGP' | wikisql |
CREATE TABLE table_5657 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Tournament of the Tour Championship take place?
| SELECT "Date" FROM table_5657 WHERE "Tournament" = 'the tour championship' | wikisql |
CREATE TABLE table_305 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the hometown for the player that attended Shanley High School?
| SELECT "Hometown" FROM table_305 WHERE "School" = 'Shanley High School' | wikisql |
CREATE TABLE table_204_44 (
id number,
"face value" number,
"\u20ac0.01" number,
"\u20ac0.02" number,
"\u20ac0.05" number,
"\u20ac0.10" number,
"\u20ac0.20" number,
"\u20ac0.50" number,
"\u20ac1.00" number,
"\u20ac2.00" number
)
-- Using valid SQLite, answer the following quest... | SELECT "\u20ac1.00" FROM table_204_44 WHERE "face value" = 2011 | squall |
CREATE TABLE table_17118657_10 (
date VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which date was the location/attendance UIC Pavilion 3,829 respectively?
| SELECT date FROM table_17118657_10 WHERE location_attendance = "UIC Pavilion 3,829" | sql_create_context |
CREATE TABLE table_3551 (
"Year" real,
"Timeslot" text,
"Network" text,
"Episodes" real,
"Viewers (in millions/overall)" text,
"Viewers (in millions/target group 14-49)" text,
"Market share (overall)" text,
"Market share (target group 14-49)" text
)
-- Using valid SQLite, answer the fo... | SELECT "Market share (overall)" FROM table_3551 WHERE "Viewers (in millions/overall)" = '1.83' | wikisql |
CREATE TABLE table_name_68 (
mountain_range VARCHAR,
mountain_peak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which mountain range contains Sierra Blanca Peak?
| SELECT mountain_range FROM table_name_68 WHERE mountain_peak = "sierra blanca peak" | sql_create_context |
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 demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.name = "Richard Gundlach" | mimicsql_data |
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID... | SELECT T1.Participant_Type_Code, SUM(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code ORDER BY SUM(COUNT(*)) DESC | nvbench |
CREATE TABLE table_62945 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average number of silver medals for germany (GER) having more than 3 bronze?
| SELECT AVG("Silver") FROM table_62945 WHERE "Nation" = 'germany (ger)' AND "Bronze" > '3' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-198501' AND NOT patient.hospitaldischargetime IS NULL ORDER B... | eicu |
CREATE TABLE Visitors (
Tourist_ID INTEGER,
Tourist_Details VARCHAR(255)
)
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Royal_Family (
Royal_Family_ID INTEGER,
Royal_Family_Details VARCHAR(255)
)
CREATE TABLE Museums (
Museum_ID INTEGER,
Museum_Detail... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY Visit_Date DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Hydrocortisone Na Succ." | mimicsql_data |
CREATE TABLE table_58002 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city of license has a Frequency under 107.7, and a call sign of... | SELECT "City of license" FROM table_58002 WHERE "Frequency MHz" < '107.7' AND "Call sign" = 'w247aq' | wikisql |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE EN... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION, EMP_FNAME ORDER BY EMP_FNAME | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.