instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE table_50753 (
"Poll source" text,
"Date(s) administered" text,
"Sample size" real,
"Margin of error" text,
"Joe Sestak (D)" text,
"Pat Toomey (R)" text,
"Other" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Other" FROM table_50753 WHERE "Margin of error" = '± 4.5%' AND "Pat Toomey (R)" = '45%' AND "Joe Sestak (D)" = '38%' |
### Instruction:
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,
draft_pick_number number,
draft_class text,
col... | SELECT college FROM match_season GROUP BY college HAVING COUNT(*) >= 2 |
### Instruction:
CREATE TABLE table_7414 (
"Tournament" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text
)
-- Using valid SQLite, answer the following que... | SELECT "2003" FROM table_7414 WHERE "2004" = 'a' |
### Instruction:
CREATE TABLE table_203_185 (
id number,
"season" text,
"a\ntechnical" text,
"b\nscientific" text,
"c\nfine arts" text,
"d\nimprovisational" text,
"e\nstructural" text,
"rising stars!\u00ae" text,
"po\nprojectoutreach\u00ae" text,
"university level" text
)
-- Us... | SELECT "a\ntechnical" FROM table_203_185 WHERE "season" > (SELECT "season" FROM table_203_185 WHERE "a\ntechnical" = 'direct diposit') ORDER BY "season" LIMIT 1 |
### Instruction:
CREATE TABLE budget (
school_id number,
year number,
budgeted number,
total_budget_percent_budgeted number,
invested number,
total_budget_percent_invested number,
budget_invested_percent text
)
CREATE TABLE endowment (
endowment_id number,
school_id number,
dona... | SELECT school_name FROM school ORDER BY enrollment LIMIT 1 |
### Instruction:
CREATE TABLE tweets (
id bigint(20),
uid int(11),
text char(140),
createdate datetime
)
CREATE TABLE user_profiles (
uid int(11),
name varchar(255),
email varchar(255),
partitionid int(11),
followers int(11)
)
CREATE TABLE follows (
f1 int(11),
f2 int(11)
)... | SELECT name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid ORDER BY name DESC |
### Instruction:
CREATE TABLE review (
a_id integer,
u_id integer,
i_id integer,
rating integer,
rank integer
)
CREATE TABLE trust (
source_u_id integer,
target_u_id integer,
trust integer
)
CREATE TABLE useracct (
u_id integer,
name varchar(128)
)
CREATE TABLE item (
i_id... | SELECT name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id ORDER BY name DESC |
### Instruction:
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Parti... | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_ID DESC |
### Instruction:
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VAR... | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details 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_Name, Team_ID FROM basketball_match |
### Instruction:
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
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... | SELECT destination, COUNT(*) FROM flight GROUP BY destination |
### 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code |
### Instruction:
CREATE TABLE table_train_276 (
"id" int,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"hcv" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the followi... | SELECT * FROM table_train_276 WHERE hypertension = 0 OR systolic_blood_pressure_sbp < 130 OR diastolic_blood_pressure_dbp < 80 |
### Instruction:
CREATE TABLE table_63236 (
"Engine" text,
"Production" text,
"Transmission" text,
"Power" text,
"Torque" text,
"Acceleration 0\u2013100km/h (0\u201362mph)" text,
"Top Speed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Production" FROM table_63236 WHERE "Engine" = '2.7l' AND "Acceleration 0\u2013100km/h (0\u201362mph)" = '8.5 s' |
### Instruction:
CREATE TABLE table_train_115 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hepatic_disease" bool,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,
"uncontrolled_blood_pressure" bool,
"NOUSE" f... | SELECT * FROM table_train_115 WHERE glucose_6_phosphate_dehydrogenase_deficiency_g6pd = 0 |
### Instruction:
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name tex... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC |
### Instruction:
CREATE TABLE table_23472 (
"Language" text,
"Concepci\u00f3n Municipality (%)" real,
"San Javier Municipality (%)" real,
"San Ram\u00f3n Municipality (%)" real,
"San Juli\u00e1n Municipality (%)" real,
"San Antonio de Lomer\u00edo Municipality (%)" text,
"Cuatro Ca\u00f1adas... | SELECT "San Javier Municipality (%)" FROM table_23472 WHERE "Cuatro Ca\u00f1adas Municipality (%)" = '202' |
### Instruction:
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority ... | SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE table_25720 (
"#" real,
"Producing Nation" text,
"10 3 bbl/d (2006)" text,
"10 3 bbl/d (2007)" real,
"10 3 bbl/d (2008)" real,
"10 3 bbl/d (2009)" real,
"Present Share" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "10 3 bbl/d (2009)" FROM table_25720 WHERE "10 3 bbl/d (2007)" = '180' |
### 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, School_ID FROM basketball_match |
### Instruction:
CREATE TABLE table_45141 (
"Episode number Production number" text,
"Title" text,
"Sydney" real,
"Melbourne" real,
"Brisbane" real,
"Adelaide" real,
"Perth" real,
"TOTAL" real,
"WEEKLY RANK" real,
"NIGHTLY RANK" real
)
-- Using valid SQLite, answer the followin... | SELECT MIN("Sydney") FROM table_45141 WHERE "WEEKLY RANK" < '8' AND "Brisbane" > '252,000' |
### Instruction:
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
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,
... | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY AVG(Capacity) |
### Instruction:
CREATE TABLE table_52680 (
"Division" text,
"League Apps (Sub)" real,
"League Goals" real,
"FA Cup Apps (Sub)" text,
"FA Cup Goals" real,
"FL Cup Apps (Sub)" real,
"FL Cup Goals" real,
"Other Apps" real,
"Other Goals" real,
"Total Apps (Sub)" text,
"Total Goa... | SELECT AVG("FL Cup Apps (Sub)") FROM table_52680 WHERE "FL Cup Goals" > '0' AND "Other Apps" < '0' |
### Instruction:
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
C... | SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 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 Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC |
### Instruction:
CREATE TABLE table_75380 (
"Years" text,
"2004" real,
"2005" real,
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real,
"2011" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest value in 2... | SELECT MAX("2011") FROM table_75380 WHERE "2006" < '5,049' AND "2008" < '1,380,935' |
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC |
### Instruction:
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
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 (
stui... | SELECT 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" |
### Instruction:
CREATE TABLE table_29189 (
"Rank" real,
"Rider" text,
"Sat 21 Aug" text,
"Mon 23 Aug" text,
"Tues 24 Aug" text,
"Wed 25 Aug" text,
"Thurs 26 Aug" text,
"Fri 27 Aug" text,
"Sat 29 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Tues 24 Aug" FROM table_29189 WHERE "Fri 27 Aug" = '20'' 58.50 107.929mph' |
### Instruction:
CREATE TABLE table_49412 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent in the final has an Ou... | SELECT "Opponent in the final" FROM table_49412 WHERE "Outcome" = 'winner' AND "Date" > '1992' AND "Surface" = 'clay' AND "Score in the final" = '3–6, 6–2, 6–1' |
### Instruction:
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name tex... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name |
### Instruction:
CREATE TABLE table_203_834 (
id number,
"rank" number,
"census subdivision" text,
"province" text,
"type" text,
"land area\n(km2, 2011)" number,
"population 2011" number,
"population 2006" number,
"population 2001" number,
"population 1996" number,
"change in... | SELECT "census subdivision" FROM table_203_834 WHERE id = 1 |
### Instruction:
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
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
... | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY Directed_by 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_Road, Team_ID FROM basketball_match |
### Instruction:
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name DESC |
### Instruction:
CREATE TABLE artwork (
Artwork_ID int,
Type text,
Name text
)
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_A... | 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 |
### Instruction:
CREATE TABLE table_39563 (
"Role" text,
"D'Oyly Carte 1920 Tour" text,
"D'Oyly Carte 1930 Tour" text,
"D'Oyly Carte 1939 Tour" text,
"D'Oyly Carte 1945 Tour" text,
"D'Oyly Carte 1950 Tour" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "D'Oyly Carte 1945 Tour" FROM table_39563 WHERE "D'Oyly Carte 1939 Tour" = 'richard walker' |
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer 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_Games, ACC_Percent FROM basketball_match |
### Instruction:
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
)
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_Affi... | 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 |
### Instruction:
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_P... | SELECT Season, COUNT(Season) FROM game GROUP BY Season ORDER BY Season DESC |
### Instruction:
CREATE TABLE table_name_1 (
upper_index_kcal__nm_3 INTEGER,
upper_index_mj__nm_3 VARCHAR,
lower_index_mj__nm_3 VARCHAR,
fuel_gas VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the entry for Upper index Kcal/ Nm 3 for the row ... | SELECT SUM(upper_index_kcal__nm_3) FROM table_name_1 WHERE lower_index_mj__nm_3 > 47.91 AND fuel_gas = "propylene" AND upper_index_mj__nm_3 > 77.04 |
### Instruction:
CREATE TABLE weekly_weather (
station_id number,
day_of_week text,
high_temperature number,
low_temperature number,
precipitation number,
wind_speed_mph number
)
CREATE TABLE train (
id number,
train_number number,
name text,
origin text,
destination text,
... | SELECT time, train_number FROM train WHERE destination = 'Chennai' ORDER BY time |
### 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC |
### Instruction:
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
draft_class text,
college text
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE player (
player_id number,
player... | SELECT college FROM match_season GROUP BY college ORDER BY COUNT(*) DESC LIMIT 3 |
### Instruction:
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Date text,
Open_Year int
)
CREATE TABLE stock (
Shop_ID int,
Device_ID int,
Quantity int
)
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
App... | SELECT Carrier, COUNT(Carrier) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Carrier |
### Instruction:
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
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
... | SELECT Openning_year, COUNT(Openning_year) FROM cinema GROUP BY Openning_year ORDER BY COUNT(Openning_year) |
### Instruction:
CREATE TABLE table_58892 (
"Team" text,
"2006\u201307 Pts" text,
"2007\u201308 Pts" text,
"2008\u201309 Pts" real,
"Total Pts" real,
"Total Pld" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total pld with 57... | SELECT MIN("Total Pld") FROM table_58892 WHERE "2006\u201307 Pts" = '57' AND "2008\u201309 Pts" > '39' |
### Instruction:
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
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,
... | SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY SUM(Capacity) DESC |
### Instruction:
CREATE TABLE table_203_532 (
id number,
"rebounds" number,
"off" number,
"def" number,
"player" text,
"team" text,
"date" text,
"opponent" text,
"score" text,
"minutes played" text,
"points" number,
"assists" number,
"steals" number,
"blocks" numb... | SELECT SUM("rebounds") FROM table_203_532 WHERE "date" = 1978 |
### Instruction:
CREATE TABLE table_66017 (
"Name" text,
"Nation" 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,
"Total Apps" text... | SELECT "FA Cup Apps" FROM table_66017 WHERE "Total Goals" > '6' AND "FA Cup Goals" < '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 Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter |
### Instruction:
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,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_sp... | SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY COUNT(name) |
### Instruction:
CREATE TABLE table_50696 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE 2009 PERFORMANCE WITH A 2012 OF 2R, 2001 OF 1R,... | SELECT "2009" FROM table_50696 WHERE "2012" = '2r' AND "2011" = '1r' AND "2007" = 'a' AND "2008" = 'a' |
### Instruction:
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.city_name IN (SELECT GEOGRAPHICalias0.city_name FROM geographic AS GEOGRAPHICalias0 WHERE GEOGRAPHICalias0.region = 'bay area') AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 |
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer |
### Instruction:
CREATE TABLE artist (
artist_id number,
artist text,
age number,
famous_title text,
famous_release_date text
)
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE volu... | SELECT T2.song FROM music_festival AS T1 JOIN volume AS T2 ON T1.volume = T2.volume_id WHERE T1.result = "Nominated" |
### Instruction:
CREATE TABLE table_76429 (
"Tournament" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "Tournament" FROM table_76429 WHERE "2013" = '1r' AND "2012" = '1r' |
### 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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC |
### Instruction:
CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent real,
Rating_in_percent real
)
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date tex... | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner DESC |
### Instruction:
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real,
Total_Points real
)
CREATE TABLE people (
People_ID int,
Name text,
Age ... | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE table_39567 (
"Role" text,
"D'Oyly Carte 1920 Tour" text,
"D'Oyly Carte 1930 Tour" text,
"D'Oyly Carte 1939 Tour" text,
"D'Oyly Carte 1945 Tour" text,
"D'Oyly Carte 1950 Tour" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "D'Oyly Carte 1945 Tour" FROM table_39567 WHERE "D'Oyly Carte 1930 Tour" = 'john dean' |
### Instruction:
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,
draft_pick_number number,
draft_class text,
col... | SELECT official_native_language FROM country WHERE official_native_language LIKE "%English%" |
### Instruction:
CREATE TABLE table_57577 (
"Ward" text,
"Bello" text,
"Ben-Tahir" text,
"Doucet" text,
"Furtenbacher" text,
"Gauthier" text,
"Haydon" text,
"Larter" text,
"Lawrance" text,
"Libweshya" text,
"Liscumb" text
)
-- Using valid SQLite, answer the following questi... | SELECT "Furtenbacher" FROM table_57577 WHERE "Liscumb" = '6' AND "Lawrance" = '10' AND "Ben-Tahir" = '24' |
### Instruction:
CREATE TABLE table_34883 (
"Geographic Unit" text,
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real,
"2011" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total 2008 value with a 2006 value greater... | SELECT COUNT("2008") FROM table_34883 WHERE "2006" > '322.7' AND "2011" = '353.9' AND "2009" < '392' |
### Instruction:
CREATE TABLE artwork (
Artwork_ID int,
Type text,
Name text
)
CREATE TABLE festival_detail (
Festival_ID int,
Festival_Name text,
Chair_Name text,
Location text,
Year int,
Num_of_Audience int
)
CREATE TABLE nomination (
Artwork_ID int,
Festival_ID int,
... | 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 |
### Instruction:
CREATE TABLE table_train_127 (
"id" int,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"back_pain" bool,
"renal_disease" bool,
"osteoarthritis" bool,
"hamilton_depression_scale_hds" int,
"liver_disease" bool,
"painful_condition" bool,
"other_chroni... | SELECT * FROM table_train_127 WHERE liver_disease = 1 OR renal_disease = 1 |
### Instruction:
CREATE TABLE movie (
movie_id int,
Title text,
Year int,
Director text,
Budget_million real,
Gross_worldwide int
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category DESC |
### 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 Country, COUNT(*) FROM airport GROUP BY Country ORDER BY Country DESC |
### Instruction:
CREATE TABLE railway_manage (
railway_id number,
manager_id number,
from_year text
)
CREATE TABLE train (
train_id number,
train_num text,
name text,
from text,
arrival text,
railway_id number
)
CREATE TABLE railway (
railway_id number,
railway text,
bu... | SELECT MAX(level) FROM manager WHERE country <> "Australia " |
### 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 Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) 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 T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
### 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 Industry, COUNT(Industry) FROM company GROUP BY Industry ORDER BY COUNT(Industry) DESC |
### Instruction:
CREATE TABLE table_203_642 (
id number,
"name" text,
"quadrant" text,
"sector" text,
"ward" text,
"type" text,
"2012\npopulation\nrank" number,
"population\n(2012)" number,
"population\n(2011)" number,
"% change" number,
"dwellings\n(2012)" number,
"area\... | SELECT "name" FROM table_203_642 WHERE "2012\npopulation\nrank" = 1 |
### 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 "year\ninstalled" > 2000 |
### 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, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer) DESC |
### 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code DESC |
### Instruction:
CREATE TABLE table_10823 (
"Year" real,
"Artist" text,
"Mintage (Proof)" text,
"Issue Price (Proof)" text,
"Mintage (BU)[ clarification needed ]" text,
"Issue Price (BU)[ clarification needed ]" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "Artist" FROM table_10823 WHERE "Issue Price (BU)[ clarification needed ]" = 'n/a' AND "Year" > '2004' AND "Mintage (Proof)" = '25,000' |
### 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, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(T2.Name) |
### Instruction:
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC |
### Instruction:
CREATE TABLE table_58891 (
"Team" text,
"2006\u201307 Pts" text,
"2007\u201308 Pts" text,
"2008\u201309 Pts" real,
"Total Pts" real,
"Total Pld" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total pld that has 36 po... | SELECT SUM("Total Pld") FROM table_58891 WHERE "2007\u201308 Pts" = '36' AND "2008\u201309 Pts" < '55' |
### 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, ACC_Percent FROM basketball_match |
### 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Manufacturer 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 movie (
movie_id int,
Title text,
Year int,
Director text,
Budget_million real,
Gross_world... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
... | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details DESC |
### Instruction:
CREATE TABLE medicine (
id number,
name text,
trade_name text,
fda_approved text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_... | SELECT T1.id, T1.name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 |
### 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 flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departur... | SELECT origin, COUNT(*) FROM flight GROUP BY origin |
### Instruction:
CREATE TABLE table_57564 (
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 O" text,
"D 46 O" text,
"D 47 +" text,
"D 48 +" text,
"D 49 +" text,
"D 50 +" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "D 50 +" FROM table_57564 WHERE "D 48 +" = 'd 53 +' |
### Instruction:
CREATE TABLE table_39174 (
"Team" text,
"Copa Libertadores 1999" text,
"Copa Mercosur 1999" text,
"Copa CONMEBOL 1999" text,
"Intercontinental Cup 1999" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the intercontinental cup... | SELECT "Intercontinental Cup 1999" FROM table_39174 WHERE "Copa Libertadores 1999" = 'did not qualify' AND "Copa Mercosur 1999" = 'quarterfinals' |
### Instruction:
CREATE TABLE table_train_162 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diastolic_blood_pressure_dbp" int,
"NOUSE" float
)
-- Using valid SQLite, answer the foll... | SELECT * FROM table_train_162 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 95 |
### Instruction:
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
... | SELECT Season, COUNT(Season) FROM game ORDER BY Season DESC |
### Instruction:
CREATE TABLE manufacturer (
Manufacturer_ID int,
Open_Year real,
Name text,
Num_of_Factories int,
Num_of_Shops int
)
CREATE TABLE furniture_manufacte (
Manufacturer_ID int,
Furniture_ID int,
Price_in_Dollar real
)
CREATE TABLE furniture (
Furniture_ID int,
Name... | SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) ORDER BY Name DESC |
### Instruction:
CREATE TABLE table_34677 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Ta... | SELECT MIN("University of Dublin") FROM table_34677 WHERE "Administrative Panel" = '3' AND "Cultural and Educational Panel" < '2' |
### 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 T1.Price DESC |
### Instruction:
CREATE TABLE table_23839 (
"Type" text,
"Beam height (mm)" real,
"Flange width (mm)" real,
"Web thickness (mm)" text,
"Flange thickness (mm)" text,
"Weight (kg/m)" text,
"Cross-section area (cm 2 )" text,
"Moment of inertia in torsion (J) (cm 4 )" text
)
-- Using valid... | SELECT COUNT("Moment of inertia in torsion (J) (cm 4 )") FROM table_23839 WHERE "Web thickness (mm)" = '4.7' |
### 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, COUNT(*) FROM School GROUP BY County |
### 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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter) |
### Instruction:
CREATE TABLE table_27479 (
"Rank" real,
"Rank w/o Hydropower" real,
"State" text,
"% Renewable" text,
"% Renewable w/o Hydro" text,
"Renewable electricity (GW\u00b7h)" real,
"Renewable electricity w/o Hydro (GW\u00b7h)" real,
"Total electricity (GW\u00b7h)" real
)
-- U... | SELECT MIN("Renewable electricity (GW\u00b7h)") FROM table_27479 WHERE "Rank" = '36' |
### 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 Grape, COUNT(Grape) FROM wine GROUP BY Grape |
### Instruction:
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Parti... | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY COUNT(Event_Details) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.