instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_4130 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college club team did the Dallas Stars choose their draft ... | SELECT "College/junior/club team" FROM table_4130 WHERE "NHL team" = 'Dallas Stars' | wikisql |
CREATE TABLE table_42516 (
"Year" text,
"Title" text,
"Genre" text,
"Label" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year's label was label?
| SELECT "Year" FROM table_42516 WHERE "Label" = 'label' | wikisql |
CREATE TABLE table_2333416_2 (
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the greatest number of wins Ken Bouchard had in a season?
| SELECT MIN(wins) FROM table_2333416_2 | sql_create_context |
CREATE TABLE artist (
Age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average age of all artists?
| SELECT AVG(Age) FROM artist | sql_create_context |
CREATE TABLE table_73900 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which categories fit under the institution calvin colleg... | SELECT "Type" FROM table_73900 WHERE "Institution" = 'Calvin College' | 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.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '46607257909' | css |
CREATE TABLE table_44942 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Round which has a Position of defensive back and corey chavous?
| SELECT MIN("Round") FROM table_44942 WHERE "Position" = 'defensive back' AND "Player" = 'corey chavous' | wikisql |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Flag, COUNT(Flag) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain WHERE Rank = 'Midshipman') GROUP BY Flag | nvbench |
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year ... | SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date ORDER BY Open_Date DESC LIMIT 3 | nvbench |
CREATE TABLE table_33574 (
"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.
-- Who is the away side that scores 9.8 (62)?
| SELECT "Away team" FROM table_33574 WHERE "Away team score" = '9.8 (62)' | wikisql |
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age ... | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY COUNT(Open_Date) DESC | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Paraplegia" AND lab."CATEGORY" = "Blood Gas" | 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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_14778650_1 (
_number VARCHAR,
length VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What track number is 4:29 in length?
| SELECT _number FROM table_14778650_1 WHERE length = "4:29" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2111.0" AND procedures.long_title = "Other endoscopy of small intestine" | mimicsql_data |
CREATE TABLE table_25042332_16 (
region VARCHAR,
below_50_percentage_of_median_income VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what region do 18.6% of the people make less than 50% of the median income?
| SELECT region FROM table_25042332_16 WHERE below_50_percentage_of_median_income = "18.6%" | sql_create_context |
CREATE TABLE table_63422 (
"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 the lost in place less than 3 and hav... | SELECT SUM("Lost") FROM table_63422 WHERE "Goals Scored" > '63' AND "Place" < '3' | wikisql |
CREATE TABLE table_name_50 (
loss VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss of the game attended by 41,212?
| SELECT loss FROM table_name_50 WHERE attendance = "41,212" | sql_create_context |
CREATE TABLE table_18594107_2 (
losses INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses for the team atl. colegiales?
| SELECT MAX(losses) FROM table_18594107_2 WHERE team = "Atl. Colegiales" | sql_create_context |
CREATE TABLE table_33586 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round was the draft pick of tight end with an Overall larger than 21?
| SELECT COUNT("Round") FROM table_33586 WHERE "Position" = 'tight end' AND "Overall" > '21' | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "50" AND prescriptions.route = "BUCCAL" | mimicsql_data |
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Cl... | SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name ORDER BY T1.name DESC | nvbench |
CREATE TABLE table_66026 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Grid has Points larger than 10 and a Time/Retired of +13.7 secs?
| SELECT "Grid" FROM table_66026 WHERE "Points" > '10' AND "Time/Retired" = '+13.7 secs' | wikisql |
CREATE TABLE table_142159_1 (
built VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many are named River Esk
| SELECT COUNT(built) FROM table_142159_1 WHERE name = "River Esk" | sql_create_context |
CREATE TABLE table_22839669_1 (
outcome VARCHAR,
score_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome of the match with score 4 6, 3 6, 2 6?
| SELECT outcome FROM table_22839669_1 WHERE score_in_the_final = "4–6, 3–6, 2–6" | sql_create_context |
CREATE TABLE table_204_563 (
id number,
"abbreviation" text,
"settlement" text,
"district" text,
"official name" text,
"division" text,
"cup" number,
"other information" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what settlement is l... | SELECT "settlement" FROM table_204_563 WHERE id = (SELECT id FROM table_204_563 WHERE "settlement" = 'oulu') + 1 | squall |
CREATE TABLE Apartment_Buildings (
building_id VARCHAR,
building_manager VARCHAR
)
CREATE TABLE Apartments (
apt_type_code VARCHAR,
apt_number VARCHAR,
building_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the apartment type codes and ... | SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" | sql_create_context |
CREATE TABLE table_name_40 (
venue VARCHAR,
opponent VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue had an opponent of Sunderland and a result of a 1-1 draw?
| SELECT venue FROM table_name_40 WHERE opponent = "sunderland" AND result = "1-1" | sql_create_context |
CREATE TABLE table_name_73 (
ihsaa_class VARCHAR,
county VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IHSAA class for the school in 10 Clark county with mascot of the Mustangs?
| SELECT ihsaa_class FROM table_name_73 WHERE county = "10 clark" AND mascot = "mustangs" | sql_create_context |
CREATE TABLE table_name_53 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did Luca Sbisa play for the Philadelphia Flyers?
| SELECT position FROM table_name_53 WHERE player = "luca sbisa" | sql_create_context |
CREATE TABLE table_44214 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result when the attendance was 78,793?
| SELECT "Result" FROM table_44214 WHERE "Attendance" = '78,793' | wikisql |
CREATE TABLE table_name_61 (
top_5 INTEGER,
events VARCHAR,
top_25 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Top-5 that has 18 or more events with a Top-25 of 23?
| SELECT MAX(top_5) FROM table_name_61 WHERE events > 18 AND top_25 = 23 | sql_create_context |
CREATE TABLE table_38074 (
"Rank" text,
"Scorer" text,
"Club" text,
"Goals" real,
"Matches" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Rank has Goals larger than 4, and a Scorer of oh seok-jae?
| SELECT "Rank" FROM table_38074 WHERE "Goals" > '4' AND "Scorer" = 'oh seok-jae' | wikisql |
CREATE TABLE table_26986076_1 (
sat_21_aug VARCHAR,
wed_25_aug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If Wed Aug 25 is no time, what is Sat aug 21?
| SELECT sat_21_aug FROM table_26986076_1 WHERE wed_25_aug = "—— No Time" | sql_create_context |
CREATE TABLE table_37626 (
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Left" real,
"Nickname" text,
"Present Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which conference does the school... | SELECT "Present Conference" FROM table_37626 WHERE "Location" = 'gainesville, florida' | wikisql |
CREATE TABLE table_58041 (
"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 score At Windy Hill?
| SELECT "Home team score" FROM table_58041 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE table_name_76 (
first VARCHAR,
surname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which first's surname is Cook?
| SELECT first FROM table_name_76 WHERE surname = "cook" | sql_create_context |
CREATE TABLE table_47048 (
"Rank" real,
"Title" text,
"Studio" text,
"Director(s)" text,
"Worldwide Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title placed in rank 7?
| SELECT "Title" FROM table_47048 WHERE "Rank" = '7' | wikisql |
CREATE TABLE table_23292220_5 (
scores VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of scores for 5x06
| SELECT COUNT(scores) FROM table_23292220_5 WHERE episode = "5x06" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ... | css |
CREATE TABLE table_31613 (
"Year" text,
"Games" real,
"Rushes" real,
"Yards" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games had 41 rushes and were than 197 yards?
| SELECT COUNT("Games") FROM table_31613 WHERE "Rushes" = '41' AND "Yards" < '197' | wikisql |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score | nvbench |
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 (SELECT COUNT(*) 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 = '12121203' AND mzjzjlb.JZKSRQ BETWEEN '2001-05-07' AND '2020-07-12') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_... | css |
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... | SELECT u.Id, u.DisplayName, u.Reputation, u.Location, COUNT(*) AS PostCount FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId INNER JOIN Posts AS q ON p.ParentId = q.Id INNER JOIN PostTags AS pt ON q.Id = pt.PostId WHERE u.Reputation > 5000 AND u.Location LIKE '%India' AND p.PostTypeId = 2 AND (pt.TagId = 5... | sede |
CREATE TABLE table_57109 (
"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.
-- Where was the game played when the home team sco... | SELECT "Venue" FROM table_57109 WHERE "Home team score" = '10.12 (72)' | wikisql |
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
rating_in_percent number
)
CREATE TABLE broadcast (
channel_id number,
program_id numb... | SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night' | spider |
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE ... | SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_204_568 (
id number,
"pennant" text,
"name" text,
"hull builder" text,
"ordered" text,
"laid down" text,
"launched" text,
"accepted into service" text,
"commissioned" text,
"est. building cost" text,
"fate" text
)
-- Using valid SQLite, answer the followi... | SELECT "name" FROM table_204_568 ORDER BY "est. building cost" DESC LIMIT 1 | squall |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name | nvbench |
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_labitems (
row_id number,
itemid number,
label te... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'comp-oth cardiac device') AND STRFTIME('%y', diagnoses_icd... | mimic_iii |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "24" AND demographic.days_stay > "11" | mimicsql_data |
CREATE TABLE table_name_7 (
high_rebounds VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the most rebounds on January 3?
| SELECT high_rebounds FROM table_name_7 WHERE date = "january 3" | sql_create_context |
CREATE TABLE table_name_67 (
muzzle_energy VARCHAR,
bullet_weight VARCHAR,
max_pressure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the muzzle energy with grains (g) bullet weight and a max pressure of 35,000 psi?
| SELECT muzzle_energy FROM table_name_67 WHERE bullet_weight = "grains (g)" AND max_pressure = "35,000 psi" | sql_create_context |
CREATE TABLE table_17628 (
"Municipality" text,
"Population" real,
"Police officers" real,
"Residents per officer" real,
"Total costs (2005)" text,
"Cost per capita" text,
"Case burden" real,
"Crime rate per 1,000 people" real,
"Police force" text
)
-- Using valid SQLite, answer th... | SELECT MAX("Crime rate per 1,000 people") FROM table_17628 WHERE "Cost per capita" = '$152' | wikisql |
CREATE TABLE table_13717 (
"Sr No" real,
"Name" text,
"Locale" text,
"Height" text,
"Floors" real,
"Building Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the least floors when the building type is residential and the sr no is 8?
| SELECT MIN("Floors") FROM table_13717 WHERE "Building Type" = 'residential' AND "Sr No" = '8' | wikisql |
CREATE TABLE table_32056 (
"Begin Date" text,
"Representative" text,
"Date of birth" text,
"House term" text,
"State served" text,
"Party" text,
"Age (years, days)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of birth of... | SELECT "Date of birth" FROM table_32056 WHERE "Party" = 'republican' AND "House term" = '1863-1865' | wikisql |
CREATE TABLE undergoes (
patient number,
procedures number,
stay number,
dateundergoes time,
physician number,
assistingnurse number
)
CREATE TABLE physician (
employeeid number,
name text,
position text,
ssn number
)
CREATE TABLE affiliated_with (
physician number,
dep... | SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1 | spider |
CREATE TABLE table_76417 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the ... | SELECT "Points" FROM table_76417 WHERE "Wins" = '0' AND "Podiums" = '0' AND "Races" = '4' | wikisql |
CREATE TABLE table_27642 (
"Letters" text,
"Organization" text,
"Nickname" text,
"Founding Date" text,
"Founding University" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the founding university of the organization Tau Eps... | SELECT "Founding University" FROM table_27642 WHERE "Organization" = 'Tau Epsilon Phi 1' | wikisql |
CREATE TABLE table_3375 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the stolen ends when ... | SELECT MAX("Stolen Ends") FROM table_3375 WHERE "Ends Won" = '32' | wikisql |
CREATE TABLE table_name_53 (
crowd INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of the crowd when the Wollongong Hawks were the home team?
| SELECT SUM(crowd) FROM table_name_53 WHERE home_team = "wollongong hawks" | sql_create_context |
CREATE TABLE table_23463 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "No. in season" FROM table_23463 WHERE "U.S. viewers (millions)" = '10.11' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.short_title = "Episodic mood disord NOS" | mimicsql_data |
CREATE TABLE table_46017 (
"Driver" text,
"Constructor" text,
"Q1 order" real,
"Q1 time" text,
"Q1 pos" real,
"Q1+Q2 time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Driver at larger than 10 with a Q1 of 18.
| SELECT "Driver" FROM table_46017 WHERE "Q1 order" > '10' AND "Q1 pos" = '18' | wikisql |
CREATE TABLE table_17820556_4 (
precincts VARCHAR,
g_hager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many precincts are in the county where G. Hager received 19 (20%) votes?
| SELECT precincts FROM table_17820556_4 WHERE g_hager = "19 (20%)" | sql_create_context |
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
product_category_code VARCHAR(20),
date_product_first_available DATETIME,
date_product_discontinued DATETIME,
product_name VARCHAR(80),
product_description VARCHAR(255),
product_price DECIMAL(19,4)
)
CREATE TABLE Cus... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code | nvbench |
CREATE TABLE table_204_918 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"attendance" number,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did they have a better score against the tenness... | SELECT "opponent" FROM table_204_918 WHERE "opponent" IN ('tennessee titans', 'green bay packers') ORDER BY "result" DESC LIMIT 1 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2133.0" AND prescriptions.drug = "Clofarabine *IND*" | mimicsql_data |
CREATE TABLE table_51400 (
"Athlete (nation)" text,
"Olympics" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest medal total with less than 3 gold medals?
| SELECT MIN("Total") FROM table_51400 WHERE "Gold" < '3' | wikisql |
CREATE TABLE table_name_33 (
report VARCHAR,
pole_position VARCHAR,
winning_driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which report includes Bobby Unser as the Pole Position and Rick Mears as the Winning driver?
| SELECT report FROM table_name_33 WHERE pole_position = "bobby unser" AND winning_driver = "rick mears" | sql_create_context |
CREATE TABLE diagnoses (
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.icd9_code = "92" | mimicsql_data |
CREATE TABLE table_name_62 (
title VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What film did Pen-Ek Ratanaruang direct?
| SELECT title FROM table_name_62 WHERE director = "pen-ek ratanaruang" | sql_create_context |
CREATE TABLE table_6761 (
"Date" text,
"Pos." text,
"Player" text,
"From club" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which From club had a Transfer fee of 3.87m?
| SELECT "From club" FROM table_6761 WHERE "Transfer fee" = '£3.87m' | wikisql |
CREATE TABLE table_44896 (
"Week" real,
"Date" text,
"TV Time" text,
"Opponent" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Result that has the Week of 5?
| SELECT "Result" FROM table_44896 WHERE "Week" = '5' | wikisql |
CREATE TABLE table_2219 (
"Year" real,
"Presidential Election Result" text,
"Redskins (Score)" text,
"Opponent (Score)" text,
"Redskins Win or Lose ?" text,
"Incumbent Party Win or Lose ?" text,
"Rule upheld?*" text,
"Popular Vote Won" text
)
-- Using valid SQLite, answer the following... | SELECT "Redskins (Score)" FROM table_2219 WHERE "Opponent (Score)" = 'Tennessee Titans 27' | wikisql |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no numbe... | SELECT AVG(T2.price) FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T1.county = "Sonoma" | spider |
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 course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LACS' AND course.number = 471 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o... | advising |
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.short_title = "Drug detoxification" | mimicsql_data |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId n... | SELECT Posts.Id AS "post_link", Body FROM Posts WHERE Body LIKE '%<kbd>%</kbd>%' ORDER BY Posts.Id | sede |
CREATE TABLE table_68211 (
"Number" real,
"Name of the song" text,
"Singer" text,
"Drama" text,
"Kind of the song" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of the song named ?
| SELECT "Number" FROM table_68211 WHERE "Name of the song" = '實情' | wikisql |
CREATE TABLE table_46248 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record of the game on January 31 with Visitors Detroit Red Wings?
| SELECT "Record" FROM table_46248 WHERE "Visitor" = 'detroit red wings' AND "Date" = 'january 31' | wikisql |
CREATE TABLE table_2775 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of director for vesni ko m st ediskov
| SELECT COUNT("Director") FROM table_2775 WHERE "Original title" = 'Vesničko má středisková' | wikisql |
CREATE TABLE table_1342379_10 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the affiliation of charles h. brand
| SELECT party FROM table_1342379_10 WHERE incumbent = "Charles H. Brand" | sql_create_context |
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 Type | nvbench |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Tests_Taken (
registration_id IN... | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) | nvbench |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CH... | SELECT apt_number, room_count FROM Apartments ORDER BY apt_number | nvbench |
CREATE TABLE table_11960610_10 (
score VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of united center 22,097?
| SELECT score FROM table_11960610_10 WHERE location_attendance = "United Center 22,097" | sql_create_context |
CREATE TABLE table_name_26 (
grid VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total grid for someone with a time/retire of +44.831
| SELECT COUNT(grid) FROM table_name_26 WHERE time_retired = "+44.831" | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE T... | SELECT COUNT(t.Id) AS "all_tags", COUNT(t2.Id) AS "tags_with_excerpt", 100.0 * COUNT(t2.Id) / COUNT(t.Id) AS "percent" FROM Tags AS t LEFT JOIN Tags AS t2 ON t.Id = t2.Id AND NOT t2.ExcerptPostId IS NULL | sede |
CREATE TABLE table_name_47 (
approximate_age VARCHAR,
virtues VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you give me the age of the Virtues of Wisdom?
| SELECT approximate_age FROM table_name_47 WHERE virtues = "wisdom" | sql_create_context |
CREATE TABLE table_56895 (
"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 away team that has a score of 10.9 (... | SELECT "Away team" FROM table_56895 WHERE "Away team score" = '10.9 (69)' | 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 t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1518558' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_204_132 (
id number,
"year" number,
"location" text,
"men's individual" text,
"women's individual" text,
"men's team" text,
"women's team" text,
"mixed team" text,
"ref" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "location" FROM table_204_132 WHERE "year" > (SELECT "year" FROM table_204_132 WHERE "location" = 'tainan') ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_22779004_1 (
conference VARCHAR,
regular_season_winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the conference when Arizona State won the regular season?
| SELECT conference FROM table_22779004_1 WHERE regular_season_winner = "Arizona State" | sql_create_context |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY AllergyType | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | SELECT COUNT(TagName) FROM Tags AS t JOIN PostTags AS p ON p.TagId = t.Id WHERE TagName = 'php' GROUP BY TagName | sede |
CREATE TABLE table_51781 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the total number of Roll that has the Area of aranga?
| SELECT COUNT("Roll") FROM table_51781 WHERE "Area" = 'aranga' | wikisql |
CREATE TABLE table_54834 (
"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.
-- How many points did the away team score in the g... | SELECT "Away team score" FROM table_54834 WHERE "Home team score" = '14.25 (109)' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.