a column of a table can be declared to have a built-in datatype called a REF to allow it to “point to”a row object of a object table. example: create type customer_t as object(…); create type agent_t as object(…); create type product_t as object(…);create type order _t as object ( ordno int, month char(3), cid char(4), aid char(3), pid char(3), qty int, dollars double precision, ordcust ref customer_t, ordagent ref agent_t, ordprod ref product_t );
example:
create type customer_t as object(…);
create type agent_t as object(…);
create type product_t as object(…);create type order _t as object
(
ordno int,
month char(3),
cid char(4),
aid char(3),
pid char(3),
qty int,
dollars double precision,
ordcust ref customer_t,
ordagent ref agent_t,
ordprod ref product_t
);
alter table emp add constraint emp_deptno_fk foreign key(deptno)
references dept(deptno);