- Objectives:
To understand and be able
to write simple SQL queries, without updates.
Reading Assignments:
6.1 - 6.4
Number of points:
100
Due date:
Monday, October 14th.
Tools for the assignment
For this assignment, you
will need the database we have created. This database is available on ISQL01
and is called cse444_hwk.
Please read the instructions on how to run your first
SQL query here: Using ISQL01 server
If you chose to work in your own database, here are the
scripts to create the tables and load the data.
- The database has the following schema:
MOVIES(MovieCode, Title, Rating, Length)
SHOWS(TheaterCode, MovieCode, Time)
THEATERS(TheaterCode, Name, Address, Phone)
BELONGS(DistrictCode, TheaterCode)
DISTRICT(DistrictCode, Name)
-
DISTRICTS refer to Seattle Districts (U District, Center City, etc).
THEATERS lists movie theaters in Seattle, while MOVIES contains the movies
currently showing (notice that the data is a bit old: don't use it to plan your
next weekend). SHOWS lists which theaters show which movies at
what times. BELONGS tells us what theaters can be found in which
districts. BELONGS is NOT one-many: some theaters list themselves
as belonging to several districts. The CSE444_HWK database on ISQL01 has been
loaded with real data from http://www.moviefone.com/,
about two years ago. Before you start it is
helpful to play with SQL Server browsing the database and getting
familiarized with the schema, the data, and SQL Server.
Make sure to complete the readings before you attempt to do the homework.
-
-
For each of the questions below you have to turn in two things:
-
a. A SQL query that answers the question.
-
b. The results you obtained by running that query on the database.