Assignment 1
Assignment 1
Winter 2016
While working on your CS122A course assignments you will gain experience in database modeling, design,
loading, querying and updates. You are required to work on this assignment in teams of three.
Problem 1
Please answer the following multiple choice questions:
1) Relationship cardinalities:
A. Constrain the number of objects that participate in a relationship
B. Are shown for both directions of a relationship
C. Indicate whether a relationship is mandatory or optional
D. All of the above
The Hollywood studio BestFlick wants to have a database designed to have access to the following information
about all the movies it ever produced: title, year released, director, actors, stuntmen, "Oscars" awarded. A
movie has only one director. In this description, the gender is irrelevant. "Actor", "director", "stuntman" can be
male or female. "Oscar for best acting" refers to an Oscar for best actor or best actress and also includes best
supporting actor or actress.
2) You would show director OF movie by a:
A. 1-1 relationship
B. 1-M relationship
C. M-N relationship
D. Ternary relationship
C. M-N relationship
D. Ternary relationship
C. Director
D. A relationship "Starring-in" between Movie and Actor
Problem 2
1 Goal
In this first step you will create a detailed description of a target application and create an entity-relationship
model (E-R diagram) to describe the data for the application. To get you started, we are providing you with a
sketch of the application that you will be working on, your job in this is to add more specifics and to develop its
E-R model. Creativity is permitted (encouraged!). To make the assignment more interesting, weve intentionally
left aspects of the application vague.
In particular, the database will need to store all the necessary information about sensors. For simplicity, we will
assume that every sensor can be one of the three types of sensors: image sensor, temperature sensor or GPS
sensor. While the sensors are active, they collect observations that they store in the database along with a
timestamp, that tells us when the observation was created. Every sensor type generates a different type of
observations. Image sensors collect raw images, temperature sensors collect raw temperature and GPS
sensors collect raw GPS coordinates, i.e. latitude and longitude. Each observation type differs considerably
from the others. Raw temperatures are numbers, while images are chunks of binary data. Thus, storing all
types of observation into a single table is a bad design decision. Except for the distinction of sensors into
image, temperature or GPS sensors, a sensor can also be classified as being a location sensor. GPS sensors
are an example of location sensors, but using the right software multiple other sensor types could serve the
role of a location sensor (for instance, if we could write code to determine from the image the location of the
camera taking the picture, the image sensor could also play the role of a location sensor).
As described earlier, mobile phones are an example of sensor platforms. A sensor platform has at least one
sensor connected to it. Sensor platforms can be fixed or mobile. Every mobile platform has a location sensor
attached to it. On the other hand, fixed platforms are positioned at a specific location object. Location object is
the term that we use to describe meaningful parts of the physical space. For example, when modeling a
building, a location object can be a room or a corridor. A room can be an office, a meeting room or both. Every
room has a room number and a maximum capacity of persons that it can have. A room might be assigned to
one or more persons for use. Except for location objects that are described above, all other location objects fall
into the category of open areas that can be used to describe parts of a building (e.g., a lounge). Sometimes we
refer to a location object by a name, to make our communication easier. In general, location is important for
modeling the physical space. For simplicity assume that a location is a two-dimensional coordinate where x, y
can range from 0 to 1000. Every location object will have a bounding box associated with it. A bounding box is
represented as two points, the lower left and upper right corners. For instance, Toms rooms bounding box
might have lower left corner of (5, 20) and upper right corner of (7, 23). Note that the location (6, 22) is inside
of Toms room, while (4, 23) is outside of it.
Events, in general, are associated with specific activity such as entering, walking, running, bending,
standing, etc.; where the location of the activity; who the persons involved in the activity; and when
the start and end time of the activity. Furthermore, each event has a confidence level associated which
captures how certain the event is. Events can not be detected out of nothing. Every event is derived from a set
of observations, a connection that is important for event analysis. Of course, the same observation could have
been used to derive multiple events.
Deliverables
1. For Problem 1, only include the question number and answer. (e.g., 1) F 2) E ...)
The filename should be problem1_answer.txt. A plain text file is enough.
2. For Problem 2, please create the following two files.
a. A detailed but concise description of the application's data requirements, including all of your
assumptions and any/all more detailed information about the various data characteristics. Be
sure to clearly identify the real-world objects of interest, their variations, their relationships, their
attributes, their rules and constraints, and so on. This description will serve as the basis for your
E-R design. The file format should be PDF. Put the filename as description.pdf.
b. An Entity-Relationship diagram for your database design along with comments on how/why you
made any particularly interesting design choices when creating the E-R model of your enterprise
based on its description and requirements. To create your E-R diagram, you are free to use
whatever tool you are most comfortable with an E-R modeling tool that you get from the web,
your favorite drawing tool (e.g., Visio, Word, PowerPoint, Dia), or just a neat hand-drawing
(followed by high-quality scanning). Please submit both the enterprise requirements description
and the E-R diagram in .PDF
Submission
Put all of your files (problem1_answer.txt, description.pdf, and erd.pdf) into a .zip archive and upload it to EEE.
Only one member of your team is required to submit the file. And all team members are required to have the
finally submitted file. Be sure to identify all team members in all files (name,
Please use the following naming scheme for your team's zip file submission:
[last -name -of -member1]_[last -name -of -member2]_[last -name -of -member3]_assignment1.zip
For example if Frederic Chopin, Alberto Eins and Franz Liszt were teammates they would submit:
Chopin_Eins_Liszt_assignment1.zip