instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_65 (
round INTEGER,
player VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a Player of dan chicoine, and a Pick larger than 23?
| SELECT AVG(round) FROM table_name_65 WHERE player = "dan chicoine" AND pick > 23 | sql_create_context |
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What a... | SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name | spider |
CREATE TABLE table_name_7 (
artist VARCHAR,
draw VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which artist has a draw higher than 4 and fewer than 5 points?
| SELECT artist FROM table_name_7 WHERE draw > 4 AND points < 5 | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admis... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 99647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | mimic_iii |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '谵妄' AND jyjgzbb.JCZBDM = '976714' | css |
CREATE TABLE table_25445 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many opponents have wimbledon (2) as the championship?
| SELECT COUNT("Opponents") FROM table_25445 WHERE "Championship" = 'Wimbledon (2)' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 AND jybgb.YLJGDM = jy... | css |
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.JCRGH, jyjgzbb.JCRXM 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 mzjzj... | css |
CREATE TABLE table_name_30 (
name VARCHAR,
themed_area VARCHAR,
manufacturer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the dreamworks experience from Ferrari?
| SELECT name FROM table_name_30 WHERE themed_area = "dreamworks experience" AND manufacturer = "ferrari" | sql_create_context |
CREATE TABLE table_name_34 (
peak VARCHAR,
hk_viewers VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entries have a HK viewers of 2.23 million, and a Rank below 2?
| SELECT COUNT(peak) FROM table_name_34 WHERE hk_viewers = "2.23 million" AND rank > 2 | sql_create_context |
CREATE TABLE table_75562 (
"Name" text,
"Pada 1" text,
"Pada 2" text,
"Pada 3" text,
"Pada 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pada 3 has a Pada 1 of te?
| SELECT "Pada 3" FROM table_75562 WHERE "Pada 1" = 'टे te' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items... | mimic_iii |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDat... | SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE CHARACTER_MAXIMUM_LENGTH > 0 | sede |
CREATE TABLE table_18025024_7 (
ncaat_record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the June 21 ncaat baseball record for Fresno State Bulldogs?
| SELECT ncaat_record FROM table_18025024_7 WHERE date = "June 21" | sql_create_context |
CREATE TABLE table_9568 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds was the fight at UFC 34?
| SELECT SUM("Round") FROM table_9568 WHERE "Event" = 'ufc 34' | wikisql |
CREATE TABLE table_name_6 (
nvr_page VARCHAR,
home_port VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the NVR Page of the ship with a Home Port of Sasebo, Japan?
| SELECT nvr_page FROM table_name_6 WHERE home_port = "sasebo, japan" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | 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 = '006-47961')) AND medication.drugname = 'glucagon 1 mg (1 unit) inj' AND STRFTI... | eicu |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HMP' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean... | SELECT Id AS "user_link", * FROM Users WHERE Users.Reputation = 1 AND Users.Id > 1 AND (DownVotes > 0 OR Id IN (SELECT UserId FROM Badges WHERE Name = 'Explainer')) ORDER BY Users.DisplayName | sede |
CREATE TABLE table_43547 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game has valiquette as the decision, with @ los angeles kings as the opponent?
| SELECT "Game" FROM table_43547 WHERE "Decision" = 'valiquette' AND "Opponent" = '@ los angeles kings' | wikisql |
CREATE TABLE table_name_27 (
played INTEGER,
drawn VARCHAR,
first_game VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of matches played that has a year of first match before 2000, fewer than 21 lost, and 0 drawn?
| SELECT SUM(played) FROM table_name_27 WHERE first_game < 2000 AND lost < 21 AND drawn < 0 | sql_create_context |
CREATE TABLE table_54675 (
"Year" real,
"Pick" text,
"Player name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the year for defensive tackle and college of lsu
| SELECT "Year" FROM table_54675 WHERE "Position" = 'defensive tackle' AND "College" = 'lsu' | wikisql |
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price) | nvbench |
CREATE TABLE table_13128 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Goals ... | SELECT MAX("Goals For") FROM table_13128 WHERE "Team" = 'congleton town' AND "Lost" > '11' | wikisql |
CREATE TABLE table_74837 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the venue for staines town
| SELECT "Venue" FROM table_74837 WHERE "Opponent" = 'staines town' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Rev... | SELECT Users.Id AS "user_link", Posts.Title AS "posts_link", 'http://english.stackexchange.com/questions/' + CAST(Posts.Id AS TEXT), Posts.LastEditDate, Posts.CreationDate, Posts.ClosedDate, Posts.AcceptedAnswerId FROM Users INNER JOIN Posts ON Users.Id = OwnerUserId WHERE Reputation >= 1000 AND Title != '' AND Posts.C... | sede |
CREATE TABLE table_name_51 (
replaced_by VARCHAR,
date_of_vacancy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the replacement when the date of vacancy is 1 september 2008?
| SELECT replaced_by FROM table_name_51 WHERE date_of_vacancy = "1 september 2008" | sql_create_context |
CREATE TABLE table_10788 (
"Player" text,
"Att." real,
"Yards" real,
"Avg." real,
"Long" real,
"FumL" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the longest Long for santana moss and Att more than 1
| SELECT MIN("Long") FROM table_10788 WHERE "Player" = 'santana moss' AND "Att." > '1' | wikisql |
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.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON 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.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj... | css |
CREATE TABLE table_5413 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest season wth a Win of 1 and a Position that is 8th?
| SELECT MAX("Season") FROM table_5413 WHERE "Wins" = '1' AND "Position" = '8th' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.icd9_code = "99702" | mimicsql_data |
CREATE TABLE table_12141496_1 (
alt_name VARCHAR,
id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many alt names does 1964-011a have?
| SELECT COUNT(alt_name) FROM table_12141496_1 WHERE id = "1964-011A" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Bacteremia" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'protein - csf' AND STRFTIME('%y', lab.labresulttime) >= '2104') | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '华文康' AND NOT ... | css |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '褚伟晔' AND hz_info.YLJGDM = '4466465' AND NOT zyjzjlb.CYKSMC LIKE '%神外%' | css |
CREATE TABLE table_66706 (
"Year" text,
"Births (000s)" real,
"Deaths" real,
"Natural Growth" real,
"Total Fertility Rate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the amount of Births (000s) that had a death rate larger than 7.6, and... | SELECT SUM("Births (000s)") FROM table_66706 WHERE "Deaths" > '7.6' AND "Year" = '1990-2009' | wikisql |
CREATE TABLE table_1966 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Events" real,
"Reset Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of points for number 6
| SELECT COUNT("Points") FROM table_1966 WHERE "#" = '6' | wikisql |
CREATE TABLE table_27994983_8 (
juries INTEGER,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many juries are there for Brolle?
| SELECT MAX(juries) FROM table_27994983_8 WHERE artist = "Brolle" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚安易' AND t_kc22.STA_DATE BETWEEN '2010-08-20' AND '2020-03-29' AND t_kc22.SELF_PAY_AMO > 6905.35 | css |
CREATE TABLE Lessons (
staff_id VARCHAR
)
CREATE TABLE Staff (
staff_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average lesson price taught by staff with first name as Janessa and last name as Sa... | SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-4181')) AND medication.routeadmin = 'intravenous' AND STRFTIME(... | eicu |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Cla... | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements GROUP BY Date_Claim_Settled ORDER BY Date_Claim_Settled DESC | nvbench |
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Participants (
Participant_ID... | SELECT T1.Participant_Type_Code, AVG(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code | nvbench |
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Ref_Detention_Type (
... | SELECT address_id, monthly_rental FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_28634206_1 (
total INTEGER,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many placements in total does russia have?
| SELECT MAX(total) FROM table_28634206_1 WHERE country = "Russia" | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TI... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_20168 (
"Round" real,
"Choice" real,
"Player name" text,
"Position" text,
"Height" text,
"Weight" real,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position(s) do players from florida state play?
| SELECT "Position" FROM table_20168 WHERE "College" = 'Florida State' | wikisql |
CREATE TABLE table_name_19 (
ground VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the ground for away team essendon?
| SELECT ground FROM table_name_19 WHERE away_team = "essendon" | sql_create_context |
CREATE TABLE table_6027 (
"Year" real,
"Round" text,
"Series" text,
"Games covered" text,
"Play-by-play" text,
"Colour commentator (s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Games covered had a round of divisional finals?
| SELECT "Games covered" FROM table_6027 WHERE "Round" = 'divisional finals' | wikisql |
CREATE TABLE table_name_89 (
total INTEGER,
gold INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest medal total with less than 3 gold medals?
| SELECT MIN(total) FROM table_name_89 WHERE gold < 3 | sql_create_context |
CREATE TABLE table_47030 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game w... | SELECT "Record" FROM table_47030 WHERE "Game" > '24' AND "Date" = 'december 19' | wikisql |
CREATE TABLE table_name_38 (
set_2 VARCHAR,
set_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Set 1 of 25 20, what was Set 2?
| SELECT set_2 FROM table_name_38 WHERE set_1 = "25–20" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number... | SELECT * FROM Users LIMIT 1000000 | sede |
CREATE TABLE table_204_243 (
id number,
"year" number,
"album" text,
"song" text,
"duration" text,
"artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what album was previous to one dream ?
| SELECT "album" FROM table_204_243 WHERE id = (SELECT id FROM table_204_243 WHERE "song" = '"one dream"') - 1 | squall |
CREATE TABLE table_1341549_10 (
incumbent VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the incumbent for 1954
| SELECT incumbent FROM table_1341549_10 WHERE first_elected = "1954" | sql_create_context |
CREATE TABLE table_name_99 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2011, when 2012 is 'A', and when Tournament is 'French Open'?
| SELECT 2011 FROM table_name_99 WHERE 2012 = "a" AND tournament = "french open" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87530)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric nasogastri... | mimic_iii |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE student (
ID varchar(5... | SELECT year, COUNT(*) FROM section GROUP BY year ORDER BY year 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "15" AND diagnoses.short_title = "Respiratory distress syn" | mimicsql_data |
CREATE TABLE table_1030 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was herb graver a starter?
| SELECT "Starter" FROM table_1030 WHERE "Player" = 'Herb Graver' | wikisql |
CREATE TABLE table_32775 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The safety position is represented in the draft by which colleges?
| SELECT "College" FROM table_32775 WHERE "Position" = 'safety' | wikisql |
CREATE TABLE table_name_59 (
city VARCHAR,
icao VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has an ICAO of Kiah?
| SELECT city FROM table_name_59 WHERE icao = "kiah" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | SELECT CONCAT('id', 'comment_link') FROM Comments WHERE Text LIKE 'mysql_*' | sede |
CREATE TABLE table_204_262 (
id number,
"rank" number,
"athlete" text,
"time" text,
"notes" text,
"q" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the time of the person who finished first ?
| SELECT "time" FROM table_204_262 WHERE "rank" = 1 | squall |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE professor (
emp_num number,
dep... | SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code | spider |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Calcium, Total" | mimicsql_data |
CREATE TABLE table_58554 (
"Country" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total swimsuit number with gowns larger than 9.48 with interviews larger than 8.9... | SELECT COUNT("Swimsuit") FROM table_58554 WHERE "Evening Gown" > '9.48' AND "Country" = 'florida' AND "Interview" > '8.94' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_fro... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_nam... | atis |
CREATE TABLE table_204_117 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did they finish above 5th place in division 2 ... | SELECT COUNT(*) FROM table_204_117 WHERE "position" < 5 AND "division" = 2 AND "level" = 3 | squall |
CREATE TABLE table_name_98 (
result_f___a VARCHAR,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- hat is the Result F A when they played against Leeds United?
| SELECT result_f___a FROM table_name_98 WHERE opponents = "leeds united" | sql_create_context |
CREATE TABLE table_name_80 (
finish VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the finish of the player who had a total of 282?
| SELECT finish FROM table_name_80 WHERE total = 282 | sql_create_context |
CREATE TABLE table_77015 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date does Yuji Tachikawa have the fa... | SELECT "Date" FROM table_77015 WHERE "Fastest Lap" = 'yuji tachikawa' AND "Round" = '1' | wikisql |
CREATE TABLE table_name_70 (
year INTEGER,
overall_pick VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Jordan Hill picked overall number 8?
| SELECT MIN(year) FROM table_name_70 WHERE overall_pick = "8" AND name = "jordan hill" | sql_create_context |
CREATE TABLE table_10051 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country with a 66-70-69=205 score?
| SELECT "Country" FROM table_10051 WHERE "Score" = '66-70-69=205' | wikisql |
CREATE TABLE table_73708 (
"Model" text,
"Launch" text,
"Model Number" text,
"Code name" text,
"Fab ( nm )" text,
"Bus interface" text,
"Memory ( MiB )" text,
"Core clock ( MHz )" text,
"Memory clock ( MHz )" text,
"Config core 1" text,
"Pixel ( GP /s)" text,
"Texture ( G... | SELECT "Bus type" FROM table_73708 WHERE "Texture ( GT /s)" = 'Fillrate' | wikisql |
CREATE TABLE table_14752049_1 (
country VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a rank of 5?
| SELECT country FROM table_14752049_1 WHERE rank = 5 | sql_create_context |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY COUNT(LName) | nvbench |
CREATE TABLE table_name_68 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did they have a record of 12-17?
| SELECT date FROM table_name_68 WHERE record = "12-17" | sql_create_context |
CREATE TABLE table_27765443_2 (
cpu_type VARCHAR,
period_of_operation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the cpu type for june 2005 - april 2009
| SELECT cpu_type FROM table_27765443_2 WHERE period_of_operation = "June 2005 - April 2009" | sql_create_context |
CREATE TABLE table_204_928 (
id number,
"year" number,
"album" text,
"territory" text,
"label" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- five and jezebel are apart of which label ?
| SELECT "label" FROM table_204_928 WHERE "album" = 'five' | squall |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), '... | eicu |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hemorrhage complic proc') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65124) AND DATETIME(diagnoses... | mimic_iii |
CREATE TABLE table_24584486_1 (
team VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was he on the year he had 38 points?
| SELECT team FROM table_24584486_1 WHERE points = 38 | sql_create_context |
CREATE TABLE table_name_21 (
transfer_window VARCHAR,
moving_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the transfer window with a moving from of fenerbah e?
| SELECT transfer_window FROM table_name_21 WHERE moving_from = "fenerbahçe" | sql_create_context |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author... | SELECT middle_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjz... | css |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'lorazepam inj') | 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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE table_23293785_2 (
sf_round INTEGER,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest value for SF round for the country of England?
| SELECT MAX(sf_round) FROM table_23293785_2 WHERE country = "England" | sql_create_context |
CREATE TABLE table_71457 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine \u2020" text,
"Tyre" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tyre is on the car driven by Pedro de la Rosa?
| SELECT "Tyre" FROM table_71457 WHERE "Driver" = 'pedro de la rosa' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '李弘伟' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2016-05-19') | css |
CREATE TABLE table_name_35 (
total__000s_ VARCHAR,
germany VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the amount of 000s when Germany had 16.6?
| SELECT total__000s_ FROM table_name_35 WHERE germany = 16.6 | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | 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.course_id WHERE (semester.semester = ... | advising |
CREATE TABLE table_32752 (
"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 is the date of the game when the venue is M... | SELECT "Date" FROM table_32752 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | SELECT p.CreationDate, CASE WHEN (2 = p.PostTypeId) THEN 'Answer' ELSE 'Question' END AS PostType, p.Score, CASE WHEN (2 = p.PostTypeId) THEN t.Title ELSE p.Title END AS QuestionTitle, p.Body, p.Id AS "post_link" FROM Posts AS p LEFT OUTER JOIN Posts AS t ON (p.ParentId = t.Id) WHERE 1 = 1 AND p.CreationDate >= DATEADD... | sede |
CREATE TABLE table_2613 (
"Stage" real,
"Stage winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Malaysian rider classification" text,
"Team classification" text,
"Malaysian team classification" text
)
-- Using valid SQLite, an... | SELECT "Points classification" FROM table_2613 WHERE "Stage" = '4' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime tim... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15125) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_204_793 (
id number,
"call-sign" text,
"location" text,
"rf" number,
"psip" number,
"programming" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many jstations have an rf of at least 29 ?
| SELECT COUNT(*) FROM table_204_793 WHERE "rf" >= 29 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.