Computer Science Assignment- Aggregate/Group Functions

Computer Science Assignment- Aggregate/Group Functions

  1. Using Unit 1 Bowling League database
  2. Create a New MS Word document and Save it as: U3_Assignment1_Lastname
  3. For all of the scenarios below, write the question numbered followed by the SQL SELECT syntax (copy & paste)and a screen shot of the SQL Select with results from SQL Server
  4.  Use the syntax:

SELECT ...

FROM ...

WHERE …

ORDER BY ….

Aggregate Functions – all of the following Select statements must use a function   

  1. Show the total number of bowlers that live in Bothell, WA (hint: How many?)
  2. Show the number of games that the bowler with bowlerID 8 has won thus far.
  3. What is the total raw scores of all bowlers who played in match 13, game 3? (hint: add the scores)
  4. Display the total handicap scores of the bowler that has a BowlerID of 18. Rename the result column Total Handicap.
  5. Show the most recent tournament date in the bowling league schedule. Rename the resulting column Last Tournament Date.
  6. Display how many tournaments have been played at Sports World Lanes. Rename the result column Number of Tournaments.

 

Aggregate Functions, Grouping Data (GROUP BY & HAVING)

  1. Display the bowler's ID and the average raw score for each bowler. Sort the results by the average raw score in descending order.
  2. Calculate the total raw score (add the scores) for each bowler. Display the bowler’s ID and total raw score. Rename the total raw score as Total Pins.
  3. Display match ID and the highest raw score for each match. Only display the results for bowlers who have a high raw score more than 193.
  4. Display the match id, game number and the average handicap score per match and  game.  Only show results foraverage  handicap scores less than 185. Rename the average score result set Average Under 185. In the results, concatenate the match id and game numbers into one column, include the      literal comma, and literal text “Match ID” and “Game Number” as shown in the sample results below:

(No Column Name)                                                 Average Under 185

Match ID 12, Game Number  1                               183

Match ID 39, Game Number  2                               184

  1. Question Attachments

    1 attachments —

Answer Detail

Get This Answer

Invite Tutor