* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download homework 5: Object-Oriented Databases
Survey
Document related concepts
Transcript
CSE 880, Fall 2014 Advanced Database Systems Homework 5: Object-Oriented Databases Due: October 27, 2014 1. (10 points) Write a schema using graphical representation (similar to the student-course-TA example for ODMG handout in class) for the following object classes: project, document, project-leader, research-paper and dbresearch-paper. Use document-IF as an interface class for document, document is a subclass of document-IF and research-paper is a subclass of document. db-research-paper is a subclass of research paper. Use the following relations between the classes: project has a set of documents and a project leader. Project leaders publish research-papers. Make appropriate assumptions on the cardinalities of the relations. 2. (10 points) Most object-oriented data models restrict an object to being an instance of a single class. However, an object can be a member of several classes by means of inheritance hierarchy (substitutability). For example, Student class and Pilot class are subclasses of Person class and a person P is both a student and a pilot. To allow this by a data model, to be an instance of both Student class and the Pilot class, ambiguities between the classes need to be handled. Describe a few such ambiguities. If the data model restricts an object to being an instance of a single class, suggest how multiple inheritance by creating Student-Pilot class can handle the situation. 3. (10 points) Write OQL statements for the following queries using the schema for Project-Task database given in the class: (a) Get all those Documents that the participating members of those tasks with description ”Database design” have published. (b) Get all project names for those projects with a task leader who is author of some article. 4. (a) (10 points) Create the following three types in Oracle objectrelational database. These types correspond to the entity sets given in the EER diagram of the sports database of homework 1. Employee-type(Eno, Ename, Eaddress) Player-type(PlayingPosition) Playing-coach-type(YrsExperience) 1 Assume that Employee-type is NOT INSTANTIABLE (note that a method can also be defined as NOT INSTANTIABLE where only interface of the method is defined with the type definition and the implementations of the method are created in the subtypes). Further assume that Playing-coach-type is a subtype of ONLY Player-type (Oracle does not support multiple inheritance). Do not forget to include NOT FINAL in Employee-type and Playertype. (b) (5 ponts) Create a table Players of Player-type. Insert into this table two tuples, one of type Player-type and the other of type Playing-coach-type. (c) (5 points) Redefine the type to prevent inserting tuples of Playingcoach-type into the table Players. (d) (5 points) Indicate if tuples of Player-type can be inserted into a table of Playing-coach-type. 5. Answer the following question for Oracle Object-Relational database. (a) (5 points) Define an object-relational schema, using nested tables, for the following entity set: Students(sid, addresses, TelNo) sid is the student ID, addresses and TelNos are multi-valued. (b) Consider the following SQL statement: Select * From THE(Select addresses From Students S Where S.sid=1234) A Where A.city= "East Lansing" i. (5 points) What does the keyword THE accomplishes? ii. (5 points) Give the meaning of the above SQL statement in plain English. (c) (10 points) Give an SQL statement for inserting telephone number 517-333-3333 into the nested table (tiny table) for the student with sid=1234. INSERT INTO THE(Select TelNo from Students S where S.sid=1234) VALUES(telNo(’517-333-3333’)); 2