Object - Oriented Database Schema Example
Object - Oriented Database Schema Example
Schema Example
• The following relations (primary keys
are in italics) describe part of a
relational database concerning
personnel who are applying for internal
promotion within a company.
Interviews are held for a number of
jobs; candidates can take part in more
than one interview. Some employees
are asked to be members of the
interview panel - i.e., a number of
employees will interview a particular
candidate for a particular job.
Relational Schema
• CANDIDATE (cno: integer, cname: char12, cdeptno:integer,
ctel:integer, present-position: char20)
• PANEL-MEMBER (pmno: integer, pmname: char12, pmdeptno:
integer, pmtel:integer, last-sat-on-panel: date)
• JOB (jobno: integer, jobtitle: char20, start-salary: money, jobdeptno:
integer)
• INTERVIEW (intno: integer, intdate: date, jobno: integer, cno:integer)
• PANEL (intno: integer, pmno: integer)
• DEPARTMENT ( deptno: integer, deptname: char12, depthead:
char20)CANDIDATE (cno: integer, cname: char12, cdeptno:integer,
ctel:integer, present-position: char20)
• PANEL-MEMBER (pmno: integer, pmname: char12, pmdeptno:
integer, pmtel:integer, last-sat-on-panel: date)
• JOB (jobno: integer, jobtitle: char20, start-salary: money, jobdeptno:
integer)
• INTERVIEW (intno: integer, intdate: date, jobno: integer, cno:integer)
• PANEL (intno: integer, pmno: integer)
• DEPARTMENT ( deptno: integer, deptname: char12, depthead:
char20)
Entity-Relationship diagram
Equivalent Object-Oriented
Database Schema
PERSON (pname char12
dept department
ptel integer)
CANDIDATE ( is a PERSON
cand_no integer
present_positio char20
n set of
cand_int interview)
PANEL-MEMBER (is a PERSON
pmno integer
last-sat-on- date
panel set of
panels_to-sit-on interview)
JOB (jobno integer
jobtitle char20
start-salary money
jobdept department)
INTERVIEW (cand candidate
jobtitle job
intdate date
interview- set of panel-
• The following information relates to a
company’s training programme.
• "Our Training Officer keeps records of
employees who are sent on in-house
courses and the skills they have acquired.
• For each employee we record his/her
name, department, internal telephone
number and the date and description of
courses attended.
• Our company runs various courses such as Systems
Analysis, Programming in C, and IT Applications. Each
course lasts for six weeks and we run them at various
points in the year. We keep a list of skills. Each skill can
be acquired by attending a particular course (always
one). For example, the skills of Word for Windows and
Paradox can be acquired by attending the IT
Applications course and the skill of SSADM can be
acquired by attending the Systems Analysis course.
• An instructor is allocated to teach on each course,
although this instructor might change from one running
of the course to the next. Details are kept of the
instructor’s name, department and internal telephone
number, and also the courses that the instructors are
qualified to teach."
a. Now construct an equivalent object-
oriented database schema. In this case
include the type of the attributes but only
those that are specific to the object-
oriented schema.