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
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
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
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
Functional dependencies are the constraints that are derived from the meaning and interrelationship of the data. Let F is a set of all functional dependencies. The set of all dependencies that include F as well as all dependencies that can be inferred from F is called CLOSURE of F denoted by F+.Example 1Given below is an example of functional dependency in database management system (DBMS) −F= { SSN-> {ENMAE, BDATE, ADDRESS, DNUMBER}, DNUMBER-> {DNAME, DMGRSSN} }OutputYou will get the following result −Example 2Given below is another example of functional dependency in the DBMS −F+ = { SSN-> {ENAME, BDATE, ADDRESS, ... Read More
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
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
Let’s see the definitions of file systems and database management systems before understanding the difference.File Management SystemIt is nothing but a collection of programs which manage and store data in files and folders in a computer hard disk.It helps in reading and writing data to the hard disk. It is also called a conventional file system.Data redundancy is high and cannot be controlled easily in file management systems.Database management system (DBMS)It is defined as a software system that allows the user to define, create and maintain the database and provide control access to the data.DBMS is a collection of programs ... Read More
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
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
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP