instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE table_62877 (
"Team" text,
"Matches" real,
"Wins" real,
"Wins %" text,
"Draws" real,
"Draws %" text,
"Losses" real,
"Losses %" text,
"Against" real,
"For & Against Ratio" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT SUM("Losses") FROM table_62877 WHERE "Matches" = '2' AND "Against" = '2' AND "Draws %" = '0%' AND "Wins" < '1' |
### Instruction:
CREATE TABLE table_21910 (
"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 COUNT("Per\u00adcent\u00adage") FROM table_21910 WHERE "Rank" = '51' |
### 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 gname FROM video_games WHERE gtype = "Collectible card game" |
### Instruction:
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
... | SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE table_27313 (
"Region" text,
"Preschool (0\u20135 years)" text,
"Primary (6\u201313 years)" text,
"Secondary (14\u201317 years)" text,
"Tertiary (18\u201324 years)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is... | SELECT "Preschool (0\u20135 years)" FROM table_27313 WHERE "Tertiary (18\u201324 years)" = '29.55' |
### Instruction:
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text... | SELECT player, years_played FROM player |
### Instruction:
CREATE TABLE table_42552 (
"Time" text,
"06:00 PM" text,
"07:00 PM" text,
"08:00 PM" text,
"09:00 PM" text,
"10:00 PM" text,
"10:30 PM" text,
"11:00 PM" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 10:30 PM... | SELECT "10:30 PM" FROM table_42552 WHERE "08:00 PM" = '[v] play & learn' AND "Time" = 'sunday' |
### Instruction:
CREATE TABLE table_66016 (
"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 "League Cup Goals" FROM table_66016 WHERE "League Cup Apps" = '1 (1)' |
### Instruction:
CREATE TABLE table_train_69 (
"id" int,
"systolic_blood_pressure_sbp" int,
"language" string,
"valvular_dysfunction" bool,
"heart_disease" bool,
"temperature" float,
"sepsis" bool,
"heart_rate" int,
"lipid_metabolism" bool,
"organ_failure" bool,
"NOUSE" float... | SELECT * FROM table_train_69 WHERE sepsis = 1 AND organ_failure = 1 |
### Instruction:
CREATE TABLE table_65229 (
"[ 3 H]CFT" real,
"[ 3 H]Nisoxetine" text,
"[ 3 H]Paroxetine" text,
"N \u00f7 D" real,
"S \u00f7 D" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest S D with a 2420 (220) [3H] paroxetine ... | SELECT MAX("S \u00f7 D") FROM table_65229 WHERE "[ 3 H]Paroxetine" = '2420 (220)' AND "N \u00f7 D" < '393.8' |
### Instruction:
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE customer (
cust_id text,
cust_name text,
a... | SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' |
### Instruction:
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
... | SELECT T1.flno FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" |
### Instruction:
CREATE TABLE table_14768 (
"Class" text,
"Type" text,
"Fleet numbers" text,
"Quantity made" real,
"Manufacturer" text,
"Date made" text,
"1958 CI\u00c9" text,
"1958 UTA" text,
"Date withdrawn" text,
"Notes" text
)
-- Using valid SQLite, answer the following que... | SELECT "Date made" FROM table_14768 WHERE "Notes" = '45/48 renumbered 15/16; two sold to sl&ncr' |
### Instruction:
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
category text,
result text
)
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding numbe... | SELECT category, COUNT(*) FROM book_club GROUP BY category |
### Instruction:
CREATE TABLE table_67556 (
"Builder" text,
"Construct- tion no." real,
"Date ordered" text,
"Wheel arrange- ment" text,
"s Cylinder" text,
"Engine weight" text,
"TC&StL no. (1883\u201384)" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT "Builder" FROM table_67556 WHERE "TC&StL no. (1883\u201384)" > '54' AND "Date ordered" = 'november 1881' |
### Instruction:
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
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
)
-- U... | SELECT DISTINCT T1.fname, T1.city_code FROM student AS T1 JOIN has_allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.allergy = "Milk" OR T2.allergy = "Cat" |
### 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 (
Train_ID int,
Name text,
Time text,
Service text
... | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) |
### Instruction:
CREATE TABLE table_17831 (
"Colt model no." text,
"Diemaco model" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
... | SELECT "Hand guards" FROM table_17831 WHERE "Rear sight" = 'A1' AND "Stock" = 'A2' |
### Instruction:
CREATE TABLE table_43245 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"2006\u20132007 Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT COUNT("Jersey #") FROM table_43245 WHERE "Height (cm)" = '183' AND "Name" = 'paul stastny' AND "Weight (kg)" < '93' |
### Instruction:
CREATE TABLE table_13572 (
"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 "GPU frequency" FROM table_13572 WHERE "Cores" = 'ultra-low power' |
### Instruction:
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
)
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Own... | SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day |
### Instruction:
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points n... | SELECT T2.name FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id WHERE T2.hometown <> "Santo Domingo" |
### Instruction:
CREATE TABLE table_204_371 (
id number,
"team" text,
"competition" text,
"category" text,
"appearances\nstart" number,
"appearances\nsub" number,
"goals" number,
"team record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "competition" FROM table_204_371 WHERE "competition" IN ('2013 eaff east asian cup', '2007 fifa u-17 world cup') ORDER BY "appearances\nstart" DESC LIMIT 1 |
### Instruction:
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points n... | SELECT DISTINCT hometown FROM people EXCEPT SELECT DISTINCT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id |
### Instruction:
CREATE TABLE table_66018 (
"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 COUNT("League Goals") FROM table_66018 WHERE "FA Cup Apps" = '0 (1)' |
### Instruction:
CREATE TABLE Benefits_Overpayments (
council_tax_id VARCHAR,
cmi_cross_ref_id VARCHAR
)
CREATE TABLE CMI_Cross_References (
source_system_code VARCHAR,
cmi_cross_ref_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tax ... | SELECT T1.source_system_code, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id |
### Instruction:
CREATE TABLE table_7862 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT AVG("Goals for") FROM table_7862 WHERE "Goals against" > '59' AND "Club" = 'real avilés cf' AND "Goal Difference" > '-10' |
### Instruction:
CREATE TABLE table_204_878 (
id number,
"model" text,
"release date" text,
"sensor\nres., size" text,
"lens (35 mm equiv.)\nzoom, aperture" text,
"screen\nsize, pixels" text,
"dimensions\nw (mm) \u00d7 h (mm) \u00d7 d (mm)" text,
"weight" text,
"features" text
)
--... | SELECT COUNT("model") FROM table_204_878 WHERE "weight" >= 100 AND "weight" <= 200 |
### Instruction:
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
rating_in_percent number
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE broadcast (
channel_id nu... | SELECT SUM(share_in_percent) FROM channel WHERE owner = 'CCTV' |
### 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 name |
### Instruction:
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major ... | SELECT COUNT(*) 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 = "Tennis Club" |
### Instruction:
CREATE TABLE table_61615 (
"Tournament" text,
"2006" 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 2008 has 1r as a 2010, A as the 2007,... | SELECT "2008" FROM table_61615 WHERE "2010" = '1r' AND "2007" = 'a' AND "2009" = '1r' |
### Instruction:
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Year text,
Total_pounds real
)
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE membership_register_branch (
Member_ID ... | SELECT City, COUNT(City) FROM branch GROUP BY City ORDER BY Open_year |
### Instruction:
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths DESC |
### Instruction:
CREATE TABLE table_27456 (
"Rank" real,
"Rider" text,
"Sat 29 May" text,
"Mon 31 May" text,
"Tues 1 June" text,
"Wed 2 June" text,
"Thurs 3 June" text,
"Fri 4 June" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT COUNT("Tues 1 June") FROM table_27456 WHERE "Mon 31 May" = '20'' 15.35 111.761mph' |
### Instruction:
CREATE TABLE table_20820 (
"Gun" text,
"m/v ft/s" real,
"Shell (lb)" text,
"Time to ft (m) at 25\u00b0 (seconds)" text,
"Time to ft (m) at 40\u00b0 (seconds)" text,
"Time to ft (m) at 55\u00b0 (seconds)" text,
"Max. height (ft)" real
)
-- Using valid SQLite, answer the fol... | SELECT MIN("m/v ft/s") FROM table_20820 WHERE "Max. height (ft)" = '23500' |
### Instruction:
CREATE TABLE table_53085 (
"Height (m.)" text,
"No. of times visited" real,
"No. of HC climbs" real,
"First time as HC climb" real,
"Most recent" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the first HC climb before 2013... | SELECT "First time as HC climb" FROM table_53085 WHERE "No. of times visited" > '3' AND "No. of HC climbs" = '4' AND "Most recent" < '2013' AND "Height (m.)" = '1669' |
### Instruction:
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_billion text
)
CREATE TABLE office_locations (
building_id number,
company_id number,
move_in_y... | SELECT COUNT(*) FROM companies WHERE industry = "Banking" OR industry = "Conglomerate" |
### Instruction:
CREATE TABLE table_65496 (
"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("FA Cup Goals") FROM table_65496 WHERE "FA Cup Apps" = '0' AND "Total Goals" < '1' AND "Position" = 'df' |
### Instruction:
CREATE TABLE table_name_34 (
earnings_per_share__ INTEGER,
ebit__us_$m_ VARCHAR,
year_to_april VARCHAR,
revenue__us_$million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Count the Earnings per share ( ) in April smaller than 2012,... | SELECT SUM(earnings_per_share__) AS ¢_ FROM table_name_34 WHERE year_to_april < 2012 AND revenue__us_$million_ = 432.6 AND ebit__us_$m_ < 150.5 |
### Instruction:
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABL... | SELECT Famous_Title, Age FROM artist ORDER BY Age DESC |
### Instruction:
CREATE TABLE fires (
fire_year number,
discovery_date number,
discovery_doy number,
discovery_time text,
stat_cause_code number,
stat_cause_descr text,
cont_date text,
cont_doy text,
cont_time text,
fire_size number,
fire_size_class text,
latitude number,... | SELECT latitude FROM fires GROUP BY latitude ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE pilot (
Pilot_name VARCHAR,
Pilot_ID VARCHAR,
Rank VARCHAR
)
CREATE TABLE aircraft (
Fleet_Series VARCHAR,
Aircraft_ID VARCHAR
)
CREATE TABLE pilot_record (
Aircraft_ID VARCHAR,
Pilot_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the... | SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank |
### 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 operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in te... | SELECT Country, COUNT(*) FROM airport GROUP BY Country |
### Instruction:
CREATE TABLE fires (
fire_year number,
discovery_date number,
discovery_doy number,
discovery_time text,
stat_cause_code number,
stat_cause_descr text,
cont_date text,
cont_doy text,
cont_time text,
fire_size number,
fire_size_class text,
latitude number,... | SELECT * FROM fires WHERE state = "TX" AND stat_cause_descr LIKE "Campfire" |
### Instruction:
CREATE TABLE table_54820 (
"Number" real,
"Opponent" text,
"Box Score" text,
"Points" real,
"FGM - FGA" text,
"3PM - 3PA" text,
"FTM - FTA" text,
"Assists" real,
"Rebounds" real,
"Steals" real,
"Blocks" real
)
-- Using valid SQLite, answer the following que... | SELECT AVG("Points") FROM table_54820 WHERE "FGM - FGA" = '11-28' AND "Number" < '7' |
### Instruction:
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
... | SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Year ORDER BY COUNT(Year) |
### 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 services, COUNT(services) FROM station GROUP BY services |
### Instruction:
CREATE TABLE table_204_987 (
id number,
"city/municipality" text,
"no. of\nbarangays" number,
"area\n(km2)" number,
"population\n(2010 census)" number,
"pop. density\n(per km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- t... | SELECT "city/municipality" FROM table_204_987 WHERE "no. of\nbarangays" = (SELECT SUM("no. of\nbarangays") FROM table_204_987 WHERE "city/municipality" IN ('morong', 'rodriguez')) |
### Instruction:
CREATE TABLE table_38877 (
"Place" text,
"Code" real,
"Area (km 2 )" real,
"Population" real,
"Most spoken language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sum of Code with a Population that's larger than 1,752, a... | SELECT COUNT("Code") FROM table_38877 WHERE "Population" > '1,752' AND "Most spoken language" = 'xhosa' AND "Place" = 'bontrug' AND "Area (km 2 )" > '2.33' |
### Instruction:
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_... | SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Age |
### Instruction:
CREATE TABLE table_65959 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT SUM("Latitude") FROM table_65959 WHERE "Water (sqmi)" = '0.267' AND "ANSI code" > '1759605' |
### Instruction:
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor... | SELECT gtype FROM video_games GROUP BY gtype ORDER BY COUNT(*) LIMIT 1 |
### 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, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY AVG(T1.Price) |
### Instruction:
CREATE TABLE table_204_964 (
id number,
"team" text,
"seasons" number,
"games" number,
"wins" number,
"ties" number,
"losses" number,
"goals\nfor" number,
"goals\nagainst" number,
"goal\ndiff" number,
"points" number
)
-- Using valid SQLite, answer the foll... | SELECT "team" FROM table_204_964 WHERE "team" <> 'montreal canadiens' AND "seasons" = (SELECT "seasons" FROM table_204_964 WHERE "team" = 'montreal canadiens') |
### Instruction:
CREATE TABLE table_40791 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the tournament played that eneded with a winni... | SELECT "Date" FROM table_40791 WHERE "Runner(s)-up" = 'arnold palmer' AND "Margin of victory" = '2 strokes' AND "Winning score" = '+6 (74-71-70-71=286)' |
### Instruction:
CREATE TABLE table_40391 (
"School year" text,
"95-96" text,
"99-00" text,
"00-01" text,
"01-02" text,
"02-03" text,
"03-04" text,
"04-05" text,
"05-06" text,
"06-07" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT "04-05" FROM table_40391 WHERE "05-06" = '205,189' |
### Instruction:
CREATE TABLE table_45533 (
"Rank" real,
"City" text,
"Province" text,
"Date of Official Foundation of Municipality" real,
"2006" real,
"1996" real,
"1986" real,
"1976" real,
"1966" real,
"1956" real
)
-- Using valid SQLite, answer the following questions for th... | SELECT AVG("Rank") FROM table_45533 WHERE "Province" = 'alborz' AND "1956" > '14526' |
### Instruction:
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE repair (
repair_id number,
name text,
launch_date text,
notes text
)
CREATE TABLE machine (
machine_id number,
making_year number,
clas... | SELECT team FROM technician GROUP BY team HAVING COUNT(*) >= 2 |
### 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 bedType |
### Instruction:
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptr... | SELECT County_name, Population FROM county ORDER BY County_name |
### Instruction:
CREATE TABLE table_78593 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the table... | SELECT AVG("Draws") FROM table_78593 WHERE "Goal Difference" > '-3' AND "Goals against" = '30' AND "Points" > '45' |
### Instruction:
CREATE TABLE table_203_349 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text,
"production\ncode" text,
"u.s. viewers\n(millions)" number
)
-- Using valid SQLite, answer the f... | SELECT "title" FROM table_203_349 WHERE "original air date" < (SELECT "original air date" FROM table_203_349 WHERE "title" = '"unpaid debts"') ORDER BY "original air date" DESC LIMIT 1 |
### Instruction:
CREATE TABLE table_32141 (
"Tournament" text,
"1966" text,
"1967" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"Career SR" text
)
-- Using valid SQLite, answer the followi... | SELECT "1968" FROM table_32141 WHERE "1967" = '1r' |
### Instruction:
CREATE TABLE table_50187 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions fo... | SELECT SUM("Starts") FROM table_50187 WHERE "Winnings" = '$139,774' AND "Wins" < '0' |
### Instruction:
CREATE TABLE table_51630 (
"Country" text,
"Preliminaries" real,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least score for interview with a preli... | SELECT MIN("Interview") FROM table_51630 WHERE "Preliminaries" < '9.4' AND "Evening Gown" < '9.55' AND "Country" = 'new york' AND "Swimsuit" > '9.18' |
### Instruction:
CREATE TABLE table_203_90 (
id number,
"religious\ngroup" text,
"population\n%" text,
"growth\n(1991-2001)" text,
"sex ratio\n(total)" number,
"literacy\n(%)" text,
"work participation\n(%)" text,
"sex ratio\n(rural)" number,
"sex ratio\n(urban)" number,
"sex rat... | SELECT "religious\ngroup" FROM table_203_90 WHERE "literacy\n(%)" > 90 |
### Instruction:
CREATE TABLE table_train_112 (
"id" int,
"systolic_blood_pressure_sbp" int,
"modified_geriatric_depression_scale_gds" int,
"diastolic_blood_pressure_dbp" int,
"rosen_modified_hachinski_ischemic_score" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
)... | SELECT * FROM table_train_112 WHERE modified_geriatric_depression_scale_gds >= 15 |
### Instruction:
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC |
### Instruction:
CREATE TABLE table_train_206 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systolic_blood_pressure_sbp" int,
"hematocrit_hct" float,
"diabetic" string,
"contraception" bool,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"NOUSE" floa... | SELECT * FROM table_train_206 WHERE pregnancy_or_lactation = 0 AND contraception = 1 |
### 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 Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY Allergy DESC |
### Instruction:
CREATE TABLE table_72311 (
"DS Division" text,
"Main Town" text,
"Divisional Secretary" text,
"GN Divisions" real,
"Area (km 2 )" real,
"Sri Lankan Tamil" real,
"Sri Lankan Moors" real,
"Sinhalese" real,
"Burgher" real,
"Other" real,
"Total" real,
"Popula... | SELECT "DS Division" FROM table_72311 WHERE "Main Town" = 'Kaluvanchikudy' |
### Instruction:
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
... | SELECT name FROM wine WHERE price > (SELECT MAX(price) FROM wine WHERE year = 2006) |
### Instruction:
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
type text,
built_year int,
notes text
)
CREATE TABLE bridge (
architect_id int,
id int,
name tex... | SELECT built_year, COUNT(built_year) FROM mill WHERE type = 'Grondzeiler' ORDER BY built_year |
### 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 city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code |
### Instruction:
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Locat... | SELECT T1.Name, COUNT(T1.Name) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY T1.Name ORDER BY T1.Name |
### Instruction:
CREATE TABLE table_30886 (
"Code" text,
"Subdivision name ( be ) (BGN/PCGN)" text,
"Subdivision name ( be ) (GOST)" text,
"Subdivision name ( ru ) (BGN/PCGN)" text,
"Subdivision name ( ru ) (GOST)" text,
"Subdivision category" text
)
-- Using valid SQLite, answer the following... | SELECT "Subdivision name ( ru ) (GOST)" FROM table_30886 WHERE "Subdivision name ( be ) (BGN/PCGN)" = 'Hrodzenskaya voblasts' |
### Instruction:
CREATE TABLE CMI_Cross_References (
cmi_cross_ref_id VARCHAR,
source_system_code VARCHAR
)
CREATE TABLE Electoral_Register (
electoral_register_id VARCHAR,
cmi_cross_ref_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the... | SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax' |
### Instruction:
CREATE TABLE table_203_397 (
id number,
"series" text,
"launch date" text,
"finale date" text,
"days" number,
"housemates" number,
"winner" text,
"main presenter" text,
"grand prize" text,
"liveshow\naudience\nmillions" number
)
-- Using valid SQLite, answer th... | SELECT "main presenter" FROM table_203_397 WHERE "launch date" < (SELECT "launch date" FROM table_203_397 WHERE "main presenter" = "barbara d'urso") ORDER BY "launch date" DESC LIMIT 1 |
### 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, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType DESC |
### Instruction:
CREATE TABLE table_16241 (
"Province" text,
"Population (2004 estimate)" real,
"Area (km\u00b2)" real,
"Density" text,
"GDP (2003, PPS in mil. \u20ac )" real,
"GDP per cap. (2003, in \u20ac)" real
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT "Population (2004 estimate)" FROM table_16241 WHERE "GDP (2003, PPS in mil. \u20ac )" = '18496' |
### Instruction:
CREATE TABLE table_27461 (
"Rank" real,
"Rider" text,
"Sat 29 May" text,
"Mon 31 May" text,
"Tues 1 June" text,
"Wed 2 June" text,
"Thurs 3 June" text,
"Fri 4 June" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT "Wed 2 June" FROM table_27461 WHERE "Thurs 3 June" = '17'' 48.58 127.111mph' |
### Instruction:
CREATE TABLE table_203_563 (
id number,
"#" number,
"judge" text,
"state" text,
"born/died" text,
"active" text,
"chief" text,
"senior" text,
"appointed by" text,
"reason for\ntermination" text
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT "judge" FROM table_203_563 WHERE "reason for\ntermination" = 'resignation' AND "#" > (SELECT "#" FROM table_203_563 WHERE "judge" = 'alexander campbell king') ORDER BY "#" LIMIT 1 |
### Instruction:
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,... | SELECT T1.flno FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" |
### Instruction:
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
-- Using valid SQLite, answer ... | SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY COUNT(Nominee) DESC |
### Instruction:
CREATE TABLE table_14415 (
"Sunday Surya (the Sun)" text,
"Monday Soma (the Moon)" text,
"Tuesday Mangala (Mars)" text,
"Friday Shukra (Venus)" text,
"Saturday Shani (Saturn)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "Sunday Surya (the Sun)" FROM table_14415 WHERE "Monday Soma (the Moon)" = 'सोमवार somavār' AND "Tuesday Mangala (Mars)" = 'मंगलवार mangalavār' |
### Instruction:
CREATE TABLE table_13797 (
"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 "Socket" FROM table_13797 WHERE "sSpec number" = 'sr0pk(e1)' |
### 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) |
### Instruction:
CREATE TABLE table_train_64 (
"id" int,
"hiv_infection" bool,
"receiving_parenteral_nutrition" bool,
"hypertriglyceridemia" bool,
"enteral_feeding" bool,
"body_mass_index_bmi" float,
"diarrhea" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions... | SELECT * FROM table_train_64 WHERE hypertriglyceridemia = 1 OR body_mass_index_bmi > 29.9 |
### Instruction:
CREATE TABLE table_22710 (
"Period" text,
"Live births per year" text,
"Deaths per year" text,
"Natural change per year" text,
"CBR*" text,
"CDR*" text,
"NC*" text,
"TFR*" text,
"IMR*" real,
"Life expectancy total" text,
"Life expectancy males" text,
"Lif... | SELECT "CBR*" FROM table_22710 WHERE "Deaths per year" = '1 058 000' |
### Instruction:
CREATE TABLE table_19570 (
"Rank" real,
"Country" text,
"International tourist arrivals (2012)" text,
"International tourist arrivals (2011)" text,
"Change (2011 to 2012)" text,
"Change (2010 to 2011)" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "Change (2011 to 2012)" FROM table_19570 WHERE "Change (2010 to 2011)" = '+1.0%' |
### Instruction:
CREATE TABLE furniture (
Furniture_ID int,
Name text,
Num_of_Component int,
Market_Rate real
)
CREATE TABLE furniture_manufacte (
Manufacturer_ID int,
Furniture_ID int,
Price_in_Dollar real
)
CREATE TABLE manufacturer (
Manufacturer_ID int,
Open_Year real,
Name... | SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 |
### Instruction:
CREATE TABLE table_203_742 (
id number,
"rnd" number,
"date" text,
"race name" text,
"circuit" text,
"city/location" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"winning team" text,
"report" text
)
-- Using valid SQLite, answer th... | SELECT "city/location" FROM table_203_742 WHERE "date" > (SELECT "date" FROM table_203_742 WHERE "date" = 'march 5') ORDER BY "date" LIMIT 1 |
### Instruction:
CREATE TABLE table_39876 (
"Team" text,
"Location" text,
"Years in senior / adult league" text,
"2013 BAFA Adult division" text,
"2013 BAFA Adult flag division" text,
"2013 BAFA Junior division" text,
"Other teams" text
)
-- Using valid SQLite, answer the following questio... | SELECT "2013 BAFA Junior division" FROM table_39876 WHERE "2013 BAFA Adult division" = 'national central' AND "Location" = 'birkenhead' |
### 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, AVG(basePrice) FROM Rooms GROUP BY decor ORDER BY decor DESC |
### Instruction:
CREATE TABLE table_7597 (
"Format name" text,
"Container" text,
"Video coding" text,
"Bit depth" real,
"Color sampling" text,
"Frame size" text,
"Video bit rate, Mbit/s" text,
"Audio coding" text
)
-- Using valid SQLite, answer the following questions for the tables pr... | SELECT "Frame size" FROM table_7597 WHERE "Audio coding" = 'pcm 4 ch/16 bit/48khz' AND "Format name" = 'dvcam' AND "Color sampling" = '4:1:1' |
### Instruction:
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE purchase (
member_id number,
... | SELECT name, address_road, city FROM branch ORDER BY open_year |
### Instruction:
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code DESC |
### Instruction:
CREATE TABLE table_74671 (
"Country" text,
"Year (most recent)" real,
"Adult (15+) Literacy Rate Total" text,
"Adult Men" text,
"Adult Women" text,
"Youth (15-24) Literacy Rate Total" text,
"Youth Men" text,
"Youth Women" text
)
-- Using valid SQLite, answer the follow... | SELECT "Country" FROM table_74671 WHERE "Youth (15-24) Literacy Rate Total" = '99%' AND "Youth Men" = '98%' |
### Instruction:
CREATE TABLE table_71450 (
"Tournament" 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 tables provided above.
-- What is ... | SELECT "2005" FROM table_71450 WHERE "2013" = '1r' AND "2011" = 'q2' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.