Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Bhanu Priya
Page 74 of 106
Check which FD violates 2NF in the given relation and decompose R into 2NF
Normalization is the process of organizing the data in a database. It helps in removing the duplicate values in the database. Normalization divides the large table into smaller tables and links them using relationships.The normal form is used to reduce redundancy from the database table. Normalization is the name given to the process of simplifying the relationship among data elements in a record.In simple words we can say, Normalization is the process of organizing data to minimize.Redundancy/duplication/repetition.Insertion, deletion, updating anomalies.Normal formsThere are six Normal forms which are as follows −First Normal Form (1NF)Second Normal Form (2NF)Third Normal Form (3NF)Boyce-Codd Normal ...
Read MoreExplain about triggers and active databases in DBMS
A trigger is a procedure which is automatically invoked by the DBMS in response to changes to the database, and is specified by the database administrator (DBA). A database with a set of associated triggers is generally called an active database.Parts of triggerA triggers description contains three parts, which are as follows −Event − An event is a change to the database which activates the trigger.Condition − A query that is run when the trigger is activated is called as a condition.Action −A procedure which is executed when the trigger is activated and its condition is true.Use of triggerTriggers may ...
Read MoreExplain about 2NF with an example in DBMS
In the 2NF, relation must be in 1NF. In the second normal form, all the non-key attributes are fully functional dependent on the primary key. Or a relation is in 2NF, when it is in 1NF and there is no partial dependency.ExampleConsider a relation R (rollno, name, subjectcode, subjectname, duration)RollnoNameSubjectcodeSubjectnameDuration1HariS1C60 days1HariS2Java90 days2PinkyS1C60 days2PinkyS2Java90 days3RakhiS3Database45 daysF: {rollno -> name, subjectcode -> (subjectname, duration).{rollno, subjectcode}+ = {rollno, name, subjectcode, subjectname, duration}=> {rollno, subjectcode } is candidate key.The above table is in 1NF because no multivalued attributes are present. But it is not in 2NF because the following two partial dependencies are present.Rollno->name ...
Read MoreWhat is Decomposition in DBMS?
Decomposition means dividing a relation R into {R1, R2, ......Rn}. It is dependency preserving and lossless.Dependency preserving decompositionLet R is decomposed into {R1, R2, ...., Rn} with projected FD set {F1, F2, ......Fn}. This decomposition is dependency preserving if F+ ={F1 U F2 U.........Fn}+.ExampleLet the relation R{A, B, C, D, E} F:{AB->C, C->D, AB->D} R is decomposed to R1(A, B, C), R2(D, E). Prove decomposition is dependency preserving.SolutionF1={AB->C}F2={C->D}=> (F1 u F2) = {AB->C, C->D}AB+ under (F1 U F2) = {A, B, C, D} => AB->D is under (F1 U F2)F+ = (F1 U F2)+=> Decomposition is dependency preserving.Decomposition is not ...
Read MoreExplain the algorithm to check lossy or lossless decomposition
Decomposition is said to be lossy, if it is impossible to reconstruct the original table from the decomposed tables without loss of information.Decomposition is said to be lossless, if it is possible to reconstruct the original table by using a natural join without any loss of information.AlgorithmGiven below is an algorithm to check if decomposition is lossy or lossless −Step 1 − Create a table with M rows and N columnsM= number of decomposed relations.N= number of attributes of original relation.Step 2 − If a decomposed relation Ri has attribute A thenInsert a symbol (say ‘a’) at position (Ri, A)Step ...
Read MoreFind the canonical cover of FD {A->BC, B->AC, C->AB} in DBMS
Canonical cover is called minimal cover which is called the minimum set of FDs. A set of FD FC is called canonical cover of F if each FD in FC is a Simple FD, Left reduced FD and Non-redundant FD.Simple FD − X->Y is a simple FD if Y is a single attribute.Left reduced FD: X->Y is a left reduced FD if there are no extraneous attributes in X.{extraneous attributes: let XA->Y then A is a extraneous attribute if X_>Y}Non-redundant FD − X->Y is a Non-redundant FD if it cannot be derived from F- {X->y}.ProblemFind the canonical cover of FD ...
Read MoreWhat is the minimal set of functional dependencies or canonical cover of FD?
A minimal cover of a set of functional dependencies (FD) E is a minimal set of dependencies F that is equivalent to E.The formal definition is: A set of FD F to be minimal if it satisfies the following conditions −Every dependency in F has a single attribute for its right-hand side.We cannot replace any dependency X->A in F with a dependency Y->A, where Y is a proper subset of X, and still have a set of dependencies that is equivalent to F.We cannot remove any dependency from F and still have a set of dependencies that are equivalent to ...
Read MoreExplain closure of attributes in DBMS
Closure of an attribute x is the set of all attributes that are functional dependencies on X with respect to F. It is denoted by X+ which means what X can determine.AlgorithmLet’s see the algorithm to compute X+Step 1 − X+ =XStep 2 − repeat until X+ does not changeFor each FD Y->Z in FIf Y ⊆ X+ then X+ = X+ U ZExample 1Consider a relation R(A, B, C, D, E, F)F: E->A, E->D, A->C, A->D, AE->F, AG->K.Find the closure of E or E+SolutionThe closure of E or E+ is as follows − E+ = E =EA ...
Read MoreWhat is tier-2 architecture in DBMS?
The overall design of the Database Management System (DBMS) depends on its architecture. A large amount of data on web servers, Personal Computers (PC) and other elements are linked with networks with the help of basic client or server architecture.PCs and workstations are part of Client architecture that are connected over the network. The architecture of DBMS depends on how the users are linked to the database.There are three kinds of DBMS Architecture, which are as follows −Tier-1 Architecture.Tier-2 Architecture.Tier-3 Architecture.Tier-2 ArchitectureThe 2-tier Architecture is based on a client-server machine.In this type of architecture, the applications on client-side interact directly ...
Read MoreWhat is tier-1 architecture in DBMS?
The overall design of the Database Management System (DBMS) depends on its architecture. A large amount of data on web servers, Personal Computers (PC) and other elements are linked with networks with the help of basic client or server architecture.PCs and workstations are part of Client architecture that are connected over the network. The architecture of DBMS depends on how the users are linked to the database.There are three kinds of DBMS Architecture, which are as follows −Tier-1 Architecture.Tier-2 Architecture.Tier-3 Architecture.Tier is a physical unit where the program code or a process is run.For example − data base server, application ...
Read More