Showing posts with label DBMS. Show all posts
Showing posts with label DBMS. Show all posts

Extended Features of ER Diagram in DBMS

Let we understand why this extended feature is needed. We know ER model is used to represent any database in pictorial view so that we can easily understand all about data but it is convenient if the data is not big or complex. But when the data become more complex than than we need to extend some feature in ER model.
For the improvement of existing ER model three new feature are added such as
  1. Specialization
  2. Generalization
  3. Aggregation

Specialization

An entity set may include sub grouping of entities or we can say that broken down into sub-entities that are distinct in some way from other entities in the set.A subset of entities with in entity set may have attribute that are not shared by all the entity in entity set.It is a top-down approach based on the specific attribute of the entity type with in given entity type.
Consider an entity set person with attribute Name,Age,Address,contact. Now a person may be further classified as one of the following.
  1. TEACHER
  2. STUDENT
Each of these person is described by a set of attribute that include all the attribute of entity set person plus possible additional attributes for example Teacher and student entities may be describe further by the attribute such as teacher-id,salary and student-id respectively. The process of designating sub grouping within a entity set is called specialization. The specialization of person according to whether they are teacher or student.
By using specialization we reduce redundancy fro example here a PERSON is sub grouping into two other entity set TEACHER and STUDENT. a PERSON contain its personal details as a attribute if the PERSON is a TEACHER than the personal detail of TEACHER is also the attribute of TEACHER.But in the case of specialization we have no need to repeat the personal detail of TEACHER entity set because TEACHER is a person and a personal detail of PERSON is given in PERSON entity set. In this way by using specialization redundancy will reduce.In specialization we create more than one entity set for a single entity.

Generalization

Generalization is a bottom-up approach in which multiple entity set combined into a higher level entity set on the basis of common features.The database designer may have first identify a TEACHER entity set with attribute TEACHER-NAME,AGE,CONTACT,ADDRESS,TEACHER-ID,SALARY,DESIG. and STUDENT entity set with the attribute NAME,AGE,CONTACT,ADDRESS,STUDENT-ID,COURSE.
There are some similarity between both entity set with respect to attribute.These common type of attribute can be expressed by generalization which show relationship between higher level entity set and one or more lower level entity set.
In this example the higher level entity set is PERSON and lower level entity set are TEACHER and STUDENT.Higher level entity set is a super class and lower level entity set is sub class such as PERSON supper class and TEACHER and STUDENT are sub class.
Generalization proceed from the recognizance that a number of entity set share some common feature such as personal details.On the basis of common features the generalization combine these entity set into a single higher level entity set. Generalization show the similarity among higher level entity set and hide the differences.It is also take care that shared attribute are not repeated.

Constraints on Generalization

  1. User Define or Condition Define
    Condition Define:We distribute the entity after checking one condition.
    for example assume highet level entity set student has attribute set student has attribute marks and the lower level entity are pass & fail.
    we valuate the student after checking condition.Suppose condition is if marks is greater than 40 than student is pass and if marks is less than 40 than student is fail.
    User Define:In user define there is no checking condition such as,
  2. Total or Partial
    Total:Each higher level entity belong to a lower level entity.
    here Suppose we have three student records such as x,y,z
    x41
    y45
    z31

    student x & y are pass and student z become fail.
    Partial:Some higher level entity may not belongs to lower level entiry such as
    Suppose we have marks of the student
    x41
    yWH (with haled)
    z45

    here x will pass
    z also pass
    But in the case of y its marks is not derived because it is with haled
    So this y which is one of higher level entity is not belong to lower level entities.
  3. Disjoint or Overlapped
    Disjoint:In disjoint constraint higher entity set are not belong to more than one entity set.
    No student are both fail and pass, so it is disjoint constraint because student is either pass or fail.It belong to only one lower level entity.
    Overlapped:In overlapped constraint some higher level entity belongs to more than one lower level entity such as
    xTeacher
    yTeacher & Student both
    zStudent

    here the high level entity are person which is (x, y, z)
    x-> belongs to teacher
    z-> belong to student
    But y-> belong to both teacher and student so the y (high level entity) belongs to more than one lower level entity (Teacher, Student)
    So we say this is overlapped.

Aggregation

One of the major problem of ER-model is that it is not possible to express the relationship among relationship. If we say in ER-diagram we can not have line from relationship diagonal box to another diagonal box.
So for solving this problem, we use the concept of aggregation.
For example
We have two entity set Doctor & Patient such as

If we want to relate new entity nurse with doctor-patient relationship than
One way is that nurse relate to both doctor and patient separately such as

But in this case redundancy is increasing.
So the another approach is aggregation.
In this approach first we make a abstract entity set than we relate with new entity set such as Nurse such as

ER-Diagram | DBMS

ER Diagram

ER Diagram is a graphical representation of database by using some specific symbols and components. All the components are given bellow. For know about ER Model

Entity

Entity are real word object that are distinguish from other real word object on the basis of their property or attribute.

Example:
  • Entity set - Teacher,Like Shailendra,Amrit etc..
  • Entity set - Student,Like Ram, shyam etc..

Attribute

Attribute describe the property of entity set.

Example: For Teacher entity, Attributes are name,dob,age,phoneno,contact etc.

Type of Attribute

  1. Composite Attribute

    Those attribute which are further decomposable .

    Name(Firstname,Middle name,Last name)

    Address (House No,Street,City)

    Attribute that are further decomposable into subpart are called composite attribute.But attribute that are not further decomposable are known as simple attribute.

    Example of simple attribute are Salary, Marks etc.

  2. Single valued and Multi valued Attribute

    Attribute that posses only one value are called single valued attribute.

    Example : Date of Birth of any person is single valued because every person have only one valid date of birth.
    But attribute that posses more than one value are called multi valued attribute.
    Example : Phone No. because a person have more than on phone numbers.

  3. Stored and Derived Attribute

    Stored attribute are the attribute that need to store physically on the storage. Example DOB etc.
    But derived attribute are the attribute that are derived from stored attribute using some mathematical calculation. Example age (because we can derive age from DOB)

  4. NULL Attribute

    NULL attribute are those attribute which we store NULL value.

Entity Set


There are two type of entity sets

  1. Strong Entity Set
  2. Week Entity Set

Strong Entity Set

Entity set in which primary key is easily identified than such entity set are known as strong entity set. Example Student

Week Entity Set

Entity set in which primary key is not available than such entity set are known as week entity set. Example local guardian.
Week entity set are made by the support of strong entity set. Example local guardian of student.Here local guardian(week entity) and student (strong entity)

Relationship

Relationship are possible in tables.We can establish relation between entities sets.

Type of Relation

  1. Unary Relation

    Those relation in which only one entity set is participated.

  2. Binary Relation

    Those relation which contain two entity set are called binary relation.

  3. Ternary Relation

    Those relation in which three entity set are participated.

Cardinality Set

It is a specific number of instances of entity.

There are two type of cardinality

  1. Minimum Cardinality
  2. Maximum Cardinality

Minimum Cardinality Set

The minimum cardinality of a relationship is the minimum number of instances of entity Y that may be associated with each instance of X.

Maximum Cardinality Set

The maximum cardinality of a relationship is the minimum number of instances of entity Y that may be associated with each instance of X..

Basic Type of Cardinality Set are

  1. 1:1 - One to one relationship
  2. 1:M - One to many relationship
  3. M:1 - Many to one relationship
  4. M:M - Many to many relationship (It is very rare)

Let we know how to find Entity and Attribute for creating any schema by taking an example.

Example 1. Find out entities and attributes for company publish magazine.
  1. Entity : Magazine

    Attributes:
    • Name
    • Frequency of magazine

  2. Entity : Categories

    Attributes:
    • Weak
    • Year

  3. Entity : Price

    Attributes:
    • MRP

  4. Entity : No of Pages

    Attributes:
    • PageNo

  5. Entity : Employ

    Attributes:
    • EmpId
    • Name
    • Address
    • ID
    • DOB
    • Gender
    • PhoneNo
    • Designation
    • Salary
    • Qualification
    • Date of joining
    • facilities

  6. Entity : Distributor

    Attributes:
    • DistNo
    • Name
    • Gander
    • PhoneNo
    • Deposited Amt or Security Deposit
    • Status of Distributor
    • Coverage area of distributor
    • Balance

  7. Entity : Subscribers

    Attributes:
    • SubcNo
    • Name
    • Address
    • PhoneNo
    • DOB
    • ID
    • Duration
    • SubcLanguage

  8. Entity : Contributor

    Attributes:
    • CodeNo
    • Name
    • Address
    • PhoneNo
    • DOB
    • ID
    • Language
    • Magzine name
    • Initial Amt

  9. Entity : Department

    Attributes:
    • Sales
    • Purchase

  10. Entity : Language Type

    Attributes:
    • Lang Name

and More......


Example 2. Find out entities and attributes for car service station.
  1. Entity : Car

    Attributes:
    • Models
    • Model Name
    • Servicing Change
    • CC
    • Standard
    • No of Gears

  2. Entity : Mechanics

    Attributes:
    • Mechanics Id
    • Name
    • Address
    • Uniform Color
    • Date of Joining
    • Salary

  3. Entity : Spare Parts

    Attributes:
    • PartNo
    • Part Color
    • Part Name
    • Price
    • Weight
    • Size
    • No of Parts

  4. Entity : Customer

    Attributes:
    • CustId
    • Name
    • Gander
    • PhoneNo
    • CarRegNo
    • KeyNo
    • DateofServive

and More......

DBMS System Architecture | DBMS

System Architecture

DBMS is a software that handles all access to the database and each of its activities revolves around the database, whatever happens in the database can be seen as follows

Data Models | DBMS

Concept of Data Models

Data model can be define as logical set of relationship describing behaviour and nature.
 
One data model can be distinguish from other on the basis of the way the relation ship among data is define and the way the database is conceptually(logically) define.

INDEX | DBMS

Introduction of DBMS

Database Management System (DBMS)

Important Terms Related To DBMS: 

Let we understand the concept of database management system by some points that given below.

1. Database is a collection of related data.

        For example collection of student information.

 

2. DBMS is a software which is used to manage database and access the database in efficient way.