Ads

Friday, March 12, 2010

Learn DBMS, Part - II

DATA MODELS:


Data model is defined as the collection of conceptual tools for describing data, data relationships, data semantics and consistency constraints. There are following four Data Model exists.

The Hierarchical Data Model

A hierarchical database consists of the following:


1. It contains nodes connected by branches same as the trees in datastructers.
2. The top node is called the root.
3. If multiple nodes appear at the top level, the nodes are called root segments.
4. The parent of node nx is a node directly above nx and connected to nx by a branch.
5. Each node (with the exception of the root) has exactly one parent.
6. The child of node nx is the node directly below nx and connected to nx by a branch.
7. One parent may have many children.

The Network Data Model

Like the The Hierarchical Data Model the Network Data Model also consists of nodes and branches, but a child may have multiple parents within the network structure.

The Relational Data Model

The Relational Data Model has the relation at its heart, but then a whole series of rules governing keys, relationships, joins, functional dependencies, transitive dependencies, multi-valued dependencies, and modification anomalies. A relation is subject to the following rules:


1. Relation (file, table) is a two-dimensional table.
2. Attribute (i.e. field or data item) is a column in the table.
3. Each column in the table has a unique name within that table.
4. Each column is homogeneous. Thus the entries in any column are all of the same type (e.g. age, name, employee-number, etc).
5. Each column has a domain, the set of possible values that can appear in that column.
6. A Tuple (i.e. record) is a row in the table.
7. The order of the rows and columns is not important.
8. Values of a row all relate to some thing or portion of a thing.
9. Repeating groups (collections of logically related attributes that occur multiple times within one record occurrence) are not allowed.
10. Duplicate rows are not allowed (candidate keys are designed to prevent this).
11. Cells must be single-valued (but can be variable length). Single valued means the following:

1. Cannot contain multiple values such as 'A1,B2,C3'.
2. Cannot contain combined values such as 'ABC-XYZ' where 'ABC' means one thing and 'XYZ' another.



Object Oriented Model

In object oriented model information is represented in the form of objects as used in object oriented programming. Object Oriented Database Management Systems is a combination of object oriented programming language capabilities and database capabilities. It contains some properties like transparently persisted data, concurrency control, data recovery, associative queries, and other capabilities. Some object oriented programming languages are Java, C++, .NET, Visual Basic, Python etc. Most object databases also offer some kind of query language, allowing objects to be found by a more declarative programming approach.


THREE SCHEMA ARCHITECTURE

The goal of Three-Schema architecture is to separate the user applications and physical database. In this architecture, schemas can be defined at the following three levels:


• The internal level:- The internal level has an internal schema which describes the physical storage structure of the database.
• The conceptual level:-The conceptual level has a conceptual schema, it describes the entities, data types, relationships, user operations, and constraints.
• The external level or view level:- The external or view level includes a number of external schemas or user views. It describes the part of the database that a particular user group is interested in and hides the rest of the database from that user group.

No comments: