Friday, March 30, 2012

Nice article about CTE(Common Table Expression)


 reference url:

http://www.simple-talk.com/sql/t-sql-programming/sql-server-cte-basics/

Friday, March 9, 2012

small example of table variable and temp table

begin tran
create table #temp (empid int,empname varchar(20));
declare @tempvariable table(empid int,empname varchar(20));

insert into #temp
select 1,'ravi'

insert into @tempvariable
select 2,'chandra'


rollback

select * from @tempvariable

select * from #temp

Monday, March 5, 2012

RealPage interview faced questions

1. Group by rollup
2.Difference between having vs where
3.union vs union all
4. Split string to table
5.Migration approach
6.Query tuning
7.Sql query execution plan
8.pivot vs unpivot example:

one table have columns with CustomerId,Year,Jan,feb,march,apr,may,june,july,aug,sep,oct,nov,dec,CustomerBalance
then we need table like customerid,year,Month,CustomerBalance