Map the COMPANY ER schema of Figure 7.2 into ODL classes. Include appropriate methods for each class.

What will be an ideal response?


```
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 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 locations;
relationship set has_employees inverse Employee:: works_for;
relationship set controls inverse Project:: controlled_by;
short no_of_employees();
void add_emp(in string new_essn) raises (essn_not_valid);
void add_proj(in string new_pname) raises (pname_not_valid);
void change_manger(in string new_mssn; in date startdate) raises
(mssn_not_valid);
};
class Project
( extent projects
key pname, pnumber
{
attribute string pname;
attribute short pnumber;
attributte string location;
relationship Department controlled_by inverse Department:: controls;
relationship set work_at inverse Hours_Worked:: work_on;
void reassign_proj(in string new_dname) raises(dname_not_valid);
};
class Hours_Worked
( extent hours_worked
{
attributte float hours;
relationship Employee work_by inverse Employee:: work;
relationship Project work_on inverse Project:: work_at;
void change_hours(in float new_hours);
};
class Dependent
( extent dependents
{
attribute string name;
attribute date bdate;
attribute enum Gender{M, F} sex;
attribute string relationship;
attributte Employee suporter;
short age();
};
```

Computer Science & Information Technology

You might also like to view...

Which of the following tags is optional in table design?

A. B. C. D.

Computer Science & Information Technology

Which function is best suited to return the specified number of characters from the end of a text string?

A) LEFT B) RIGHT C) MID D) TRIM

Computer Science & Information Technology

You can NOT save a file into a folder

Indicate whether the statement is true or false

Computer Science & Information Technology

A(n) _____ is a simple graphic organizer that helps systems analysts visualize the status of a project. 

A. histogram B. storyboard C. pool D. epic

Computer Science & Information Technology