1. | The table Scores(Team, Day, Opponent, Runs) Gives the scores in the Japanese Baseball League for two consecutive days. The Opponent is NULL if the Team did not play on that day. The number of Runs is given as NULL if either the team did not play, or will play on that day but the game is not yet concluded. The data in this table is as follows: Team | Day | Opponent | Runs | Dragons | Sunday | Swallows | 4 | Tigers | Sunday | Bay Stars | 9 | Carp | Sunday | NULL | NULL | Swallows | Sunday | Dragons | 7 | Bay Stars | Sunday | Tigers | 2 | Giants | Sunday | NULL | NULL | Dragons | Monday | Carp | NULL | Tigers | Monday | NULL | NULL | Carp | Monday | Dragons | NULL | Swallows | Monday | Giants | 0 | Bay Stars | Monday | NULL | NULL | Giants | Monday | Swallows | 5 | What is the result of the following query? SELECT Opponent, COUNT(*), AVG(Runs) FROM Scores GROUP BY Opponent Then, identify in the list below one of the tuples in the result. | | 2. | Suppose relations R(A,B) and S(B,C,D) have the tuples shown below: Compute the result of the join query: SELECT A, R.B, C, D FROM R, S WHERE R.B = S.B Then, identify which of the following tuples is in the result. | | | | a) | (1,2,6,8) | | | b) | (3,4,7,9) | | | c) | (3,4,4,6) | | | d) | (1,2,4,8) | | 3. | The latest scores from the Japanese Baseball League are in the table with schema Scores(Team, Opponent, RunsFor, RunsAgainst) The data in this table is as follows: Team | Opponent | RunsFor | RunsAgainst | Dragons | Tigers | 5 | 3 | Carp | Swallows | 4 | 6 | Bay Stars | Giants | 2 | 1 | Marines | Hawks | 5 | 3 | Ham Fighters | Buffaloes | 1 | 6 | Lions | Golden Eagles | 8 | 12 | Tigers | Dragons | 3 | 5 | Swallows | Carp | 6 | 4 | Giants | Bay Stars | 1 | 2 | Hawks | Marines | 3 | 5 | Buffaloes | Ham Fighters | 6 | 1 | Golden Eagles | Lions | 12 | 8 | What is the result of executing on this data the query: SELECT Team, Opponent FROM Scores WHERE Team LIKE '% %' OR Opponent LIKE '_i%' Identify, in the list below, a row of the result. | | 4. | Here are two relations, R(A,B) and S(C,D). Their current values are: Compute the result of the query: SELECT A, D FROM R, S WHERE B+C = 10 Identify, in the list below, the row that appears in the result. | | | | a) | (3,10) | | | b) | (5,14) | | | c) | (1,14) | | | d) | (1,16) | | 5. | Here are three relations, R(A,B), S(C,D), and T(E,F). Their current values are: Compute the result of the query: SELECT A, F, SUM(C), SUM(D) FROM R, S, T WHERE B = C AND D = E GROUP BY A, F HAVING COUNT(*) > 1 Identify, in the list below, the row that appears in the result. | | | | a) | (1,0,2,1) | | | b) | (1,0,2,2) | | | c) | (1,1,1,1) | | | d) | (1,0,1,2) | | |