表间关系如下:
-- Create table
create table T_TOPIC_APPLIED
(
BOOTHS INTEGER,
SPACE NUMBER(5,1),
TOPICID NUMBER(10) not null,
TOPICAPPLIEDID NUMBER(10) not null,
USERID NUMBER(10) not null,
EXPOID NUMBER(10) not null
)
tablespace EXPO
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table T_TOPIC_APPLIED
add primary key (TOPICAPPLIEDID)
using index
tablespace EXPO
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table T_TOPIC_APPLIED
add constraint FK_TOPIC_APPLIED_1 foreign key (EXPOID)
references T_EXPO (EXPOID) on delete cascade;
alter table T_TOPIC_APPLIED
add foreign key (TOPICID)
references T_EXPO_TOPIC (TOPICID) on delete cascade;
alter table T_TOPIC_APPLIED
add foreign key (USERID)
references T_USER (USERID) on delete cascade;
-- Create table
create table T_TOPIC_ITEM_APPLIED
(
ITEMAPPLIEDID NUMBER(10) not null,
ITEMID NUMBER(10) not null,
TOPICAPPLIEDID NUMBER(10) not null
)
tablespace EXPO
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table T_TOPIC_ITEM_APPLIED
add primary key (ITEMAPPLIEDID)
using index
tablespace EXPO
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1