SQL Interview Question And Answer | SQL Server | SQL Interview Question And Answer for Fresher | Set-02

1.What is Functional Dependency?
 Ans: Functional dependency, denoted by X->Y between two set of attributes X and Y, means that the value of Y component are determined by the value of X component. We can also say that Y is functional depend on X.

2.What is the Normalization?
 Ans: Normalization is the process of analyzing relation scheme in term of their functional dependency to achieve the minimizing redundancy and minimizing insertion, deletion and update anomalies.  

        1NF: A relation is said to be in first normal form if all its attributes are atomic.
  
        2NF : A relation is said to be in 2nd normal form if all its non prime attributes are functionally   dependent on prime attributes.

        3NF: A relation is said to be in 3rd  Normal form if it is in 2nd normal form and there is no transitive dependency.
 
3.What is de-normalization and when would you go for it?
 Ans: As the name indicates, de-normalization is the reverse process of normalization. It is the controlled introduction of redundancy in to the database design. It helps improve the query performance as the number of joins could be reduced.

4.How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?
 Ans: One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships.

        One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships.

        Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table.

5.What is Composite Candidate key?
 Ans: A candidate key comprising of two or more attributes.

6.What is non-key attributes?
 Ans: The attributes other than the primary key attributes in a table/relation are called non-key attributes

7.What is an index?
 Ans: An index is a structure that provides rapid access to the rows of a table based on the values of one or more columns.

8.What are the advantages of index?
 Ans: 1.It speeds up the execution of SQL statements with search conditions that refer to the indexed column(s).

         2.It is most appropriate when retrieval of data from tables is more frequent than inserts and updates.

9.What are the disadvantages of having an index?
 Ans: 1.It consumes additional disk space.
   
          2.The index table must be updated every time a row is added to the table and every time the indexed column is updated in existing row. This imposes additional overhead on insert and update statements for the table.

10.Why do we use “where” clause?
 Ans: “Where” is a clause, it used to specify a search condition that limits the number of rows retrieved.


Previous Next


:: Click the links below for similar type Questions and answers ::

0 comments:

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes