create type address_typ as object (
street varchar2(40),
city varchar2(30),
state char(2),
zip char(10));
/

create type person_typ as object (
first varchar2(15),
last varchar2(30),
addr address_typ,
birthday DATE);
/

create table people of person_typ;

insert into people values
( person_typ ('John', 'Smith', 
address_typ ('500 Oracle Parkway', 'Redwood Shores', 'CA', '94535'),
TO_DATE ('01-jan-1960')));

insert into people values
( person_typ ('Diane', 'Major',
address_typ('13 Downing Street', 'London', 'UK', '33874'),
TO_DATE ('01-mai-1962')));

create type person_tab as table of person_typ;
/

create type project_typ as object (
pno char(5),
pname char(20),
budget dec(7,2),
employees person_tab);
/

create table projects of project_typ 
nested table employees store as emp_table;

insert into projects values
( project_typ('110', 'Project Hubble', '10000', null));
