Database Management Models
Database Management Models
is data model ? Why data models are important ? Basic data-modeling building blocks. What are business rules and how do they influence database design? How the major data models evolved ? How data models can be classified by level of abstraction ?
Data Model: A set of concepts to describe the structure of a database, and certain constraints that the database should obey.
Data Model Operations: Operations for specifying database retrievals and updates by referring to the concepts of the data model. Operations on the data model may include basic operations and user-defined operations.
Entity
Anything about which data will be collected/stored
Attribute
Characteristic of an entity
Relationship
Describes an association among entities
One-to-one
Constraint
A restriction placed on the data
Data models
Representations, usually graphical, of complex real-world data structures Facilitate interaction among the designer, the applications programmer and the end user
End-users have different views and needs for data Data model organizes data for various users
American National Standards Institute (ANSI) Standards Planning and Requirements Committee (SPARC) Developed standards 1970 Framework for data modeling based on degrees of data abstraction: External Conceptual Internal Physical
Each end users view of the data environment Modeler subdivides requirements and constraints into functional (Business units) modules
Global view of the entire database Representation of data as viewed by the entire organization Basis for identification and high-level description of main data objects, avoiding details
Most widely used conceptual model is the Entity Relationship (ER) model
Provides a relatively easily understood macro level view of data environment
The database as seen by the DBMS Maps the conceptual model to the DBMS Depicts a specific representation of an internal model Logical independence
Can change the internal model without affecting the conceptual model
Physical independence
Can change the physical model without affecting the internal model
Hierarchical DB model
SALIENT FEATURES
Logically represented by an upside down TREE Each parent can have many children Each child has only one parent The top layer is perceived as the parent of the segment directly beneath it. The segments below other segments are the children of the segment above them.
Hierarchical DB model
Hierarchical DB model
Example
PARENT Emp No. 100 101 102 103 CHILD Serial No. 3009734-4 3-23-283742 2-22-723423 232342 Type Computer Monitor Monitor Printer User Emp No. 100 100 100 100 First Name John Antony Mary David Last Name Dougals Wanton Queen Moorey Dept Num 2A 2B 2C 2D
Advantages
Disadvantages
Complex implementation
Network DB model
Network DB model
Developed in mid 1960s as part of work of CODASYL (Conference on Data Systems Languages) which proposed programming language COBOL (1966) and then network model (1971) The network model has greater flexibility than the hierarchical model for handling complex spatial relationships Objective of network model is to separate data structure from physical storage, eliminate unnecessary duplication of data with associated errors and costs The Network Database Model was created for three main purposes : - representing a complex data relationship more effectively - improving database performance - imposing a database standard
Network DB model
Major characteristic of this database model is that it comprises of at least two record types ; the owner & the member. An owner is a record type equivalent to the parent type in the hierarchal database model, and the member record type resembles the child type in the hierarchal model. The network database model uses a data management language that defines data characteristics and the data structure in order to manipulate the data.
Network DB model
The network model contains logical information such as connectivity relationships among nodes and links, directions of links, and costs of nodes and links. Example with diagram
A node represents an object of interest. A link represents a relationship between two nodes. Within a directed network, any link can be bidirected (that is, able to be traversed either from the start node to the end node or from the end node to the start node) or unidirected (that is, able to be traversed only from the start node to the end node). Within an undirected network, all links are bidirected. A path is an alternating sequence of nodes and links, beginning and ending with nodes, and usually with no nodes and links appearing more than once. (Repeating nodes and links within a path are permitted, but are rare in most network applications.)
A network is a set of nodes and links. A network is directed if the links that it contains are directed, and a network is undirected if the links that it contains are undirected. A logical network contains connectivity information but no geometric information. This is the model used for network analysis. A logical network can be treated as a directed graph or undirected graph, depending on the application. Cost is a non-negative numeric attribute that can be associated with links or nodes for computing the minimum cost path Duration is a non-negative numeric attribute that can be associated with links or nodes to specify a duration value for the link or node.
Network Hierarchy
A network hierarchy enables us to represent a network with multiple levels of abstraction by assigning a hierarchy level to each node. The lowest (most detailed) level in the hierarchy is level 1, and successive higher levels are numbered 2, 3, and so on. Nodes at adjacent levels of a network hierarchy have parent-child relationships. Each node at the higher level can be the parent node for one or more nodes at the lower level.
Network Hierarchy
Each node at the lower level can be a child node of one node at the higher level. Sibling nodes are nodes that have the same parent node. Links can also have parent-child relationships. However, because links are not assigned to a hierarchy level, there is not necessarily a relationship between link parent-child relationships and network hierarchy levels. Sibling links are links that have the same parent link.
In a typical road network, the intersections of roads are nodes and the road segments between two intersections are links. An important operation with a road network is to find the path from a start point to an end point, minimizing either the travel time or distance. There may be additional constraints on the path computation, such as having the path go through a particular landmark or avoid a particular intersection. Also in a biochemical process metabolic pathways are networks involved in enzymatic reactions, while regulatory pathways represent protein-protein interactions. In this example, a pathway is a network; genes, proteins, and chemical compounds are nodes; and reactions among nodes are links.
The subway network of any major city is probably best modeled as a logical network, assuming that precise spatial representation of the stops and track lines is unimportant. Important operations with a train network include finding all stations that can be reached from a specified station, finding the number of stops between two specified stations, and finding the travel time between two stations.
Advantages
Simplicity : The network model is conceptually simple and easy to design. Ability to handle more relationship types : The network model can handle the one-to-many and many-to-many relationships. Ease of data access : In the network database terminology, a relationship is a set. Each set comprises of two types of records.- an owner record and a member record, In a network model an application can access an owner record and all the member records within a set.
Advantages
Data Integrity : In a network model, no member can exist without an owner. A user must therefore first define the owner record and then the member record. This ensures the integrity. Data Independence : The network model draws a clear line of demarcation between programs and the complex physical storage details. The application programs work independently of the data. Any changes made in the data characteristics do not affect the application program.
Disadvantages
System Complexity : The structure of the network model is very difficult to change. This type of system is very complex Lack of Structural independence : This model lacks structural independence. This database model should be used when it is necessary to have a flexible way of representing objects and their relationship. Any changes made to the database structure require the application programs to be modified before they can access data.
Relational DB model
Definitions Instance
A database instance, or an instance is made up of the background processes needed by the database software.
Include a process monitor, session monitor, lock monitor, etc. They will vary from database vendor to database vendor.
A database application is the code base to manipulate and retrieve the data stored in the database application schema.
view is a selective presentation of the structure of, and data in, one or more tables (or other views). A view is a virtual table, having predefined columns and joins to one or more tables, reflecting a specific facet of information.
Terminology
Table name or relation name Products: Name Price Category Manufacturer Attribute names
gizmo
$19.99
MultiTouch
$203.99
household
Hitachi
Relational DB model
The order of the rows and columns is not important. Values of a row all relate to some thing or portion of a thing. Repeating groups (collections of logically related attributes that occur multiple times within one record occurrence) are not allowed. Duplicate rows are not allowed (candidate keys are designed to prevent this). Cells must be single-valued (but can be variable length). Single valued means the following: Cannot contain multiple values such as 'A1,B2,C3'. Cannot contain combined values such as 'ABC-XYZ' where 'ABC' means one thing and 'XYZ' another
Thank You