Powered By Blogger

Sunday 22 April 2012

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.

Difference Between Star schema and Snowflake Schema


                   Star schema
                       Snowflake Schema
1. De-Normalized Data Structure

2. Category wise Single Dimension Table

3. More data dependency and redundancy

4. No need to use complicated join

5. Query Results Faster

6. No Parent Table

7. Simple DB Structure


1. Normalized Data Structure

2. Dimension table split into many pieces

3. less data dependency and No redundancy

4. Complicated Join

5. Some delay in Query Processing

6. It May contain Parent Table

7. Complicated DB Structure