CS 4250: Database Management Systems
Fall 2017 - Homework 1
Due September 21, 2017, at the beginning of class
This is an individual assignment. All work must be your own.
You should not look at any other student's work (in whole or in part,
on paper or on screen), nor allow anyone else to look at yours, during
the course of this assignment.
Turn in as hardcopy or via email (MS Word or PDF or plain text only). Typed wherever
When drawing ER diagrams, do not be subtle. Put a gap between double-lines.
Draw subset symbols nice and large.
Consider a database containing information about pets.
Create entities and relationships as appropriate for each situation.
Information that is true for all of the following ER diagrams:
All (mammalian) pets have RFID tag IDs that uniquely identify them, and also names and colors.
For each of the following situations, draw an ER diagram that describes it.
Unless told to do otherwise, consider each situation independently.
- Pets have food bowls. Sometimes bowls are shared among pets; sometimes
one pet has multiple bowls. Every food
bowl has a color, a size, and a unique manufacturer's ID.
- Some pets are rabbits, and the database needs to store the minimum
cage size for each rabbit. Some pets are dogs, and the database needs
to store the favorite treat for each dog.
- Every pet collar belongs to exactly one pet. Pet collars are identified
by tag number, and the database also keeps track of collar colors and patterns.
(Some pets are fashionistas and have many collars.)
- Pets must have a water bowl or bowls. Bowls are identified
by a unique manufacturer's ID, and also have a color and size.
- The database must keep track of pet photos. To be in the database,
each photo must be of one pet in the database and have a timestamp. Timestamps
are not unique, since two family members might photograph different family
pets at the exact same time.
- Translate the following image into relations. Write the SQL statements
to create those relations. Write English explanations of anything in the ER
diagram that is not captured in your SQL. Assume all keys are data type 'integer' and
all other fields are data type 'date'.
(Let me know if the diagram is too small and you want a bigger version of it.)