Elm04_21 - Chapter 21: Object Database Standards,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 21: Object Database Standards, Languages, and Design CHAPTER 21: OBJECT DATABASE STANDARDS, LANGUAGES, AND DESIGN Answers to Selected Exercises 21.15 Map the COMPANY ER schema of Figure 3.2 into ODL classes. Include appropriate methods for each class. Answer: class Employee ( extent employees key ssn { attribute struct name {string fname , string mname , string lname } name ; attribute string ssn ; attribute date bdate ; attribute enum Gender{M, F} sex ; attribute string address ; attribute float salary ; attributte Employee supervisor ; relationship Department works_for inverse Department:: has_employees ; relationship set< Hours_Worked > work inverse Hours_Worked:: work_by ; short age() ; void give_raise (in float raise ); void change_address (in string new_address ); void reassign_emp (in string new_dname ) raises( dname_not_valid ); }; class Department ( extent departments key dname, dnumber { attribute string dname ; attribute short dnumber ; attribute struct Dept_Mgr { Employee manager , date startdate } mgr ; attribute set<string> locations ; relationship set<
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Elm04_21 - Chapter 21: Object Database Standards,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online