instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_13336122_7 (
original_air_date VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were seen by 0.67 million US viewers on their original air dates?
| SELECT COUNT(original_air_date) FROM table_13336122_7 WHERE us_viewers__million_ = "0.67" | 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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8879930' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 10) AS T | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalp... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-24306')) AND DATETIME(medication.drugstarttime, 'start of ... | eicu |
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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "9907" | mimicsql_data |
CREATE TABLE table_42311 (
"Country" text,
"Automobile Name" text,
"Manufacturer" text,
"Engine Make/Capacity" text,
"Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was Letecke Zavody N.P., Jinonice the manufacturer?
| SELECT "Year" FROM table_42311 WHERE "Manufacturer" = 'letecke zavody n.p., jinonice' | wikisql |
CREATE TABLE table_name_64 (
voltage VARCHAR,
frequency VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Voltage has a Frequency of 2000mhz, and a Release date in q3 2008?
| SELECT voltage FROM table_name_64 WHERE frequency = "2000mhz" AND release_date = "q3 2008" | sql_create_context |
CREATE TABLE table_40435 (
"Band" text,
"Value" text,
"Ratio" text,
"Ratio as %" text,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Band has a Ratio of 9/9?
| SELECT "Band" FROM table_40435 WHERE "Ratio" = '9/9' | wikisql |
CREATE TABLE city (
city_id number,
county_id number,
name text,
white number,
black number,
amerindian number,
asian number,
multiracial number,
hispanic number
)
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers num... | SELECT T1.name, T2.name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.county_id = T2.county_id | spider |
CREATE TABLE table_73045 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When thomas l fkvis... | SELECT "General classification" FROM table_73045 WHERE "Points classification" = 'Alessandro Petacchi' AND "Young rider classification" = 'Thomas Löfkvist' | wikisql |
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 = '4045580' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-07-15' AND '2011-09-29' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 7992.28) AS T | css |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
produ... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY COUNT(date_account_opened) DESC | nvbench |
CREATE TABLE table_name_72 (
year INTEGER,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Category of best performance by a leading actress in a musical?
| SELECT MAX(year) FROM table_name_72 WHERE category = "best performance by a leading actress in a musical" | sql_create_context |
CREATE TABLE table_52565 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did Fantasy Records release a CD format of catalog FCD-4513-2?
| SELECT "Date" FROM table_52565 WHERE "Label" = 'fantasy records' AND "Format" = 'cd' AND "Catalog" = 'fcd-4513-2' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id ... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'aortocor bypas-1 cor art') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612 AND NOT admissions.d... | mimic_iii |
CREATE TABLE table_14396 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Kerry is at 36.7%, what is the total number of others?
| SELECT COUNT("Others#") FROM table_14396 WHERE "Kerry%" = '36.7%' | wikisql |
CREATE TABLE table_name_98 (
gold INTEGER,
rank VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of gold with a rank that is 3 and a silver larger than 7?
| SELECT SUM(gold) FROM table_name_98 WHERE rank = "3" AND silver > 7 | sql_create_context |
CREATE TABLE table_69908 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the label for October 21, 1981?
| SELECT "Label" FROM table_69908 WHERE "Date" = 'october 21, 1981' | wikisql |
CREATE TABLE table_20466963_13 (
guest_2 VARCHAR,
presenter VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the guest 2 for colin murray 6 april
| SELECT COUNT(guest_2) FROM table_20466963_13 WHERE presenter = "Colin Murray" AND date = "6 April" | sql_create_context |
CREATE TABLE table_name_55 (
outgoing_manager VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the outgoing manager of the Heart of Midlothian?
| SELECT outgoing_manager FROM table_name_55 WHERE team = "heart of midlothian" | sql_create_context |
CREATE TABLE table_57906 (
"Year" real,
"Title" text,
"Original channel" text,
"Role" text,
"Note" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the year when the title is jotei?
| SELECT SUM("Year") FROM table_57906 WHERE "Title" = 'jotei' | wikisql |
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
... | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Away_team, Home_team ORDER BY Home_team DESC | nvbench |
CREATE TABLE table_name_57 (
position INTEGER,
points VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positions have 15 for the points, with a drawn less than 3?
| SELECT SUM(position) FROM table_name_57 WHERE points = 15 AND drawn < 3 | sql_create_context |
CREATE TABLE table_53762 (
"Candidate" text,
"Money Raised, 3Q" text,
"Loans Received, 3Q" text,
"Money Spent, 3Q" text,
"Total Receipts" text,
"Cash On Hand" text,
"Total Debt" text,
"After Debt" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Money Spent, 3Q" FROM table_53762 WHERE "After Debt" = '$1,757,936' | wikisql |
CREATE TABLE table_name_75 (
bronze INTEGER,
silver VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest bronze medals for a team with fewer than 1 silver and rank lower than 5?
| SELECT MIN(bronze) FROM table_name_75 WHERE silver < 1 AND rank < 5 | sql_create_context |
CREATE TABLE table_name_22 (
episodes VARCHAR,
season_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How may episodes did season 1 have?
| SELECT COUNT(episodes) FROM table_name_22 WHERE season_no = 1 | sql_create_context |
CREATE TABLE table_name_23 (
place INTEGER,
goals_scored VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most place for goals scored more than 28 and played less than 18
| SELECT MAX(place) FROM table_name_23 WHERE goals_scored > 28 AND played < 18 | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Descr... | WITH ReOpenedQuestions AS (SELECT p.LastEditDate, ph.CreationDate, p.OwnerUserId, p.LastEditorUserId FROM Posts AS p, PostHistory AS ph WHERE p.Id = ph.PostId AND ph.PostHistoryTypeId = 11 AND p.PostTypeId = 1) SELECT (SELECT COUNT(*) FROM ReOpenedQuestions) AS "all_re-opened_questions", (SELECT COUNT(*) FROM ReOpenedQ... | sede |
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 (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'w/craft fa... | mimic_iii |
CREATE TABLE table_29825 (
"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 i... | SELECT "Record" FROM table_29825 WHERE "Date" = 'November 25' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
A... | SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_15854 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school did the player that has been in Toronto from 2012-p... | SELECT "School/Club Team" FROM table_15854 WHERE "Years in Toronto" = '2012-present' | wikisql |
CREATE TABLE table_55918 (
"Season" text,
"Club" text,
"National League" text,
"National Cup" text,
"European Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season is Euroleague with Greek Cup?
| SELECT "Season" FROM table_55918 WHERE "European Cup" = 'euroleague' AND "National Cup" = 'greek cup' | wikisql |
CREATE TABLE table_name_36 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for opponent Matt Serra?
| SELECT record FROM table_name_36 WHERE opponent = "matt serra" | sql_create_context |
CREATE TABLE table_19722664_5 (
steals VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many steals did Nicole Levandusky make?
| SELECT steals FROM table_19722664_5 WHERE player = "Nicole Levandusky" | sql_create_context |
CREATE TABLE table_66294 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what place has score 66-74-68-73=281
| SELECT "Place" FROM table_66294 WHERE "Score" = '66-74-68-73=281' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
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 diagnosis (
diagn... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'dic syndrome') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnos... | eicu |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '29261183' AND jybgb.BGRQ BETWEEN '2011-05-08... | css |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE table_187239_1 (
minor_sponsors VARCHAR,
kit_manufacturer VARCHAR,
period VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 2011 is the period and olympikus is the kit manufacturer how many minor sponsors are there?
| SELECT COUNT(minor_sponsors) FROM table_187239_1 WHERE kit_manufacturer = "Olympikus" AND period = "2011" | sql_create_context |
CREATE TABLE table_name_49 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team played against Hawthorn?
| SELECT home_team AS score FROM table_name_49 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text
)
CREATE TABLE playlists... | SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall" | spider |
CREATE TABLE table_66313 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does the player from the Arizona Diamondbacks play?
| SELECT "Position" FROM table_66313 WHERE "Team" = 'arizona diamondbacks' | wikisql |
CREATE TABLE table_57420 (
"Date" text,
"Competition" text,
"Ground" text,
"Score" text,
"Attendance" real,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total attendance with a Report of sd.hr, and a Score of 3 1, and a Da... | SELECT SUM("Attendance") FROM table_57420 WHERE "Report" = 'sd.hr' AND "Score" = '3–1' AND "Date" = '14 apr 2001' | wikisql |
CREATE TABLE table_44298 (
"Edition" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Opponent" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round resulted in 6-0, 6-1, 6-2?
| SELECT "Round" FROM table_44298 WHERE "Result" = '6-0, 6-1, 6-2' | wikisql |
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '孙虹影' AND t_kc21.MED_SER_ORG_NO = '3151160' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%牙体%' | css |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '19215217478' AND t_kc22.OVE_SELF_AMO > 5990.11 | css |
CREATE TABLE table_19529639_3 (
current_west_end_cast VARCHAR,
original_west_end_cast VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What member of the current West End cast plays the character played by Jodie Jacobs in the original West End cast?
| SELECT current_west_end_cast FROM table_19529639_3 WHERE original_west_end_cast = "Jodie Jacobs" | 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 t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7425569' GROUP BY t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE table_name_9 (
location_attendance VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game played when the opponent was Oklahoma City, and what was the attendance?
| SELECT location_attendance FROM table_name_9 WHERE team = "oklahoma city" | sql_create_context |
CREATE TABLE table_name_45 (
pct INTEGER,
pts VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average PCT when it has a PTS smaller than 9 a wins larger than 1?
| SELECT AVG(pct) FROM table_name_45 WHERE pts < 9 AND wins > 1 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'psoriatic arthropathy') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90369) ORDER BY diag... | mimic_iii |
CREATE TABLE table_11734041_20 (
years_for_rockets VARCHAR,
school_club_team_country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of years for rockets where school/club team/country is baylor
| SELECT COUNT(years_for_rockets) FROM table_11734041_20 WHERE school_club_team_country = "Baylor" | sql_create_context |
CREATE TABLE table_name_76 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Sandy Lyle's To Par?
| SELECT to_par FROM table_name_76 WHERE player = "sandy lyle" | sql_create_context |
CREATE TABLE table_2581397_3 (
group VARCHAR,
weight__kg_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How man teams had a total weight of 57.5?
| SELECT COUNT(group) FROM table_2581397_3 WHERE weight__kg_ = "57.5" | sql_create_context |
CREATE TABLE Mailshot_Campaigns (
mailshot_id INTEGER,
product_category VARCHAR(15),
mailshot_name VARCHAR(80),
mailshot_start_date DATETIME,
mailshot_end_date DATETIME
)
CREATE TABLE Premises (
premise_id INTEGER,
premises_type VARCHAR(15),
premise_details VARCHAR(255)
)
CREATE TABLE ... | SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
r... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 51177 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_4620 (
"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 home team that scored 10.13 (73)?
| SELECT "Home team" FROM table_4620 WHERE "Home team score" = '10.13 (73)' | wikisql |
CREATE TABLE table_name_45 (
gain VARCHAR,
loss VARCHAR,
long VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gains were there for the player who had a loss greater than 57 and a long less than 55?
| SELECT COUNT(gain) FROM table_name_45 WHERE loss > 57 AND long < 55 | sql_create_context |
CREATE TABLE table_31146 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did episode 4 in... | SELECT "Original air date" FROM table_31146 WHERE "No. in season" = '4' | wikisql |
CREATE TABLE table_203_296 (
id number,
"country" text,
"total gdp (nominal)\n(billion us$)" text,
"gdp per capita\n(us$, ppp)" text,
"gdp growth,\n2007-2011\n(in %)" number,
"hdi" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country has... | SELECT "country" FROM table_203_296 WHERE "total gdp (nominal)\n(billion us$)" = 9.5 AND "gdp per capita\n(us$, ppp)" = 1531 | squall |
CREATE TABLE table_38926 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Opponent of Boston red sox and a Save of sager?
| SELECT "Score" FROM table_38926 WHERE "Opponent" = 'boston red sox' AND "Save" = 'sager' | wikisql |
CREATE TABLE table_name_32 (
directed_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell me the director of the production code ad1d02.
| SELECT directed_by FROM table_name_32 WHERE production_code = "ad1d02" | sql_create_context |
CREATE TABLE table_20667854_1 (
company VARCHAR,
index_weighting___percentage VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every company with an index weighting % of 1 and the city of Dimitrovgrad?
| SELECT company FROM table_20667854_1 WHERE index_weighting___percentage = "1" AND city = "Dimitrovgrad" | sql_create_context |
CREATE TABLE table_57629 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score of the game against opponent Ana Ivanovic?
| SELECT "Score" FROM table_57629 WHERE "Opponent in the final" = 'ana ivanovic' | wikisql |
CREATE TABLE table_45691 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Record, when Game is '36'?
| SELECT "Record" FROM table_45691 WHERE "Game" = '36' | wikisql |
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE club (
Club_ID in... | SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation | nvbench |
CREATE TABLE table_name_89 (
winner VARCHAR,
notes VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner for the world championship formula 1 at the venue, circuit de monaco?
| SELECT winner FROM table_name_89 WHERE notes = "world championship formula 1" AND venue = "circuit de monaco" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_25962 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the results for all games which involved ... | SELECT "Score" FROM table_25962 WHERE "Opponent" = 'Detroit Red Wings' | wikisql |
CREATE TABLE table_204_600 (
id number,
"name" text,
"status" text,
"population" number,
"district" text,
"former local authority" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which is a civil parish , aintree village or maghull ?
| SELECT "name" FROM table_204_600 WHERE "name" IN ('aintree village', 'maghull') AND "status" = 'civil parish' | squall |
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 SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '鲁和颂' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-03-16' AND '2004-10-26' | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id nu... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'parent infus nutrit sub') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND D... | mimic_iii |
CREATE TABLE table_43836 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which site was the game against Louisville played?
| SELECT "Site" FROM table_43836 WHERE "Opponent" = 'louisville' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" | mimicsql_data |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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 ... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB 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_inf... | css |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight i... | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS CITY' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare... | atis |
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Project_Staff (
staff_id DOUBLE,
project_id INTEGER,
role_code VARCHAR(10),
date_from DATETIME,
date_to DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Researc... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_id DESC | nvbench |
CREATE TABLE table_56847 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Edmonton was the home team?
| SELECT "Score" FROM table_56847 WHERE "Home" = 'edmonton' | wikisql |
CREATE TABLE table_52633 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue where there are more than 52,302 in attendance and the result is 2-0?
| SELECT "Venue" FROM table_52633 WHERE "Attendance" > '52,302' AND "Result" = '2-0' | wikisql |
CREATE TABLE table_50230 (
"Name" text,
"Country" text,
"Date of birth" text,
"Debut" text,
"Last match" text,
"Age as of 1 February 2014" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Pananmal Punjabi's date of birth?
| SELECT "Date of birth" FROM table_50230 WHERE "Name" = 'pananmal punjabi' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND prescriptions.drug = "Glycopyrrolate" | mimicsql_data |
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 lab (
labid numbe... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-30273')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | 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.dob_year < "2089" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
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 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 >= '2014-04-18') | css |
CREATE TABLE table_884 (
"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.
-- Who was ... | SELECT "High rebounds" FROM table_884 WHERE "Date" = 'December 22' | wikisql |
CREATE TABLE table_70236 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the followin... | SELECT "Intergiro classification" FROM table_70236 WHERE "Stage" = '21' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
... | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-91239') AND patient.unitdischargetime IS NUL... | eicu |
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 intakeoutput (
in... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4428')) AND intakeoutput.celllabel = 'nutrit... | eicu |
CREATE TABLE table_14903491_1 (
mens_singles VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the mens singles for 1989
| SELECT mens_singles FROM table_14903491_1 WHERE year = 1989 | sql_create_context |
CREATE TABLE table_20315 (
"Series" text,
"Episodes" real,
"Series premiere" text,
"Series finale" text,
"Region 1" text,
"Region 2" text,
"Region 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes in the series that premier... | SELECT "Episodes" FROM table_20315 WHERE "Series premiere" = '5 February 2012' | wikisql |
CREATE TABLE table_16799784_4 (
year_named INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Norterma Tholus created?
| SELECT MAX(year_named) FROM table_16799784_4 WHERE name = "Norterma Tholus" | sql_create_context |
CREATE TABLE table_name_20 (
centerfold_model VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Centerfold model on 5-88?
| SELECT centerfold_model FROM table_name_20 WHERE date = "5-88" | sql_create_context |
CREATE TABLE table_53291 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the premiere rating asso... | SELECT MIN("Premiere") FROM table_53291 WHERE "Average" = '35' AND "Rank" > '1' | wikisql |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE... | atis |
CREATE TABLE table_53412 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the runner-up in the tournament in London?
| SELECT "Runner-up" FROM table_53412 WHERE "Tournament" = 'london' | wikisql |
CREATE TABLE table_57800 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game when the Rockies had a record of 61 66?
| SELECT "Date" FROM table_57800 WHERE "Record" = '61–66' | wikisql |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51254" | mimicsql_data |
CREATE TABLE table_name_10 (
team__b_ VARCHAR,
s_no INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team (B), when S No is greater than 17?
| SELECT team__b_ FROM table_name_10 WHERE s_no > 17 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | 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 = '31549527' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2006-04-16') | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.