Presentation on theme: "The Hierarchical Model"— Presentation transcript:
1The Hierarchical Model Developed in the 1960s to manage large amounts of data for complex projectsBasic logical structure is represented by an upside-down “tree”
2Hierarchical database model In the hierarchical model, data is organized as an inverted tree. Each entity has only one parent but can have several children. At the top of the hierarchy, there is one entity, which is called the root.An example of the hierarchical model representing a university
4The Hierarchical Model (continued) The hierarchical structure contains levels, or segmentsDepicts a set of one-to-many (1:M) relationships between a parent and its children segmentsEach parent can have many childreneach child has only one parent
5Hierarchical model Data are organized as an upside down tree. Each entity has only one parent but can have several children.
6The Hierarchical Model (continued) DisadvantagesComplex to implementDifficult to manageLacks structural independenceImplementation limitationsLack of standards
7Network database model In the network model, the entities are organized in a graph, in which some entities can be accessed through several pathAn example of the network model representing a university
8The Network Data ModelIn this model, data is represented by collections of records and relationships among data are represented by links. Ie., the collection of records which are connected to one another by means of links.A record is a collection of fields (attributes), each of which contains only one data value.A link is an association between precisely two records.The structure of the database is shown as an arbitrary graph in which the records form the nodes and links form the edges.There is no concept of a root node.
9The operations on a network database are performed through a data manipulation language for network model.The operations that can be performed on a network database include find, insert, delete, modify etc.The inserting or removing records include connect, disconnect and reconnect operations.
11Relational modelData are organized in two-dimensional tables called relations.The tables are related to each other.The most popular model.
12The Relational Data Model In this model,the data is organized into tables (ie., rows and columns). These tables are called relations.A row in a table represents a relationship among a set of values.Consider a sample database with three tables (relations):Suppliers, Items, Quantities: Suppliers (sup-no#,sup-name,status, city)Items ( item-no#, item-name, price)Quantities (sup-no#, item-no#, Qty)
13Suppliers Items Quantities Sup-no# Sup-Name Status City S1 S2 S3 BritanniaNewCockg1030DelhiMumbaiItemsItem-no#Item-namePriceI1I2I3I4I5I6MilkCakeBreadBiscuitIce creamJam15.005.009.0014.006.0010.00QuantitiesSup-no#Item-no#QtyS1S2S3I2I3I6I4I5I11020
14Rows of relations are generally referred to as tuples and the columns are usually referred to as attributes.No two tuples are identical and their ordering is not important.A relationship is represented by combining the primary key of the relations.various operations can be performed on relations such as insert new tuples, delete tuples and modify tuples.There are several languages for expressing these operations. One such language is relational query language.
15Relational model RDBMS (Relational Database Management System) external viewThe data are represented as a set of relations.A relation is a two-dimensional table.This doesn’t mean that data are stored as tables; the physical storage of the data is independent of the way the data are logically organized.
16RelationName – each relation in a relational database should have a name that is unique among other relations.Attribute – each column in a relation.The degree of the relation – the total number of attributes for a relation.Tuple – each row in a relation.The cardinality of the relation – the total number of rows in a relation.
18Operations on relations In a relational database, we can define several operations to create new relations out of the existing ones.Basic operations:InsertDeleteUpdateSelectProjectJoinUnionIntersectionDifference
19Insert operation An unary operation. Insert a new tuple into the relation.
20Delete operation An unary operation. Delete a tuple defined by a criterion from the relation.
21Update operation An unary operation. Changes the value of some attributes of a tuple.
22Select operation An unary operation. It is applied to one single relation and creates another relation.The tuples in the resulting relation are a subset of the tuples in the original relation.Use some criteria to select
23Project operation An unary operation. It is applied to one single relation and creates another relation.The attributes in the resulting relation are a subset of the attributes in the original relation.
24Join operation A binary operation. Combines two relations based on common attributes.
25Union operation A binary operation. Creates a new relation in which each tuple is either in the first relation, in the second, or in both.The two relations must have the same attributes.
26Intersection operation A binary operation.Creates a new relation in which each tuple is a member in both relations.The two relations must have the same attributes.
27Difference operation A binary operation. Creates a new relation in which each tuple is in the first relation but not the second.The two relations must have the same attributes.