Унаследованная база данных:
Создание таблиц и их связей:
drop table if exists CLIENT_OBJ;
/*==============================================================*/
/* Table: CLIENT_OBJ */
/*==============================================================*/
create table CLIENT_OBJ
(
ID numeric(8,0) not null,
primary key (ID));
drop table if exists CLIENT_REGION;
/*==============================================================*/
/* Table: CLIENT_REGION */
/*==============================================================*/
create table CLIENT_REGION
(
NAME varchar(64),
COMEN varchar(128),
TYPE varchar(64),
TOKEN_ID int not null,
ID numeric(8,0) not null,
LOCATION varchar(128),
primary key (TOKEN_ID)
);
alter table CLIENT_REGION add constraint FK_Relationship_7 foreign key (ID)
references CLIENT_OBJ (ID) on delete restrict on update restrict;
drop table if exists CLIENT_TOKEN;
/*==============================================================*/
/* Table: CLIENT_TOKEN */
/*==============================================================*/
create table CLIENT_TOKEN
(
TOKEN varchar(128),
"NAME." varchar(64) not null,
TOKEN_ID int not null,
CAPS varchar(16),
ENABLED int,
primary key ("NAME.")
);
alter table CLIENT_TOKEN add constraint FK_Relationship_1 foreign key (TOKEN_ID)
references CLIENT_REGION (TOKEN_ID) on delete restrict on update restrict;
drop table if exists DESCRIPTION;
/*==============================================================*/
/* Table: DESCRIPTION */
/*==============================================================*/
create table DESCRIPTION
(
OBJID int not null,
ID numeric(8,0) not null,
GROUPID int,
CMNT varchar(32),
NETID varchar(16),
CORECTION_X int,
CORECTION_Y int,
USER_STATE int,
MAX_AGE int,
MAX_RESPONSE int,
"NAME..." varchar(16),
primary key (OBJID)
);
alter table DESCRIPTION add constraint FK_Relationship_10 foreign key (GROUPID)
references DGROUP (GROUPID) on delete restrict on update restrict;
alter table DESCRIPTION add constraint FK_Relationship_8 foreign key (ID)
references CLIENT_OBJ (ID) on delete restrict on update restrict;
drop table if exists DGROUP;
/*==============================================================*/
/* Table: DGROUP */
/*==============================================================*/
create table DGROUP
(
GROUPID int not null,
"NAME.." varchar(64),
primary key (GROUPID)
);
drop table if exists MAP_EVENT;
/*==============================================================*/
/* Table: MAP_EVENT */
/*==============================================================*/
create table MAP_EVENT
(
"NAME." varchar(64) not null,
COORDTYPE int,
CENTERX numeric(8,0),
CENTERY numeric(8,0),
FORIEGN_ID varchar(128),
FORIEGN_TYPE varchar(128),
GEO_ID int
);
alter table MAP_EVENT add constraint FK_Relationship_2 foreign key ("NAME.")
references CLIENT_TOKEN ("NAME.") on delete restrict on update restrict;
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.