0% found this document useful (0 votes)
73 views

Hierarchical Model

The document discusses several database models: 1) The hierarchical model organizes data in a tree-like structure with a single upward link and sort field to describe nesting. This allows 1:N relationships but is inefficient for certain queries. 2) The network model builds on the hierarchical model concept but allows branches to connect to multiple nodes, representing relationships more efficiently. It uses navigational access via pointers. 3) The relational model represents data in tables with rows and columns. Relations refer to tables and tuples refer to rows. It uses keys to uniquely identify rows and join data across tables. This model aims for data independence and uses set theory and logic.

Uploaded by

hasandalal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Hierarchical Model

The document discusses several database models: 1) The hierarchical model organizes data in a tree-like structure with a single upward link and sort field to describe nesting. This allows 1:N relationships but is inefficient for certain queries. 2) The network model builds on the hierarchical model concept but allows branches to connect to multiple nodes, representing relationships more efficiently. It uses navigational access via pointers. 3) The relational model represents data in tables with rows and columns. Relations refer to tables and tuples refer to rows. It uses keys to uniquely identify rows and join data across tables. This model aims for data independence and uses set theory and logic.

Uploaded by

hasandalal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Hierarchical model

In a hierarchical model, data is organized into a tree-like structure, implying a single upward link in each record to describe the nesting, and a sort field to keep the records in a particular order in each same-level list. Hierarchical structures were widely used in the early mainframe database management systems, such as the Information Management System (IMS) by IBM, and now describe the structure of XML documents. This structure allows one 1:N relationship between two types of data. This structure is very efficient to describe many relationships in the real world; recipes, table of contents, ordering of paragraphs/verses, any nested and sorted information. However, the hierarchical structure is in efficient for certain database operations when a full path (as opposed to upward link and sort field) is not also included for each record. Parentchild relationship: Child may only have one parent but a parent can have multiple children. Parents and children are tied together by links called "pointers". A parent will have a list of pointers to each of their children.

The network model(defined by the CODASYL specification) organizes data using two fundamental constructs, called records and sets. Records contain fields (which maybe organized hierarchically, as in the programming language COBOL). Sets (not to be confused with mathematical sets) define one-to-many relationships between records: one owner, many members. A record may be an owner in any number of sets, and a member in any number of sets. The network model is a variation on the hierarchical model, to the extent that it is built on the concept of multiple branches (lower-level structures) emanating from one or more nodes (higherlevel structures), while the model differs from the hierarchical model in that branches can be connected to multiple nodes. The network model is able to represent redundancy in data more efficiently than in the hierarchical model. The operations of the network model are navigational in style: a program maintains a current position, and navigates from one record to another by following the relationships in which the record participates. Records can also be located by supplying key values. Although it is not an essential feature of the model, network databases generally implement the set relationships by means of pointers that directly address the location of a record on disk. This gives excellent retrieval performance, at the expense of operations such as database loading and reorganization. Most object databases use the navigational concept to provide fast

navigation across networks of objects, generally using object identifiers as "smart" pointers to related objects. Objectivity/DB, for instance, implements named 1:1, 1:many, many:1 and many:

many named relationships that can cross databases. Many object databases also support SQL, combining the strengths of both models

Relational dbms This model was developed by the E. F. Codd. The main aim of making this model is to prepare a independent application. It is also termed as a mathematical model which defined the term of logic and also set theory. In relational database, 3 terms are mostly used i.e. relations, attributes and domains. A relation model is explained in the form of table with rows and columns and in that columns in relational database The named columns of the relation are called

attributes, and the domain is the set of values the attributes are allowed to take. The basic data structure of the relational model is the table, where information about a particular entity (say, an employee) is represented in rows (also called tuples) and columns. Thus, the "relation" in "relational database" refers to the various tables in the database; a relation is a set of tuples. The columns enumerate the various attributes of the entity (the employee's name, address or phone number, for example), and a row is an actual instance of the entity (a specific employee) that is represented by the relation. As a result, each tuple of the employee table represents various attributes of a single employee. All relations (and, thus, tables) in a relational database have to adhere to some basic rules to qualify as relations. First, the ordering of columns is immaterial in a table. Second, there can't be identical tuples or rows in a table. And third, each tuple will contain a single value for each of its attributes. A relational database contains multiple tables, each similar to the one in the "flat" database model. One of the strengths of the relational model is that, in principle, any value occurring in two different records (belonging to the same table or to different tables), implies a relationship among those two records. Yet, in order to enforce explicit integrity constraints, relationships between records in tables can also be defined explicitly, by identifying or non-identifying parent-child relationships characterized by assigning cardinality (1:1, (0)1:M, M:M). Tables can also have a designated single attribute or a set of attributes that can act as a "key", which can be used to uniquely identify each tuple in the table. A key that can be used to uniquely identify a row in a table is called a primary key. Keys are commonly used to join or combine data from two or more tables. For example, an Employee table may contain a column named Location which contains a value that matches the key of a Location table. Keys are also critical in the creation of indexes, which facilitate fast retrieval of

data from large tables. Any column can be a key, or multiple columns can be grouped together into a compound key. It is not necessary to define all the keys in advance; a column can be used as a key even if it was not originally intended to be one. A key that has an external, real-world meaning (such as a person's name, a book's ISBN, or a car's serial number) is sometimes called a "natural" key. If no natural key is suitable (think of the many people named Brown), an arbitrary or surrogate key can be assigned (such as by giving employees ID numbers). In practice, most databases have both generated and natural keys, because generated keys can be used internally to create links between rows that cannot break, while natural key scan be used, less reliably, for searches and for integration with other databases. (For example, records in two independently developed databases could be matched up by social security number, except when the social security numbers are incorrect, missing, or have changed.)

You might also like