instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE table_25441 (
"Year" real,
"Tournaments" real,
"Titles" real,
"Hardcourt W\u2013L" text,
"Clay W\u2013L" text,
"Grass W\u2013L" text,
"Carpet W\u2013L" text,
"Overall W\u2013L" text,
"Win %" text,
"Year End Ranking" text
)
-- Using valid SQLite, an... | SELECT "Carpet W\u2013L" FROM table_25441 WHERE "Year" = '1993' |
### Instruction:
CREATE TABLE table_65364 (
"1953" text,
"1954" text,
"1955" text,
"1956" text,
"1957" text,
"1958" text,
"1959" text,
"1960" text,
"1961" text,
"1962" text,
"1963" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "1958" FROM table_65364 WHERE "1957" = '2' AND "1956" = '3' |
### Instruction:
CREATE TABLE table_17784 (
"Day" text,
"Sunday Surya (the Sun)" text,
"Monday Soma (the Moon)" text,
"Tuesday Mangala (Mars)" text,
"Wednesday Budha (Mercury)" text,
"Thursday Guru (Jupiter)" text,
"Friday Shukra (Venus)" text,
"Saturday Shani (Saturn)" text
)
-- Using... | SELECT "Thursday Guru (Jupiter)" FROM table_17784 WHERE "Wednesday Budha (Mercury)" = 'বুধবার Budhbar' |
### Instruction:
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 ... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC |
### Instruction:
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE albums (
aid number,
title text,
... | SELECT DISTINCT label FROM albums |
### Instruction:
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_pres... | SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.class_president_vote |
### Instruction:
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 ... | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
### Instruction:
CREATE TABLE table_66146 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part numb... | SELECT "L3 cache" FROM table_66146 WHERE "Release price ( USD )" = '$440' |
### Instruction:
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
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
)
... | SELECT Openning_year, COUNT(Openning_year) FROM cinema ORDER BY Openning_year DESC |
### Instruction:
CREATE TABLE table_13910 (
"Rank" real,
"Airport" text,
"City" text,
"Code (IATA/ICAO)" text,
"2009" real,
"2010" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank is an airport coded CLJ/LRCL, with a value larger than 32... | SELECT MIN("Rank") FROM table_13910 WHERE "2009" > '32,561' AND "Code (IATA/ICAO)" = 'clj/lrcl' AND "2010" > '1,028,907' |
### Instruction:
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 ... | SELECT Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY COUNT(Founder) |
### Instruction:
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the first and la... | SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER" |
### Instruction:
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CR... | SELECT COUNT(*) FROM faculty |
### Instruction:
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region... | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name |
### Instruction:
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_... | SELECT Location, COUNT(Location) FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID GROUP BY Location |
### Instruction:
CREATE TABLE table_34139 (
"common name" text,
"protein name" text,
"divergence from human lineage (MYA)" real,
"accession number" text,
"sequence length (aa)" real,
"sequence identity to human protein" text
)
-- Using valid SQLite, answer the following questions for the table... | SELECT "sequence identity to human protein" FROM table_34139 WHERE "divergence from human lineage (MYA)" > '8.8' AND "sequence length (aa)" > '1587' AND "protein name" = 'soga2' |
### Instruction:
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,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state te... | SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer) |
### Instruction:
CREATE TABLE checking (
custid VARCHAR,
balance INTEGER
)
CREATE TABLE accounts (
name VARCHAR,
custid VARCHAR
)
CREATE TABLE savings (
custid VARCHAR,
balance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names o... | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM savings) |
### Instruction:
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
... | SELECT DISTINCT T1.major FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.treasurer_vote |
### Instruction:
CREATE TABLE table_64446 (
"Rank" real,
"Metropolitan area" text,
"Country" text,
"GDP (PPP) (2008) Billions of US$" real,
"Metropolitan population (2006) Millions" real,
"GDP (PPP) US$ per capita" real
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT AVG("Metropolitan population (2006) Millions") FROM table_64446 WHERE "Metropolitan area" = 'lima' AND "GDP (PPP) US$ per capita" > '13,100' |
### Instruction:
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE people (
People_ID int,
Age int,
Name text,
Nationality text,
Graduation_College text
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Indust... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC |
### Instruction:
CREATE TABLE table_3031 (
"Position" text,
"Name" text,
"Nationality" text,
"Event 1 Medley" text,
"Event 2 Truck Pull" text,
"Event 3 Squat Lift" text,
"Event 4 Carwalk" text,
"Event 5 Dumbbell Press" text,
"Event 6 Atlas Stones" text
)
-- Using valid SQLite, answ... | SELECT "Event 1 Medley" FROM table_3031 WHERE "Event 3 Squat Lift" = '4 (6 in 31.85s)' |
### Instruction:
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connection text
)
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
co... | SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id ORDER BY id |
### Instruction:
CREATE TABLE table_34867 (
"Team" text,
"Average" real,
"Points" real,
"Played" real,
"1989-90" text,
"1990-91" text,
"1991-1992" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of averages where the ... | SELECT SUM("Average") FROM table_34867 WHERE "Played" > '38' AND "1990-91" = '39' AND "1989-90" = '34' |
### Instruction:
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region... | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name DESC |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder |
### Instruction:
CREATE TABLE table_51902 (
"Draw" real,
"Artist" text,
"Song" text,
"Rank" real,
"Points" real,
"A. Krajka" real,
"Gj. Leka" real,
"B. Haxhia" real,
"D. Tukiqi" real,
"R. Magjistari" real,
"Gj. Xhuvani" real,
"A. Sk\u00ebnderaj" real
)
-- Using valid SQ... | SELECT MAX("Points") FROM table_51902 WHERE "R. Magjistari" > '12' |
### Instruction:
CREATE TABLE table_50602 (
"Oklahoma vs." text,
"Overall Record" text,
"at Norman" text,
"at Opponent's Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"Since Beginning of Big 12" text
)
-- Using valid SQ... | SELECT "Oklahoma vs." FROM table_50602 WHERE "Current Streak" = 'l 1' AND "at Neutral Site" = 'osu, 7-6' |
### Instruction:
CREATE TABLE member (
member_id text,
name text,
nationality text,
role text
)
CREATE TABLE performance (
performance_id number,
date text,
host text,
location text,
attendance number
)
CREATE TABLE member_attendance (
member_id number,
performance_id numbe... | SELECT T2.name, T3.location FROM member_attendance AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id JOIN performance AS T3 ON T1.performance_id = T3.performance_id ORDER BY T2.name |
### Instruction:
CREATE TABLE table_49795 (
"Province" text,
"South Asians 2001" real,
"% 2001" text,
"South Asians 2011" real,
"% 2011" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What % of South Asians were in Nova Scotia in 2001 with 115 and 2... | SELECT "% 2001" FROM table_49795 WHERE "South Asians 2001" > '115' AND "South Asians 2011" > '12,620' AND "Province" = 'nova scotia' |
### Instruction:
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 ... | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
### Instruction:
CREATE TABLE table_46444 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Average 1" real,
"Points 2" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT AVG("Goals Against") FROM table_46444 WHERE "Drawn" > '9' AND "Lost" > '15' AND "Position" = '24' AND "Played" < '46' |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
### Instruction:
CREATE TABLE table_21907 (
"Rank" real,
"Family" text,
"Abbre\u00adviation" text,
"Constellation" text,
"Area (sq.deg.)" text,
"Area (msr)" text,
"Per\u00adcent\u00adage" text,
"Right ascension (hm)" text,
"Decli\u00adnation (dm)" text,
"Quad" text
)
-- Using v... | SELECT "Per\u00adcent\u00adage" FROM table_21907 WHERE "Abbre\u00adviation" = 'Nor' |
### Instruction:
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played num... | SELECT stuid, SUM(hours_played) FROM plays_games GROUP BY stuid |
### Instruction:
CREATE TABLE table_67234 (
"Polyphenyl Ether" text,
"Appearance" text,
"Thermal Stability \u00b0F (\u00b0C)" text,
"Viscosity (cSt) at 100\u00b0F (38\u00b0C)" real,
"Viscosity (cSt) at 210\u00b0F (99\u00b0C)" real
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT "Appearance" FROM table_67234 WHERE "Polyphenyl Ether" = '3- and 4-ring oxythio' |
### Instruction:
CREATE TABLE table_41027 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Win %" text
)
-- Using valid SQLite, answer the following q... | SELECT "2007" FROM table_41027 WHERE "2003" = '1r' |
### Instruction:
CREATE TABLE table_1186 (
"Name" text,
"GP" real,
"Solo" real,
"Ast" real,
"Total" real,
"TFL-Yds" text,
"No-Yds" text,
"BrUp" real,
"QBH" real,
"No.-Yds" text,
"Avg" text,
"TD" real,
"Rcv-Yds" text,
"FF" real,
"Blkd Kick" real
)
-- Using va... | SELECT "TFL-Yds" FROM table_1186 WHERE "No-Yds" = '1-0' |
### Instruction:
CREATE TABLE table_202_26 (
id number,
"club" text,
"season" text,
"league\napps" number,
"league\ngoals" number,
"cup1\napps" number,
"cup1\ngoals" number,
"continental2\napps" number,
"continental2\ngoals" number,
"other3\napps" number,
"other3\ngoals" numb... | SELECT MAX("total\ngoals") FROM table_202_26 |
### Instruction:
CREATE TABLE table_train_65 (
"id" int,
"intention_to_arterial_catheter" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"central_venous_pressure_cvp" int,
"receiving_vasopressor" bool,
"pulmonary_artery_occlusive_pressure_paop" int,
"septic_sh... | SELECT * FROM table_train_65 WHERE age >= 18 AND septic_shock = 1 |
### Instruction:
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
... | SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY Committee |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
### Instruction:
CREATE TABLE table_14086 (
"Year(s)" real,
"Tournament or series" text,
"Played in" text,
"Games played ( Tests )" text,
"Games won ( Tests )" text,
"Games lost ( Tests )" text,
"Games drawn ( Tests )" text,
"Points for ( Tests )" text,
"Points against ( Tests )" tex... | SELECT "Points against ( Tests )" FROM table_14086 WHERE "Year(s)" = '2000' AND "Games won ( Tests )" = '4 (1)' |
### Instruction:
CREATE TABLE table_70109 (
"City" text,
"January (Avg. High \u00b0F)" text,
"January (Avg. Low \u00b0F)" text,
"July (Avg. High \u00b0F)" real,
"July (Avg. Low \u00b0F)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city had a... | SELECT "City" FROM table_70109 WHERE "July (Avg. High \u00b0F)" < '84' AND "January (Avg. Low \u00b0F)" = '34.3' |
### Instruction:
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE authors (
authid number,
lname text,
... | 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 WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich" |
### Instruction:
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age num... | SELECT stuid FROM sportsinfo INTERSECT SELECT stuid FROM plays_games |
### Instruction:
CREATE TABLE screen_mode (
graphics_mode number,
char_cells text,
pixels text,
hardware_colours number,
used_kb number,
map text,
type text
)
CREATE TABLE phone (
company_name text,
hardware_model_name text,
accreditation_type text,
accreditation_level text,... | SELECT * FROM chip_model |
### 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, Population FROM county ORDER BY Population |
### Instruction:
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 ... | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
### 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 Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE editor (
editor_id number,
name text,
age number
)
CREATE TABLE journal (
journal_id number,
date text,
theme text,
sales number
)
CREATE TABLE journal_committee (
editor_id number,
journal_id number,
work_type text
)
-- Using valid SQLite, answe... | SELECT T2.name, T2.age, T3.theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.editor_id = T2.editor_id JOIN journal AS T3 ON T1.journal_id = T3.journal_id ORDER BY T3.theme |
### 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 decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY decor DESC |
### Instruction:
CREATE TABLE tweets (
id number,
uid number,
text text,
createdate time
)
CREATE TABLE follows (
f1 number,
f2 number
)
CREATE TABLE user_profiles (
uid number,
name text,
email text,
partitionid number,
followers number
)
-- Using valid SQLite, answer th... | SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Mary" INTERSECT SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Susan" |
### Instruction:
CREATE TABLE table_73770 (
"Rank" real,
"Rank w/o Hydropower" real,
"State" text,
"% Renewable" text,
"% Renewable w/o Hydro" text,
"Renewable electricity (GW\u2022h)" real,
"Renewable electricity w/o Hydro (GW\u2022h)" real,
"Total electricity (GW\u2022h)" real
)
-- U... | SELECT "% Renewable w/o Hydro" FROM table_73770 WHERE "State" = 'South Dakota' |
### Instruction:
CREATE TABLE table_43071 (
"Year" real,
"Drivers" text,
"Races" real,
"Wins" real,
"Poles" real,
"F.L." real,
"Points" real,
"D.C." text,
"T.C." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of D.C. has Ra... | SELECT "D.C." FROM table_43071 WHERE "Races" < '20' AND "Points" > '0' AND "Drivers" = 'christian vietoris' AND "Wins" = '1' |
### Instruction:
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE trai... | SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location ORDER BY AVG(Number_of_Platforms) DESC |
### 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, Population FROM county ORDER BY County_name |
### Instruction:
CREATE TABLE table_204_408 (
id number,
"nation" text,
"1986" text,
"1989" text,
"1991" text,
"1997" text,
"1999" text,
"2000" text,
"2003" text,
"2005" text,
"2007" text,
"2009" text,
"2011" text,
"years" number
)
-- Using valid SQLite, answer ... | SELECT "nation" FROM table_204_408 ORDER BY "2009" LIMIT 1 |
### Instruction:
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE sportsinfo (
stuid number,
sportname te... | SELECT gname, gtype FROM video_games ORDER BY gname |
### Instruction:
CREATE TABLE table_train_94 (
"id" int,
"mini_mental_state_examination_mmse" int,
"substance_dependence" bool,
"psychiatric_disease" bool,
"modified_hachinski_ischemia_scale" int,
"smoking" bool,
"alcohol_abuse" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the f... | SELECT * FROM table_train_94 WHERE mini_mental_state_examination_mmse > 16 OR mini_mental_state_examination_mmse > 26 |
### Instruction:
CREATE TABLE table_train_83 (
"id" int,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"diabetic" string,
"estimated_glomerular_filtration_rate_egfr" int,
"iq" int,
"geriatric_depression_scale_gds" int,
"NOUSE" float
)
-- Using valid SQLite, answer the follow... | SELECT * FROM table_train_83 WHERE estimated_glomerular_filtration_rate_egfr < 45 OR renal_disease = 1 |
### Instruction:
CREATE TABLE table_dev_12 (
"id" int,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"allergy_to_glucagon" bool,
"platelet_count" float,
"diastolic_blood_pressure_dbp" int,
"insulin_requirement" float,
"adverse_reaction_to_glucagon" bool,
"NOUSE"... | SELECT * FROM table_dev_12 WHERE insulin_requirement > 1 OR insulin_requirement < 15 |
### Instruction:
CREATE TABLE table_7369 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"1983\u20131984 Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT MAX("Height (cm)") FROM table_7369 WHERE "1983\u20131984 Team" = 'montreal canadiens' AND "Jersey #" < '21' |
### Instruction:
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
... | SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY Category |
### Instruction:
CREATE TABLE table_204_634 (
id number,
"tour" number,
"official title" text,
"venue" text,
"city" text,
"date\nstart" text,
"date\nfinish" text,
"prize money\nusd" number,
"report" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'malaysia open super series') > (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'french super series') |
### Instruction:
CREATE TABLE table_1346 (
"Num" real,
"Team" text,
"W" real,
"L" real,
"PCT" text,
"PF" real,
"PA" real,
"Last appearance" real,
"Last championship" real,
"HOME games" real,
"Home wins" real,
"Home losses" real,
"Home Win Pct." text,
"ROAD games" ... | SELECT MAX("Num") FROM table_1346 WHERE "L" < '6.0' |
### Instruction:
CREATE TABLE table_26314 (
"Administrative District" text,
"DS Divisions" real,
"GN Divisions" real,
"Total Area (km 2 )" real,
"Land Area (km 2 )" real,
"Sri Lankan Tamil" real,
"Sri Lankan Moors" real,
"Sinhalese" real,
"Indian Tamil" real,
"Other" real,
"T... | SELECT COUNT("Other") FROM table_26314 WHERE "GN Divisions" = '95' |
### Instruction:
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,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE party (
party_id number,
... | SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 |
### Instruction:
CREATE TABLE university (
school_id number,
school text,
location text,
founded number,
affiliation text,
enrollment number,
nickname text,
primary_conference text
)
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_re... | SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation |
### Instruction:
CREATE TABLE table_11254 (
"Language/dialect" text,
"Mana" text,
"Kamu" text,
"Mahu" text,
"Pergi" text,
"Dengan" text,
"Basikal" text,
"Boleh" text,
"-kah (atau tidak)" text,
"Saya" text,
"Ikut" text
)
-- Using valid SQLite, answer the following questions ... | SELECT "-kah (atau tidak)" FROM table_11254 WHERE "Basikal" = 'basikal' AND "Language/dialect" = 'malay language (informal)' |
### Instruction:
CREATE TABLE table_75962 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text,
"Win %" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "2007" FROM table_75962 WHERE "2008" = 'sf' AND "2010" = 'f' |
### Instruction:
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,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE party (
party_id number,
... | SELECT COUNT(DISTINCT party_name) FROM party |
### Instruction:
CREATE TABLE table_22721 (
"Rank" real,
"Metropolitan Statistical Area" text,
"Total Population (2010)" real,
"Indian American Population (2010)" real,
"% Indian American" text,
"Asian American Population (2010)" real,
"% Asian American" text,
"Combined Statistical Area"... | SELECT MAX("Asian American Population (2010)") FROM table_22721 WHERE "Combined Statistical Area" = 'Kansas City-Overland Park-Kansas City, MO-KS CSA' |
### Instruction:
CREATE TABLE table_47306 (
"Rank" real,
"Rank Forbes 2000" real,
"Name" text,
"Headquarters" text,
"Revenue (Bn.$)" real,
"Profit (Bn.$)" real,
"Assets (Bn.$)" real,
"Market value (Bn.$)" real,
"Industry" text
)
-- Using valid SQLite, answer the following questions... | SELECT COUNT("Rank") FROM table_47306 WHERE "Assets (Bn.$)" = '70.74' AND "Market value (Bn.$)" > '11.29' |
### Instruction:
CREATE TABLE table_31467 (
"Rank" real,
"Rider" text,
"Sat 20 Aug" text,
"Mon 22 Aug" text,
"Tues 23 Aug" text,
"Wed 24 Aug" text,
"Thurs 25 Aug" text,
"Fri 26 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT "Thurs 25 Aug" FROM table_31467 WHERE "Wed 24 Aug" = '19'' 59.73 113.216mph' |
### 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 Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY Industry DESC |
### Instruction:
CREATE TABLE flight (
id number,
vehicle_flight_number text,
date text,
pilot text,
velocity number,
altitude number,
airport_id number,
company_id number
)
CREATE TABLE airport (
id number,
city text,
country text,
iata text,
icao text,
name tex... | SELECT type, COUNT(*) FROM operate_company GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE flight (
id number,
vehicle_flight_number text,
date text,
pilot text,
velocity number,
altitude number,
airport_id number,
company_id number
)
CREATE TABLE airport (
id number,
city text,
country text,
iata text,
icao text,
name tex... | SELECT id, country, city, name FROM airport ORDER BY name |
### Instruction:
CREATE TABLE university (
school_id number,
school text,
location text,
founded number,
affiliation text,
enrollment number,
nickname text,
primary_conference text
)
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_re... | SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1 |
### Instruction:
CREATE TABLE table_5613 (
"Rank" real,
"Airline" text,
"2012" real,
"2011" real,
"2010" real,
"2009" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- avg passengers in 2012 for 2009 more than 104.5 and 2010 less than 162.6 and 201... | SELECT AVG("2012") FROM table_5613 WHERE "2009" > '104.5' AND "2010" < '162.6' AND "2011" < '141.8' |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder |
### Instruction:
CREATE TABLE table_31169 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"2nd" real,
"3rd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ( \u20ac )" text,
"Money list rank" text,
"Scoring average" text,
"Scoring rank" text,
... | SELECT MAX("Rolex ranking") FROM table_31169 WHERE "Money list rank" = '3' |
### 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 AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor |
### Instruction:
CREATE TABLE table_64204 (
"Years covered" text,
"All bills sponsored" real,
"All amendments sponsored" real,
"All bills cosponsored" real,
"All amendments cosponsored" real,
"Bills originally cosponsored" real,
"Amendments originally cosponsored" real
)
-- Using valid SQL... | SELECT MAX("All amendments cosponsored") FROM table_64204 WHERE "Amendments originally cosponsored" = '53' AND "All bills sponsored" > '54' |
### Instruction:
CREATE TABLE table_13712 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" real,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answer the... | SELECT AVG("Total Goals") FROM table_13712 WHERE "FA Cup Goals" = '0' AND "FA Cup Apps" = '3' AND "Position" = 'fw' |
### Instruction:
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE participates_in (
stuid number,
actid numb... | SELECT COUNT(*) FROM activity |
### Instruction:
CREATE TABLE people (
People_ID int,
Age int,
Name text,
Nationality text,
Graduation_College text
)
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Indust... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
... | SELECT COUNT(*) FROM songs |
### Instruction:
CREATE TABLE table_9585 (
"Year" real,
"Lijsttrekker" text,
"Fractievoorzitter" text,
"Cabinet" text,
"Chair" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Cabinet, when Year is before 2001, when Lijsttrekker is 'No Electio... | SELECT "Cabinet" FROM table_9585 WHERE "Year" < '2001' AND "Lijsttrekker" = 'no elections' AND "Fractievoorzitter" = 'hans van mierlo' AND "Chair" = 's. van der loo' |
### Instruction:
CREATE TABLE table_35399 (
"Region" text,
"Employment ( salaries & wages)" text,
"Self employed" text,
"Investment income" text,
"Working tax credit" text,
"State pensions" text,
"Occupational pensions" text,
"Disability benefits" text,
"Other social security benefit... | SELECT "Investment income" FROM table_35399 WHERE "State pensions" = '7%' AND "Self employed" = '7%' AND "Other income sources" = '2%' |
### 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 buildings (
id int,
name text,
City text,
Height int,
Stories int,
... | SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE table_203_457 (
id number,
"tramway" text,
"country" text,
"city" text,
"height of pylons" text,
"span width,\nleaning straight line" text,
"span width,\nhorizontal measurement" text,
"height of cable over ground" text,
"year of inauguration" number,
... | SELECT "tramway" FROM table_203_457 WHERE "year of inauguration" = (SELECT "year of inauguration" FROM table_203_457 WHERE "tramway" = '3s aerial tramway') - 1 |
### Instruction:
CREATE TABLE table_train_174 (
"id" int,
"fasting_plasma_glucose_fpg" float,
"hemoglobin_a1c_hba1c" float,
"substance_dependence" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"allergy_to_insulin_lispro" bool,
"urine_albumin_to_creatinine_ratio_uacr" int,
"smoki... | SELECT * FROM table_train_174 WHERE smoking = 1 OR substance_dependence = 1 |
### Instruction:
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 ... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price |
### Instruction:
CREATE TABLE table_46379 (
"Institution" text,
"Wins" real,
"Loss" real,
"Home Wins" real,
"Home Losses" real,
"Away Wins" real,
"Away Losses" real,
"Neutral Wins" real,
"Neutral Losses" real
)
-- Using valid SQLite, answer the following questions for the tables pr... | SELECT COUNT("Neutral Wins") FROM table_46379 WHERE "Home Losses" > '2' AND "Loss" = '7' AND "Away Wins" > '3' |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code |
### Instruction:
CREATE TABLE table_50259 (
"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 "2004" FROM table_50259 WHERE "2009" = 'grand slam tournaments' |
### Instruction:
CREATE TABLE table_76164 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
)
-- Using valid SQLite, answer the following questions for th... | SELECT MIN("Profits (billion $)") FROM table_76164 WHERE "Sales (billion $)" = '425.7' AND "Rank" > '4' |
### Instruction:
CREATE TABLE table_204_907 (
id number,
"lift name" text,
"type" text,
"top\nelevation\n(ft)" number,
"bottom\nelevation" number,
"vertical\nrise" number,
"length\n(ft)" number,
"slope\n(%)" text,
"capacity\n(rides/hr)" number,
"speed\n(ft/min)" number,
"lift... | SELECT COUNT("lift name") FROM table_204_907 WHERE "type" = 'detach quad' |
### 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 bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.