Found 1659 Articles for Big Data Analytics

Explain the algorithm to check lossy or lossless decomposition

Bhanu Priya
Updated on 03-Jul-2021 09:28:49

2K+ 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
Updated on 03-Jul-2021 09:22:05

8K+ 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
Updated on 03-Jul-2021 09:18:30

18K+ 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
Updated on 03-Jul-2021 09:16:54

16K+ 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

Explain the inference rules for functional dependencies in DBMS

Bhanu Priya
Updated on 03-Jul-2021 09:11:46

9K+ Views

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

What are the most used SQL clauses in DBMS?

Bhanu Priya
Updated on 03-Jul-2021 08:53:34

3K+ 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 about nested queries in DBMS

Bhanu Priya
Updated on 13-Sep-2023 13:12:39

34K+ Views

A nested query is a query that has another query embedded within it. The embedded query is called a subquery.A subquery typically appears within the WHERE clause of a query. It can sometimes appear in the FROM clause or HAVING clause.ExampleLet’s learn about nested queries with the help of an example.Find the names of employee who have regno=103The query is as follows −select E.ename from employee E where E.eid IN (select S.eid from salary S where S.regno=103);Student tableThe student table is created as follows −create table student(id number(10), name varchar2(20), classID number(10), marks varchar2(20)); Insert into student values(1, 'pinky', 3, ... Read More

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

Bhanu Priya
Updated on 03-Jul-2021 08:45:34

3K+ 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

Explain the use of delete command in DBMS

Bhanu Priya
Updated on 03-Jul-2021 08:44:10

4K+ Views

Delete command is a data manipulation command which is used to remove records from a table. All records may be removed in one go, or a set of records may be deleted based on a condition.Remove specific rows from tableTo remove a specific row in the table, we need to mention where condition. Based on the condition, that particular row is deleted from the table.The syntax is as follows −delete from tablename where conditionFor example, Delete from employee where name=’sneha’;ExampleGiven below is an example to remove specific rows from table −create table employee(ename varchar(30), department varchar(20), age number(30), salary number(20)); ... Read More

What is the use of update command in SQL?

Bhanu Priya
Updated on 03-Jul-2021 08:42:19

4K+ Views

Update command is a data manipulation command which is used to edit the records of a table. It may be used to update a single row based on a condition, all rows or set of rows based on the condition given by the user.It is used along with the SET clause, operationally, a WHERE clause may be used to match conditions −Example 1An example is given below for the use of update command −update table student set name=’sneha’ where branch=’CSE’;Example 2Given below is another example of the usage of update command −create table employee(ename varchar(30), department varchar(20)); insert into employee ... Read More

Advertisements