Menu

Tuesday 12 February 2013

Interview Questions


1)What are different types of functions available in SQL Server? and differences between them?
2)What is inline functions?
3)What are alternate keys?
4)What are custom datatypes?
5)Can we create an index based on a column which is part of primary key?
6)Different methods to get no. of records in table:
SELECT COUNT(*) FROM TABLE_NAME
EXEC SP_SPACEUSED TABLE_NAME
SELECT ROW_COUNT FROM SYS.DM_DB_PARTITION_STATS
WHERE OBJECT_ID=(SELECT OBJECT_ID FROM SYS.OBJECTS WHERE NAME='TABLE_NAME')
7)You have a table EMP
EMP_ID      Name
----------- ----
1           A
2           NULL
3           A

SELECT COUNT(*),COUNT(EMP_ID),COUNT(NAME),COUNT(1),COUNT(2) FROM EMP
--------------------------------------------
3        3        2        3        2

8)What are different types joins?
9)Are joins physical joins or logical joins?
10)How to delete duplicate records?
11)Different types of indexes and difference between them?
12)Difference between functions and procedures?

1 comment:

  1. 8) Answer
    Types of joins are Inner Join, Self Join, Right/Left Outer join, Cross join.

    9) Answer
    Joins that we use in SQL queries are known as Logical joins.

    ReplyDelete