CS 3335Exam IFeb. 10, 2009100 points Name:For all queries, label all output columns appropriately.1. How many rows and co lumns will result from the following queries? Give a formula if itis not possible to know the exact number.(a) SELECT * FROM games, moves(b) SELECT * FROM games NATURAL JOIN moves2. (10)Write a single SQL query to find the player name, game id and move numb er where theplayer castled (special is ’0-0’) as white.Page 23. (10)Write a single SQL query to find the player name with the most recent rating.Page 34. (10)Remove all players who have not played in a game.5. (10)Change any move by a white pawn that starts on row 1 to start on row 2 inst ead. Assumethe column is correct.6. (10)Insert the first move of the game with id 7 as the first move of opening C48.Page 47. (10)In a single SQL query, find the pairs of player names such that the players have notplayed each other.Page 58. (10)Find all pairs of games such that all of the white pieces moved in one game were alsomoved in the other. There are 16 white pieces when a game starts. Note this relationshipdoes not have to be symmetrical.Page 69. (10)Find the total number of play count f or each player as white. Include those players whohave not played any games as white ( clearly, such players would have a play count of 0).Order the results by the total play count.Page 710. (10)Find all players who have a higher total play count as black than as white.Page
View Full Document