略知一二:references是用在对象表中,如果你的表中有个ref类型的字段,通过它你就能检索出它所指向的另一个对象表中的其他字段。foreign key就是用在普通表之间...

解决方案 »

  1.   

    foreign key就是外键,用来关联表和表的,不过我们这个数据库里面没有这个东东,所以也没有例子。
      

  2.   

    foreign key 是外部键,它是用来实现数据库的完整性,它是关联表A中的一个属性C和另一个表B中primary key。而且属性C和primary key的名字、类型必须是一样的。
      

  3.   

    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
    );
      

  4.   

    foreign key其实就是关联另外一张表的primary key
      

  5.   

    例子:
    alter table emp add constraint emp_deptno_fk foreign key(deptno)
    references dept(deptno);