Wednesday, December 23, 2009

Sql Server Interview

http://vyaskn.tripod.com/iq.htm


1). Sql server datetime maxlength and minlength ?
1). Min : 1/1/1753 , Max: 12/31/9999

2). Consider the following two tables:
1. customers( customer_id, customer_name)
2. branch ( branch_id, branch_name )
What will be the output if the following query is executed:
Select * branch_name from customers,branch
a. It will return the fields customer_id, customer_name, branch_name
b. It will return the fields customer_id, customer_name, branch_id, branch_name
c. It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name
d. It will return an empty set since the two tables do not have any common field name
e. It will return an error since * is used alone for one table only 
2) b is correct

3) Global variables ?
a). @@rowcount
b). @@version
c). @@error
d). @@colcount
3) d is invalid



 

Sql nth highest salary

Thanks to Pinal dave for his contribution in sql. I have found a very knwn and mostly asked sql question of how to find nth highest salary?
SELECT     TOP (1) sal
FROM         (SELECT DISTINCT TOP (n) sal
                       FROM          emp
                       ORDER BY sal DESC) AS a
ORDER BY sal;



Replace Top (n)  with nth salary number required

blog.sqlauthority.com/.../sql-server-find-nth-highest-salary-of-employee-query-to-retrieve-the-nth-maximum-value/

Wednesday, December 16, 2009

Regular Expression to match date dd/mm/yyyy

Regular Expression to check date format dd/mm/yyyy



ValidationExpression="(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[-
/.](19|20)\d\d"

Friday, December 11, 2009

gzip html

http://www.stardeveloper.com/articles/display.html?article=2007110401&page=1
http://www.stardeveloper.com/articles/display.html?article=2007110401&page=1

Thursday, December 10, 2009

Jquery: Slideshow

http://malsup.com/jquery/cycle/

My requirement: something like http://dell.co.in/.  Here, we can see a flash being displayed fews images are faded and new image is listed and also we can see page number just above the images.
Now Jqeury's cycle plugin is what came to my rescue as i had not to write any code and just select the pattern and your is done.

To display navigation above images do following:

// wrapper  
//div for images      



create the above structure for images

Now navigation

$(function() {
    $('#s4').after('