Data Model of the Sample Database

The scott.mql script executed when you set up the applet loads the business definitions for the human resources database. This file adds the required attributes, types, policies, and relationships, as well as a Person, scott, who owns all the objects in the human resources database.

See Also
Setting up the Adaplet

These administrative objects are defined with the bare minimum parameters and would need to be enhanced to make real life use of this database. For example, all business objects must be governed by a policy, and so several are added with this script. However, only one state is defined in most of them. Also, the script does not create any Formats or Stores, and so none are included in any of the policy definitions. To check files into any of the objects in the Human Resources database, at least one format and store needs to be created and added to the applicable policy.

This code shows the sample MQL script for adding schema to support this database:

add attribute "Department Number" type integer;
add attribute Location type string;
add type Department attribute "Department Number",Location;
add attribute "Low Salary" type real;
add attribute "High Salary" type real;
add type "Salary Grade" attribute "Low Salary", "High Salary";
add attribute "Employee Number" type integer;
add attribute "Hire Date" type date;
add attribute Salary type real;
add type Employee attribute "Employee Number","Hire Date",Salary;
add type Clerk derive Employee;
add type Manager derive Employee;
add type Analyst derive Employee;
add type President derive Employee;
add attribute Commission type real;
add type Salesman derive Employee attribute Commission;
add policy Departments type Department state base;
add policy "Salary Grades" type "Salary Grade" state base;
add policy Employees type Employee state hired state trained state active state former;
add relation Department from type Department card one to type Employee card many;
add relation "Salary Grade" from type "Salary Grade" card one to type Employee card many;
add relation Manager from type Employee card one to type Employee card many;
add person scott;