Alan K. Dippel
CSC 570/671
November 30,1998
Professor: Fred Sadri

University of North Carolina at Greensboro
Department of Mathematical Sciences

Assignment 6

 

http://www.cs.indiana.edu/~adippel/csc671/assignment6.htm


Question 1.



Use ODL to specify the (object-oriented) schema for entities ``student'' and ``course'' with the relationship ``registered''. Choose appropriate attributes for the entities. Remember that in ODL, the (E-R) relationship will be modeled by a pair of relationships that are inverse of each other.


interface Student (key ID) {

attribute integer ID;
attribute string Name;
attribute string Address;
relationship Set<Course> registeredFor
inverse Course::StudentsRegistered;

};
interface Course (key C#) {

attribute string C#;
attribute string Title;
attribute string Description;
relationship Set<Student> StudentsRegistered
inverse Student::registeredFor;

};


Question 2.



Write an OQL query to list students in CSC 570 (using the database of previous question).

select distinct s.name
from Course c, c.StudentsRegistered s
where c.C# = "CSC 570"


http://www.cs.indiana.edu/~adippel/csc671/assignment6.htm