instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE restaurant (
resid number,
resname text,
address text,
rating number
)
CREATE TABLE restaurant_type (
restypeid number,
restypename text,
restypedescription text
)
CREATE TABLE type_of_restaurant (
resid number,
restypeid number
)
CREATE TABLE visits_... | SELECT major, COUNT(*) FROM student GROUP BY major HAVING COUNT(major) BETWEEN 2 AND 30 |
### Instruction:
CREATE TABLE operate_company (
id number,
name text,
type text,
principal_activities text,
incorporated_in text,
group_equity_shareholding number
)
CREATE TABLE flight (
id number,
vehicle_flight_number text,
date text,
pilot text,
velocity number,
altit... | SELECT T3.id, COUNT(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id |
### Instruction:
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
Ci... | SELECT Country, COUNT(*) FROM stadium GROUP BY Country |
### Instruction:
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE tracklists (
albumid number,
position num... | SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE table_37973 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2011" text,
"2012" text,
"2013" text,
"Career SR" text,
"Career Win-Loss" text
... | SELECT "2008" FROM table_37973 WHERE "Career Win-Loss" = '25–40' |
### Instruction:
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE sportsinfo (
stuid number,
sportname te... | SELECT gname FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1 |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY All_Games |
### Instruction:
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Ag... | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name |
### Instruction:
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy I... | SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY roomName DESC |
### Instruction:
CREATE TABLE people (
people_id number,
name text,
country text,
is_male text,
age number
)
CREATE TABLE church (
church_id number,
name text,
organized_by text,
open_date number,
continuation_of text
)
CREATE TABLE wedding (
church_id number,
male_id n... | SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30 |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Neutral, School_ID FROM basketball_match ORDER BY School_ID DESC |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY All_Games DESC |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road DESC |
### Instruction:
CREATE TABLE hosting_city (
Year int,
Match_ID int,
Host_City text
)
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
GDP real
)
CREATE TABLE match (
Match_ID int,
Date text,
Venue text,
Score text,... | SELECT Competition, COUNT(*) FROM match GROUP BY Competition |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID DESC |
### Instruction:
CREATE TABLE table_70747 (
"Year" real,
"Catcher" text,
"First Baseman" text,
"Second Baseman" text,
"Shortstop" text,
"Third Baseman" text,
"Rightfielder" text,
"Centerfielder" text,
"Leftfielder" text,
"Starting Pitcher" text
)
-- Using valid SQLite, answer t... | SELECT "Leftfielder" FROM table_70747 WHERE "Second Baseman" = 'davey lopes' AND "First Baseman" = 'steve garvey' AND "Shortstop" = 'bill russell' AND "Year" > '1977' |
### Instruction:
CREATE TABLE table_34487 (
"Week 1 Sept 2" text,
"Week 2 Sept 7" text,
"Week 3 Sept 14" text,
"Week 5 Sept 28" text,
"Week 6 Oct 5" text,
"Week 7 Oct 12" text,
"Week 10 Nov 2" text,
"Week 13 Nov 23" text,
"Week 14 Nov 30" text,
"Week 15 Dec 7" text,
"Week 16 ... | SELECT "Week 2 Sept 7" FROM table_34487 WHERE "Week 6 Oct 5" = 'wake forest (3-1)' |
### Instruction:
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
... | SELECT Time, meter_100 FROM swimmer |
### Instruction:
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State ... | SELECT Year, COUNT(Year) FROM wine WHERE Price > 100 GROUP BY Grape, Year ORDER BY Year |
### Instruction:
CREATE TABLE table_train_89 (
"id" int,
"chronically_uncontrolled_hypertension" bool,
"uncontrolled_diabetes" bool,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"geriatric_depression_scale_gds" int,
"major_... | SELECT * FROM table_train_89 WHERE uncontrolled_diabetes = 1 OR hemoglobin_a1c_hba1c > 7 OR chronically_uncontrolled_hypertension = 1 |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home |
### Instruction:
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes... | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name |
### Instruction:
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value_billion text
)
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREA... | SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name |
### Instruction:
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State ... | SELECT Year, AVG(MAX(Price)) FROM wine ORDER BY AVG(MAX(Price)) DESC |
### Instruction:
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,... | SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director |
### Instruction:
CREATE TABLE table_41247 (
"Event" text,
"2006\u201307" text,
"2007\u201308" text,
"2008\u201309" text,
"2009\u201310" text,
"2010\u201311" text,
"2011\u201312" text,
"2012\u201313" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "2008\u201309" FROM table_41247 WHERE "2011\u201312" = 'qf' |
### Instruction:
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departu... | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY origin DESC |
### Instruction:
CREATE TABLE table_23430 (
"Colt model no." text,
"Military designation" text,
"Barrel Length" text,
"Barrel" text,
"Handguard type" text,
"Buttstock type" text,
"Pistol grip type" text,
"Lower receiver type" text,
"Upper receiver type" text,
"Rear sight type" te... | SELECT "Rear sight type" FROM table_23430 WHERE "Muzzle device" = 'ACR muzzle brake' |
### Instruction:
CREATE TABLE table_64733 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT AVG("Latitude") FROM table_64733 WHERE "Land ( sqmi )" < '35.874' AND "Pop. (2010)" > '35' AND "County" = 'cass' AND "Water (sqmi)" = '0.008' |
### Instruction:
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
... | SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office) |
### Instruction:
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE photos (
id int,
camera_lens_id int,... | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name |
### Instruction:
CREATE TABLE table_34486 (
"Week 1 Sept 2" text,
"Week 2 Sept 7" text,
"Week 3 Sept 14" text,
"Week 5 Sept 28" text,
"Week 6 Oct 5" text,
"Week 7 Oct 12" text,
"Week 10 Nov 2" text,
"Week 13 Nov 23" text,
"Week 14 Nov 30" text,
"Week 15 Dec 7" text,
"Week 16 ... | SELECT "Week 3 Sept 14" FROM table_34486 WHERE "Week 6 Oct 5" = 'kansas (4-1)' |
### Instruction:
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_o... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) DESC |
### Instruction:
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested int,
total_budget_percent_invested real,
Budget_invested_percent text
)
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot te... | SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY County |
### Instruction:
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
service... | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week DESC |
### Instruction:
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE song (
song_name text,
artist_name text,
country tex... | SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7 |
### Instruction:
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real... | SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY County DESC |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Neutral |
### Instruction:
CREATE TABLE table_203_59 (
id number,
"country" text,
"2000" number,
"2001" number,
"2002" number,
"2003" number,
"2004" number,
"2005" number,
"2006" number,
"2007" number,
"2008" number,
"2009" number,
"2010" number,
"2011" number
)
-- Using ... | SELECT "country" FROM table_203_59 WHERE "2011" < (SELECT "2011" FROM table_203_59 WHERE "country" = 'brazil') ORDER BY "2011" DESC LIMIT 1 |
### Instruction:
CREATE TABLE happy_hour (
HH_ID int,
Shop_ID int,
Month text,
Num_of_shaff_in_charge int
)
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE happy_hour_member (
HH_ID int,
Member_ID int,
Total_am... | SELECT Time_of_purchase, Age FROM member GROUP BY Address ORDER BY Time_of_purchase |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Neutral |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Road |
### Instruction:
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0... | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY origin |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Road, School_ID FROM basketball_match ORDER BY All_Road DESC |
### Instruction:
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_o... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) |
### Instruction:
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE customer (
cust_id text,
cust_name text,
a... | SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' |
### Instruction:
CREATE TABLE CHARACTERISTICS (
characteristic_id VARCHAR,
characteristic_name VARCHAR
)
CREATE TABLE products (
product_id VARCHAR,
color_code VARCHAR
)
CREATE TABLE product_characteristics (
product_id VARCHAR,
characteristic_id VARCHAR
)
CREATE TABLE ref_colors (
color_... | SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow" |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Road |
### Instruction:
CREATE TABLE table_1470 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
... | SELECT MIN("40 to 44") FROM table_1470 |
### Instruction:
CREATE TABLE has_amenity (
dormid VARCHAR,
amenid VARCHAR
)
CREATE TABLE lives_in (
stuid VARCHAR,
dormid VARCHAR
)
CREATE TABLE dorm_amenity (
amenid VARCHAR,
amenity_name VARCHAR
)
CREATE TABLE student (
fname VARCHAR,
age VARCHAR,
stuid VARCHAR
)
-- Using val... | SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') |
### Instruction:
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
Sta... | SELECT Year, SUM(AVG(Price)) FROM wine ORDER BY SUM(AVG(Price)) |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season |
### Instruction:
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREA... | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price) |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY All_Road |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games DESC |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Home |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Games, Team_ID FROM basketball_match ORDER BY All_Games DESC |
### Instruction:
CREATE TABLE nomination (
Artwork_ID int,
Festival_ID int,
Result text
)
CREATE TABLE festival_detail (
Festival_ID int,
Festival_Name text,
Chair_Name text,
Location text,
Year int,
Num_of_Audience int
)
CREATE TABLE artwork (
Artwork_ID int,
Type text,
... | SELECT T3.Festival_Name, T1.Festival_ID FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T1.Festival_ID |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home |
### Instruction:
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
apps number,
tries number,
goals text,
points number
)
CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
bronze number,
total number... | SELECT AVG(gold) FROM club_rank |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home |
### Instruction:
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE player (
player_id number,
name text,
position text,
clu... | SELECT name FROM club ORDER BY name DESC |
### Instruction:
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Mar... | SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_Name) |
### Instruction:
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appe... | SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) DESC |
### Instruction:
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_o... | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Games, Team_ID FROM basketball_match ORDER BY All_Games |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home |
### Instruction:
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took... | SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY Minister |
### Instruction:
CREATE TABLE table_53535 (
"G\u00fczel\u00e7aml\u0131\u2019nin Kay\u0131p Panteri" text,
"G\u00fczel\u00e7aml\u0131\u2019s Lost Panther" text,
"Collection of Short Stories" text,
"Can Yay\u0131nlar\u0131" text,
"2005" real
)
-- Using valid SQLite, answer the following questions fo... | SELECT "2005" FROM table_53535 WHERE "G\u00fczel\u00e7aml\u0131\u2019s Lost Panther" = 'green fairy' |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY Team_Name |
### Instruction:
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE songs (
son... | SELECT type FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands" |
### Instruction:
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State ... | SELECT Grape, COUNT(Grape) FROM wine WHERE Price > 100 GROUP BY Grape |
### Instruction:
CREATE TABLE member (
member_id number,
member_name text,
party_id text,
in_office text
)
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
region_id number,
region_name text,
d... | SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1 |
### Instruction:
CREATE TABLE table_1469 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
... | SELECT MIN("25 to 29") FROM table_1469 |
### Instruction:
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE club (
clubid number,
clubname ... | SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M" |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Games |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home |
### Instruction:
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Ye... | SELECT Time, ID FROM swimmer |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY Team_Name |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY Team_Name |
### Instruction:
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested int,
total_budget_percent_invested real,
Budget_invested_perc... | SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment) DESC |
### Instruction:
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num... | SELECT Venue, COUNT(Venue) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Venue ORDER BY COUNT(Venue) |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Games |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Games, Team_ID FROM basketball_match ORDER BY Team_ID DESC |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation DESC |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home |
### Instruction:
CREATE TABLE table_64882 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT AVG("GEO ID") FROM table_64882 WHERE "Latitude" < '46.57958' AND "Longitude" = '-102.109898' AND "Land ( sqmi )" > '35.99' |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home |
### Instruction:
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
apps number,
tries number,
goals text,
points number
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TAB... | SELECT competition_type, country FROM competition |
### Instruction:
CREATE TABLE table_77501 (
"Year" real,
"B\u00f6tzow" real,
"Schwante" real,
"Vehlefanz" real,
"Neu-Vehlefanz" real,
"Marwitz" real,
"B\u00e4renklau" real,
"Eichst\u00e4dt" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT COUNT("Year") FROM table_77501 WHERE "Schwante" < '2.043' AND "Eichst\u00e4dt" < '848' AND "B\u00e4renklau" < '1.262' |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Road |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY ACC_Percent |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road |
### Instruction:
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_I... | SELECT Company, Rank FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.