db_id
stringclasses
127 values
query
stringlengths
20
523
question
stringlengths
16
224
schema
stringclasses
127 values
theme_gallery
SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004
Show all artist names who didn't have an exhibition in 2004.
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
theme_gallery
SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004
What are the names of artists who did not have an exhibition in 2004?
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
theme_gallery
SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500
Show the theme for exhibitions with both records of an attendance below 100 and above 500.
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
theme_gallery
SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500
Which themes have had corresponding exhibitions that have had attendance both below 100 and above 500?
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
theme_gallery
SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10
How many exhibitions have a attendance more than 100 or have a ticket price below 10?
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
theme_gallery
SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10
Count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10.
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
theme_gallery
SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING avg(T1.attendance) > 200
Show all artist names with an average exhibition attendance over 200.
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
theme_gallery
SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING avg(T1.attendance) > 200
What are the names of artist whose exhibitions draw over 200 attendees on average?
CREATE TABLE "artist" ( "Artist_ID" int, "Name" text, "Country" text, "Year_Join" int, "Age" int, PRIMARY KEY ("Artist_ID") ); CREATE TABLE "exhibition" ( "Exhibition_ID" int, "Year" int, "Theme" text, "Artist_ID" int, "Ticket_Price" real, PRIMARY KEY ("Exhibition_ID"), FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`) ); CREATE TABLE "exhibition_record" ( "Exhibition_ID" int, "Date" text, "Attendance" int, PRIMARY KEY ("Exhibition_ID","Date"), FOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`) ); INSERT INTO "artist" VALUES (1,"Vijay Singh","Fiji","1998",45); INSERT INTO "exhibition" VALUES (1,"2004","Santa Claus",1,"19.95"); INSERT INTO "exhibition_record" VALUES (1,"December 2",965);
riding_club
SELECT count(*) FROM player
How many players are there?
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Player_name FROM player ORDER BY Votes ASC
List the names of players in ascending order of votes.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Gender , Occupation FROM player
What are the gender and occupation of players?
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Player_name , residence FROM player WHERE Occupation != "Researcher"
List the name and residence for players whose occupation is not "Researcher".
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Sponsor_name FROM player WHERE Residence = "Brandon" OR Residence = "Birtle"
Show the names of sponsors of players whose residence is either "Brandon" or "Birtle".
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1
What is the name of the player with the largest number of votes?
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Occupation , COUNT(*) FROM player GROUP BY Occupation
Show different occupations along with the number of players in each occupation.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1
Please show the most common occupation of players.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2
Show the residences that have at least two players.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID
Show the names of players and names of their coaches.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1
Show the names of players coached by the rank 1 coach.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT T3.Player_name , T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011
Show the names and genders of players with a coach starting after 2011.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC
Show the names of players and names of their coaches in descending order of the votes of players.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM player_coach)
List the names of players that do not have coaches.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT Residence FROM player WHERE gender = "M" INTERSECT SELECT Residence FROM player WHERE gender = "F"
Show the residences that have both a player of gender "M" and a player of gender "F".
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT T1.club_id , T1.club_name, count(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id
How many coaches does each club has? List the club id, name and the number of coaches.
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
riding_club
SELECT T1.club_id , T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY count(*) DESC LIMIT 1
How many gold medals has the club with the most coaches won?
CREATE TABLE IF NOT EXISTS "player" ( "Player_ID" int, "Sponsor_name" text, "Player_name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" int, "Rank" text, PRIMARY KEY ("Player_ID") ); CREATE TABLE IF NOT EXISTS "club" ( "Club_ID" int, "Club_name" text, "Region" text, "Start_year" int, PRIMARY KEY ("Club_ID") ); CREATE TABLE IF NOT EXISTS "coach" ( "Coach_ID" int, "Coach_name" text, "Gender" text, "Club_ID" int, "Rank" int, PRIMARY KEY ("Coach_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); CREATE TABLE IF NOT EXISTS "player_coach" ( "Player_ID" int, "Coach_ID" int, "Starting_year" int, PRIMARY KEY ("Player_ID","Coach_ID"), FOREIGN KEY (`Player_ID`) REFERENCES `player`(`Player_ID`), FOREIGN KEY (`Coach_ID`) REFERENCES `coach`(`Coach_ID`) ); CREATE TABLE IF NOT EXISTS "match_result" ( "Rank" int, "Club_ID" int, "Gold" int, "Big_Silver" int, "Small_Silver" int, "Bronze" int, "Points" int, PRIMARY KEY ("Rank","Club_ID"), FOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`) ); INSERT INTO player VALUES(1,'Brandon—Souris','Jean Luc Bouché','M','Brandon','Locomotive Engineer',6055,'2nd'); INSERT INTO club VALUES(1,'AIK','USA',2009); INSERT INTO coach VALUES(1,'Jameson Tomas','M',1,1); INSERT INTO player_coach VALUES(1,1,2010); INSERT INTO match_result VALUES(1,1,20,14,9,8,168);
gymnast
SELECT count(*) FROM gymnast
How many gymnasts are there?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT count(*) FROM gymnast
Count the number of gymnasts.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC
List the total points of gymnasts in descending order.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC
What are the total points for all gymnasts, ordered by total points descending?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC
List the total points of gymnasts in descending order of floor exercise points.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC
What are the total points of gymnasts, ordered by their floor exercise points descending?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT avg(Horizontal_Bar_Points) FROM gymnast
What is the average horizontal bar points for all gymnasts?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT avg(Horizontal_Bar_Points) FROM gymnast
Return the average horizontal bar points across all gymnasts.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Name FROM People ORDER BY Name ASC
What are the names of people in ascending alphabetical order?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Name FROM People ORDER BY Name ASC
Return the names of people, ordered alphabetically.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID
What are the names of gymnasts?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID
Return the names of the gymnasts.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != "Santo Domingo"
What are the names of gymnasts whose hometown is not "Santo Domingo"?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != "Santo Domingo"
Return the names of gymnasts who did not grow up in Santo Domingo.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Age FROM people ORDER BY Height DESC LIMIT 1
What is the age of the tallest person?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Age FROM people ORDER BY Height DESC LIMIT 1
Return the age of the person with the greatest height.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Name FROM People ORDER BY Age DESC LIMIT 5
List the names of the top 5 oldest people.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Name FROM People ORDER BY Age DESC LIMIT 5
What are the names of the five oldest people?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1
What is the total point count of the youngest gymnast?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1
Return the total points of the gymnast with the lowest age.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID
What is the average age of all gymnasts?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID
Return the average age across all gymnasts.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5
What are the distinct hometowns of gymnasts with total points more than 57.5?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5
Give the different hometowns of gymnasts that have a total point score of above 57.5.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
What are the hometowns of gymnasts and the corresponding number of gymnasts?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
How many gymnasts are from each hometown?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1
What is the most common hometown of gymnasts?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1
Return the hometown that is most common among gymnasts.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2
What are the hometowns that are shared by at least two gymnasts?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2
Give the hometowns from which two or more gymnasts are from.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC
List the names of gymnasts in ascending order by their heights.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC
What are the names of gymnasts, ordered by their heights ascending?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
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
List the distinct hometowns that are not associated with any gymnast.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
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
From which hometowns did no gymnasts come from?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20
Show the hometowns shared by people older than 23 and younger than 20.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20
From which hometowns did both people older than 23 and younger than 20 come from?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT count(DISTINCT Hometown) FROM people
How many distinct hometowns did these people have?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT count(DISTINCT Hometown) FROM people
Count the number of different hometowns of these people.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC
Show the ages of gymnasts in descending order of total points.
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
gymnast
SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC
What are the ages of the gymnasts, ordered descending by their total points?
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, PRIMARY KEY ("Gymnast_ID"), FOREIGN KEY ("Gymnast_ID") REFERENCES "people"("People_ID") ); CREATE TABLE "people" ( "People_ID" int, "Name" text, "Age" real, "Height" real, "Hometown" text, PRIMARY KEY ("People_ID") ); INSERT INTO "people" VALUES (1,"Paul Hamm","24","1.71","Santo Domingo"); INSERT INTO "gymnast" VALUES ("1","9.725","9.737","9.512","9.575","9.762","9.750","58.061");
browser_web
SELECT count(*) FROM browser WHERE market_share >= 5
How many main stream browsers whose market share is at least 5 exist?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT name FROM browser ORDER BY market_share DESC
List the name of browsers in descending order by market share.
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT id , name , market_share FROM browser
List the ids, names and market shares of all browsers.
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT max(market_share) , min(market_share) , avg(market_share) FROM browser
What is the maximum, minimum and average market share of the listed browsers?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT id , market_share FROM browser WHERE name = 'Safari'
What is the id and market share of the browser Safari?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT name , operating_system FROM web_client_accelerator WHERE CONNECTION != 'Broadband'
What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998
What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT T1.id , T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING count(*) >= 2
What are the ids and names of the web accelerators that are compatible with two or more browsers?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT T1.id , T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
What is the id and name of the browser that is compatible with the most web accelerators?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'
When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT count(DISTINCT client) FROM web_client_accelerator
How many different kinds of clients are supported by the web clients accelerators?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );
How many accelerators are not compatible with the browsers listed ?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15;
What distinct accelerator names are compatible with the browswers that have market share higher than 15?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox'
List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT name , operating_system FROM web_client_accelerator EXCEPT SELECT T1.name , T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'
Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%"
Which accelerator name contains substring "Opera"?
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT Operating_system , count(*) FROM web_client_accelerator GROUP BY Operating_system
Find the number of web accelerators used for each Operating system.
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
browser_web
SELECT T2.name , T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id ORDER BY T1.compatible_since_year DESC
give me names of all compatible browsers and accelerators in the descending order of compatible year
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" ( "id" int, "name" text, "Operating_system" text, "Client" text, "Connection" text, primary key("id") ); CREATE TABLE IF NOT EXISTS "browser" ( "id" int, "name" text, "market_share" real, primary key("id") ); CREATE TABLE IF NOT EXISTS "accelerator_compatible_browser" ( "accelerator_id" int, "browser_id" int, "compatible_since_year" int, primary key("accelerator_id", "browser_id"), foreign key ("accelerator_id") references `Web_client_accelerator`("id"), foreign key ("browser_id") references `browser`("id") ); INSERT INTO Web_client_accelerator VALUES(1,'CACHEbox','Appliance (Linux)','End user, ISP','Broadband, Satellite, Wireless, Fiber, DSL'); INSERT INTO browser VALUES(1,'Internet Explorer',28.960000000000000852); INSERT INTO accelerator_compatible_browser VALUES(1,1,1995);
wrestler
SELECT count(*) FROM wrestler
How many wrestlers are there?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT count(*) FROM wrestler
Count the number of wrestlers.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Name FROM wrestler ORDER BY Days_held DESC
List the names of wrestlers in descending order of days held.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Name FROM wrestler ORDER BY Days_held DESC
What are the names of the wrestlers, ordered descending by days held?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1
What is the name of the wrestler with the fewest days held?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1
Return the name of the wrestler who had the lowest number of days held.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan"
What are the distinct reigns of wrestlers whose location is not "Tokyo,Japan" ?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan"
Give the different reigns of wrestlers who are not located in Tokyo, Japan.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Name , LOCATION FROM wrestler
What are the names and location of the wrestlers?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Name , LOCATION FROM wrestler
Give the names and locations of all wrestlers.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Elimination_Move FROM Elimination WHERE Team = "Team Orton"
What are the elimination moves of wrestlers whose team is "Team Orton"?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT Elimination_Move FROM Elimination WHERE Team = "Team Orton"
Return the elimination movies of wrestlers on Team Orton.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT T2.Name , T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID
What are the names of wrestlers and the elimination moves?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT T2.Name , T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID
Give the names of wrestlers and their elimination moves.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT T2.Name , T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC
List the names of wrestlers and the teams in elimination in descending order of days held.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT T2.Name , T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC
What are the names of wrestlers and their teams in elimination, ordered descending by days held?
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");
wrestler
SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1
List the time of elimination of the wrestlers with largest days held.
CREATE TABLE "wrestler" ( "Wrestler_ID" int, "Name" text, "Reign" text, "Days_held" text, "Location" text, "Event" text, PRIMARY KEY ("Wrestler_ID") ); CREATE TABLE "Elimination" ( "Elimination_ID" text, "Wrestler_ID" text, "Team" text, "Eliminated_By" text, "Elimination_Move" text, "Time" text, PRIMARY KEY ("Elimination_ID"), FOREIGN KEY ("Wrestler_ID") REFERENCES "wrestler"("Wrestler_ID") ); INSERT INTO "wrestler" VALUES (1,"Rey Misterio Sr.","1","344","Tijuana , Mexico","Live event"); INSERT INTO "Elimination" VALUES ("1",1,"Team Orton","Punk","Go To Sleep","00:11");