Oracle表单非空,唯一,主键,外键,check,sequence.应用。

-- Create table







constraint A unique (ID)
create table ZHU
(
  ZHUID NUMBER not null,
  NAME  VARCHAR2(33)
)
tablespace SYSTEM
  pctfree 10
  pctused 40
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Create/Recreate primary, unique and foreign key constraints
alter table ZHU
  add constraint PK2 primary key (ZHUID)
  using index
  tablespace SYSTEM
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table ZHU
  add constraint ZHU_FK_FU foreign key (ZHUID)
  references FU (ZHUID);
-- Create table
create table ZHU
(
  ZHUID NUMBER not null,
  NAME  VARCHAR2(33)
)
tablespace SYSTEM
  pctfree 10
  pctused 40
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Create/Recreate primary, unique and foreign key constraints
alter table ZHU
  add constraint PK2 primary key (ZHUID)  using index
  tablespace SYSTEM
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table ZHU
  add constraint ZHU_FK_FU foreign key (ZHUID)
  references FU (ZHUID);

你可能感兴趣的:(oracle)