

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Pramanik; Class: Advanced Database Systems; Subject: Computer Science & Engineering; University: Michigan State University; Term: Spring 2008;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


(a) Get all those projects that John has worked for. (b) Get all those Documents that the participating members of those tasks with description ”Database design” have published. (c) Get those projects all of whose task leaders have published at least 10 articles. (d) Get all project names for those projects with a task leader who is author of some article.
class student relationship s courses is a set {course} inverse of s courses is c students in course class course relationship c students is a set {student} inverse of c students is s courses in student
Most of the attributes for the above classes, such as student name and student id, are omitted from the definition. The relationship s courses in the student class represents a set of courses taken by a student and the relationship c students in the course class represents a set of students taking a course. Thus, a relationship is defined in a class to relate an object of that class to an object or a set of objects in another class. The line ”inverse of s courses is c students in course” in the definition of student class means that if ”student x is taking a course y” is in the relationship s courses then ”course y is taken by student x” is in the relationship c students. Answer the following four questions related to the definition of relationships and inverse of relationships.
(a) Is it necessary to have inverse statements in the definition of the student and the course classes? Give a justification for your answer. (b) In general, when is it necessary to have inverse statements in defining relationships? (c) Give the definition of a person class with the relationships mother, f ather and children. Note that the target class for the relation- ships is also person. (d) Is the inverse of the mother relationship the children relationship? Give a justification for your answer.
(a) Draw the following classes showing the hierarchy for inheritance along with all the inherited attributes. Indicate which rules have been used for each inheritance: class worker(name:string, salary:int, car:car) inherit object-class class car(name:string, price:real, hp:integer) inherit object-class class exp-car(name:string, price:real, option: integer) inherit car class consultant(work-address:string, specialization:string) inherit