instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (... | SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY Age DESC |
### Instruction:
CREATE TABLE member (
member_id number,
member_name text,
party_id text,
in_office text
)
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE region (
region_id number,
... | SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id |
### Instruction:
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
ica... | SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
### Instruction:
CREATE TABLE table_62514 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"5:00 pm" text,
"6:30 pm" tex... | SELECT "1:30 pm" FROM table_62514 WHERE "4:00 pm" = 'pinky and the brain' |
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Neutral DESC |
### Instruction:
CREATE TABLE routes (
rid integer,
dst_apid integer,
dst_ap varchar(4),
src_apid bigint,
src_ap varchar(4),
alid bigint,
airline varchar(4),
codeshare text
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign ... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country |
### 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_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season 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 ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY 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, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY Company 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_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID DESC |
### Instruction:
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Vid... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName |
### Instruction:
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
... | SELECT T1.rank, COUNT(*) FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.rank |
### Instruction:
CREATE TABLE table_37642 (
"Location (State, City)" text,
"USN 2013" real,
"BW 2013" real,
"Forbes 2011" real,
"Ec 2013" real,
"FT 2011" real,
"AE 2011" real,
"CNN 2011" real,
"BI 2013" real,
"ARWU 2012" real
)
-- Using valid SQLite, answer the following questi... | SELECT "BW 2013" FROM table_37642 WHERE "ARWU 2012" > '51' AND "Location (State, City)" = 'washington, d.c.' |
### Instruction:
CREATE TABLE operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in text,
Group_Equity_Shareholding real
)
CREATE TABLE airport (
id int,
City text,
Country text,
IATA text,
ICAO text,
name text
)
CREATE TABLE flight ... | SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id ORDER BY T1.id |
### Instruction:
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE T... | SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name ORDER BY COUNT(County_name) |
### Instruction:
CREATE TABLE table_12825 (
"Rank" real,
"Family" text,
"Abbre\u00adviation" text,
"Constellation" text,
"Area (sq.deg.)" real,
"Area (msr)" real,
"Per\u00adcent\u00adage" text,
"Right ascension (hm)" real,
"Decli\u00adnation (dm)" text,
"Quad" text
)
-- Using v... | SELECT SUM("Area (sq.deg.)") FROM table_12825 WHERE "Area (msr)" = '43.059' AND "Right ascension (hm)" > '747.73' |
### Instruction:
CREATE TABLE table_7478 (
"LastDays begin" text,
"Startof Christ's Presence" text,
"Christ madeKing" text,
"Resurrection of144,000" text,
"Judgmentof Religion" text,
"Separating Sheep &Goats" text,
"Great Tribulation" text
)
-- Using valid SQLite, answer the following ques... | SELECT "Resurrection of144,000" FROM table_7478 WHERE "Startof Christ's Presence" = '1914' AND "Separating Sheep &Goats" = 'during christ''s presence' AND "Great Tribulation" = '1975?' |
### 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_Regular_Season, School_ID FROM basketball_match ORDER BY ACC_Regular_Season DESC |
### Instruction:
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE customer (
cu... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY cust_name DESC |
### 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(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName) DESC |
### Instruction:
CREATE TABLE competition_record (
competition_id number,
farm_id number,
rank number
)
CREATE TABLE farm (
farm_id number,
year number,
total_horses number,
working_horses number,
total_cattle number,
oxen number,
bulls number,
cows number,
pigs number,
... | SELECT MAX(cows), MIN(cows) FROM farm |
### Instruction:
CREATE TABLE table_20951 (
"Year" real,
"Edmonton Hundred" real,
"Elthorne Hundred" real,
"Gore Hundred" real,
"Isleworth Hundred" real,
"Holborn Division" real,
"Finsbury Division" real,
"Kensington Division" real,
"Tower Division" real,
"Spelthorne Hundred" rea... | SELECT MAX("Gore Hundred") FROM table_20951 WHERE "Spelthorne Hundred" = '12743' |
### Instruction:
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
... | SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name ORDER BY COUNT(County_name) DESC |
### Instruction:
CREATE TABLE member (
member_id number,
member_name text,
party_id text,
in_office text
)
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE region (
region_id number,
... | SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2 |
### Instruction:
CREATE TABLE table_16548 (
"Engine" text,
"Power, continuous" text,
"Critical altitude This is the highest altitude at which the engine can achieve its full continuous power rating. Above this altitude, power falls off with height as with a naturally aspirated engine . See Supercharger#Alti... | SELECT "Compression ratio" FROM table_16548 WHERE "Power, continuous" = 'hp (kW) at 2,200 RPM' AND "Octane rating" = '80/87' |
### 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 ORDER BY Team_ID |
### 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 ACC_Regular_Season |
### Instruction:
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE member (
member_id number,
card_number text,
name text,
... | SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id |
### Instruction:
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
... | SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id ORDER BY network_name DESC |
### Instruction:
CREATE TABLE table_name_61 (
pocona_municipality___percentage_ INTEGER,
entre_ríos_municipality___percentage_ VARCHAR,
puerto_villarroel_municipality___percentage_ VARCHAR,
chimoré_municipality___percentage_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the table... | SELECT MIN(pocona_municipality___percentage_) FROM table_name_61 WHERE puerto_villarroel_municipality___percentage_ < 14.6 AND chimoré_municipality___percentage_ = 5.1 AND entre_ríos_municipality___percentage_ < 0.9 |
### Instruction:
CREATE TABLE flight (
id int,
Vehicle_Flight_number text,
Date text,
Pilot text,
Velocity real,
Altitude real,
airport_id int,
company_id int
)
CREATE TABLE airport (
id int,
City text,
Country text,
IATA text,
ICAO text,
name text
)
CREATE TABL... | SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY Type ORDER BY COUNT(Type) |
### 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_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
### 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_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent |
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
### 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_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC |
### Instruction:
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstNa... | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName |
### Instruction:
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE ... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) 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_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID DESC |
### Instruction:
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE ma... | SELECT DISTINCT T2.position FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T1.capital = "Dublin" |
### Instruction:
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),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departu... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) |
### 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 club_rank (
rank number,
club_id number,
gold number,
si... | SELECT MAX(silver), MIN(silver) FROM club_rank |
### Instruction:
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is tex... | SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 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 event (
ID int,
Name text,
Stadium_ID int,
Ye... | SELECT name, ID FROM swimmer ORDER BY name |
### Instruction:
CREATE TABLE table_60644 (
"Year" real,
"Total Horses" real,
"Working Horses" text,
"Total Cattle" real,
"Oxen" real,
"Bulls" text,
"Cows" real,
"Pigs" real,
"Sheep and Goats" real
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT MIN("Total Horses") FROM table_60644 WHERE "Total Cattle" < '6274.1' AND "Oxen" < '156.5' AND "Bulls" = '40.0' AND "Cows" < '3377' |
### 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 Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID |
### Instruction:
CREATE TABLE table_66896 (
"Year" text,
"Superintendent" text,
"Glendale Principal" text,
"H.H. Principal" text,
"Maplemere Principal" text,
"W.R. Principal" text,
"M.S. Principal" text,
"H.S. Principal" text,
"H. S. Asst. Principal" text
)
-- Using valid SQLite, a... | SELECT "Glendale Principal" FROM table_66896 WHERE "M.S. Principal" = 'greg smorel' AND "H.S. Principal" = 'joleen reinholz' AND "Year" = '2006-2007' |
### Instruction:
CREATE TABLE table_46684 (
"Player" text,
"Games Played" real,
"Minutes Played" real,
"Minutes Played Per Game" real,
"Rebounds" real,
"Rebounds Per Game" real,
"Assists" real,
"Assists Per Game" real,
"Field Goal %" real,
"Free Throw %" real,
"Points" real,
... | SELECT COUNT("Field Goal %") FROM table_46684 WHERE "Free Throw %" > '0.5' AND "Rebounds" = '159' AND "Points Per Game" < '7.1' |
### Instruction:
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year number
)
CREATE TABLE event (
id number,
name text,
stadium_id number,
year text
)
CREATE TABLE record (
id number,
result text,
swimmer_id number,
... | SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event) |
### Instruction:
CREATE TABLE swimmer (
id number,
name text,
nationality text,
meter_100 number,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
time text
)
CREATE TABLE record (
id number,
result text,
swimmer_id ... | SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1 |
### Instruction:
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
C... | SELECT Status, AVG(Population) FROM city GROUP BY Status |
### 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, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road |
### Instruction:
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
L... | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID |
### Instruction:
CREATE TABLE mountain (
id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE camera_lens (
id number,
brand text,
name text,
focal_length_mm number,
max_aperture number
)
CREATE TABLE photos (
id number,
ca... | SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma' |
### Instruction:
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstNa... | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName) |
### Instruction:
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
... | SELECT T2.season, T2.player, T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country |
### Instruction:
CREATE TABLE table_dev_22 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"cardiovascular_disease" bool,
"esophageal_varices" bool,
"liver_disease" bool,
"diabetes" bool,
"serum_creatinine" float,
"hypertension" bool,
"portal_... | SELECT * FROM table_dev_22 WHERE (serum_creatinine < 1.5 AND gender = 'male') OR (serum_creatinine < 1.4 AND gender = 'female') |
### Instruction:
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
-- U... | SELECT AVG(age) FROM student WHERE stuid IN (SELECT T1.stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "animal") |
### Instruction:
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CRE... | SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment) DESC |
### Instruction:
CREATE TABLE player (
player_id number,
player text,
team text,
age number,
position text,
school_id number
)
CREATE TABLE school_performance (
school_id number,
school_year text,
class_a text,
class_aa text
)
CREATE TABLE school_details (
school_id number,... | SELECT location FROM school ORDER BY founded DESC |
### Instruction:
CREATE TABLE table_42283 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text... | SELECT "2009" FROM table_42283 WHERE "2001" = 'not masters series' |
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
### Instruction:
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CR... | SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands" |
### Instruction:
CREATE TABLE store_district (
store_id number,
district_id number
)
CREATE TABLE product (
product_id number,
product text,
dimensions text,
dpi number,
pages_per_minute_color number,
max_page_size text,
interface text
)
CREATE TABLE store (
store_id number,
... | SELECT AVG(pages_per_minute_color) FROM product |
### Instruction:
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CR... | SELECT Time, ID FROM swimmer ORDER BY ID |
### 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, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY Company |
### Instruction:
CREATE TABLE table_50263 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "2005" FROM table_50263 WHERE "2011" = 'q2' AND "2012" = 'q1' AND "2003" = '1r' |
### Instruction:
CREATE TABLE table_12686 (
"Season" text,
"GP/MP" text,
"Kills" real,
"K/Game" real,
"Errors" real,
"Total Attempts" real,
"Percentage" real,
"Assists" real,
"Service Aces" real,
"Digs" real,
"Solo Blocks" real,
"Block Assists" real,
"Total Blocks" re... | SELECT MIN("Total Attempts") FROM table_12686 WHERE "Percentage" > '0.34900000000000003' AND "Service Aces" < '13' |
### 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 Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) |
### Instruction:
CREATE TABLE table_10512 (
"Squad No." real,
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Playoff Apps"... | SELECT MIN("League Goals") FROM table_10512 WHERE "Position" = 'fw' AND "FA Cup Apps" = '0' AND "Playoff Goals" > '0' |
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC |
### Instruction:
CREATE TABLE farm_competition (
competition_id number,
year number,
theme text,
host_city_id number,
hosts text
)
CREATE TABLE city (
city_id number,
official_name text,
status text,
area_km_2 number,
population number,
census_ranking text
)
CREATE TABLE co... | SELECT theme FROM farm_competition ORDER BY year |
### 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_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC |
### Instruction:
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office 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,
Region_name text,
Date text,
L... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID |
### 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_Name, All_Games_Percent FROM basketball_match ORDER BY All_Games_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 ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY COUNT(ACC_Road) |
### Instruction:
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
service... | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY COUNT(local_authority) |
### Instruction:
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,
Area_size real,
Number_of_product_category real,
Ranking int
)
CREATE... | SELECT Type, COUNT(*) FROM store GROUP BY Type |
### 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 competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
bronze number,
total number
)
CREATE TABLE player (
player_id number,... | SELECT position, AVG(points) FROM player GROUP BY position |
### Instruction:
CREATE TABLE table_13384 (
"2002/ 03" text,
"2003/ 04" text,
"2004/ 05" text,
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the followin... | SELECT "2006/ 07" FROM table_13384 WHERE "2007/ 08" = 'nr' |
### Instruction:
CREATE TABLE school_details (
school_id number,
nickname text,
colors text,
league text,
class text,
division text
)
CREATE TABLE school (
school_id number,
school text,
location text,
enrollment number,
founded number,
denomination text,
boys_or_gir... | SELECT AVG(enrollment) FROM school |
### Instruction:
CREATE TABLE table_52125 (
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 \u221a" text,
"D 46 \u221a" text,
"D 47 \u221a" text,
"D 48 \u221a" text,
"D 49 \u221a" text,
"D 50 O" text
)
-- Using valid SQLite, answer the foll... | SELECT "D 48 \u221a" FROM table_52125 WHERE "D 50 O" = 'd 31' |
### 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 T3.name, COUNT(T3.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 T3.name |
### Instruction:
CREATE TABLE table_62515 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"5:00 pm" text,
"6:30 pm" tex... | SELECT "12:30 pm" FROM table_62515 WHERE "8:00 am" = 'good morning america' |
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Games_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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation DESC |
### Instruction:
CREATE TABLE table_68764 (
"Group" real,
"Half-Life (s)" real,
"Decay Constant (s \u22121 )" real,
"Yield, Neutrons per Fission" real,
"Fraction" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest group number that ha... | SELECT MIN("Group") FROM table_68764 WHERE "Fraction" < '0.000748' AND "Half-Life (s)" = '55.72' AND "Decay Constant (s \u22121 )" > '0.012400000000000001' |
### Instruction:
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
... | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY T2.Name DESC |
### Instruction:
CREATE TABLE table_test_13 (
"id" int,
"systolic_blood_pressure_sbp" int,
"tachycardia" int,
"diastolic_blood_pressure_dbp" int,
"total_cholesterol" int,
"high_density_lipoprotein_cholesterol_hdl_c" int,
"serum_creatinine" float,
"alcohol_abuse" bool,
"drug_abuse" bo... | SELECT * FROM table_test_13 WHERE diastolic_blood_pressure_dbp < 90 |
### Instruction:
CREATE TABLE student (
stu_num VARCHAR,
stu_lname VARCHAR
)
CREATE TABLE enroll (
class_code VARCHAR,
stu_num VARCHAR
)
CREATE TABLE CLASS (
class_code VARCHAR,
crs_code VARCHAR
)
CREATE TABLE course (
crs_description VARCHAR,
crs_credit VARCHAR,
crs_code VARCHAR
... | SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson' |
### 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, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road |
### Instruction:
CREATE TABLE table_58837 (
"7:00 am" text,
"9:00 am" text,
"10:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"2:30 pm" text,
"3:30 pm" text,
"4:30 pm" text,
"5:00 pm" text,
"6:30 pm" te... | SELECT "noon" FROM table_58837 WHERE "12:30 pm" = 'the young and the restless' |
### Instruction:
CREATE TABLE table_7930 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
... | SELECT "1999" FROM table_7930 WHERE "1998" = 'grand slam tournaments' |
### 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 meter_500, ID FROM swimmer |
### 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 company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_bil... | SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion |
### 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(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC |
### Instruction:
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
)
CREA... | SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Home_team, Away_team ORDER BY COUNT(Away_team) 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 Team_Name, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
### Instruction:
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
... | SELECT Committee, COUNT(Committee) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" GROUP BY Committee |
### Instruction:
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE inst (
instid number,
name text,
c... | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.