Смекни!
smekni.com

Автоматизированная система управления комбината Белшина (стр. 12 из 13)

NoChildren Number(18, 1) NULL ,

RecID Number(10, 0) NOT NULL ,

ScienceDegree Varchar2(64) NULL ,

SecondName Varchar2(64) NULL ,

Sex Varchar2(16) NULL ,

Telephone Varchar2(64) NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_Staff PRIMARY KEY ( RecID ));

Create Table StaffProfAssoc (

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

ProfGrade Varchar2(16) NULL ,

ProfessionID Number(10, 0) NOT NULL ,

RecID Number(10, 0) NOT NULL ,

StaffID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_StaffProfAssoc PRIMARY KEY ( RecID ));

Create Table StaffQualAssoc (

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

Grade Varchar2(64) NULL ,

QualificacionID Number(10, 0) NOT NULL ,

RecID Number(10, 0) NOT NULL ,

StaffID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_StaffQualAssoc PRIMARY KEY ( RecID ));

Create Table StaffTable (

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

LostTimeTypeID Number(10, 0) NULL ,

OutPutesItemID Number(10, 0) NULL ,

QtyHour Number(18, 1) NULL ,

RecID Number(10, 0) NOT NULL ,

StaffID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

TimeTableID Number(10, 0) NOT NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_StaffTable PRIMARY KEY ( RecID ));

Create Table StatusGrade (

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

RecID Number(10, 0) NOT NULL ,

StatusName Varchar2(64) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_StatusGrade PRIMARY KEY ( RecID ));

Create Table Stock (

AccountPlanID Number(10, 0) NULL ,

CardNo Varchar2(16) NULL ,

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

PartID Number(10, 0) NOT NULL ,

Price Number(18, 2) NULL ,

Qty Number(18, 1) NULL ,

RecID Number(10, 0) NOT NULL ,

StoreID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_Stock PRIMARY KEY ( RecID ));

Create Table StockAttrAssoc (

AttrValue Number(20, 10) NULL ,

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

PartAttributeID Number(10, 0) NOT NULL ,

RecID Number(10, 0) NOT NULL ,

StockID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_StockAttrAssoc PRIMARY KEY ( RecID ));

Create Table StockDocItem (

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

DocumentItemID Number(10, 0) NOT NULL ,

RecID Number(10, 0) NOT NULL ,

StockID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_StockDocItem PRIMARY KEY ( RecID ));

Create Table SuppPayAkkreditive (

AkkreditiveID Number(10, 0) NOT NULL ,

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

RecID Number(10, 0) NOT NULL ,

SuppPaymentID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_SuppPayAkkreditive PRIMARY KEY ( RecID ));

Create Table SuppPayBooking (

BookkeepDocID Number(10, 0) NOT NULL ,

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

RecID Number(10, 0) NOT NULL ,

SuppPaymentID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_SuppPayBooking PRIMARY KEY ( RecID ));

Create Table Tarife (

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

DateBegin date NULL ,

DateEnd date NULL ,

Discriminator Varchar2(32) NULL ,

GroundSalValue Number(18, 2) NOT NULL ,

OrdersID Number(10, 0) NOT NULL ,

RecID Number(10, 0) NOT NULL ,

TarifeName Varchar2(64) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_Tarife PRIMARY KEY ( RecID ));

CREATE TABLE O_Tarife (

TarifeID Number(10, 0) NOT NULL UNIQUE);

Create Table TarifeItem (

AdditCaeff Number(20, 10) NULL ,

Caefficient Number(20, 10) NULL ,

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

Discriminator Varchar2(32) NULL ,

RecID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_TarifeItem PRIMARY KEY ( RecID ));

CREATE TABLE O_TarifeItem (

TarifeItemID Number(10, 0) NOT NULL UNIQUE);

Create Table WorkersChild (

CreatedBy Varchar2(31) NULL ,

CreatedWhen date NULL ,

RecID Number(10, 0) NOT NULL ,

Staff_he_fatherID Number(10, 0) NOT NULL ,

Staff_he_motherID Number(10, 0) NOT NULL ,

Staff_isID Number(10, 0) NOT NULL ,

TimeStamp Number(10, 0) NULL ,

WrittenBy Varchar2(31) NULL ,

WrittenWhen date NULL ,

Constraint PK_WorkersChild PRIMARY KEY ( RecID ));

Alter Table Akkreditive Add (

Constraint FK_AkkreditiveAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table Bank Add (

Constraint FK_BankAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table Carrier Add (

Constraint FK_CarrierAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table CompanyAccount Add (

Constraint FK_CompanyAccountAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table CreditContract Add (

Constraint FK_CreditContractAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table Customer Add (

Constraint FK_CustomerAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table HSGradeShool Add (

Constraint FK_HSGradeShoolAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table OtherAddr Add (

Constraint FK_OtherAddrAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table Payer Add (

Constraint FK_PayerAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table Recipient Add (

Constraint FK_RecipientAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table Supplier Add (

Constraint FK_SupplierAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table Wechsel Add (

Constraint FK_WechselAddressee FOREIGN KEY (AddresseeID) References Addressee ( RecID )

);

Alter Table CTIDepartmentAssoc Add (

Constraint FK_CTIDepartmentAssocCTL FOREIGN KEY (CategTarifeLinksID) References CategTarifeLinks ( RecID )

);

Alter Table COfferContrAssoc Add (

Constraint FK_COfferContrAssocCCI FOREIGN KEY (CContractItemID) References CContractItem ( RecID )

);

Alter Table CustomerDelivery Add (

Constraint FK_CustomerDeliveryCCI FOREIGN KEY (CContractItemID) References CContractItem ( RecID )

);

Alter Table ProdReservation Add (

Constraint FK_ProdReservationCCI FOREIGN KEY (CContractItemID) References CContractItem ( RecID )

);

Alter Table Akzis Add (

Constraint FK_AkzisCoefficient FOREIGN KEY (CoefficientID) References Coefficient ( RecID )

);

Alter Table CoeffRef Add (

Constraint FK_CoeffRefCoefficient FOREIGN KEY (CoefficientID) References Coefficient ( RecID )

);

Alter Table CommonCost Add (

Constraint FK_CommonCostCoefficient FOREIGN KEY (CoefficientID) References Coefficient ( RecID )

);

Alter Table SelfCost Add (

Constraint FK_SelfCostCoefficient FOREIGN KEY (CoefficientID) References Coefficient ( RecID )

);

Alter Table District Add (

Constraint FK_DistrictCountry FOREIGN KEY (CountryID) References Country ( RecID )

);

Alter Table NationalAssoc Add (

Constraint FK_NationalAssocCountry FOREIGN KEY (CountryID) References Country ( RecID )

);

Alter Table OfficialTrip Add (

Constraint FK_OfficialTripCountry FOREIGN KEY (CountryID) References Country ( RecID )

);

Alter Table Document Add (

Constraint FK_DocumentDateWork FOREIGN KEY (DateWorkID) References DateWork ( RecID )

);

Alter Table TimeTable Add (

Constraint FK_TimeTableDateWork FOREIGN KEY (DateWorkID) References DateWork ( RecID )

);

Alter Table BasisEquipment Add (

Constraint FK_BasisEquipmentDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table CTIDepartmentAssoc Add (

Constraint FK_CTIDepartmentAssocD FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table DepToShop Add (

Constraint FK_DepToShopDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table Equipment Add (

Constraint FK_EquipmentDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table MatIssueAux Add (

Constraint FK_MatIssueAuxDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table NCTIDepAssoc Add (

Constraint FK_NCTIDepAssocDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table NeedPlan Add (

Constraint FK_NeedPlanfromDepartment FOREIGN KEY (Department_fromID) References Department ( RecID ),

Constraint FK_NeedPlantoDepartment FOREIGN KEY (Department_toID) References Department ( RecID )

);

Alter Table OrderPlan Add (

Constraint FK_OrderPlanfromDepartment FOREIGN KEY (Department_fromID) References Department ( RecID ),

Constraint FK_OrderPlantoDepartment FOREIGN KEY (Department_toID) References Department ( RecID )

);

Alter Table OrgStructure Add (

Constraint FK_OrgStructureis_subD FOREIGN KEY (Department_is_subID) References Department ( RecID ),

Constraint FK_OrgStructureis_superD FOREIGN KEY (Department_is_superID) References Department ( RecID )

);

Alter Table Part Add (

Constraint FK_PartDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table PartTechOper Add (

Constraint FK_PartTechOperDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table PartTechProc Add (

Constraint FK_PartTechProcDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table Perpetrators Add (

Constraint FK_PerpetratorsDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table ProdRecDept Add (

Constraint FK_ProdRecDeptDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table ProductionPlan Add (

Constraint FK_ProductionPlanfromD FOREIGN KEY (Department_fromID) References Department ( RecID ),

Constraint FK_ProductionPlantoD FOREIGN KEY (Department_toID) References Department ( RecID )

);

Alter Table RemainsInShop Add (

Constraint FK_RemainsInShopDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table SelfCostItem Add (

Constraint FK_SelfCostItemDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table ShopToDep Add (

Constraint FK_ShopToDepDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table Store Add (

Constraint FK_StoreDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table TimeTable Add (

Constraint FK_TimeTableDepartment FOREIGN KEY (DepartmentID) References Department ( RecID )

);

Alter Table CustomerContract Add (

Constraint FK_CustomerContractsignsE FOREIGN KEY (Employee_signsID) References Employee ( RecID ),

Constraint FK_CustomerContractworks_onE FOREIGN KEY (Employee_works_onID) References Employee ( RecID )

);

Alter Table SupplierContract Add (

Constraint FK_SupplierContractsignsE FOREIGN KEY (Employee_signsID) References Employee ( RecID ),

Constraint FK_SupplierContractworks_onE FOREIGN KEY (Employee_works_onID) References Employee ( RecID )

);

Alter Table NCTIDepAssoc Add (

Constraint FK_NCTIDepAssocNCTI FOREIGN KEY (NonCategTarifItemID) References NonCategTarifItem ( RecID )

);

Alter Table Maternity Add (

Constraint FK_MaternityOrders FOREIGN KEY (OrdersID) References Orders ( RecID )

);

Alter Table CustomerContract Add (

Constraint FK_CustomerContractOS FOREIGN KEY (OrderStateID) References OrderState ( RecID )

);

Alter Table OrderPlanItem Add (

Constraint FK_OrderPlanItemOrderState FOREIGN KEY (OrderStateID) References OrderState ( RecID )

);

Alter Table ConditionsOfOType Add (

Constraint FK_ConditionsOfOTypeOT FOREIGN KEY (OrderTypeID) References OrderType ( RecID )

);

Alter Table CustomerContract Add (

Constraint FK_CustomerContractOT FOREIGN KEY (OrderTypeID) References OrderType ( RecID )

);

Alter Table AkzisItem Add (

Constraint FK_AkzisItemPeriod FOREIGN KEY (PeriodID) References Period ( RecID )

);

Alter Table CCostItem Add (

Constraint FK_CCostItemPeriod FOREIGN KEY (PeriodID) References Period ( RecID )

);

Alter Table CompItem Add (

Constraint FK_CompItemPeriod FOREIGN KEY (PeriodID) References Period ( RecID )

);

Alter Table Estimate Add (

Constraint FK_EstimatePeriod FOREIGN KEY (PeriodID) References Period ( RecID )

);

Alter Table NeedPlanItem Add (

Constraint FK_NeedPlanItemPeriod FOREIGN KEY (PeriodID) References Period ( RecID )

);

Alter Table OrderPlanItem Add (

Constraint FK_OrderPlanItemPeriod FOREIGN KEY (PeriodID) References Period ( RecID )

);

Alter Table ProductionPlan Add (

Constraint FK_PPPlanningPeriodP FOREIGN KEY (Period_PlanningPeriodID) References Period ( RecID )

);

Alter Table Summary Add (

Constraint FK_SummaryPeriod FOREIGN KEY (PeriodID) References Period ( RecID )

);

Alter Table PartAssign Add (

Constraint FK_PartAssignPeriodAssign FOREIGN KEY (PeriodAssignID) References PeriodAssign ( RecID )

);

Alter Table Contract Add (

Constraint FK_ContractPlaceEmpAssoc FOREIGN KEY (PlaceEmpAssocID) References PlaceEmpAssoc ( RecID )

);

Alter Table Rubber Add (

Constraint FK_RubberReasonOfCreate FOREIGN KEY (ReasonOfCreateID) References ReasonOfCreate ( RecID )

);

Alter Table RubberGlue Add (

Constraint FK_RubberGlueReasonOfCreate FOREIGN KEY (ReasonOfCreateID) References ReasonOfCreate ( RecID )

);

Alter Table RubberImpregnant Add (

Constraint FK_RubberImpregnantROC FOREIGN KEY (ReasonOfCreateID) References ReasonOfCreate ( RecID )

);

Alter Table RubberLubricant Add (

Constraint FK_RubberLubricantROC FOREIGN KEY (ReasonOfCreateID) References ReasonOfCreate ( RecID )

);

Alter Table CustomerContract Add (

Constraint FK_CustomerContractsignsS FOREIGN KEY (Staff_signsID) References Staff ( RecID ),

Constraint FK_CustomerContractworks_onS FOREIGN KEY (Staff_works_onID) References Staff ( RecID )

);

Alter Table CustomerOffer Add (

Constraint FK_CustomerOfferStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table Document Add (

Constraint FK_DocumentInStaff FOREIGN KEY (Staff_InID) References Staff ( RecID ),

Constraint FK_DocumentOutStaff FOREIGN KEY (Staff_OutID) References Staff ( RecID ),

Constraint FK_DocumentOwnerStaff FOREIGN KEY (Staff_OwnerID) References Staff ( RecID )

);

Alter Table Maternity Add (

Constraint FK_MaternityStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table NationalAssoc Add (

Constraint FK_NationalAssocStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table OutPutesItem Add (

Constraint FK_OutPutesItemStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table Perpetrators Add (

Constraint FK_PerpetratorsStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table PersonalCard Add (

Constraint FK_PersonalCardStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table PrivateAccount Add (

Constraint FK_PrivateAccountStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table StandingIdle Add (

Constraint FK_StandingIdleStaff FOREIGN KEY (StaffID) References Staff ( RecID )

);

Alter Table SupplierContract Add (