Powered By Blogger

Sunday 22 April 2012

Difference Between FUNCTION AND PROCEDURE


Procedure Vs Function
                    Procedure
                   Function
1. Procedure doesn’t contain return clause in header & executable part.

2. Procedure may be return or may not be return a value.

3. Procedure can’t be called into select statements.

4. Procedure are used to implement business logic.
1. Function contain return clause in header & executable part.

2. Function always returns a value.


3. Function can be called into select statement.

4. Function are used for numeric calculation.

Difference Between WHERE AND HAVING


WHERE Vs HAVING
                     Where
                    Having
1.Without group by clause

2. Where clause select Row before grouping.

3. Where clause can’t contain aggregate function.
1.With group by clause

2.Having clause select after grouping


3.Having clause contain aggregate
Function.

Difference Between JOIN & UNION



Difference between JOIN and UNION
                      Join
                    Union
1.   Join the columns.

2.   Duplicate are allowed

3.   Combine the column based on condition.
1.Merge the row

2.Duplicates are not allowed

3. Combine the result of two select statements.

Difference Between DROP, DELETE & TRUNCATE


Difference between DROP, DELETE and TRUNCATE
          Drop
            Delete
           Truncate
1. Whole structure and data will drop.

2.can’t  Rollback

3.can’t use where clause

4.All data and structure
drop simultaneously
1. Structure will not drop, data will drop.

2.can Rollback

3.can use WHERE clause

4. Row by Row data Delete
1. Structure will not drop data will drop.

2.can’t Rollback

3.can’t use WHERE clause

4. Only all data will drop, truncate operation drop and recreate the table.