求解简单的oracle数据库中表的主键 外键 一些表中约束条件的用法,用实例解答或真人解答更好!qq:89663011

2024-12-16 04:04:02
推荐回答(2个)
回答1:

create table fuckface
(id number(4) primary key //主键
,name varchar2(10) , foreign key reference fuckass(name) //外键
,name2 varchar2(10) , foreign key reference fuckass(name) //外键
,constaint name >name2

)
constraint种类很多 推荐google搜索一下
或者直接去oracle网站找相关内容

回答2:

CREATE INDEX HIS.IDX_IPN_MED_RTN_RTN_DT ON HIS.IPN_MED_RTN
(RTN_DT)
LOGGING
TABLESPACE HIS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOPARALLEL;

CREATE INDEX HIS.IPN_BED_RTN_DEPT_CDE ON HIS.IPN_MED_RTN
(DEPT_CDE)
LOGGING
TABLESPACE HIS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOPARALLEL;

CREATE UNIQUE INDEX HIS.PK_IPN_MED_RTN ON HIS.IPN_MED_RTN
(RTN_CODE)
LOGGING
TABLESPACE EMR
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 256K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOPARALLEL;