Download presentation
Presentation is loading. Please wait.
1
“ Possible representation (3) “
Welcome: To the sixth learning sequence “ Possible representation (3) “ Recap : In the previous learning sequence, we discussed four possible representations. Present learning: We shall explore the following topics: - Hierarchical organization. - Hash – addressing. - Network data structure.
2
Possible representation
- In this section we make a simple collection of sample data and consider some of many ways it could be represented in storage at the level of stored record interface.
3
Possible representation
The sample data is consists of information about the same five suppliers; for each supplier we wish to record the same attributes: Supplier number (S#), a supplier name (SNAME), and location (CITY).
4
Possible representation
8- Another representation that should be mentioned is the hierarchical organization; illustrated in fig7 Here we have one stored file containing three (hierarchical) stored record occurrences, one for each city. Part of each stored record occurrence consists of variable _ length (list) of supplier entries. One for each supplier in that city and each supplier entry contains supplier number and name
5
Possible representation
Athens London Paris Fig 7: Hierarchical Organization
6
Possible representation
Athens London Paris S5 Adams Fig 7: Hierarchical Organization
7
Possible representation
Athens London Paris S5 Adams S1 Smith S4 Clark Fig 7: Hierarchical Organization
8
Possible representation
Athens London Paris S5 Adams S1 Smith S4 Clark S2 Jones S3 Blake Fig 7: Hierarchical Organization
9
Possible representation
9- The basic idea of Hash – addressing is that each stored record occurrence in the database at a location whose address (SRA) may be completed as name function (hash function) of a value that appears in that occurrence – usually the primary key value.
10
Possible representation
Thus to store the occurrence initially. That (DBMS) compute the (SRA) and instruct the Access method to place the occurrence (record) at that position. To retrieve (access) the occurrence (record), the DBMS perform the same computation (algorithm) as before and then request the access method to fetch the occurrence at that computed position. The advantage of this organization is that provides very fast direct access on the basic of values of the hashed field.
11
Possible representation
As an example of hash – addressing let us assume that the S # values are (100,200,300,400,500) and let us consider the hash function (algorithm). SRA=remainder after dividing by 13 The SRA = for the five supplier are there 9 , 5 , 1 , 10 , 6 respectively, giving us there representation shown in fig 8.
12
Possible representation
1 S300 Blake 30 Paris 2 3 4 5 S200 Jones 20 Paris 6 S500 Adams 30 Athens 7 8 9 10 S400 Clark 20 London 11 Fig 8: A Hash-addressing Organization
13
Possible representation
10- A Network data structure allows any entity to have any number of subordinates or superiors. A network structure is shown in figure 9. Entities are connected using network links, which are data items common to both of the connected entities. Some of problems inherent in hierarchical structures can be alleviated using the network structure, but the network structure is more complex.
14
Possible representation
Entity Entity Link Link Link Link Entity Entity Entity Fig 9: A Network structure
15
Possible representation
An example of the compact disc ordering database using a network structure is shown in figure 10. The entities (ITEM-DESCRIPTION and ORDER-DETAILS) are connected by network links (STATUS-LINK). Updating record (such as correcting a person’s credit-card number) is easier than in hierarchical structure, because order record (10784 for “MacRae”) appears only once. It is also possible to insert records for customers who have not yet placed orders (for instance, if they wish to be on a catalog mailing list). The appropriate ITEM-DESCRIPTION can be added at a later date, when the order is placed.
16
Fig 10:Network Structure
STATUS-LINK ITEM-DESCRIPTION Shipped5/12 B235 Guys and Dotts 8.99 Shipped5/14 B521 My Fair Lady 6.99 Inprocess B894 42 street 10.99 Inprocess B992 A Chorus Line 10.99 Backordered 10784 MacRae G 2314Curly Circle Lincoin NE Shipped5/12 10796 Jones S 34Dream Lane Oklahama OK Shipped5/12 11821 Preston R 1003Madison Ave. River City IA 12845 Channing C 454Hammonia St. NewYork NY 11872 Kittey R 765Dulcines Drive Lamansha CA ORDER-DETAILS Fig 10:Network Structure
17
Possible representation
Our survey of some storage structures permitted by the stored record interface in now complete. In conclusion we should perhaps points out that there is no such thing as a "best" storage structure. What is "best" depend on what is important to the enterprise (organization). It is the responsibility of the DBA to balance large conflicting requirements in choosing a storage structure.
18
Possible representation
The consideration that must be taken into account include so many pointed such as: Retrieval performance. The difficulty of applying change. The amount of storage space available. The ease with which the database may be reorganized. Desired frequency of such reorganization. Problem of recovery. And so on.
19
Summary: In this learning sequence, we discussed the following topic:
- Three possible representations for some sample data.
20
END
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.