Top

Database

31.

What do you understand by Functional dependency?

Ans:

A relation is said to be in functional dependency when one attribute uniquely defines another attribute.

For Example, R is a Relation, X and Y are two attributes. T1 and T2 are two tuples. Then,

T1[X]=T2[X] and T1[Y]=T2[Y]

This means, the value of component X uniquely defines the value of component Y.

Also, X->Y means Y is functionally dependent on X.

32.

When is functional dependency said to be the fully functional dependent?

Ans:

To fulfill the criteria of fully functional dependency, the relation must meet the requirement of functional dependency.

A functional dependency 'A' and 'B' are said to be fully functional dependent when removal of any attribute say 'X' from 'A' means the dependency does not hold anymore.

33.

 What is normalization?

Ans:

Normalization is the process of minimizing redundancy and dependency by organizing fields and table of a database. The main aim of Normalization is to add, delete or modify fields that can be made in a single table.

34.

What is Denormalization?

Ans:

Denormalization is a technique used to access the data from higher to lower normal forms of the database. It is also the process of introducing redundancy into a table by incorporating data from the related tables.

35.

What are the different types of Normalization?

Ans:

Different types of Normalization are:

  • First Normal Form (1NF): A relation is said to be in 1NF only when all the entities of the table contain unique or atomic values.
  • Second Normal Form (2NF): A relation is said to be in 2NF only if it is in 1NF and all the non-key attribute of the table is fully dependent on the primary key.
  • Third Normal Form (3NF): A relation is said to be in 3NF only if it is in 2NF and every non-key attribute of the table is not transitively dependent on the primary key.

36.

What do you understand by Data Redundancy?

Ans:

Duplication of data in the database is known as data redundancy. As a result of data redundancy, duplicated data is present at multiple locations, hence it leads to wastage of the storage space, and the integrity of the database is destroyed.

37.

Explain the terms ‘Record’, ‘Field’, and ‘Table’ in terms of database.

Ans:

  • Record: Record is a collection of values or fields of a specific entity. For Example, An employee, Salary account, etc.
  • Field: A field refers to an area within a record that is reserved for specific data. For Example, Employee ID.
  • Table: Table is the collection of records of specific types. For Example, the Employee table is a collection of records related to all the employees.

38.

How to fetch alternate records from a table?

Ans:

Records can be fetched for both Odd and Even row numbers:

  • To display even numbers:
Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=0
  • To display odd numbers:
Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=1

 

39.

How to fetch common records from two tables?

Ans:

Common records result set can be achieved by:

Select studentID from student INTERSECT Select StudentID from Exam

 

40.

How to select unique records from a table?

Ans:

Select unique records from a table by using the DISTINCT keyword:

Select DISTINCT StudentID, StudentName from Student

 

Loading…
Tags: Database Interview Questions and Answers || Database Sort Questions and Answers || Database Detailed Questions and Answers || Database Tutorial