Database Relations

754 Views


Defined as

File-to-file Relationship

Defined as relation is automatically created for a file if a reference is made to a non-existence file

eg. Employee Defined as Employee.

Owned by

File-to-file relationship

Key fields of owing file become key fields of owned file. Attributes of owning file will become virtual fields of owned file.

e.g. Orderdetail OWNED BY Order

Known by

Specifies the key fields for a file

eg. Order KNOWN By ORDER No

Qualified by

To qualify a file identifier by one or more variable factors like date, time, sequence number etc.

Appropriate fields of referring file can be redirected (RDR) to the effective field in referred file with a possibility of specifying *PREVIOUS or *NEXT field in the relation must be ATR and not CDE.

e.g.
Product Price Owned by Product Code
Product Price Qualified by Effective date
Product Price Has Product price

Has Relation

Declares a field to be present in a file as an attribute.

e.g. Order HAS Quantity

Includes Relation

File includes all the fields of a strucutre (STR) file.

e.g. Product INCLUDES Auditstamp -----------> (STR) File

Refers to Relation

File refers to another file.

Allows access to any of the fields on the referred file from a referring file.

Primary Key ----> Key field
Virtual Key -----> Non Key field
e.g. OrderDetail Refers to Product.

Extended By

Declares a file to be extension of another file

Recommended to use Extended by along with Owned by. 

If used with OWNED BY, the fields of the extended file are available as virtual fields in the file being extended.

e.g. Customer Extended by CustomerDetails.

Sequence order

Post Comments