Bhanu Priya

Bhanu Priya

1,060 Articles Published

Articles by Bhanu Priya

Page 87 of 106

Explain about 2NF with an example in DBMS

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 2K+ Views

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 More

What is Decomposition in DBMS?

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 12K+ Views

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 More

Explain the algorithm to check lossy or lossless decomposition

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 4K+ Views

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 More

Find the canonical cover of FD {A->BC, B->AC, C->AB} in DBMS

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 12K+ Views

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 More

What is the minimal set of functional dependencies or canonical cover of FD?

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 22K+ Views

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 More

Explain closure of attributes in DBMS

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 21K+ Views

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 More

What is tier-2 architecture in DBMS?

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 18K+ Views

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 More

What is tier-1 architecture in DBMS?

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 10K+ Views

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

What are the most used SQL clauses in DBMS?

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 4K+ Views

SQL is a Structured Query Language which is the standard and most widely used programming language for relational databases. It is used to manage and organize data in all sorts of systems where all varieties of data relationships exist.Structured Query Language (SQL) ClausesThe SQL clauses are of three types as shown below−Let us learn about them one by one.GROUP BY CLAUSESQL GROUP BY is used to arrange identical data into groups. It is used with the SQL SELECT statement. The GROUP BY statement follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause. It is also ...

Read More

Explain the difference between a table, view and synonym in SQL

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 4K+ Views

Let us understand what table, view and synonym in the structured query language (SQL) are.Table, view and synonymA table is a repository of data, where in the table it is a physical entity. A table resides physically in the database.A view is not a part of the database’s physical representation. It is precompiled, so that data retrieval behaves faster and also provides a secure accessibility mechanism.A synonym is an alternate name assigned to a table, view, sequence or program unit.ExampleCreate table employee (empID integer primary key, name varchar2(30), skill varchar2(30), salary number(20), DOB datetime).Let’s say there is a scenario where ...

Read More
Showing 861–870 of 1,060 articles
« Prev 1 85 86 87 88 89 106 Next »
Advertisements