instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id num... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.long_title = "Incision of vessel, abdominal arteries" | mimicsql_data |
CREATE TABLE table_name_77 (
losses INTEGER,
club VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Cobden has more than 1487 against and what average of losses?
| SELECT AVG(losses) FROM table_name_77 WHERE club = "cobden" AND against > 1487 | sql_create_context |
CREATE TABLE table_name_58 (
start_term INTEGER,
end_term VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Start term with a 1912 end term?
| SELECT AVG(start_term) FROM table_name_58 WHERE end_term = 1912 | sql_create_context |
CREATE TABLE table_name_79 (
director VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the movie The Star Packer?
| SELECT director FROM table_name_79 WHERE title = "the star packer" | sql_create_context |
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 t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6176731' AND t_kc21.IN_HOSP_DATE BETWEEN '2009-12-18' AND '2011-08-05' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Bar char... | SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY Publication_Date | nvbench |
CREATE TABLE table_7605 (
"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.
-- Which Tie has a Score of 5 1?
| SELECT "Tie no" FROM table_7605 WHERE "Score" = '5–1' | wikisql |
CREATE TABLE table_25716399_1 (
written_by VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode where the original air date is july20,2007?
| SELECT written_by FROM table_25716399_1 WHERE original_air_date = "July20,2007" | sql_create_context |
CREATE TABLE table_name_41 (
byes VARCHAR,
losses VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of byes that has 13 losses and wins less than 5?
| SELECT COUNT(byes) FROM table_name_41 WHERE losses = 13 AND wins < 5 | sql_create_context |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '器质性精神综合征' AND jyjgzbb.JCZBMC = ... | css |
CREATE TABLE table_name_12 (
position INTEGER,
name VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest position when the name is esv t rkheim, and Drawn more than 0?
| SELECT MIN(position) FROM table_name_12 WHERE name = "esv türkheim" AND drawn > 0 | 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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_... | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_56 (
week INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average week for result of l 28 17
| SELECT AVG(week) FROM table_name_56 WHERE result = "l 28–17" | sql_create_context |
CREATE TABLE table_25474825_1 (
description VARCHAR,
software VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the description of the intact software?
| SELECT description FROM table_25474825_1 WHERE software = "IntAct" | sql_create_context |
CREATE TABLE table_name_77 (
surface VARCHAR,
outcome VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Surface when Todd Woodbridge was the runner-up, and a Date of 24 february 1997?
| SELECT surface FROM table_name_77 WHERE outcome = "runner-up" AND date = "24 february 1997" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE a... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'primary lung cancer - small cell ca' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELE... | eicu |
CREATE TABLE table_name_56 (
streak VARCHAR,
game INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Streak has a Game larger than 49?
| SELECT streak FROM table_name_56 WHERE game > 49 | sql_create_context |
CREATE TABLE table_name_34 (
ubigeo INTEGER,
province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Chep n's average UBIGEO?
| SELECT AVG(ubigeo) FROM table_name_34 WHERE province = "chepén" | sql_create_context |
CREATE TABLE table_name_81 (
played VARCHAR,
tries_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Played, when Tries Against is '63'?
| SELECT played FROM table_name_81 WHERE tries_against = "63" | sql_create_context |
CREATE TABLE table_21021796_1 (
torque VARCHAR,
stroke VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the torque possible when the stroke is 88.4mm?
| SELECT torque FROM table_21021796_1 WHERE stroke = "88.4mm" | sql_create_context |
CREATE TABLE table_62469 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Parish (Prestegjeld) was built in 1907?
| SELECT "Parish (Prestegjeld)" FROM table_62469 WHERE "Year Built" = '1907' | wikisql |
CREATE TABLE table_name_90 (
builder VARCHAR,
works_number VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the builder for 4/1906 and works number more than 199
| SELECT builder FROM table_name_90 WHERE works_number > 199 AND date = "4/1906" | sql_create_context |
CREATE TABLE policies (
policy_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of records of each policy type and its type code.
| SELECT policy_type_code, COUNT(*) FROM policies GROUP BY policy_type_code | sql_create_context |
CREATE TABLE table_72226 (
"Member" text,
"Week Arrived On Main Island" text,
"Week Sent To Third Island" text,
"Original Tribe" text,
"Tribe They Chose To Win" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many members arrived on the main isla... | SELECT COUNT("Member") FROM table_72226 WHERE "Week Arrived On Main Island" = '4' | wikisql |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
-- Using valid SQLite, answer the following que... | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee | nvbench |
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 transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15257 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND NOT transfers.careunit IS NULL ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_64847 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner at Milan Circuit Race?
| SELECT "Winner" FROM table_64847 WHERE "Course" = 'milan circuit race' | wikisql |
CREATE TABLE table_12119 (
"Mininera DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE HIGHEST WINS WITH AGAINST SMALLER THAN 924, LOSSES SMALLER THAN 2?
| SELECT MAX("Wins") FROM table_12119 WHERE "Against" < '924' AND "Losses" < '2' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | SELECT DisplayName, COUNT(*) AS number FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id GROUP BY DisplayName ORDER BY number DESC | sede |
CREATE TABLE table_203_305 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- list each player drafted from canada .
| SELECT "player" FROM table_203_305 WHERE "nationality" = 'canada' | squall |
CREATE TABLE table_42156 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Series in 2009?
| SELECT "Series" FROM table_42156 WHERE "Season" = '2009' | wikisql |
CREATE TABLE table_name_50 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when the away team was carlisle united?
| SELECT date FROM table_name_50 WHERE away_team = "carlisle united" | sql_create_context |
CREATE TABLE table_30578 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is listed when the college/junior/club team... | SELECT "Nationality" FROM table_30578 WHERE "College/junior/club team" = 'Oshawa Generals (OHL)' | wikisql |
CREATE TABLE table_name_18 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the away team that played home team Geelong?
| SELECT away_team AS score FROM table_name_18 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '029-27704' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_name_20 (
country VARCHAR,
airport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has the Narita International Airport?
| SELECT country FROM table_name_20 WHERE airport = "narita international airport" | sql_create_context |
CREATE TABLE table_14655 (
"City" text,
"Province/Region" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has an IATA of tsa?
| SELECT "City" FROM table_14655 WHERE "IATA" = 'tsa' | wikisql |
CREATE TABLE table_name_89 (
played INTEGER,
lost VARCHAR,
goal_difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number played when there were less than 13 losses and a goal difference of +46?
| SELECT MAX(played) FROM table_name_89 WHERE lost < 13 AND goal_difference = "+46" | sql_create_context |
CREATE TABLE dependent (
Dependent_name VARCHAR,
relationship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- find all dependent names who have a spouse relation with some employee.
| SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse' | sql_create_context |
CREATE TABLE table_name_52 (
constructor VARCHAR,
engine_† VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What constructor has an engine of cosworth cr-2 and a driver of luciano burti?
| SELECT constructor FROM table_name_52 WHERE engine_† = "cosworth cr-2" AND driver = "luciano burti" | sql_create_context |
CREATE TABLE table_204_886 (
id number,
"rank" number,
"swimmer" text,
"country" text,
"time" text,
"note" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many competitors from venezuela qualified for the final ?
| SELECT COUNT("swimmer") FROM table_204_886 WHERE "country" = 'venezuela' | squall |
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 bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType | nvbench |
CREATE TABLE table_29005 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the nhl team for the player john maclean?
| SELECT "NHL team" FROM table_29005 WHERE "Player" = 'John MacLean' | wikisql |
CREATE TABLE table_name_42 (
original_name VARCHAR,
singer_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original name for the song performed by Brad Kavanagh?
| SELECT original_name FROM table_name_42 WHERE singer_s_ = "brad kavanagh" | sql_create_context |
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 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 = '011-55939')) AND diagnosis.diagnosisname = 'hyperglycemia - stres... | eicu |
CREATE TABLE table_name_73 (
mountain_peak VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the mountain peak when the location is 37.5775 n 105.4856 w?
| SELECT mountain_peak FROM table_name_73 WHERE location = "37.5775°n 105.4856°w" | sql_create_context |
CREATE TABLE table_46332 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which the highest Round has a Player of mike williams, and a Pick # larger than 4?
| SELECT MAX("Round") FROM table_46332 WHERE "Player" = 'mike williams' AND "Pick #" > '4' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%france%' OR UPPER(Location) LIKE '%france' ORDER BY Reputation DESC LIMIT 2500 | sede |
CREATE TABLE gwyjzb (
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '3153321' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-02-17' AND '2015-11-04' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 29 UNION SELECT fg... | css |
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE ref_characteristic_types (
... | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_80283 (
"Player" text,
"Height" real,
"Position" text,
"Year born" real,
"Current Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does Mario Kasun play?
| SELECT "Position" FROM table_80283 WHERE "Player" = 'mario kasun' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | 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 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.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb... | css |
CREATE TABLE table_45684 (
"Wicket" text,
"Runs" text,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the batting team in the 2006 season?
| SELECT "Batting team" FROM table_45684 WHERE "Season" = '2006' | wikisql |
CREATE TABLE table_35054 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round was Robert Deciantis taken in?
| SELECT "Round" FROM table_35054 WHERE "Player" = 'robert deciantis' | wikisql |
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 MIN(T1.duration), MIN(T2.rating) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY MIN(T1.duration) | 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 mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
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.language = "SPAN" AND demographic.dob_year < "2074" | mimicsql_data |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE video_games (
gameid number,
gname text,
... | SELECT DISTINCT gtype FROM video_games | spider |
CREATE TABLE College (
cName VARCHAR,
enr VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.
| SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA" | sql_create_context |
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_diagnoses (
row_id number,
icd9_co... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_23292220_13 (
scores VARCHAR,
seans_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on the episode that had Russell Kane and Louise Redknapp on Sean's team?
| SELECT scores FROM table_23292220_13 WHERE seans_team = "Russell Kane and Louise Redknapp" | sql_create_context |
CREATE TABLE table_2208838_4 (
team VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had an average of 20.4?
| SELECT team FROM table_2208838_4 WHERE average = "20.4" | sql_create_context |
CREATE TABLE table_24329520_4 (
fate_in_1832 VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the fate in 1832 for pembrokeshire
| SELECT fate_in_1832 FROM table_24329520_4 WHERE county = "Pembrokeshire" | sql_create_context |
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text,
acc_percent text,
acc_home text,
acc_road text,
all_games text,
all_games_percent number,
all_home text,
all_road text,
all_neutral text
)
CREATE TABLE university (... | SELECT t2.team_name, t2.acc_regular_season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded LIMIT 1 | spider |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '孙文心' AND IN_HOSP_DATE BETWEEN '2013-08-12' AND '2018-06-11' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_80 (
build_date VARCHAR,
prr_class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the build date for PRR Class gf30a?
| SELECT build_date FROM table_name_80 WHERE prr_class = "gf30a" | sql_create_context |
CREATE TABLE table_2581397_4 (
distance VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the distance in the Manikato Stakes race?
| SELECT distance FROM table_2581397_4 WHERE race = "Manikato Stakes" | sql_create_context |
CREATE TABLE table_31507 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many acres does the area of Lissagroom with Bandon as its poor law union cover?... | SELECT "Area( acres )" FROM table_31507 WHERE "Poor law union" = 'Bandon' AND "Townland" = 'Lissagroom' | wikisql |
CREATE TABLE Guests (
guest_first_name VARCHAR,
guest_last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the first names and last names of all guests
| SELECT guest_first_name, guest_last_name FROM Guests | sql_create_context |
CREATE TABLE table_178242_7 (
season VARCHAR,
the_mole VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season is it when Milouska was the show's mole ?
| SELECT season FROM table_178242_7 WHERE the_mole = "Milouska" | sql_create_context |
CREATE TABLE table_train_248 (
"id" int,
"anemia" bool,
"prostate_specific_antigen_psa" float,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"fasting_triglycerides" int,
"hyperlipidemia" bool,
"hgb" int,
"fasting_total_cholesterol" int,
"fasting_ldl_cholesterol" int,
"bo... | SELECT * FROM table_train_248 WHERE anemia = 1 OR hgb < 11 | criteria2sql |
CREATE TABLE table_31537 (
"Place" real,
"Title" text,
"Platform" text,
"Publisher" text,
"Units sold" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the average units sold for square enix
| SELECT AVG("Units sold") FROM table_31537 WHERE "Publisher" = 'square enix' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0101657' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) > 23 | css |
CREATE TABLE table_23585197_3 (
position VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the song thar genjor mcnell performed?
| SELECT position FROM table_23585197_3 WHERE artist = "Genjor McNell" | sql_create_context |
CREATE TABLE table_name_19 (
year VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year for the United Arab Emirates?
| SELECT COUNT(year) FROM table_name_19 WHERE country = "united arab emirates" | sql_create_context |
CREATE TABLE table_204_11 (
id number,
"year" number,
"fbs opponent" text,
"result" text,
"opponent's conference" text,
"opponent's head coach" text,
"charleston southern's head coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was t... | SELECT "charleston southern's head coach" FROM table_204_11 GROUP BY "charleston southern's head coach" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_31075 (
"Train Number" real,
"Train Name" text,
"Departure Pune" text,
"Arrival Lonavla" text,
"Frequency" text,
"Origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what time does the train that arrives in lonavla at 22:22... | SELECT "Departure Pune" FROM table_31075 WHERE "Arrival Lonavla" = '22:22' | wikisql |
CREATE TABLE table_3459 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Top 5" FROM table_3459 WHERE "Avg. Start" = '21.9' | wikisql |
CREATE TABLE table_20527 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What conference does Gonzaga Uni... | SELECT "Primary conference" FROM table_20527 WHERE "Institution" = 'Gonzaga University' | wikisql |
CREATE TABLE table_67637 (
"Episode" text,
"First aired" text,
"Entrepreneur(s)" text,
"Company or product name" text,
"Money requested (\u00a3)" text,
"Investing Dragon(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much money did James... | SELECT "Money requested (\u00a3)" FROM table_67637 WHERE "Entrepreneur(s)" = 'james seddon' | wikisql |
CREATE TABLE table_39275 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rank has a team of Suzuki with under 16 points?
| SELECT "Rank" FROM table_39275 WHERE "Team" = 'suzuki' AND "Points" < '16' | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" AND lab.fluid = "Cerebrospinal Fluid ... | mimicsql_data |
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 mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL... | css |
CREATE TABLE table_43987 (
"Name" text,
"Location" text,
"Country" text,
"Longest span" text,
"Pylons" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the third bridge over panama canal?
| SELECT "Location" FROM table_43987 WHERE "Name" = 'third bridge over panama canal' | wikisql |
CREATE TABLE table_37600 (
"Rank" real,
"Airport" text,
"Code (IATA/ICAO)" text,
"Total Cargo (Metric Tonnes)" real,
"% Change" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average total cargo in metric tonnes that has an 11.8% Change?
| SELECT AVG("Total Cargo (Metric Tonnes)") FROM table_37600 WHERE "% Change" = '11.8%' | wikisql |
CREATE TABLE table_36964 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Time of 2:31?
| SELECT "Opponent" FROM table_36964 WHERE "Time" = '2:31' | wikisql |
CREATE TABLE table_49351 (
"Average population (x 1000)" text,
"Live births 1" text,
"Deaths 1" text,
"Natural change 1" text,
"Crude birth rate (per 1000)" real,
"Crude death rate (per 1000)" real,
"Natural change (per 1000)" real
)
-- Using valid SQLite, answer the following questions fo... | SELECT SUM("Crude birth rate (per 1000)") FROM table_49351 WHERE "Live births 1" = '356 013' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Ascites" | mimicsql_data |
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 diagnoses_icd (
row_id number,
subject_i... | 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 = 6170) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FR... | mimic_iii |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... | atis |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY" | mimicsql_data |
CREATE TABLE table_11677100_18 (
school VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school did the player attend who's hometown was Montvale, NJ?
| SELECT school FROM table_11677100_18 WHERE hometown = "Montvale, NJ" | sql_create_context |
CREATE TABLE table_name_72 (
player VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player placed t10?
| SELECT player FROM table_name_72 WHERE place = "t10" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Hydronephrosis" | mimicsql_data |
CREATE TABLE table_name_82 (
wins INTEGER,
points VARCHAR,
draws VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of wins for club Cd Orense, with points greater than 36 and more than 4 draws?
| SELECT MAX(wins) FROM table_name_82 WHERE draws > 4 AND club = "cd orense" AND points > 36 | sql_create_context |
CREATE TABLE table_22883210_7 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total score for january 18?
| SELECT COUNT(score) FROM table_22883210_7 WHERE date = "January 18" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.