OCL4 - September, 2005 - Johnson
Lab 1
Please turn in a hardcopy of responses to the TA.
-
a. Using two entity sets, model home ownership, on the assumption that homes can be jointly owned and that
one person may own any number of homes.
b. Model NYC apartment rentals, using entity sets for renters, rent-controlled apartments, and other
apartments. Assume that an apartment may be jointly rented, and an individual
may rent multiple apartments, but, in order to qualify for rent control, the apartment must be the
renter's primary residence. (What does this imply for the relationship between renters and
rent-controlled apartments?)
-
Draw an E/R diagram to capture the following situation.
Entity sets:
- Empoyees
- Projects
- Departments
Relationships:
- assigned-to(employees, departments)
- works-on(employees, projects)
- boss-of(employees, employees)
- manages(employees, departments)
Assume that each person has exactly one boss but may work on multiple projects; multiple employees may work on the same project.
- An individual webpage has:
- a domain name (the usual .com addresses)
- a IP addresses (also picking out the domain)
- a filename and path
- links to other pages
Create an E/R diagram representing this situation.
- Think of a situation to model in which there are at least three kinds of entities and at least two entities
of different multiplicities. Clearly describe the situation and give an E/R model.
-
What are the multiplicities (e.g., one-one, many-many, many-one) of the following relationships?
- Square-of? (e.g., (3,9))
- Cube-of? (e.g., (-3,-27))
- Wife-of?
If you need to make assumptions about the entity sets, state them.
-
In your own words, what was the main improvement of the second "libary" E/R design?
-
Consider the following situation in E/R:
Students enroll in courses and get grades.
Enrollments should be a weak ES, representing students taking the
course and including the students' grades.
Draw an E/R diagram, indicating indicate weak entity sets, connecting relationships, and keys.
Is the grade part of the key for enrollments?
-
Convert the second "library" E/R from the slides (search for "library" in Lecture 1) into the relational model.
- Convert your course/grade/enrollment E/R above to the relational model.
- Start the reading.
|