正在加载图片...
DEPARTMENT D EMPLOYEE ASSIGN TO D PROJECT FIGURE 94.9 Representing many-to-many relationships in the network model employee(D_EMPLOYEE) is one-to-many. This relationship defines a set type where the owner record type is DEPARTMENT and the member record type is D_EMPLOYEE. Each instance of an owner record type along with all the corresponding member records represents a set instance of the underlying set type. In practice, a set is commonly implemented using a circular- linked list which allows an owner record to be linked to all its member records. The pointer associated with the owner record is known as the FIRSt pointer, and the one associated with a member record is known as a NEXT pointer In general, a record type cannot be both the owner and a member of the same set type. Also, a record cannot exist in more than one instance of a specific set type. The latter requirement implies that many-to-many relationships are not directly implemented in the network data model. Itionship is represented by two set types and an intermediate record type. The new record type could be record type, and the other has D_ PROJECT as owner and ASSIGNED_TO as member record type member named ASSIGNED_TO (see Fig 94.9). One set has D_EMPLOYEE as owner and ASSIGNED_TO as member Standards for the network model's DDL and DMl were originally proposed by the CODASYL ( Conference On Data SYstems Languages) committee in 1971. Several revisions to the original proposal were made later. In a network DDL, such as that of the IDMS database management system, a set declaration specifies the name of the set, its owner record type, and its member record type. The insertion mode for the set members needs to be specified using combinations of the following four commands: An inserted record is automatically connected to the appropriate set instance. case, records are inserted into the appropriate set instance by an application program IONA a member record does not have to be a member of a set instance. the member record can be connected to connected from a set instance using DML commands MANDATORY A member record needs to be connected to a set instance. a member record can be moved to another set instance using the network's DML F工XED a member record needs to be connected to a set instance. a member record cannot be moved to another The networks DDl allows member records to be ordered in several ways. Member records can be sorted in ascending or descending order according to one or more fields. Alternatively, a new member record can be nserted next(prior)to the current record (pointed to by the currency indicator)in the set instance. a newly inserted member record can also be placed first(or last)in the set instance. This will lead to a chronological (or reverse chronological)order among member records As with the hierarchy model, network DMLs are record-at-a-time languages, and currency indicators are necessary for navigation through the network database. For example, the IDMS main data manipulation commands can be summarized as follows: e 2000 by CRC Press LLC© 2000 by CRC Press LLC employee (D_EMPLOYEE) is one-to-many. This relationship defines a set type where the owner record type is DEPARTMENT and the member record type is D_EMPLOYEE. Each instance of an owner record type along with all the corresponding member records represents a set instance of the underlying set type. In practice, a set is commonly implemented using a circular-linked list which allows an owner record to be linked to all its member records. The pointer associated with the owner record is known as the FIRST pointer, and the one associated with a member record is known as a NEXT pointer. In general, a record type cannot be both the owner and a member of the same set type. Also, a record cannot exist in more than one instance of a specific set type. The latter requirement implies that many-to-many relationships are not directly implemented in the network data model. The relationship between D_PROJECT and D-EMPLOYEE is many-to-many. In the network model, this relationship is represented by two set types and an intermediate record type. The new record type could be named ASSIGNED_TO (see Fig. 94.9). One set has D_EMPLOYEE as owner and ASSIGNED_TO as member record type, and the other has D_PROJECT as owner and ASSIGNED_TO as member record type. Standards for the network model’s DDL and DML were originally proposed by the CODASYL (Conference On Data SYstems Languages) committee in 1971. Several revisions to the original proposal were made later. In a network DDL, such as that of the IDMS database management system, a set declaration specifies the name of the set, its owner record type, and its member record type. The insertion mode for the set members needs to be specified using combinations of the following four commands: AUTOMATIC An inserted record is automatically connected to the appropriate set instance. MANUAL In this case, records are inserted into the appropriate set instance by an application program. OPTIONAL A member record does not have to be a member of a set instance. The member record can be connected to or disconnected from a set instance using DML commands. MANDATORY A member record needs to be connected to a set instance. A member record can be moved to another set instance using the network’s DML. FIXED A member record needs to be connected to a set instance. A member record cannot be moved to another set instance. The network’s DDL allows member records to be ordered in several ways. Member records can be sorted in ascending or descending order according to one or more fields. Alternatively, a new member record can be inserted next (prior) to the current record (pointed to by the currency indicator) in the set instance. A newly inserted member record can also be placed first (or last) in the set instance. This will lead to a chronological (or reverse chronological) order among member records. As with the hierarchy model, network DMLs are record-at-a-time languages, and currency indicators are necessary for navigation through the network database. For example, the IDMS main data manipulation commands can be summarized as follows: FIGURE 94.9 Representing many-to-many relationships in the network model
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有