正在加载图片...
PARTMENT D EMPLOYEE D PROJECT FIGURE 94.8 A hierarchical schema Such redundancies can be reduced to a large extent through the use of logical links. A logical link associates a virtual record from a hierarchical schema with an actual record from either the same schema or another schema. The redundant copy of the actual record is therefore replaced by a virtual record, which is nothing more than a pointer to the actual one. Hierarchical DLLs are used by a designer to declare the different hierarchical schemas, record types, and logical links. Furthermore, a root node must be declared for each hierarchical schema, and each record type declaration must also specify the parent record type Unlike relational DMLs, hierarchical DMLs such as DL/I are record at-a-time languages. DL/l is used by IBM,s IMS hierarchical DBMS In DL/I a tree traversal is based on a preorder algorithm, and within each tree the last record accessed through a Dl/l command can be located through a currency indicator. Retrieval commands are of three GET UNIQUE <record type> WHERE <restrictions> Such a command retrieves the leftmost record that meets the imposed restrictions. The search always starts at the root of the tree pointed to by the currency indicator. ET NExT [<record type> WHERE <restrictions>] Starting from the current position, this command uses the preodrer algorithm to retrieve the next record that satisfies the restrictions. The clause enclosed between brackets is optional. GET NEXT is used to retrieve the next(preorder)record from the current position. GET NEXT WITHIN PARENT [<record type> WHERE <restrictions>] It retrieves all records that have the same parent and that satisfy the restrictions. The parent is assumed to have been selected through a previous GET command. Four commands are used for record updates: Stores a new record and links it to a parent. The parent has been already selected through a GEt command REPLACE The current record(selected through a previous GET command)is modified. DELETE The current record and all its descendants are deleted GET HOLD Locks the current record while it is being modified. The DL/1 commands are usually embedded in a general-purpose(host)language. In this case, a record accessed through a Dl/I command is assigned to a program variable Network databases d Navathe, 1994] associations between record types are less restrictive than with the hierarchy model. Here, associations among record types are represented as graphs One-to-one and one-to-many relationships are described using the notion of set type. Each set type has an owner record type and a member record type. In the example of Fig. 94.8, the relationship between DEPARTMENT and c2000 by CRC Press LLC© 2000 by CRC Press LLC Such redundancies can be reduced to a large extent through the use of logical links. A logical link associates a virtual record from a hierarchical schema with an actual record from either the same schema or another schema. The redundant copy of the actual record is therefore replaced by a virtual record, which is nothing more than a pointer to the actual one. Hierarchical DLLs are used by a designer to declare the different hierarchical schemas, record types, and logical links. Furthermore, a root node must be declared for each hierarchical schema, and each record type declaration must also specify the parent record type. Unlike relational DMLs, hierarchical DMLs such as DL/1 are record at-a-time languages. DL/1 is used by IBM’s IMS hierarchical DBMS. In DL/1 a tree traversal is based on a preorder algorithm, and within each tree, the last record accessed through a DL/1 command can be located through a currency indicator. Retrieval commands are of three types: GET UNIQUE <record type> WHERE <restrictions> Such a command retrieves the leftmost record that meets the imposed restrictions. The search always starts at the root of the tree pointed to by the currency indicator. GET NEXT [<record type> WHERE <restrictions>] Starting from the current position, this command uses the preodrer algorithm to retrieve the next record that satisfies the restrictions. The clause enclosed between brackets is optional. GET NEXT is used to retrieve the next (preorder) record from the current position. GET NEXT WITHIN PARENT [<record type> WHERE <restrictions>] It retrieves all records that have the same parent and that satisfy the restrictions. The parent is assumed to have been selected through a previous GET command. Four commands are used for record updates: INSERT Stores a new record and links it to a parent. The parent has been already selected through a GET command. REPLACE The current record (selected through a previous GET command) is modified. DELETE The current record and all its descendants are deleted. GET HOLD Locks the current record while it is being modified. The DL/1 commands are usually embedded in a general-purpose (host) language. In this case, a record accessed through a DL/1 command is assigned to a program variable. Network Databases In the network model [Elmasri and Navathe, 1994] associations between record types are less restrictive than with the hierarchy model. Here, associations among record types are represented as graphs. One-to-one and one-to-many relationships are described using the notion of set type. Each set type has an owner record type and a member record type. In the example of Fig. 94.8, the relationship between DEPARTMENT and FIGURE 94.8 A hierarchical schema
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有