Various interview questions on SQL Server
In this part we have tried to put some light on various SQL Server interview questions asked by the interviewer. So here we go with SQL Server questions.
What is primary key in SQL?
Primary key let us uniquely identify the row in a table.
How it is different from Unique key?
Primary key never accepts null value whereas in case of unique key one of the values can be null.
Can you write down a query which will display the current financial year?
How will you find the index of a particular character in a SQL variable?
We will use CharIndex method.
Let say we have multiple queries and we have to show result set of all queries as one result. What we have to do?
Is it possible to use order by with UNION?
We cannot write order by in each query but can in last query which will affect entire result set.
Also see another SQL Server interview questions video on RowNumber, Partition, Rank & DenseRank : -