instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_28019988_2 (
series__number INTEGER,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What series number is the episode with production code bdf101?
| SELECT MAX(series__number) FROM table_28019988_2 WHERE production_code = "BDF101" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44842')) AND medication.drugname = 'nicoderm cq' AND STRFTIME('%y', me... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_30824 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Conference Player of the Year" FROM table_30824 WHERE "Tournament Winner" = 'Alabama State' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE... | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2104-12' | eicu |
CREATE TABLE table_name_30 (
skip VARCHAR,
second VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the skip with a second of Philippe Caux?
| SELECT skip FROM table_name_30 WHERE second = "philippe caux" | sql_create_context |
CREATE TABLE table_367 (
"Date of Issue" text,
"Theme" text,
"Denomination" text,
"Design" text,
"Illustration" text,
"Printing Process" text,
"Paper Type" text,
"First Day Cover Cancellation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT COUNT("Paper Type") FROM table_367 WHERE "Design" = 'Ian Drolet' | wikisql |
CREATE TABLE table_203_663 (
id number,
"country" text,
"zone" text,
"national federation" text,
"#gm" number,
"#fide" number,
"national championship" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country has the most #gm ?
| SELECT "country" FROM table_203_663 ORDER BY "#gm" DESC LIMIT 1 | squall |
CREATE TABLE table_7735 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the winning score of the tournament with Charles Coody as the runner-up?
| SELECT "Winning score" FROM table_7735 WHERE "Runner(s)-up" = 'charles coody' | wikisql |
CREATE TABLE bank (
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of different states which banks are located at.
| SELECT COUNT(DISTINCT state) FROM bank | sql_create_context |
CREATE TABLE table_13079788_3 (
date VARCHAR,
gtc_winner VARCHAR,
gt3_winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the date for gtc winners graeme mundy jamie smyth and gt3 winners hector lester tim mullen
| SELECT date FROM table_13079788_3 WHERE gtc_winner = "Graeme Mundy Jamie Smyth" AND gt3_winner = "Hector Lester Tim Mullen" | sql_create_context |
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '4879097' AND jybgb.BGRQ BETWEEN '2000-04-27' AND '2007-01-01' GROUP BY jybgb.KSBM HAVING COUNT(*) < 28 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ... | css |
CREATE TABLE table_2144436_1 (
population__2000_ INTEGER,
barangay VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the populati in 2000 for Panlicsian?
| SELECT MIN(population__2000_) FROM table_2144436_1 WHERE barangay = "Panlicsian" | sql_create_context |
CREATE TABLE table_name_72 (
bronze INTEGER,
nation VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of bronze for Canada and silver is less than 0?
| SELECT SUM(bronze) FROM table_name_72 WHERE nation = "canada" AND silver < 0 | sql_create_context |
CREATE TABLE table_name_98 (
time VARCHAR,
country VARCHAR,
rank VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time of the Belarus Player with a Rank larger than 2 and Notes of FB?
| SELECT time FROM table_name_98 WHERE rank > 2 AND notes = "fb" AND country = "belarus" | sql_create_context |
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 VoteTypes (
Id number,
Name text
)
C... | SELECT a.Id, a.ParentId, a.Score, a.OwnerUserId, q.Title, q.Tags, q.AnswerCount, q.FavoriteCount FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId INNER JOIN PostTags ON q.Id = PostTags.PostId INNER JOIN Users ON a.OwnerUserId = Users.Id WHERE PostTags.TagId IN (SELECT Id FROM Tags WHERE TagName IN (SELECT * F... | sede |
CREATE TABLE ASSESSMENT_NOTES (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many assessment notes are there in total?
| SELECT COUNT(*) FROM ASSESSMENT_NOTES | sql_create_context |
CREATE TABLE table_11884814_3 (
country VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country had the swimsuit score 9.67?
| SELECT country FROM table_11884814_3 WHERE swimsuit = "9.67" | sql_create_context |
CREATE TABLE table_name_58 (
games INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game has 2 points?
| SELECT MAX(games) FROM table_name_58 WHERE points = 2 | 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, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_name_76 (
size INTEGER,
ihsaa_class VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Size has an IHSAA Class of aa, and a Location of milan?
| SELECT SUM(size) FROM table_name_76 WHERE ihsaa_class = "aa" AND location = "milan" | sql_create_context |
CREATE TABLE table_46836 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Score" FROM table_46836 WHERE "Date" = 'january 26' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | WITH TagNames AS (SELECT t.Id FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.Id = pt.PostId AND p.PostTypeId = 1 WHERE p.Id NOT IN (SELECT p2.Id FROM Posts AS p2 INNER JOIN PostTags AS ptTarget ON p2.Id = ptTarget.PostId AND ptTarget.TagId = t.Id INNER JOIN PostTags AS ptNotTarge... | sede |
CREATE TABLE table_47508 (
"Team A" text,
"Team C" text,
"Team D" text,
"Team E" text,
"Team F" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is team E when Jason Manning is Team F?
| SELECT "Team E" FROM table_47508 WHERE "Team F" = 'jason manning' | 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_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0314561' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE table_name_20 (
college VARCHAR,
pick__number VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college(s) did the player(s) picked in round 4 with a pick number less than 98 play for?
| SELECT college FROM table_name_20 WHERE pick__number < 98 AND round = "round 4" | sql_create_context |
CREATE TABLE table_16146 (
"Rd" real,
"Name" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the Datsun Twin 200 race, what was the fastes... | SELECT "Fastest Lap" FROM table_16146 WHERE "Name" = 'Datsun Twin 200' | wikisql |
CREATE TABLE table_name_64 (
record VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record when Minnesota was the home team?
| SELECT record FROM table_name_64 WHERE home = "minnesota" | sql_create_context |
CREATE TABLE table_name_59 (
league VARCHAR,
playoffs VARCHAR,
the_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which league did not qualify for the Playoffs, and had a Year larger than 2008?
| SELECT league FROM table_name_59 WHERE playoffs = "did not qualify" AND the_year > 2008 | sql_create_context |
CREATE TABLE table_name_39 (
points VARCHAR,
team VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Herdez Competition's total points with a grid larger than 1?
| SELECT COUNT(points) FROM table_name_39 WHERE team = "herdez competition" AND grid > 1 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-49538') AND patient.unitdischargetime IS NULL) AND vitalperiodic... | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Left heart cardiac cath" | mimicsql_data |
CREATE TABLE table_204_126 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the first player on this chart ?
| SELECT "player" FROM table_204_126 WHERE id = 1 | squall |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '96134838030' | css |
CREATE TABLE table_33303 (
"Song" text,
"Release date" text,
"Release info" text,
"Formats" text,
"Album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which album had a release of heavenly (hvn95)?
| SELECT "Album" FROM table_33303 WHERE "Release info" = 'heavenly (hvn95)' | wikisql |
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.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_91 (
first_elected VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of the first elected year of the incumbent from the washington 8 district?
| SELECT COUNT(first_elected) FROM table_name_91 WHERE district = "washington 8" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE table_4156 (
"Regiment" text,
"Company" text,
"Company Commander" text,
"Date of Election/Commission" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many company commanders were commissioned or elected on November 12,... | SELECT COUNT("Company Commander") FROM table_4156 WHERE "Date of Election/Commission" = 'November 12, 1861' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description ... | SELECT COUNT(*) AS tag_count, Tags.TagName, Tags.Id FROM PostTags JOIN Tags ON Tags.Id = PostTags.TagId JOIN Posts ON PostTags.PostId = Posts.Id WHERE Posts.Id IN (SELECT PostId FROM PostTags WHERE TagId = 243) GROUP BY Tags.TagName, Tags.Id ORDER BY tag_count DESC | sede |
CREATE TABLE table_70411 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the lowest Decile that is coed?
| SELECT MIN("Decile") FROM table_70411 WHERE "Gender" = 'coed' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation, LastAccessDate, Age FROM Users WHERE LENGTH(Location) > 1 AND LOWER(Location) LIKE LOWER('%##Location##%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_69 (
prominence__m_ INTEGER,
elevation__m_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- COunt the sum of Prominence (m) of an Elevation (m) of 2,024?
| SELECT SUM(prominence__m_) FROM table_name_69 WHERE elevation__m_ = 2 OFFSET 024 | 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_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '姜玉石' AND t_kc22.STA_DATE BETWEEN '2004-07-19' AND '2019-01-14' AND t_kc22.SOC_SRT_DIRE_NM = '布洛芬片(糖衣)' | css |
CREATE TABLE table_30707 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Matchups/Results" text,
"Attendance" real,
"Payout ( US$ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of th... | SELECT "Date" FROM table_30707 WHERE "Matchups/Results" = 'Army 16, SMU 14' | wikisql |
CREATE TABLE table_62889 (
"Name" text,
"Tests" real,
"Club" text,
"Career caps" real,
"Tour Apps" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of career caps for a full back, when tour Apps is smaller than ... | SELECT COUNT("Career caps") FROM table_62889 WHERE "Position" = 'full back' AND "Tour Apps" < '29' | wikisql |
CREATE TABLE table_807 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Number of dances is 11 and competition finish ... | SELECT "Total" FROM table_807 WHERE "Number of dances" = '11' AND "Competition finish" > '2.0' | wikisql |
CREATE TABLE table_256286_14 (
no_votes INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most no votes
| SELECT MAX(no_votes) FROM table_256286_14 | sql_create_context |
CREATE TABLE table_204_487 (
id number,
"home team" text,
"score" text,
"visiting team" text,
"location" text,
"venue" text,
"door" text,
"surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the other team besides brazil to score 5 g... | SELECT "home team" FROM table_204_487 WHERE "home team" <> 'brazil' AND "score" = 5 | squall |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '0656795' AND BGRQ BETWEEN '2002-01-26' AND '2007-11-14' GROUP BY JCZBMC, JCZBJGDW | css |
CREATE TABLE table_name_7 (
attendance VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Attendance at the game against the Cincinnati Bengals?
| SELECT attendance FROM table_name_7 WHERE opponent = "cincinnati bengals" | sql_create_context |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | SELECT Grape, COUNT(Grape) FROM wine WHERE Price > 100 GROUP BY Grape | nvbench |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_32506 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team that scored 13.13 (91) in... | SELECT "Home team" FROM table_32506 WHERE "Crowd" > '10,000' AND "Home team score" = '13.13 (91)' | wikisql |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.itemid = "51375" | mimicsql_data |
CREATE TABLE table_67316 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record at the game against the Blue Jays with a loss of Batist... | SELECT "Record" FROM table_67316 WHERE "Opponent" = 'blue jays' AND "Loss" = 'batista (0–3)' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_39 (
no_5 VARCHAR,
no_4 VARCHAR,
no_8 VARCHAR,
no_10 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the No. 5 which has a No. 8 of logan, and a No. 10 of ethan, and a No. 4 of jacob?
| SELECT no_5 FROM table_name_39 WHERE no_8 = "logan" AND no_10 = "ethan" AND no_4 = "jacob" | sql_create_context |
CREATE TABLE table_11734041_11 (
player VARCHAR,
no_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player who's number is 3?
| SELECT player FROM table_11734041_11 WHERE no_s_ = "3" | sql_create_context |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality | nvbench |
CREATE TABLE table_26669939_1 (
host_city VARCHAR,
host_country VARCHAR,
edition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the host city of the 8th edition in the the host country of Croatia?
| SELECT host_city FROM table_26669939_1 WHERE host_country = "Croatia" AND edition = "8th" | sql_create_context |
CREATE TABLE table_53178 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition resulted in 2-0 score, hosted in Amman?
| SELECT "Competition" FROM table_53178 WHERE "Score" = '2-0' AND "Venue" = 'amman' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT p.AcceptedAnswerId AS "post_link", p.OwnerUserId AS "user_link" FROM Posts AS p INNER JOIN PostHistory AS e ON p.AcceptedAnswerId = e.PostId WHERE e.PostHistoryTypeId = 13 AND NOT p.OwnerUserId IS NULL AND p.AcceptedAnswerId NOT IN (SELECT v.PostId FROM Votes AS v WHERE v.VoteTypeId = 1) ORDER BY p.AcceptedAnswe... | sede |
CREATE TABLE table_13480 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mascot for the team smaller than 154 from 49 Marion?
| SELECT "Mascot" FROM table_13480 WHERE "Size" < '154' AND "County" = '49 marion' | wikisql |
CREATE TABLE table_name_41 (
pts INTEGER,
year VARCHAR,
engine VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1972, what was the highest number of points with a Ford engine and an entrant of Brooke Bond Oxo Team Surtees?
| SELECT MAX(pts) FROM table_name_41 WHERE engine = "ford" AND entrant = "brooke bond oxo team surtees" AND year = 1972 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'ammonia') | eicu |
CREATE TABLE table_test_20 (
"id" int,
"ejection_fraction_ef" int,
"anemia" bool,
"gender" string,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"left_main_coronary_artery_stenosis" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
... | SELECT * FROM table_test_20 WHERE anemia = 1 OR hemoglobin_a1c_hba1c < 8.5 | criteria2sql |
CREATE TABLE table_23832 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode tit... | SELECT "Written by" FROM table_23832 WHERE "Title" = 'The Morning After Job' | wikisql |
CREATE TABLE table_36721 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 2007 has 236 for 2006?
| SELECT "2007" FROM table_36721 WHERE "2006" = '236' | wikisql |
CREATE TABLE table_2273 (
"-Butadiene" text,
"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" text,
"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" text,
"\u0394H \u2021 /kcal mol \u22121" text,
"\u0394S \u2021 /cal mol \u22121 K \u22121" text
)
-- Using valid SQLite, answer the... | SELECT "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" FROM table_2273 WHERE "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" = '1.00' | wikisql |
CREATE TABLE table_203_171 (
id number,
"place\n(posicion)" number,
"team\n(equipo)" text,
"played\n(pj)" number,
"won\n(pg)" number,
"draw\n(pe)" number,
"lost\n(pp)" number,
"goals scored\n(gf)" number,
"goals conceded\n(gc)" number,
"+/-\n(dif.)" number,
"points\n(pts.)" n... | SELECT AVG("lost\n(pp)") FROM table_203_171 | squall |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "17519" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Suture of laceration of bladder" | mimicsql_data |
CREATE TABLE table_27293285_2 (
points_for VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points for did Munster have?
| SELECT points_for FROM table_27293285_2 WHERE club = "Munster" | sql_create_context |
CREATE TABLE table_55192 (
"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.
-- Which home team plays at Punt Road Oval?
| SELECT "Home team" FROM table_55192 WHERE "Venue" = 'punt road oval' | wikisql |
CREATE TABLE people (
person_id number,
first_name text,
middle_name text,
last_name text,
cell_mobile_number text,
email_address text,
login_name text,
password text
)
CREATE TABLE student_course_registrations (
student_id number,
course_id number,
registration_date time
)
... | SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121 | spider |
CREATE TABLE table_name_17 (
number_of_deputies INTEGER,
number_of_votes_received VARCHAR,
election_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was deputies with the lowest number of unknown received votes, in an election year after 1986?
| SELECT MIN(number_of_deputies) FROM table_name_17 WHERE number_of_votes_received = "unknown" AND election_date > 1986 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "WHITE - RUSSIAN" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_I... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) | nvbench |
CREATE TABLE table_73770 (
"Rank" real,
"Rank w/o Hydropower" real,
"State" text,
"% Renewable" text,
"% Renewable w/o Hydro" text,
"Renewable electricity (GW\u2022h)" real,
"Renewable electricity w/o Hydro (GW\u2022h)" real,
"Total electricity (GW\u2022h)" real
)
-- Using valid SQLite... | SELECT "% Renewable w/o Hydro" FROM table_73770 WHERE "State" = 'South Dakota' | wikisql |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
... | SELECT local_authority, id FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id ORDER BY local_authority | nvbench |
CREATE TABLE table_1773 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sogn)" text,
"Church Name" text,
"Year Built" real,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of churches named H yanger Kyrkj... | SELECT COUNT("Sub-Parish (Sogn)") FROM table_1773 WHERE "Church Name" = 'Høyanger kyrkje' | wikisql |
CREATE TABLE table_67932 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the opponent the White Sox and the record 18-13?
| SELECT "Date" FROM table_67932 WHERE "Opponent" = 'white sox' AND "Record" = '18-13' | wikisql |
CREATE TABLE table_42479 (
"Name" text,
"GP-GS" text,
"Effic" real,
"Att-Cmp-Int" text,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest avg/g that has an effic greater than 34.36, with wesley carroll as the name?
| SELECT MIN("Avg/G") FROM table_42479 WHERE "Effic" > '34.36' AND "Name" = 'wesley carroll' | wikisql |
CREATE TABLE table_name_95 (
league_cup INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest League Cup with a Player that is steed malbranque?
| SELECT MAX(league_cup) FROM table_name_95 WHERE player = "steed malbranque" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168) AND prescriptions.drug = 'phenytoin sodium' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-47 month') | mimic_iii |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | 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 = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'T... | atis |
CREATE TABLE table_11797 (
"Team" text,
"Seasons" text,
"Regular season" real,
"Tournament" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the highest total for the tournament more than 0 and regular season after 8
| SELECT MAX("Total") FROM table_11797 WHERE "Tournament" > '0' AND "Regular season" > '8' | wikisql |
CREATE TABLE table_2147588_4 (
successor VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When new york 8th is teh district who is the successor?
| SELECT successor FROM table_2147588_4 WHERE district = "New York 8th" | sql_create_context |
CREATE TABLE table_name_17 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team when North Melbourne was the home team?
| SELECT away_team FROM table_name_17 WHERE home_team = "north melbourne" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '55748768' AND hz_info.YLJGDM = '3373155' AND mzjzjlb.JZKSMC LIKE '%推拿%' | css |
CREATE TABLE table_46602 (
"Tournament" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"Career SR" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1989 res... | SELECT "1989" FROM table_46602 WHERE "1983" = 'a' AND "1987" = 'a' | wikisql |
CREATE TABLE table_18180 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first election year listed?
| SELECT MIN("First elected") FROM table_18180 | wikisql |
CREATE TABLE table_65187 (
"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 to par for mathew goggin?
| SELECT "To par" FROM table_65187 WHERE "Player" = 'mathew goggin' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number... | SELECT q.Id AS "post_link", q.ViewCount, q.CreationDate AS "asked", a.CreationDate AS "answered" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##user##' ORDER BY q.ViewCount DESC | sede |
CREATE TABLE table_name_93 (
races INTEGER,
pole VARCHAR,
season VARCHAR,
flaps VARCHAR,
podiums VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT ARE THE RACES WHEN FLAPS ARE ZERO, PODIUMS ARE LARGER THAN 0, SEASON IS 2008, AND POLE SMALLER TH... | SELECT SUM(races) FROM table_name_93 WHERE flaps = 0 AND podiums > 0 AND season = "2008" AND pole < 1 | sql_create_context |
CREATE TABLE betfront (
year number,
datetime time,
country text,
competion text,
match text,
home_opening number,
draw_opening number,
away_opening number,
home_closing number,
draw_closing number,
away_closing number
)
CREATE TABLE football_data (
season text,
date... | SELECT COUNT(*) FROM football_data WHERE psh <> "" AND psd <> "" AND psa <> "" | worldsoccerdatabase |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.