Wednesday 8 July 2015

Difference between Union and Union All in sql server 2008?

Union gives distinct value from combination of two tables while Union All gives value with duplication from combination of two tables.
In Union result set is sorted in ascending order while In Union All result set is not sorted, two query output gets appended.

Union Vs UnionAll in Sql server 2008?

Union:-
1. It is used to combine the result set of two or more SELECT statement.
2. Each SELECT statement within the UNION must have the same no of columns.
3. Columns must have the similar data type.
4. Columns in each SELECT statement must be in the same order.
5. Union operator Select distinct value by default.

Union All:-
1. It is used to combine the result set of two or more SELECT statement.
2. Each SELECT statement within the UNION ALL must have the same no of columns.
3. Columns must have the similar data type.
4. Columns in each SELECT statement must be in the same order
5. Union All select all the value i.e Union All will not eliminate duplicate value

Tuesday 7 July 2015

In c#, the variable which is declared inside a class but not I a method is called as?

The variable which is declared inside a class but not inside the method is called as instance variable.

Instance variable does not include any static modifier in the class and also they operate on instance of a class.

In c#, what is the keyword used to access the base class members within the derived class?

‘base’ is c# keyword used to access the base class members. It just give the permission to access  to the constructor, instance property accessor or a instance method. We  cannot use ‘base’ keyword in static method.

Monday 6 July 2015

What is implementation inheritance and interface inheritance?

When a class is derived from another class in such a way that it will inherits all its member to its corresponding derived class then it is implementation inheritance.
When a class inherits only the signatures of the functions or methods from its corresponding base class, then it is called as interface inheritance.