Унаследованная база данных. Создание таблиц и их связей: drop table if exists CLIENT_OBJ, страница 2

drop table if exists MAP_EVENT_REGION;

/*==============================================================*/

/* Table: MAP_EVENT_REGION                                      */

/*==============================================================*/

create table MAP_EVENT_REGION

(

ORDERID              int,

X                    double,

Y                    double,

EVENTID              int

);

alter table MAP_EVENT_REGION add constraint FK_Relationship_9 foreign key ()

references MAP_EVENT on delete restrict on update restrict;

drop table if exists POSITION;

/*==============================================================*/

/* Table: POSITION                                              */

/*==============================================================*/

create table POSITION

(

OBJID                int not null,

STAIT_DATA_TIME      date,

CREATED_DATA_TIME    date,

LOC_DATA_TIME        date,

STATE                int,

GPS_STATE            int,

ALARMS_OLD           int,

ALARMS               int,

ALARMS_NOW           int,

ALARMS_WAS           int,

OUTS                 int,

WHO                  int,

LATITUDE             float,

LONGITUDE            float,

COURSE               int,

SPEED                int,

ADC1                 float,

ADC2                 float,

ADC3                 float,

ADC4                 float,

POWER_VOLTAGE        float,

FLASH_ADDR           int

);

alter table POSITION add constraint FK_Relationship_4 foreign key (OBJID)

references DESCRIPTION (OBJID) on delete restrict on update restrict;

база данных:

Создание таблиц и их связей:

Унаследованная база данных:

drop table if exists Indentifikacia;

/*==============================================================*/

/* Table: Indentifikacia                                        */

/*==============================================================*/

create table Indentifikacia

(

login                varchar(128),

porol                varchar(128),

id1                  numeric(8,0) not null,

primary key (id1)

);

drop table if exists Nastroiki;

/*==============================================================*/

/* Table: Nastroiki                                             */

/*==============================================================*/

create table Nastroiki

(

"nomer  borta"       numeric(8,0) not null,

Napragenae           char(10),

"Temperatura obshai" char(10)

);

alter table Nastroiki add constraint FK_Relationship_2 foreign key ("nomer  borta")

references Otchetu ("nomer  borta") on delete restrict on update restrict;

drop table if exists Otchetu;

/*==============================================================*/

/* Table: Otchetu                                               */

/*==============================================================*/

create table Otchetu

(

"nomer  borta"       numeric(8,0) not null,

id1                  numeric(8,0) not null,

shirota              int,

dolgota              int,

primary key ("nomer  borta")

);

alter table Otchetu add constraint FK_Relationship_1 foreign key (id1)

references Indentifikacia (id1) on delete restrict on update restrict;

drop table if exists Tempertu;

/*==============================================================*/

/* Table: Tempertu                                              */

/*==============================================================*/

create table Tempertu

(

"Temperatura obshai" char(10),

"Temperatura dvigatela" char(10)

);

alter table Tempertu add constraint FK_Relationship_3 foreign key ()

references Nastroiki on delete restrict on update restrict;