Value and Object Types
(Object-type example)
- Methods
observer and mutator are for querying and modifying an attribute value.
- A
constructor function serves to create or initialize values.
|
|
CREATE VALUE TYPE address
street VARCHAR(25),
city VARCHAR(25) );
CREATE OBJECT TYPE person (
name VARCHAR(30),
age INT,
domicle address );
CREATE OBJECT TYPE employee UNDER person (
qualification VARCHAR(30),
salary DECIMAL(7,2),
familymembers SET(person) );
CREATE TABLE company (
name VARCHAR(30),
headoffice address,
subsidiaries SET( VARCHAR(30) ),
president employee );
|
|