Posts

Showing posts with the label dbms

NORMALISATION

Normalisationis a process of organizing the data in database to avoid data redundancyand anomalies . We have different levels of normal forms 1st,2nd, 3rd , BCNF ,4th,5th etc . A relation is always specified with its highest normalization level . First Normal Form defines that all the attributes in a relation must have atomic values . Second Normal Form is based on the concept of fully functional dependency . To be in second normal form, a relation must be in First Normal Form and every non-prim attributes are fully functionally dependent on any of the candidate keys. A relation is in 3rd normal form , 1)It must be in 2NF 2)Nonprime attributes should not be transitively dependent on candidate keys. For a relation to be in Boyce-CoddNormal Form (BCNF  or 3.5 NF) , 1.It should be in theThird Normal Form. 2.And, for any dependency X→ Y, X must be asuper key. Stronger version of 3NF .

MINIMAL COVER OF FUNCTIONAL DEPENDENCIES

A minimal cover of a set of FDs F is a minimal set of functional dependencies F min  that is equivalent to F. There can be many such minimal covers for a set of functional dependencies F. Steps to derive  minimal cover for  a FD set . 1)Right Hand Side (RHS) of all FDs should be single attribute . 2)Eliminate redundant functional dependencies if any . Given relation R(A,B,C)    and      FDs : {  AB -> C, C -> A }    FDmin ={AB à C}   ,here C-->A is   redundant dependency  3)Remove redundant attribute on LHS if any .  Consider  FD ,  AB -> C              If AB+ = A+  we can say B is redundant  then reduce to  A à C              If AB+ =B+ we can say A is redundant then reduce to B à C

GATE QUESTIONS ON FUNCTIONAL DEPENDENCIES

FUNCTIONAL DEPENDENCIES & ARMSTRONG'S AXIOMS

Redundancy in relation may cause insertion, deletion and updation anomalies Normalization  is the process of minimizing  redundancy  from a relation or set of relations . I t helps to minimize the redun dancy in relations , hence avoids anomalies . A functional dependency (FD) for relation R is a formula of the form A à B where A and B are sets of attributes of R. We say A functionally determines the B , or   B   is functionally dependent on the A . Trivial functional dependency :  A → B has trivial functional dependency if B is a subset of A . Non Trivial Functional Dependency : If a functional dependency X->Y holds , where Y is not a subset of X then this dependency is called non trivial Functional dependency . Multi valued   dependency   :   occurs when two attributes in a table are independent of each other but, both depend on a third attribute . Transitive dependency:    functional dependency  is said to b...

ANOMALIES IN DATABASE

A poorly designed database is inconsistent and create issues while adding, deleting or updating information . Poorly designed database stores same data item multiple times , known as Data Redundancy .

DBMS -KYES

Key has important role in relational database:   I t is used for identifying unique rows from table. It  establishes relationship among tables . Types of keys : Composite keys ,Super keys , candidate keys, primary key, secondary keys , Composite Key :   A key that consists of more than one attribute to uniquely identify rows (also known as records & tuples) in a table is called composite key . Super Key  :   A super key is a set of one of more attributes to uniquely identify rows in a table . Candidate Key  :   A minimal  super key with no redundant attributes . Primary key:   A Primary key is selected from a set of candidate keys .   This is done by database admin or database designer.  Foreign Key   :  Foreign keys are the attributes of a table that points to the primary key of another table. They act as a cross-reference between tables .