Docsity

Advanced Database Systems Homework 3 - CSE 880, Fall 2008 - Prof. Sakti Pramanik, Assignments of Deductive Database Systems

Toggle sidebar
bg1
CSE 880, Fall 2008
Advanced Database Systems
Homework 3
Due: February 26
1. Following problem is on inheritance in Oracle object relational database.
A copy of the Oracle object relational DB manual will be put on reserve
in the Engineering Library.
(a) Create the following three types in Oracle object-relational database.
These types correspond to the entity sets given in the EER dia-
gram of the sports database.
Employee-type(Eno, Ename, Eaddress)
Player-type(PlayingPosition)
Playing-coach-type(YrsExperience)
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 Player-
type.
(b) 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) Redefine the type to prevent inserting tuples of Playing-coach-type
into the table Players.
(d) Indicate if tuples of Player-type can be inserted into a table of
Playing-coach-type.
2. Object-relational implementation in Oracle of some of the entity and
relationship types of the modified EER diagram is posted on this web
page under the name object-relational schema. You will need to
1
pf2

Partial preview of the text

Download Advanced Database Systems Homework 3 - CSE 880, Fall 2008 - Prof. Sakti Pramanik and more Assignments Deductive Database Systems in PDF only on Docsity!

CSE 880, Fall 2008

Advanced Database Systems

Homework 3

Due: February 26

  1. Following problem is on inheritance in Oracle object relational database. A copy of the Oracle object relational DB manual will be put on reserve in the Engineering Library.

(a) Create the following three types in Oracle object-relational database. These types correspond to the entity sets given in the EER dia- gram of the sports database. Employee-type(Eno, Ename, Eaddress) Player-type(PlayingPosition) Playing-coach-type(YrsExperience) 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 Player- type. (b) 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) Redefine the type to prevent inserting tuples of Playing-coach-type into the table Players. (d) Indicate if tuples of Player-type can be inserted into a table of Playing-coach-type.

  1. Object-relational implementation in Oracle of some of the entity and relationship types of the modified EER diagram is posted on this web page under the name object-relational schema. You will need to

complete this schema for the modified EER diagram of homework 1, also posted. NOTE ABOUT THE SCHEMA GIVEN: In object-relational data model an attribute can be defined as a table type, called nested relations. This is one way of defining a set type at- tribute in Oracle. One problem of nested relations is that the resulting tables are not in 3rd Normal form, creating a serious update problem due to replication. One way of handling this problem is to use refer- ences to the tuples being replicated instead of replicating the actual tuple.

  1. Two member functions (getWinner, getMaxScore) are needed to imple- ment the following SQL queries. The member function getWinner and the interface to getMaxScore member function are given in object- relational schema file. You need to implement the getMaxS- core member function.
  2. Implement the following SQL queries:

(a) Get the names of those teams which have players with address ’East Lansing’ (b) Get the name of each game and the players who have scored the highest in that game. (c) Get all the teams in League A who have not won any games.