- 7


Code INTEGER NOT NULL,

Owner INTEGER NOT NULL,

ToUsl INTEGER,

PlatDate DATE_TYPE,

PlatType INTEGER NOT NULL,

DocNmb CHAR(12) NOT NULL

);

ALTER TABLE Plat

ADD CONSTRAINT XPKPlat PRIMARY KEY (Code);

CREATE TABLE SysLog (

Code INTEGER NOT NULL,

TableName CHAR(16) NOT NULL,

OpType INTEGER NOT NULL,

NewData CHAR(64) NOT NULL,

OpDate DATE NOT NULL

);

ALTER TABLE SysLog

ADD CONSTRAINT XPKSysLog PRIMARY KEY (Code);

CREATE TABLE SysSettings (

Code INTEGER NOT NULL,

TimeTalksUsl INTEGER NOT NULL,

NullOwner INTEGER NOT NULL

);

ALTER TABLE SysSettings

ADD CONSTRAINT XPKSysSettings PRIMARY KEY (Code);

CREATE TABLE Talks (

Code INTEGER NOT NULL,

DayCode INTEGER NOT NULL,

Phone INTEGER NOT NULL,

ToPhone INTEGER NOT NULL,

CallTime CALLTIME_TYPE,

PhoneNmb PHONE_TYPE,

HowLong INTEGER NOT NULL,

ToPhoneNmb PHONE_TYPE,

Calculated SMALLINT NOT NULL,

CallDate DATE_TYPE

);

CREATE INDEX XAK1TalksCallDate ON Talks

(

CallDate

);

ALTER TABLE Talks

ADD CONSTRAINT XPKTalks PRIMARY KEY (Code);

CREATE TABLE TalksPay (

Code INTEGER NOT NULL,

Phone INTEGER NOT NULL,

TotalSum CURR_TYPE,

TotalLgotTime CALLTIME_TYPE,

TotalFullTime CALLTIME_TYPE,

TotalTime COMPUTED BY (TotalLgotTime+TotalFullTime),

CallDate DATE_TYPE