SQL

http://weblogs.sqlteam.com/peterl/archive/2009/02/12/Get-all-your-databases-and-their-sizes.aspx

Difference between primary and unique key constraints


 Unique Key Constraints
The column values should retain uniqueness.
It allows null values in the column.
It will create non-clustered index by default.
Any number of unique constraints can be added to a table.


Primary Key Constraints
Primary key will create column data uniqueness in the table.
It will not allow Null values.
By default Primary key will create clustered index.
Only one Primary key can be created for a table.


Find the 2nd top  salary 
-------------------------------------

select MIN(salary) from employee where salary in (select top 2 salary from employee order by salary DESC)

Find the 3rd top  salary 
-------------------------------------

select MIN(salary) from employee where salary in (select top 3 salary from employee order by salary DESC)