instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_482 (
"Season #" real,
"Series #" real,
"Title" text,
"Canadian airdate" text,
"U.S. airdate" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the Canadian air dates where the u.s. air date i... | SELECT "Canadian airdate" FROM table_482 WHERE "U.S. airdate" = 'May 1, 2009' | wikisql |
CREATE TABLE table_2562572_22 (
dominant_religion__2002_ VARCHAR,
cyrillic_name_other_names VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the dominant religion for
| SELECT dominant_religion__2002_ FROM table_2562572_22 WHERE cyrillic_name_other_names = "Станишић" | sql_create_context |
CREATE TABLE table_name_92 (
county VARCHAR,
r_bacon VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which county has 438 (4%) listed under R. Bacon?
| SELECT county FROM table_name_92 WHERE r_bacon = "438 (4%)" | sql_create_context |
CREATE TABLE table_name_41 (
john_edwards VARCHAR,
john_kerry VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is John Edwards, when John Kerry is '70%'?
| SELECT john_edwards FROM table_name_41 WHERE john_kerry = "70%" | sql_create_context |
CREATE TABLE table_name_54 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the match against Sanaz Marand?
| SELECT score FROM table_name_54 WHERE opponent = "sanaz marand" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT p.Id AS Id, p.Id AS "post_link", se.Id AS "suggested_edit_link" FROM SuggestedEdits AS se INNER JOIN SuggestedEditVotes AS sev ON sev.SuggestedEditId = se.Id INNER JOIN Posts AS p ON p.Id = se.PostId WHERE sev.UserId = '##UserId##' AND NOT se.RejectionDate IS NULL AND sev.VoteTypeId = 2 | sede |
CREATE TABLE table_34338 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many picks did the College of USC wind up getting?
| SELECT COUNT("Pick #") FROM table_34338 WHERE "College" = 'usc' | wikisql |
CREATE TABLE table_name_35 (
money___$__ VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Money ( $ ), when Score is '75-71-72-70=288'?
| SELECT money___$__ FROM table_name_35 WHERE score = 75 - 71 - 72 - 70 = 288 | sql_create_context |
CREATE TABLE table_35972 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a points average with 0 extra points and 0 field goals?
| SELECT AVG("Points") FROM table_35972 WHERE "Extra points" = '0' AND "Field goals" > '0' | 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 MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "BLADDER CANCER/SDA" | mimicsql_data |
CREATE TABLE table_69378 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had the attendance of 16,468 and lost?
| SELECT "Loss" FROM table_69378 WHERE "Attendance" = '16,468' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Posts.Id AS "post_link", Title, Posts.CreationDate, PostTypeId, AnswerCount, Tags, ViewCount, Score, OwnerUserId AS "user_link", DisplayName, LastActivityDate, LastEditDate, ClosedDate, Body FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.CreationDate >= CURRENT_TIMESTAMP() - 60 AND (Title LIKE '%... | sede |
CREATE TABLE table_203_661 (
id number,
"year" number,
"single" text,
"peak chart positions\nus mod" number,
"peak chart positions\nuk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long was it between losing streak almbum a... | SELECT ABS((SELECT "year" FROM table_203_661 WHERE "album" = 'losing streak') - (SELECT "year" FROM table_203_661 WHERE "album" = 'gnv fla')) | squall |
CREATE TABLE table_34916 (
"Country" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Skip has a Third of sara carlsson?
| SELECT "Skip" FROM table_34916 WHERE "Third" = 'sara carlsson' | wikisql |
CREATE TABLE table_name_58 (
player VARCHAR,
club_province VARCHAR,
date_of_birth__age_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player on the Bulls has a 6 May 1978 birthday?
| SELECT player FROM table_name_58 WHERE club_province = "bulls" AND date_of_birth__age_ = "6 may 1978" | sql_create_context |
CREATE TABLE table_3049 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" text,
"Points won" real,
"New points" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the competitor ranking with 900... | SELECT COUNT("Seed") FROM table_3049 WHERE "Points defending" = '900' | wikisql |
CREATE TABLE table_204_884 (
id number,
"medal" text,
"name" text,
"sport" text,
"event" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many gold medals did this country win during these olympics ?
| SELECT COUNT(*) FROM table_204_884 WHERE "medal" = 'gold' | squall |
CREATE TABLE table_3796 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the branding for callsign dypv?
| SELECT "Branding" FROM table_3796 WHERE "Callsign" = 'DYPV' | wikisql |
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 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '66990606' AND t_kc22.STA_DATE BETWEEN '2008-08-22' AND '2015-12-14' AND t_kc21.MED_SER_ORG_NO = '0896805' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_34 (
centre VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Centre has a Rank of 42?
| SELECT centre FROM table_name_34 WHERE rank = 42 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | SELECT jybgb.KSBM, jybgb.KSMC FROM jybgb WHERE jybgb.BGDH = '41571015009' | css |
CREATE TABLE table_name_64 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Player of bernard thompson?
| SELECT position FROM table_name_64 WHERE player = "bernard thompson" | sql_create_context |
CREATE TABLE table_67409 (
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date that 4,286 attended?
| SELECT "Date" FROM table_67409 WHERE "Attendance" = '4,286' | wikisql |
CREATE TABLE table_name_22 (
points INTEGER,
played VARCHAR,
goal_difference VARCHAR,
losses VARCHAR,
goals_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest points for positions with under 12 losses, goals against under 5... | SELECT MIN(points) FROM table_name_22 WHERE losses < 12 AND goals_against < 50 AND goal_difference > 11 AND played < 30 | sql_create_context |
CREATE TABLE table_73140 (
"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.
-- Name the incumbent for lost renomination republican hold
| SELECT "Incumbent" FROM table_73140 WHERE "Result" = 'Lost renomination Republican hold' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | SELECT chartevents.charttime 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 = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra... | mimic_iii |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
SALARY decimal(8,2),
CO... | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC | nvbench |
CREATE TABLE table_57132 (
"Dep." text,
"Chief town" text,
"Arrondissement" text,
"Population (1999)" text,
"Area (Square km)" real,
"Pop density" real,
"Cantons" real,
"Communes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many c... | SELECT AVG("Communes") FROM table_57132 WHERE "Cantons" > '10' AND "Area (Square km)" = '1,589' | wikisql |
CREATE TABLE table_61066 (
"State" text,
"City" text,
"Population" real,
"Violent Crime" text,
"Murder and Non-Negligent Manslaughter" real,
"Forcible Rape" text,
"Robbery" real,
"Aggravated Assault" real,
"Property Crime" text,
"Burglary" real,
"Larceny-Theft" text,
"Mot... | SELECT MIN("Burglary") FROM table_61066 WHERE "Population" > '832,901' AND "Murder and Non-Negligent Manslaughter" = '11.6' | wikisql |
CREATE TABLE table_name_47 (
attendance VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance when the opponent was the Houston Oilers?
| SELECT attendance FROM table_name_47 WHERE opponent = "houston oilers" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Subtrochanteric fx-close" AND prescriptions.route = "LEFT EYE" | mimicsql_data |
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 WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " | mimicsql_data |
CREATE TABLE table_name_13 (
attendance VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the Score was 4-10, what was the Attendance?
| SELECT attendance FROM table_name_13 WHERE score = "4-10" | sql_create_context |
CREATE TABLE table_33885 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for game 5?
| SELECT "Score" FROM table_33885 WHERE "Game" = '5' | wikisql |
CREATE TABLE table_71159 (
"Margin" real,
"Score" text,
"Opponent" text,
"Venue" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponent for 1996 at the mt smart stadium venue
| SELECT "Opponent" FROM table_71159 WHERE "Venue" = 'mt smart stadium' AND "Year" = '1996' | wikisql |
CREATE TABLE table_52044 (
"Series" text,
"Years" text,
"Magazine" text,
"Albums" text,
"Editor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which series with a total of 27 albums did Dargaud edit?
| SELECT "Series" FROM table_52044 WHERE "Editor" = 'dargaud' AND "Albums" = '27' | wikisql |
CREATE TABLE table_name_99 (
year VARCHAR,
publication VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year had a publication of Pazz & Jop?
| SELECT year FROM table_name_99 WHERE publication = "pazz & jop" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '16935106' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 853.43) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '16935106' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FR... | css |
CREATE TABLE player (
POSITION VARCHAR,
Points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the positions with both players having more than 20 points and less than 10 points.
| SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM... | advising |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) DESC | nvbench |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) | nvbench |
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 demographic.age FROM demographic WHERE demographic.name = "Josette Orr" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8991 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE degrees (
Id VARCHAR
)
CREATE TABLE campuses (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many degrees were conferred in 'San Jose State University' in 2000?
| SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000 | sql_create_context |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC | nvbench |
CREATE TABLE table_67793 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Match report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Match Report for the Euro2008q at the Athens Olympic Stadium on November 17, 2007?
| SELECT "Match report" FROM table_67793 WHERE "Competition" = 'euro2008q' AND "Venue" = 'athens olympic stadium' AND "Date" = 'november 17, 2007' | wikisql |
CREATE TABLE table_58122 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first prize amount of the person who has ... | SELECT COUNT("1st Prize( $ )") FROM table_58122 WHERE "Score" = '207 (-9)' AND "Purse( $ )" > '800,000' | wikisql |
CREATE TABLE table_34894 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2nd (m) has a 1st (m) of 120.5 and Points... | SELECT AVG("2nd (m)") FROM table_34894 WHERE "1st (m)" = '120.5' AND "Points" < '249.9' | wikisql |
CREATE TABLE table_52444 (
"Year" real,
"Network" text,
"Lap-by-lap" text,
"Color commentator(s)" text,
"Pit reporters" text,
"Host" text,
"Ratings" text,
"Viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the host that gar... | SELECT "Host" FROM table_52444 WHERE "Ratings" = '9.6/26' | wikisql |
CREATE TABLE table_9338 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the Perth Wildcats as away team?
| SELECT "Score" FROM table_9338 WHERE "Away team" = 'perth wildcats' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.language FROM demographic WHERE demographic.name = "Jonathan Wiggins" | mimicsql_data |
CREATE TABLE table_name_15 (
week INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest week with an opponent of cincinnati bengals?
| SELECT MIN(week) FROM table_name_15 WHERE opponent = "cincinnati bengals" | sql_create_context |
CREATE TABLE table_49542 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game against the baltimore bullets on March 14?
| SELECT "Score" FROM table_49542 WHERE "Opponent" = 'baltimore bullets' AND "Date" = 'march 14' | wikisql |
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 d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59473) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(),... | mimic_iii |
CREATE TABLE table_2284 (
"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.
-- Which episode aired on aug... | SELECT "Title" FROM table_2284 WHERE "Original air date" = 'August19,2012' | wikisql |
CREATE TABLE table_name_85 (
set_2 VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What set 2 has a total of 97 74?
| SELECT set_2 FROM table_name_85 WHERE total = "97–74" | sql_create_context |
CREATE TABLE table_name_30 (
length VARCHAR,
character_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the length of the film with Burleigh Sullivan as the character?
| SELECT length FROM table_name_30 WHERE character_name = "burleigh sullivan" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_name_15 (
place VARCHAR,
weapon VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Place, when Weapon is '35mm fire', and when Date is '27 May 1982'?
| SELECT place FROM table_name_15 WHERE weapon = "35mm fire" AND date = "27 may 1982" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '006-35134' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Subject... | SELECT middle_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'WOMENSTD' AND course.number = 323 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_c... | SELECT DISTINCT booking_class FROM class_of_service WHERE booking_class = 'Y' | atis |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
Dele... | SELECT Count, TagName FROM Tags WHERE Count > 50000 ORDER BY Count | sede |
CREATE TABLE table_35735 (
"Word" text,
"Pronunciation a" text,
"Meaning a" text,
"Pronunciation b" text,
"Meaning b" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the word with pronunciation b of *s ks
| SELECT "Word" FROM table_35735 WHERE "Pronunciation b" = '*sɨks' | wikisql |
CREATE TABLE table_204_466 (
id number,
"rank" number,
"bib" number,
"country" text,
"time" text,
"penalties (p+s)" text,
"deficit" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is france and germany 's deficit combined ?
| SELECT SUM("deficit") FROM table_204_466 WHERE "country" IN ('france', 'germany') | squall |
CREATE TABLE table_17244483_1 (
time_retired VARCHAR,
car_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Car number 15 earned what time?
| SELECT time_retired FROM table_17244483_1 WHERE car_no = 15 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id ... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 90165 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE customers (
payment_method_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each payment method, return how many customers use it.
| SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code | sql_create_context |
CREATE TABLE table_1452 (
"Official #" real,
"TF1 #" real,
"French title" text,
"English title" text,
"Air date (France)" text,
"Original Beechwood Bunny Tale / Source material" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the french titl... | SELECT "French title" FROM table_1452 WHERE "English title" = 'Inventor Bunnies' | wikisql |
CREATE TABLE table_48395 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Result, when Venue is G tzis , Austria?
| SELECT "Result" FROM table_48395 WHERE "Venue" = 'götzis , austria' | wikisql |
CREATE TABLE table_50300 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Bronze, when Gold is greater than 0, when Rank is 4, and when To... | SELECT COUNT("Bronze") FROM table_50300 WHERE "Gold" > '0' AND "Rank" = '4' AND "Total" > '4' | wikisql |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGE... | SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments GROUP BY Payment_Method_Code ORDER BY Date_Payment_Made | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '75810879' AND t_kc21.MED_SER_ORG_NO = '2045056' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%皮炎%' | css |
CREATE TABLE table_71880 (
"Representative" text,
"Title" text,
"Presentation of Credentials" text,
"Termination of Mission" text,
"Appointed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the representative with a presentation of credent... | SELECT "Representative" FROM table_71880 WHERE "Presentation of Credentials" = 'february 23, 1854' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT COUNT(*) > 0 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 = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'... | mimic_iii |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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,
... | SELECT MIN(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 = 6196)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart... | mimic_iii |
CREATE TABLE table_204_659 (
id number,
"seat" text,
"state" text,
"majority" number,
"member" text,
"party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total majority that the dobell seat had ?
| SELECT "majority" FROM table_204_659 WHERE "seat" = 'dobell' | squall |
CREATE TABLE table_name_21 (
country VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Yerevan located in?
| SELECT country FROM table_name_21 WHERE city = "yerevan" | sql_create_context |
CREATE TABLE table_69481 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class's call sign is wokg?
| SELECT "Class" FROM table_69481 WHERE "Call sign" = 'wokg' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT Time, ID FROM swimmer ORDER BY Time | nvbench |
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),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC | nvbench |
CREATE TABLE table_61298 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What average gold has China (chn) as the nation with a bronze greater than 1?
| SELECT AVG("Gold") FROM table_61298 WHERE "Nation" = 'china (chn)' AND "Bronze" > '1' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id num... | SELECT SUM(outputevents.value) 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 = 6705) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.it... | mimic_iii |
CREATE TABLE table_name_92 (
_jerk VARCHAR,
clean_ INTEGER,
total__kg_ VARCHAR,
snatch VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest clean & jerk when total (kg) is 200.0 and snatch is more than 87.5?
| SELECT MAX(clean_) & _jerk FROM table_name_92 WHERE total__kg_ = "200.0" AND snatch > 87.5 | 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 t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '13021575114' AND t_kc22.SOC_SRT_DIRE_CD = '493365633' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Cyst and pseudocyst of pancreas" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
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 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."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '2640814' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-03-08' AND '2019-01-15' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 3787.33) AS T | css |
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 vitalperiodic (
... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-80293') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... | eicu |
CREATE TABLE table_7305 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest games Played where the ... | SELECT MAX("Played") FROM table_7305 WHERE "Place" = '10' AND "Points" < '17' | wikisql |
CREATE TABLE table_name_89 (
team__number2 VARCHAR,
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played against Hapoel tel aviv when they were team #1?
| SELECT team__number2 FROM table_name_89 WHERE team__number1 = "hapoel tel aviv" | sql_create_context |
CREATE TABLE table_2182170_1 (
car_s_ VARCHAR,
listed_owner_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cars does Gregg Mixon own?
| SELECT COUNT(car_s_) FROM table_2182170_1 WHERE listed_owner_s_ = "Gregg Mixon" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '81867' AND IN_HOSP_DATE BETWEEN '2011-12-31' AND '2015-05-22' AND IN_DIAG_DIS_NM = '煤尘肺(炭末肺)' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_21436 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the car number dr... | SELECT "Car No." FROM table_21436 WHERE "Driver" = 'Darren Manning' | wikisql |
CREATE TABLE table_204_670 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in attendance for week 5 and 9
| SELECT ABS((SELECT "attendance" FROM table_204_670 WHERE "week" = 5) - (SELECT "attendance" FROM table_204_670 WHERE "week" = 9)) | squall |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '7488811' AND jybgb.BGRQ BETWEEN '2003-05-07' AND '2009-04-12' GROUP BY jybgb.KSBM HAVING COUNT(*) > 25) AS T | css |
CREATE TABLE table_61688 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance on September 19, 1971, after week 1?
| SELECT AVG("Attendance") FROM table_61688 WHERE "Date" = 'september 19, 1971' AND "Week" > '1' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.