DATABASE | SQL SERVER | SQL SERVER INTERVIEW QUESTION AND ANSWERS 6 | DEFINE SELF JOIN? | WHAT THE DIFFERENCE BETWEEN UNION AND UNIONALL? | WHAT ARE DIFFERENT TYPE OF COLLATION SENSITIVITY? | WHAT IS THE DIFFERENCE FUNCTION AND STORED PROCEDURE? | WHAT IS THE DIFFERENCE BETWEEN A LOCAL AND A GLOBAL VARIABLE?

SQL Server Interview Question and Answers:

26.     Define Self Join?
     Self join means joining one table with itself.
    The self join can be viewed as a join of two copies of the same table.

27.     What the difference between UNION and UNIONALL?
      Union will remove the duplicate rows from the result set while Union all does’nt.

28.     What are different type of Collation Sensitivity?
    The different phases of transaction are :
    Case sensitivity
    Accent sensitivity
    Kana Sensitivity
    Width sensitivity

29.     What is the difference Function and Stored Procedure?
      UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
    UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
    Inline UDF›s can be though of as views that take parameters and can be used in JOINs and other Rowset operations.

30.     What is the difference between a local and a global variable?
      A Local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
A Global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection are closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time.

No comments:

Post a Comment