Sunday, January 11, 2015

Entity, attribute, attribute value, relationship instance, composite attribute, multivalued attribute, derived attribute, complex attribute,.......

Entity, attribute, attribute value, relationship instance, composite attribute, multivalued attribute, derived attribute, complex attribute,.......

Entity: An entity is a thing in the real world. It may be an object with a physical existence or an object with a conceptual existence. For example, a man, a building, a company, a school etc.

Attribute: Attribute is a property of an object or an entity. For example, a car has a color, a brand name, a model number, an owner’s name, type etc.

Attribute value: Attribute value is the real data of a particular entity for each of its attributes. In other word, associated with each real world entities are certain attributes that describe that entity; value of these attributes for any entity is called attribute value. For example, attribute value of first_name of attribute of student_name can be Gyanendra.

Relationship instance: Each relationship instance ri in R is an association of entities, where the association includes exactly one entity from each participating entity type. Each such relationship instance ri represent the fact that the entities participating in ri are related in some way in the corresponding miniworld situation. For example, in relationship type WORKS_FOR associates one EMPLOYEE and DEPARTMENT, which associates each employee with the department for which the employee works. Each relationship instance in the relationship set WORKS_FOR associates one EMPLOYEE and one DEPARTMENT.

Composite attribute: Composite attribute is an attribute that can be divided into smaller subparts, which represent more basic attributes with dependent meanings, is called a composite attribute. For example, the Address attribute consists of several domains such as house number, street number, city, country, etc.

Multivalued attribute: A multi-valued attribute can have more than one value at one time. For example, address of a person is a multi-valued attribute since a person can have more than one address such as Present and Permanent address. Upper and lower bounds may be placed on the number of values in a multi-valued attribute. For example, a bank may limit the number of addresses recorded for a single customer to two.

Derived attribute: If an attribute’s value can be determined from the values of other attributes, then the attribute is derivable, and is said to be a derived attribute. Example: consider attributes for an employee: birth date, current age; here, age is derivable by subtracting the birth date from the current date.

Complex attribute: Composite and multivalued attribute can be nested arbitrarily. Arbitrary nesting can be represented by grouping components of a composite attribute between parenthesis and separating the components with commas and by displaying multivalued attributes between braces. Such attributes are called composite attributes. For example, if a person has more than one address and each residence has multiple phones and address_phone attribute can be specifies as:
{AddressPhone( (Phone{AreaCode,PhoneNumber)},Address(StreetAddress(Number, Street, ApartmentNumber), City, State, Zip) ) }

Key attribute: Each real world entity is unique in itself. There are certain attributes whose value is different for all similar type of entities. Those attributes are called key attributes. These attributes are used to specify uniqueness constraint in relation. For example, a house has a registration number. This is a key of all entity of house.

Value set (domain): There is a range of values from which a particular attriute can take value for a attribute of a real world entity. For example, salary attribute of an employee must have value, let, from $2000 to $12000, and then all integers in range $2000 to $12000 are domain of attribute salary.

Tuesday, January 6, 2015

DBMS Data Models

Data model tells how the logical structure of a database is modeled. Data Models are fundamental entities to introduce abstraction in DBMS. Data models define how data is connected to each other and how it will be processed and stored inside the system.
The very first data model could be flat data-models where all the data used to be kept in same plane. Because earlier data models were not so scientific they were prone to introduce lots of duplication and update anomalies.

Entity-Relationship Model

Entity-Relationship model is based on the notion of real world entities and relationship among them. While formulating real-world scenario into database model, ER Model creates entity set, relationship set, general attributes and constraints.
ER Model is best used for the conceptual design of database.
ER Model is based on:
  • Entities and their attributes
  • Relationships among entities
  • These concepts are explained below.

[Image: ER Model]

  • Entity
    An entity in ER Model is real world entity, which has some properties called attributes. Every attribute is defined by its set of values, called domain.
    For example, in a school database, a student is considered as an entity. Student has various attributes like name, age and class etc.
  • Relationship
    The logical association among entities is called relationship. Relationships are mapped with entities in various ways. Mapping cardinalities define the number of association between two entities.
    Mapping cardinalities:
    • one to one
    • one to many
    • many to one
    • many to many
ER-Model is explained here.

Relational Model

The most popular data model in DBMS is Relational Model. It is more scientific model then others. This model is based on first-order predicate logic and defines table as an n-ary relation.

[Image: Table in relational Model]

The main highlights of this model are:
  • Data is stored in tables called relations.
  • Relations can be normalized.
  • In normalized relations, values saved are atomic values.
  • Each row in relation contains unique value
  • Each column in relation contains values from a same domain.
Click here to Know the DBMS Data Abstraction

Advantages of DBMS

Click the below link to know the advantages
Advantages of DBMS

DBMS USERS

Users

DBMS is used by various users for various purposes. Some may involve in retrieving data and some may involve in backing it up. Some of them are described as follows:
[Image: DBMS Users]
  • Administrators: A bunch of users maintain the DBMS and are responsible for administrating the database. They are responsible to look after its usage and by whom it should be used. They create users access and apply limitation to maintain isolation and force security. Administrators also look after DBMS resources like system license, software application and tools required and other hardware related maintenance.
  • Designer: This is the group of people who actually works on designing part of database. The actual database is started with requirement analysis followed by a good designing process. They people keep a close watch on what data should be kept and in what format. They identify and design the whole set of entities, relations, constraints and views.
  • End Users: This group contains the persons who actually take advantage of database system. End users can be just viewers who pay attention to the logs or market rates or end users can be as sophisticated as business analysts who takes the most of it.

DBMS Defination

Database is collection of data which is related by some aspect. Data is collection of facts and figures which can be processed to produce information. Name of a student, age, class and her subjects can be counted as data for recording purposes.
Mostly data represents recordable facts. Data aids in producing information which is based on facts. For example, if we have data about marks obtained by all students, we can then conclude about toppers and average marks etc.
A database management system stores data, in such a way which is easier to retrieve, manipulate and helps to produce information.