instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### 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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
### Instruction: CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel_Propulsion text ) CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE pilot ( ...
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality
### Instruction: CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE gas_station ( station_id number, open_year num...
SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Neutral, School_ID 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
### 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
### 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 T1.Name ORDER BY T1.Manufacturer
### 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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price
### 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(Headquarters) FROM company GROUP BY Industry, Headquarters ORDER BY Headquarters 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 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
### Instruction: CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions...
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
### Instruction: 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 text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number...
SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'
### 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 Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Revenue)
### Instruction: CREATE TABLE table_7208 ( "Objects" text, "Date" text, "SiO 2" real, "Al 2 O 3" real, "Fe 2 O 3" real, "K 2 O" real, "Na 2 O" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest SiO 2, when K 2 O is greater th...
SELECT MAX("SiO 2") FROM table_7208 WHERE "K 2 O" > '0.16' AND "Fe 2 O 3" > '0.16' AND "Na 2 O" < '7.53'
### Instruction: CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE volume ( Vol...
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY Result
### Instruction: CREATE TABLE table_train_273 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "hba1c" float, "insulin_requirement" float, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions...
SELECT * FROM table_train_273 WHERE body_mass_index_bmi >= 27 AND body_mass_index_bmi <= 45 AND body_weight <= 136
### Instruction: CREATE TABLE table_22833 ( "\u5366\u540d Name" text, "\u81ea\u7136 Nature" text, "\u5b63\u8282 Season" text, "\u6027\u60c5 Personality" text, "\u5bb6\u65cf Family" text, "\u65b9\u4f4d Direction" text, "\u610f\u7fa9 Meaning" text ) -- Using valid SQLite, answer the followin...
SELECT "\u610f\u7fa9 Meaning" FROM table_22833 WHERE "\u6027\u60c5 Personality" = 'Gentle'
### Instruction: CREATE TABLE table_73020 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Time Frame" text, "Starring Actors" text, "Theme Song(s)" text, "Episodes" real, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT "Starring Actors" FROM table_73020 WHERE "Time Frame" = 'Thursdays 22:00~22:54 2005-04-xx to 2005-06-xx'
### Instruction: CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_I...
SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name
### Instruction: CREATE TABLE table_50388 ( "Tournament" 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 tables provided ab...
SELECT "2008" FROM table_50388 WHERE "2009" = '0' AND "Tournament" = 'atp tournaments won'
### 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 Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by)
### Instruction: CREATE TABLE table_203_621 ( id number, "player" text, "games played" number, "minutes played" number, "minutes played per game" number, "rebounds" number, "rebounds per game" number, "assists" number, "assists per game" number, "field goal %" number, "free t...
SELECT "player" FROM table_203_621 WHERE "player" IN ('larry johnson', 'charlie ward') ORDER BY "points" 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 decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE table_39551 ( "Tournament" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "Career W\u2013L" text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT "1997" FROM table_39551 WHERE "1992" = '1r' AND "1994" = 'a'
### Instruction: CREATE TABLE table_24839 ( "Episode number" real, "Title" text, "Original airing on Channel 4" text, "Time of airing on Channel 4" text, "Original airing on E4" text, "Time of airing on E4" text, "Position in Channel 4s ratings a" text, "Position in E4s ratings b" text, ...
SELECT COUNT("Position in Channel 4s ratings a") FROM table_24839 WHERE "Original airing on Channel 4" = 'February 24, 2010'
### Instruction: CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, Sta...
SELECT Year, AVG(Price) FROM wine GROUP BY Year
### Instruction: CREATE TABLE table_63425 ( "State" text, "Adopted" text, "Population (2011-01-01)" text, "Nominal GDP World Bank, 2009 (million USD)" real, "Relative GDP of total (nominal)" text, "GDP per capita World Bank, 2009 nominal (USD)" real ) -- Using valid SQLite, answer the followin...
SELECT "Adopted" FROM table_63425 WHERE "Nominal GDP World Bank, 2009 (million USD)" = '48477'
### Instruction: CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE gas_station ( station_id number, open_year num...
SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)
### Instruction: CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( tec...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, ...
SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
### Instruction: CREATE TABLE table_dev_26 ( "id" int, "gender" string, "hemoglobin_a1c_hba1c" float, "dyslipidemia" bool, "body_weight" float, "hba1c" float, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for...
SELECT * FROM table_dev_26 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 35.5 AND body_weight > 50
### 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 T1.Name ORDER BY T1.Name DESC
### Instruction: CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( ...
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code
### Instruction: CREATE TABLE table_17770 ( "Day: (see Irregularities )" text, "Sunday S\u014dl (Sun)" text, "Monday Luna (Moon)" text, "Tuesday Mars (Mars)" text, "Wednesday Mercurius (Mercury)" text, "Thursday Iuppiter (Jupiter)" text, "Friday Venus (Venus)" text, "Saturday Saturnus ( ...
SELECT "Tuesday Mars (Mars)" FROM table_17770 WHERE "Day: (see Irregularities )" = 'Ancient Greek'
### 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 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, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue) DESC
### Instruction: CREATE TABLE table_34884 ( "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 highest 2009 value with a 2006 value small...
SELECT MAX("2009") FROM table_34884 WHERE "2006" < '280.4' AND "2007" < '2.2' AND "2010" < '3.5'
### Instruction: CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitat...
SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY name
### Instruction: CREATE TABLE table_34951 ( "Region/country" text, "1985-1990" real, "1990-1995" real, "1995-2000" real, "2000-2005" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1990-1995 > 0.37, 2000-2005 of 1.37, what's the highest for 1995...
SELECT MAX("1995-2000") FROM table_34951 WHERE "1990-1995" > '0.37' AND "2000-2005" = '1.37'
### 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 T2.Name
### 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
### Instruction: CREATE TABLE table_17700 ( "Rank in Nyagatare Sectors, 2012" real, "Sector" text, "Area in sqkm" real, "Population August 15, 2012" real, "Population, August 15, 2002" real, "Population Change 2002-2012 (%)" text, "Population Density 2012 (km 2 )" real ) -- Using valid SQL...
SELECT COUNT("Population August 15, 2012") FROM table_17700 WHERE "Sector" = 'Gatunda'
### 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 T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id
### Instruction: CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, ...
SELECT DISTINCT T1.director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.film_id = T2.film_id WHERE T2.year = 1995
### 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue DESC
### Instruction: CREATE TABLE table_6268 ( "Rank" real, "Airport" text, "Total Passengers" real, "% Change 2005/2006" text, "International Passengers" real, "Domestic Passengers" real, "Transit Passengers" real, "Aircraft Movements" real, "Freight (Metric Tonnes)" real ) -- Using v...
SELECT SUM("Domestic Passengers") FROM table_6268 WHERE "% Change 2005/2006" = '10.9%' AND "Freight (Metric Tonnes)" < '4,022'
### 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T2.Revenue
### 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, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
### Instruction: CREATE TABLE table_6917 ( "Season" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Goals for" real, "Goals against" real, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the points average wh...
SELECT AVG("Points") FROM table_6917 WHERE "Tied" > '8' AND "Games" < '82' AND "Coach" = 'bryan mclay † morris lallo ‡ gerry moore ‡' AND "Goals against" > '322'
### Instruction: CREATE TABLE table_203_171 ( id number, "place\n(posicion)" number, "team\n(equipo)" text, "played\n(pj)" number, "won\n(pg)" number, "draw\n(pe)" number, "lost\n(pp)" number, "goals scored\n(gf)" number, "goals conceded\n(gc)" number, "+/-\n(dif.)" number, "...
SELECT "won\n(pg)" FROM table_203_171 WHERE "team\n(equipo)" = 'chorrillo f.c'
### Instruction: CREATE TABLE table_26711 ( "Legion no and title" text, "Main legion base" text, "Emblem" text, "Date founded/ founder" text, "Date disband" text, "Castra legionaria (legion bases) * = main base. Start date 31 BC if unspecified" text, "Notes" text ) -- Using valid SQLite, a...
SELECT "Notes" FROM table_26711 WHERE "Castra legionaria (legion bases) * = main base. Start date 31 BC if unspecified" = '39-c.300 Moguntiacum * (GS)'
### Instruction: CREATE TABLE table_15595 ( "1910s" real, "1920s" real, "1930s" real, "1940s" real, "1950s" real, "1960s" real, "1970s" real, "1980s" real, "1990s" real, "2000s" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT SUM("1930s") FROM table_15595 WHERE "2000s" = '2000' AND "1940s" < '1940'
### Instruction: CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, in...
SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY origin DESC
### Instruction: CREATE TABLE table_203_207 ( id number, "site name" text, "reason for designation\nbiological interest" number, "reason for designation\ngeological interest" number, "area\nhectares" number, "area\nacres" number, "coordinates & grid ref" text, "year in which notified" nu...
SELECT "site name" FROM table_203_207 WHERE "site name" IN ("carver's rocks", 'cawdor quarry') ORDER BY "area\nacres" 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 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 DESC
### Instruction: CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, ica...
SELECT name FROM airports WHERE city = 'Goroka'
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer
### 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.Manufacturer 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 county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id ...
SELECT COUNT(*) FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE population > 20000)
### 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 t3.fname = "Linda" AND t3.lname = "Smith"
### 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, T2.Revenue 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_17227 ( "State" text, "Norwegian Americans (1980)" real, "Percent (1980)" text, "Norwegian Americans (1990)" real, "Percent (1990)" text, "Norwegian Americans (2000)" real, "Percent (2000)" text, "Norwegian Americans (2009)" real, "Percent (2009)" ...
SELECT COUNT("Percent (2000)") FROM table_17227 WHERE "Percent (1980)" = '3.4%'
### Instruction: CREATE TABLE table_train_172 ( "id" int, "systolic_blood_pressure_sbp" int, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "peak_stimulated_c_peptide" float, "diastolic_blood_pressure_dbp" int, "mixed_meal_tolerance_test_mmtt" bool, "vitamin_d" int, "NOUSE" f...
SELECT * FROM table_train_172 WHERE hemoglobin_a1c_hba1c <= 8.5
### 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 title, year, director FROM movie ORDER BY budget_million
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, s...
SELECT stuid, COUNT(*), SUM(gamesplayed) FROM sportsinfo GROUP BY stuid
### Instruction: CREATE TABLE table_13513 ( "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 "I/O bus" FROM table_13513 WHERE "sSpec number" = 'sr0n5(l1)'
### Instruction: CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, ica...
SELECT country FROM airports ORDER BY elevation 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 T1.Name, T2.Revenue 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 film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate r...
SELECT Type, COUNT(Type) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type ORDER BY Type DESC
### Instruction: 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 ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Aller...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType 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 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.Name
### Instruction: CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name...
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID
### Instruction: CREATE TABLE game ( stadium_id number, id number, season number, date text, home_team text, away_team text, score text, competition text ) CREATE TABLE injury_accident ( game_id number, id number, player text, injury text, number_of_matches text, ...
SELECT MAX(home_games), MIN(home_games), AVG(home_games) FROM stadium
### Instruction: CREATE TABLE table_6740 ( "Buechel & Manhart spelling (pronunciation)" text, "Ullrich" text, "Brandon University" text, "Deloria & Boas" text, "Dakota Mission" text, "Rood & Taylor" text, "Riggs" text, "Williamson" text, "University of Minnesota" text, "White Hat...
SELECT "Ullrich" FROM table_6740 WHERE "Riggs" = 'e' AND "Buechel & Manhart spelling (pronunciation)" = 'e'
### Instruction: CREATE TABLE table_204_481 ( id number, "poll source" text, "date(s)\nadministered" text, "sample\nsize" number, "margin of\nerror" text, "andrew\ncuomo (d)" text, "rob\nastorino (r)" text, "other" text, "undecided" text ) -- Using valid SQLite, answer the followin...
SELECT (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'siena') > (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'quinnipiac')
### 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 AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType
### 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 name DESC
### 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 ORDER BY Openning_year DESC
### Instruction: CREATE TABLE table_204_44 ( id number, "face value" number, "\u20ac0.01" number, "\u20ac0.02" number, "\u20ac0.05" number, "\u20ac0.10" number, "\u20ac0.20" number, "\u20ac0.50" number, "\u20ac1.00" number, "\u20ac2.00" number ) -- Using valid SQLite, answer th...
SELECT "\u20ac0.01" FROM table_204_44 WHERE "face value" = 2010
### 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 Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name ORDER BY COUNT(*) 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.Name
### 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 "directed by" FROM table_203_349 WHERE "directed by" <> 'jeremiah chechik' AND "original air date" = (SELECT "original air date" FROM table_203_349 WHERE "directed by" = 'jeremiah chechik')
### Instruction: CREATE TABLE table_204_322 ( id number, "township" text, "fips" number, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text ) -- Using valid SQL...
SELECT (SELECT "land area\nkm2 (sq mi)" FROM table_204_322 WHERE "township" = 'alta') - (SELECT "land area\nkm2 (sq mi)" FROM table_204_322 WHERE "township" = 'newton')
### Instruction: CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrie...
SELECT District, COUNT(District) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY District
### Instruction: CREATE TABLE table_19603 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "2nd" real, "3rd" real, "Top 10s" real, "Best finish" text, "Earnings ( $ )" real, "Money list rank" text, "Scoring average" text, "Scoring rank" text ) --...
SELECT COUNT("Earnings ( $ )") FROM table_19603 WHERE "Best finish" = 'T2' AND "Scoring average" = '71.25'
### Instruction: CREATE TABLE table_60455 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer...
SELECT "Tournament" FROM table_60455 WHERE "2003" = 'a'
### Instruction: CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr ...
SELECT pName, COUNT(pName) FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID GROUP BY pName ORDER BY T1.pName
### Instruction: CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Road, School_ID FROM basketball_match
### 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, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
### Instruction: CREATE TABLE table_name_28 ( annual_interchanges__millions__2011_12 INTEGER, number_of_platforms VARCHAR, annual_entry_exit__millions__2011_12 VARCHAR, rank VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's ...
SELECT AVG(annual_interchanges__millions__2011_12) FROM table_name_28 WHERE rank > 26 AND location = "liverpool" AND annual_entry_exit__millions__2011_12 < 14.209 AND number_of_platforms > 10
### Instruction: CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, ...
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.name 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, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC
### Instruction: CREATE TABLE table_train_242 ( "id" int, "macroalbuminuria" bool, "hyperlipidemia" bool, "fasting_serum_triglycerides" int, "fasting_ldl_cholesterol" int, "panel_reactive_antibodies" int, "serum_creatinine" float, "albumin" float, "body_mass_index_bmi" float, "fa...
SELECT * FROM table_train_242 WHERE macroalbuminuria = 1 OR albumin > 300
### 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 DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume"
### 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 decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY COUNT(*)
### Instruction: CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE music_festival ( ...
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category
### 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
### Instruction: CREATE TABLE type_of_restaurant ( resid number, restypeid number ) CREATE TABLE restaurant_type ( restypeid number, restypename text, restypedescription text ) CREATE TABLE visits_restaurant ( stuid number, resid number, time time, spent number ) CREATE TABLE rest...
SELECT address FROM restaurant WHERE resname = "Subway"
### Instruction: CREATE TABLE table_7537 ( "Position" text, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "Previous Club/Team" text, "NHL rights, if any" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Birthplace" FROM table_7537 WHERE "Weight (kg)" > '88' AND "NHL rights, if any" = '1999 draft eligible' AND "Birthdate" = 'march 26, 1980'