Network Model The Network model replaces the hierarchical































- Slides: 31

Network Model The Network model replaces the hierarchical tree with a graph thus allowing more general connections among the nodes. The main difference of the network model from the hierarchical model, is its ability to handle many to many (N: N) relations. In other words, it allows a record to have more than one parent. Suppose an employee works for two departments. The strict hierarchical arrangement is not possible here and the tree becomes a more generalized graph – a network. The network model was evolved to specifically handle non-hierarchical relationships. A network structure thus allows 1: 1 (one: one), 1: M (one: many), M: M (many: many) relationships among entities. In network database terminology, a relationship is a set. Each set is made up of at least two types of records: an owner record (equivalent to parent in the hierarchical model) and a member record (similar to the child record in the hierarchical model).

Network view of Sample Database

Operations on Network Model Insert Operation To insert a new record containing the details of a new supplier, we simply create a new record occurrence. Initially, there will be no connector. The new supplier’s chain will simply consist of a single pointer starting from the supplier to itself. For example supplier S 4 can be inserted in network model that does not supply any part as a new record occurrence with a single pointer from S 4 to itself. This is not possible in case of hierarchical model. Similarly a new part can be inserted who does not supplied by any supplier. Consider another case if supplier S 1 now starts supplying P 3 part with quantity 100, then a new connector containing the 100 as supplied quantity is added in to the model and the pointer of S 1 and P 3 are modified


Update Operation: Unlike hierarchical model, where updation was carried out by search and had many inconsistency problems, in a network model updating a record is a much easier process. We can change the city of S 1 from Qadian to Jalandhar without search or inconsistency problems because the city for S 1 appears at just one place in the network model. Similarly same operation is performed to change the any attribute of part. Delete operation: If we wish to delete the information of any part say P 1, then that record occurrence can be deleted by removing the corresponding pointers and connectors, without affecting the supplier who supply that part i. e. P 1, the model is modified. Similarly same operation is performed to delete the information of supplier.


For example if supplier S 1 stops the supply of part P 1 with 250 quantity the model is modified without affecting P 1 and S 1 information.

Conclusion As explained earlier, we can conclude that network model does not suffers from the Insert anomalies, Update anomalies and Deletion anomalies, also the retrieval operation is symmetric, as compared to hierarchical model, but the main disadvantage is the complexity of the model. Since each above operation involves the modification of pointers, which makes whole model complicated and complex.

Advantages of Network Model Conceptual simplicity: Just like the hierarchical model, the network model is also conceptually simple and easy to design. Capability to handle more relationship types: The network model can handle the one-to-many (1: N) and many to many (N: N) relationships, which is a real help in modeling the real life situations. Ease of data access: The data access is easier than and flexible than the hierarchical model. Data Integrity: The network model does not allow a member to exist without an owner. Thus a user must first define the owner record and then the member

Data independence: The network model is better than the hierarchical model in isolating the programs from the complex physical storage details. Database Standards: One of the major drawbacks of the hierarchical model was the nonavailability of universal standards for database design and modeling. The network model is based on the standards formulated by the DBTG and augmented by ANSI/SPARC (American National Standards Institute/Standards Planning and Requirements Committee) in the 1970 s. All the network database management systems conformed to these standards. These standards included a Data Definition Language (DDL) and the Data Manipulation Language (DML), thus greatly enhancing database administration and portability.

Disadvantages of Network Model System complexity: All the records are maintained using pointers and hence the whole database structure becomes very complex. Operational Anomalies: As discussed earlier, network model’s insertion, deletion and updating operations of any record require large number of pointer adjustments, which makes its implementation very complex and complicated. Absence of structural independence: Since the data access method in the network database model is a navigational system, making structural changes to the database is very difficult in most cases and impossible in some cases. If changes are made to the database structure then all the application programs need to be modified before they can access data.

Relational Model Relational model stores data in the form of tables. This concept purposed by Dr. E. F. Codd, a researcher of IBM in the year 1960 s. The relational model consists of three major components: 1. The set of relations and set of domains that defines the way data can be represented (data structure). 2. Integrity rules that define the procedure to protect the data (data integrity). 3. The operations that can be performed on data (data manipulation). A relational model database is defined as a database that allows you to group its data items into one or more independent tables that can be related to one another by using fields common to each related table.

Characteristics of Relational Database The whole data is conceptually represented as an orderly arrangement of data into rows and columns, called a relation or table. ¨ All values are scalar. That is, at any given row/column position in the relation there is one and only one value. ¨ All operations are performed on an entire relation and result is an entire relation, a concept known as closure.

Basic Terminology used in Relational Model Tuples of a Relation Each row of data is a tuple. Actually, each row is an n-tuple, but the “n-” is usually dropped. Cardinality of a relation The number of tuples in a relation determines its cardinality. In this case, the relation has a cardinality of 4. Degree of a relation Each column in the tuple is called an attribute. The number of attributes in a relation determines its degree. The relation in has a degree of 3.

Domains A domain definition specifies the kind of data represented by the attribute. More particularly, a domain is the set of all possible values that an attribute may validly contain. Domains are often confused with data types, but this is inaccurate. Data type is a physical concept while domain is a logical one. “Number” is a data type and “Age” is a domain. To give another example “Street. Name” and “Surname” might both be represented as text fields, but they are obviously different kinds of text fields; they belong to different domains. Domain is also a broader concept than data type in that a domain definition includes a more specific description of the valid data.

Body of a Relation The body of the relation consists of an unordered set of zero or more tuples. There are some important concepts here. First the relation is unordered. Record numbers do not apply to relations. Second a relation with no tuples still qualifies as a relation. Third, a relation is a set. The items in a set are, by definition, uniquely identifiable. Keys of a Relation It is a set of one or more columns whose combined values are unique among all occurrences in a given table. A key is the relational means of specifying uniqueness. Some different types of keys are Primary key is an attribute or a set of attributes of a relation which posses the properties of uniqueness and irreducibility (No subset should be unique). For example: Supplier number in S table is primary key, Part number in P table is primary key and the combination of Supplier number and Part Number in SP table is a primary key

Foreign key is the attributes of a table, which refers to the primary key of some another table. Foreign key permit only those values, which appears in the primary key of the table to which it refers or may be null (Unknown value). For example: SNO in SP table refers the SNO of S table, which is the primary key of S table, so we can say that SNO in SP table is the foreign key. PNO in SP table refers the PNO of P table, which is the primary key of P table, so we can say that PNO in SP table is the foreign key.

Operations in Relational Model Insert Operation: Suppose we wish to insert the information of supplier who does not supply any part, can be inserted in S table without any anomaly e. g. S 4 can be inserted in S table. Similarly, if we wish to insert information of a new part that is not supplied by any supplier can be inserted into a P table. If a supplier starts supplying any new part, then this information can be stored in shipment table SP with the supplier number, part number and supplied quantity. So we can say that insert operations can be performed in all the cases without any anomaly.

Update Operation: Suppose supplier S 1 has moved from Qadian to Jalandhar. In that case we need to make changes in the record so that the supplier table is up-todate. Since supplier number is the primary key in the S (supplier) table, so there is only a single entry of S 1, which needs a single update and problem of data inconsistencies would not arise. Similarly, part and shipment information can be updated by a single modification in the tables P and SP respectively without the problem of inconsistency. Update operation in relational model is very simple and without any anomaly in case of relational model.

Delete Operation: Suppose if supplier S 3 stops the supply of part P 2, then we have to delete the shipment connecting part P 2 and supplier S 3 from shipment table SP. This information can be deleted from SP table without affecting the details of supplier of S 3 in supplier table and part P 2 information in part table. Similarly, we can delete the information of parts in P table and their shipments in SP table and we can delete the information of suppliers in S table and their shipments in SP table.

Advantages and Disadvantages of Relational Model Structural independence: In relational model, changes in the database structure do not affect the data access. When it is possible to make change to the database structure without affecting the DBMS’s capability to access data, we can say that structural independence have been achieved. So, relational database model has structural independence. Conceptual simplicity: Design, implementation, maintenance and usage ease: Ad hoc query capability: The presence of very powerful, flexible and easy-to-use query capability is one of the main reasons for the immense popularity of the relational database model. The query language of the relational database models structured query language or SQL makes ad hoc queries a reality. SQL is

Disadvantages of Relational Model The drawbacks of the relational database systems could be avoided if proper corrective measures are taken. The drawbacks are not because of the shortcomings in the database model, but the way it is being implemented. Hardware overheads: Relational database system hides the implementation complexities and the physical data storage details from the users. For doing this, i. e. for making things easier for the users, the relational database systems need more powerful hardware computers and data storage devices. So the RDBMS needs powerful machines to run smoothly. But as the processing power of modern computers is increasing at an exponential rate and in today’s scenario, the need for more processing power is no longer a very big issue.

Ease of design can lead to bad design: The relational database is an easy to design and use. The users need not know the complex details of physical data storage. They need not know how the data is actually stored to access it. This ease of design and use can lead to the development and implementation of very poorly designed database management systems. Since the database is efficient, these design inefficiencies will not come to light when the database is designed and when there is only a small amount of data. As the database grows, the poorly designed databases will slow the system down and will result in performance degradation and data corruption.

‘Information island’ phenomenon: As we have said before, the relational database systems are easy to implement and use. This will create a situation where too many people or departments will create their own databases and applications. These information islands will prevent the information integration that is essential for the smooth and efficient functioning of the organization. These individual databases will also create problems like data inconsistency, data duplication, data redundancy and so on. But as we have said all these issues are minor when compared to the advantages and all these issues could be avoided if the organization has a properly designed database and has enforced good database standards.

Comparison of Data Models





Which Data Model to Use? a model that best suits an organization depends on the following factors: • The organization’s primary goals and requirements. • The volume of daily transactions that will be done. • The estimated number of enquiries that will be made by the organization. Among the traditional data models, the widely preferred one is the relational data model. This is because relational model can be used for representing most of the real world objects and the relationships among them. Security and integrity are maintained easily by relational data model. Also, use of relational model for database design increases the productivity of application programs, since it eliminates the need to change the application programs when a change is made to the database. Moreover, relational tables show only the logical relationship. End users need not know the exact physical structure of a table or relation.

Network Model is also free from anomalies but due to its complex nature it is not a preferred model. Since, hierarchical model suffers from lot of anomalies it is useful only for those cases which are hierarchical in nature.