hw1.htm
CS 311: Databases
Homework 1
due Monday, February 20
The following questions refer to the table BasketballScores, which you should all have access to. For each question you should provide a SQL query that answers the question. I want the query, not the data that Oracle provides. You should hand in (using handin) a text or Word file that contains the query needed for each question. All of these questions can be answered with the SELECT-FROM-WHERE statement. For more on this statement, see the Stanford notes Getting Started With Oracle and Oracle Dates and Times, as well as section 6.1 of the text.
1. How many games are represented in the BasketballScores table?
2. Which games were won by the Home team?
3. How many games did Team A play?
4. Which games did Team A win?
5. Find all of the games that were decided by 3 or fewer points.
6. Find all of the games that were played in 2006.
7. Find all of the games where Team A played Team B.
8. Find all of the games played on a Saturday.
9. On how many different dates were games played?
10. Write down (in English) at least two questions that would be natural to ask about this data but that can't be answered with a simple SELECT-FROM-WHERE query.